ckalech asks…
Can we whitelist an !P address so that the number of failed attempts does not block a given IP range? I know we can whitelist an IP range so they do not need to log in but that is not what we want. Different users at the same organization with a static IP address need to log in as different users with different permissions. However if one person fails to log in 5 times the whole organization is blocked for 30 minutes.
You will need an MU plugin file to accomplish this. Here’s a quick example.
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
<?php
add_action('ws_plugin__s2member_before_track_failed_logins', function() {
if ($_SERVER['REMOTE_ADDR'] === '123.456.789.0') { // Change this IP address to the one you want to whitelist.
$GLOBALS['WS_PLUGIN__']['s2member']['o']['max_failed_login_attempts'] = 0; // Disable.
}
});
See also: this reference to the hook in s2Member’s source code.