1. Go to this page and download the library: Download cedaro/wprestcop library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cedaro / wprestcop example snippets
/**
* Set the rate limit to 10 requests every 5 minutes.
*/
add_action( 'wprestcop_plugin_loaded', function( $wprestcop ) {
$wprestcop
->set_limit( 10 )
->set_interval( 5 * MINUTE_IN_SECONDS );
} );
/**
* Global IP rules configuration.
*/
add_action( 'wprestcop_plugin_loaded', function( $wprestcop ) {
$wprestcop->get_ip_rules()
->allow( '192.168.50.4' ); // Also accepts an array of IP addresses.
// Or...
$wprestcop->get_ip_rules()
->deny( '66.249.66.1' ); // Also accepts an array of IP addresses.
} );