RateLimitNotice
in package
Show a notice about rate limit when contacting a devowl.io external service.
Tags
Table of Contents
Constants
- NOTICE_ID = 'notice-devowl-rate-limit'
Properties
- $core : mixed
Methods
- admin_notices() : mixed
- Output the notice about rate limit when we catched a failed request.
- getCore() : PluginReceiver
- Get core instance.
- getFailedUrl() : mixed
- Get the latest failed URL which run into "Too many requests" error.
- hooks() : mixed
- Create hooks to obtain rate limit requests and show the notice accordingly.
- http_response() : mixed
- Filters the response of a HTTP request and check if it is to our devowl.io server and if it failed with 429 error code.
- instance() : RateLimitNotice
- Get a new instance of RateLimitNotice.
- __construct() : mixed
- C'tor.
Constants
NOTICE_ID
public
mixed
NOTICE_ID
= 'notice-devowl-rate-limit'
Properties
$core
private
mixed
$core
Methods
admin_notices()
Output the notice about rate limit when we catched a failed request.
public
admin_notices() : mixed
getCore()
Get core instance.
public
getCore() : PluginReceiver
Tags
Return values
PluginReceivergetFailedUrl()
Get the latest failed URL which run into "Too many requests" error.
public
getFailedUrl() : mixed
hooks()
Create hooks to obtain rate limit requests and show the notice accordingly.
public
hooks() : mixed
http_response()
Filters the response of a HTTP request and check if it is to our devowl.io server and if it failed with 429 error code.
public
http_response(array<string|int, mixed> $response, array<string|int, mixed> $parsed_args, string $url) : mixed
Parameters
- $response : array<string|int, mixed>
- $parsed_args : array<string|int, mixed>
- $url : string
instance()
Get a new instance of RateLimitNotice.
public
static instance(PluginReceiver $core) : RateLimitNotice
Parameters
- $core : PluginReceiver
Tags
Return values
RateLimitNotice__construct()
C'tor.
private
__construct(PluginReceiver $core) : mixed
Parameters
- $core : PluginReceiver