Created
May 23, 2013 13:05
-
-
Save Coopeh/5635891 to your computer and use it in GitHub Desktop.
Error log out bad auth on wp-login failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_login_failed', 'log_wp_login_fail'); | |
function log_wp_login_fail($username) { | |
$ip = ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') ? $_SERVER['REMOTE_ADDR'] : $_SERVER['X_FORWARDED_FOR']; | |
error_log("Authentication failure for $username from {$ip}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment