Preparation fpr new mareike & solea module
This commit is contained in:
@ -28,8 +28,7 @@ class Security
|
||||
$loginUrl = get_option('whl_page', null) ?? 'bdp-login';
|
||||
}
|
||||
|
||||
enable_option_rewrite_url($loginUrl);
|
||||
enable_option_disable_xmlrpc();
|
||||
enable_option_disable_xmlrpc();
|
||||
enable_option_block_authorscan();
|
||||
enable_option_block_execution_in_uploads();
|
||||
enable_option_prohibit_special_files();
|
||||
@ -83,12 +82,17 @@ class Security
|
||||
public static function SetPageFilters() {
|
||||
global $wp;
|
||||
|
||||
if (str_contains($_SERVER['REQUEST_URI'], 'wp-login.php?action=logout')) {
|
||||
return;
|
||||
add_action('template_redirect', [Security::class, 'protectAuthorScan']);
|
||||
|
||||
if (null !== is_login_rewritten()) {
|
||||
if (str_contains($_SERVER['REQUEST_URI'], 'wp-login.php?action=logout')) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_action('template_redirect', [Security::class, 'protectAuthorScan']);
|
||||
Security::protectLoginSecurity();
|
||||
Security::protectLoginSecurity();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function protectLoginSecurity() {
|
||||
|
@ -86,12 +86,6 @@ function disable_option_disable_wp_debug() {
|
||||
WpConfigEditor::updateConfig('WP_DEBUG', 'true');
|
||||
}
|
||||
|
||||
function enable_option_rewrite_url(?string $url = null) {
|
||||
global $_POST;
|
||||
$saveUrl = $url ?? $_POST['rewrite_login'];
|
||||
update_option('kompass_sec_rewrite_login', $saveUrl);
|
||||
}
|
||||
|
||||
function disable_option_rewrite_url() {
|
||||
update_option('kompass_sec_rewrite_login', null);
|
||||
}
|
||||
@ -110,7 +104,6 @@ function kompass_sec_save_settings($settings) {
|
||||
'option_prohibit_bot_access',
|
||||
'option_block_directory_listing',
|
||||
'option_disable_wp_debug',
|
||||
'option_rewrite_url',
|
||||
];
|
||||
|
||||
$enableSettings = array_intersect($allPossibleSettings, $settings);
|
||||
|
@ -98,20 +98,6 @@
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="bdp_setting_box">
|
||||
<input <?php if (null !== is_login_rewritten()) {echo ' checked';} ?> type="checkbox" id="sec_mod_11" name="security_settings[]" value="option_rewrite_url" />
|
||||
<label for="sec_mod_11">
|
||||
<?= __('Change Login URL', BDP_LV_PLUGIN_SLUG); ?><br />
|
||||
<span>
|
||||
<?= __('Changing the default login URL of WordPress is advisable to enhance the security of your website. By default, WordPress login URLs is /wp-admin or /wp-login.php, which are easily guessed by hackers and facilitate attacks such as brute-force attacks. Changing the login URL to something unique and difficult to guess increases security since potential attackers will struggle to find the correct URL. This can help protect your website from unauthorized access and other malicious activities.', BDP_LV_PLUGIN_SLUG); ?><br />
|
||||
<label style="font-weight: bold;">
|
||||
<?= __('Login-URL', BDP_LV_PLUGIN_SLUG) ?>: <?= get_site_url(); ?>/<input style="width: 100px;" class="long_text" type="text" name="rewrite_login" id="rewrite_login" value="<?= is_login_rewritten(); ?>">
|
||||
</label>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br /><br />
|
||||
<input type="submit" class="button" value="<?= __('Save changes', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
|
Reference in New Issue
Block a user