add("3", __("Max Login Attempts Per Host MUST be a positive integer.")); } if ($_POST['BWPS_limitlogin_maxattemptsuser'] != $mauinput) { $errorHandler->add("3", __("Max Login Attempts Per User MUST be a positive integer.")); } if ($_POST['BWPS_limitlogin_checkinterval'] != $ciinput) { $errorHandler->add("3", __("Login Time Period (minutes) MUST be a positive integer.")); } if ($_POST['BWPS_limitlogin_banperiod'] != $bainput) { $errorHandler->add("3", __("Lockout Time Period (minutes) MUST be a positive integer.")); } } else { $BWPS->saveOptions("limitlogin_enable", $_POST['BWPS_limitlogin_enable']); $BWPS->saveOptions("limitlogin_maxattemptshost", $mahinput); $BWPS->saveOptions("limitlogin_maxattemptsuser", $mauinput); $BWPS->saveOptions("limitlogin_checkinterval", $ciinput); $BWPS->saveOptions("limitlogin_banperiod", $bainput); $BWPS->saveOptions("limitlogin_denyaccess", $_POST['BWPS_limitlogin_denyaccess']); $BWPS->saveOptions("limitlogin_emailnotify", $_POST['BWPS_limitlogin_emailnotify']); $opts = $BWPS->getOptions(); } if (is_wp_error($errorHandler)) { echo '

' . $errorHandler->get_error_message() . '

'; } else { echo '

Settings Saved

'; } $ledisplay = $_POST['BWPS_limitlogin_enable']; $mahdisplay = $_POST['BWPS_limitlogin_maxattemptshost']; $maudisplay = $_POST['BWPS_limitlogin_maxattemptsuser']; $cidsplay = $_POST['BWPS_limitlogin_checkinterval']; $bpdisplay = $_POST['BWPS_limitlogin_banperiod']; $dadisplay = $_POST['BWPS_limitlogin_denyaccess']; $endisplay = $_POST['BWPS_limitlogin_emailnotify']; } else { $ledisplay = $opts['limitlogin_enable']; $mahdisplay = $opts['limitlogin_maxattemptshost']; $maudisplay = $opts['limitlogin_maxattemptsuser']; $cidsplay = $opts['limitlogin_checkinterval']; $bpdisplay = $opts['limitlogin_banperiod']; $dadisplay = $opts['limitlogin_denyaccess']; $endisplay = $opts['limitlogin_emailnotify']; } if (isset($_POST['BWPS_releasesave'])) { if (!wp_verify_nonce($_POST['wp_nonce'], 'BWPS_releasesave')) { //verify nonce field die('Security error!'); } while (list($key, $value) = each($_POST)) { if (strstr($key,"lo")) { $wpdb->query("DELETE FROM " . $opts['limitlogin_table_lockouts'] . " WHERE lockout_ID = " . $value . ";"); } } } ?>

Better WP Security - Limit Logins Options

Limit Logins Options

Set options below to limit the number of bad login attempts. Once this limit is reached, the host or computer attempting to login will be banned from the site for the specified "lockout length" period.

The number of login attempts a user has before their host or computer is locked out of the system.

The number of login attempts a user has before their username is locked out of the system.


The number of minutes in which bad logins should be remembered.


The length of time a host or computer will be banned from this site after hitting the limit of bad logins.


If the host is locked out it will be completely banned from the site and unable to access either content or the backend for the duration of the logout.


Enabling this feature will trigger an email to be sent to the website administrator whenever a host or user is locked out of the system.

Active Lockouts

Select a host or computer and click remove to release the lockout and allow them to log into the system.

Locked Out Hosts Locked Out Users
listLocked(); if (sizeof($lockedList) > 0) { foreach ($lockedList as $item) { echo " \n"; } echo "

\n"; } else { echo "

There are no hosts currently locked out.

\n"; } ?>
listLocked("users"); if (sizeof($lockedList) > 0) { foreach ($lockedList as $item) { echo " \n"; } echo "

\n"; } else { echo "

There are no users currently locked out.

\n"; } ?>