Created
September 28, 2014 17:42
-
-
Save bolorino/1ec700e0e4ec8c4b748b to your computer and use it in GitHub Desktop.
WordPress Plugin: Enable 403 status on login failed
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
<?php | |
/** | |
* Plugin Name: Security Auth | |
* Plugin URI: http://kovshenin.com/2014/fail2ban-wordpress-nginx/ | |
* Description: Enable 403 status on login failed. | |
* Tags: security, login | |
* Version: 1.0 | |
* License: GPLv2 | |
* Author: Konstantin Kovshenin | |
* Author URI: http://kovshenin.com/ | |
* | |
*/ | |
if ( realpath(__FILE__) === realpath($_SERVER['SCRIPT_FILENAME']) ) | |
exit('Do not access this file directly.'); | |
function my_login_failed_403() { | |
status_header( 403 ); | |
} | |
add_action( 'wp_login_failed', 'my_login_failed_403' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment