query("DELETE FROM " . BWPS_TABLE_D404 . " WHERE attempt_date < '" . (time() - 300) . "';");
}
if ($_POST['BWPS_removeLogin'] == 1) {
$wpdb->query("DELETE FROM " . BWPS_TABLE_LL . " WHERE attempt_date < '" . (time() - 1800) . "';");
}
if ($_POST['BWPS_removeLockouts'] == 1) {
$opts = $BWPS->getOptions();
$wpdb->query("DELETE FROM " . BWPS_TABLE_LOCKOUTS . " WHERE lockout_date < '" . (time() - ($opts['ll_checkinterval'] * 60)) . "';");
unset($opts);
}
if (isset($errorHandler)) {
echo '
' . $errorHandler->get_error_message() . '
';
} else {
echo '' . __('Old Data Has Been Cleared From The Database', 'better-wp-security') . '.
';
}
}
/**
* Count how many 404s are in the database
* @return integer
* @param NULL
*/
function d404_count() {
global $wpdb;
$count = $wpdb->get_var("SELECT COUNT(attempt_ID) FROM " . BWPS_TABLE_D404 . " WHERE attempt_date < '" . (time() - 300). "';");
echo $count;
}
/**
* Count how many 404s are in the database
* @return integer
* @param NULL
*/
function old_lockouts() {
global $wpdb;
$count = $wpdb->get_var("SELECT COUNT(lockout_id) FROM " . BWPS_TABLE_LOCKOUTS . " WHERE lockout_date < " . (time() - 1800) . ";");
echo $count;
}
/**
* Count how many 404s are in the database
* @return integer
* @param NULL
*/
function logins_count() {
global $wpdb, $BWPS;
$opts = $BWPS->getOptions();
$count = $wpdb->get_var("SELECT COUNT(attempt_ID) FROM " . BWPS_TABLE_LL . " WHERE attempt_date < '" . (time() - ($opts['ll_checkinterval'] * 60)) . "';");
unset($opts);
echo $count;
}
?>