Control and prevent abuse from excessive calls.
wc_rate_limit
table with an additional remaining column for tracking the request count in any given request window.
cocart_api_rate_limit_options
filter.
GET
, POST
, PUT
, PATCH
, and DELETE
wp-config.php
.
cocart_api_rate_limit_options
filter.wp-config.php
file.proxy_support
option to work properly, service layers (load balancer, cache service, CDNs, etc.) must be passing the originating IP supported through standard IP forwarding headers, namely:
X_REAL_IP
|CLIENT_IP
Custom popular implementations that simplify obtaining the origin IP for the requestX_FORWARDED_FOR
De-facto standard header for identifying the originating IP, DocumentationX_FORWARDED
Documentation, RFC 7239RateLimit-Limit
Maximum requests per time frame.RateLimit-Remaining
Requests available during current time frame.RateLimit-Retry-After
Seconds until requests are unblocked again. Only shown when the limit is reached.RateLimit-Reset
Unix timestamp of next time frame reset.cocart_api_rate_limit_exceeded
action to track and handle instances of API abuse:
cocart_api_rate_limit_id
.
/wp-json/cocart/v2/coupon
beyond current limits (currently 25 requests under 10 seconds)