Enables the rate limiting feature for CoCart that is available in CoCart Plus and up. It is setup so that it can be installed as a standalone WordPress plugin, or included into CoCart as a Composer Package.
Once you have the plugin installed and activated you will have the default options applied.
You can if you want change any of the options via your wp-config.php
file.
These are the constants to use in your wp-config.php
which will override the default values.
define( 'COCART_RATE_LIMITING_ENABLED', true );
define( 'COCART_RATE_LIMITING_PROXY_SUPPORT', false );
define( 'COCART_RATE_LIMITING_LIMIT', 25 );
define( 'COCART_RATE_LIMITING_SECONDS', 10 );
[See guide on Rate Limiting] for more advanced setup.
If you want to restrict the rate limit even further to 1 request per 60 seconds for specified routes, then you can use this filter cocart_rate_limit_restricted_request_patterns
.
add_filter( 'cocart_rate_limit_restricted_request_patterns' function() {
return array(
'#^/cocart/v2/checkout?#'
);
});
We have different channels at your disposal where you can find information about the CoCart project, discuss it and get involved:
- 📖 Docs: this is the place to learn how to use CoCart API. Get started!
- 🧰 Resources: this is the hub of all CoCart resources to help you build a headless store. Get resources!
- 👪 Community: use our Discord chat room to share any doubts, feedback and meet great people. This is your place too to share how are you planning to use CoCart!
- 🐞 GitHub: we use GitHub for bugs and pull requests, doubts are solved with the community.
- 🐦 Social media: a more informal place to interact with CoCart users, reach out to us on Twitter.
- 💌 Newsletter: do you want to receive the latest plugin updates and news? Subscribe here.
Released under GNU General Public License v3.0.
Website cocartapi.com · GitHub @co-cart · Twitter @cocartapi
CoCart is developed and maintained by Sébastien Dumont. Founder of CoCart Headless, LLC.
Website sebastiendumont.com · GitHub @seb86 · Twitter @sebd86