What you need
- Exponential 6.0. Under PHP-FPM with Apache or nginx the hook needs nothing from the kernel; under Exponential Velocity, use the 6.0.15 line.
- PHP 7.4 to 8.5. On PHP 7.4 the extension loads a build of the same library files with the syntax downgraded.
- APCu is optional: without it the counters live in plain files.
Quick start
composer require se7enxweb/exp_request_shield
- Activate the extension: ActiveExtensions[]=exp_request_shield in settings/override/site.ini.append.php.
- Add the hook to config.php, above the HTTP cache's early exit (see below).
- Give the site its own rules: copy rules/request-shield.rules and the three rules/exponential*.rules files to settings/request-shield/, then name your host names. Or press any mode switch in Setup > Request shield, which makes the copies for you.
- Regenerate the autoloads, clear the caches, and open Setup > Request shield.
- Read Setup > Request shield > Log for anything a real visitor or editor did, and add an exception for it, or set mode monitor while you look.
The hook in config.php:
if ( is_file( __DIR__ . '/extension/exp_request_shield/bootstrap/hook.php' ) )
require __DIR__ . '/extension/exp_request_shield/bootstrap/hook.php';
Check the rules before they go live:
cd extension/exp_request_shield php bin/request-shield check ../../settings/request-shield/request-shield.rules php bin/request-shield test ../../settings/request-shield/request-shield.rules
After an update
Your copies in settings/request-shield/ are written once and never changed by an update. Compare them with extension/exp_request_shield/rules/ after every update and read the changelog for rules that changed.
The full procedure, with Velocity, permissions and checks: INSTALL.md. Running on 7x hosting? We install and tune it for you.