Moved Hide Login to WPS Hide Login
Moved IP restrictions to Protect Login
This commit is contained in:
@ -11,7 +11,6 @@ class Security
|
||||
public const delete_plugins = [
|
||||
'akismet/akismet.php',
|
||||
'hello.php',
|
||||
'wps-hide-login/wps-hide-login.php',
|
||||
'limit-login-attempts-reloaded'
|
||||
];
|
||||
|
||||
@ -23,10 +22,6 @@ class Security
|
||||
self::installSecurityPlugin($pluginSlug, $pluginData['downloadUrl']);
|
||||
}
|
||||
}
|
||||
$loginUrl = get_option('kompass_sec_rewrite_login', null);
|
||||
if (null == $loginUrl) {
|
||||
$loginUrl = get_option('whl_page', null) ?? 'bdp-login';
|
||||
}
|
||||
|
||||
enable_option_disable_xmlrpc();
|
||||
enable_option_block_authorscan();
|
||||
@ -38,7 +33,7 @@ class Security
|
||||
enable_option_prohibit_bot_access();
|
||||
enable_option_block_directory_listing();
|
||||
self::resetLimitLoginAttempts();
|
||||
delete_option('whl_page');
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -83,26 +78,20 @@ class Security
|
||||
global $wp;
|
||||
|
||||
add_action('template_redirect', [Security::class, 'protectAuthorScan']);
|
||||
|
||||
if (null !== is_login_rewritten()) {
|
||||
if (str_contains($_SERVER['REQUEST_URI'], 'wp-login.php?action=logout')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Security::protectLoginSecurity();
|
||||
}
|
||||
|
||||
|
||||
Security::protectLoginSecurity();
|
||||
}
|
||||
|
||||
public static function protectLoginSecurity() {
|
||||
$hideLogin = is_login_rewritten();
|
||||
|
||||
if (null === $hideLogin) {
|
||||
return;
|
||||
}
|
||||
update_option('whl_page', get_option(get_option('kompass_sec_rewrite_login', null)));
|
||||
delete_option('kompass_sec_rewrite_login');
|
||||
kompass_install_plugin( 'https://downloads.wordpress.org/plugin/wps-hide-login.1.9.17.1.zip', 'wps-hide-login' );
|
||||
|
||||
if ( str_contains( $_SERVER['REQUEST_URI'], 'wp-login.php' ) && ! isset( $_POST['redirect_to'] ) && $_POST['redirect_to'] !== 'interner-bereich' ) {
|
||||
|
||||
if ( str_contains( $_SERVER['REQUEST_URI'], 'wp-login.php' ) && ! isset( $_POST['redirect_to'] ) && $_POST['redirect_to'] !== 'interner-bereich' ) {
|
||||
wp_redirect( home_url() );
|
||||
die();
|
||||
}
|
||||
|
Reference in New Issue
Block a user