Created setup environment

This commit is contained in:
2024-02-27 11:33:24 +01:00
parent 18820c7191
commit 40a3b93d4b
6 changed files with 25 additions and 122 deletions

View File

@ -23,8 +23,11 @@ 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';
}
$loginUrl = get_option('whl_page', null) ?? 'bdp-login';
enable_option_rewrite_url($loginUrl);
enable_option_disable_xmlrpc();
enable_option_block_authorscan();
@ -35,11 +38,20 @@ class Security
enable_option_secure_include_dir();
enable_option_prohibit_bot_access();
enable_option_block_directory_listing();
delete_option('whl_page');
}
public static function deletePlugins() {
deactivate_plugins(self::delete_plugins);
delete_plugins(self::delete_plugins);
$existingPlugins = [];
foreach (self::delete_plugins as $curPlugin) {
if (file_exists(WP_PLUGIN_DIR . '/' . $curPlugin)) {
$existingPlugins[] = $curPlugin;
}
}
deactivate_plugins($existingPlugins);
delete_plugins($existingPlugins);
}
public static function ProhibitBots() {

View File

@ -57,13 +57,13 @@ function enable_option_secure_include_dir() : bool {
function enable_option_prohibit_bot_access() {
update_option('protect_wp_prohibit_bot_access', true);
if (count(get_prohibitedbot_list()) == 0) {
set_prohibitedbot_list(_protect_wp_initial_bot_list_array());
}
}
function disable_option_prohibit_bot_access() {
update_option('protect_wp_prohibit_bot_access', false);
if (count(get_prohibitedbot_list()) == 0) {
set_prohibitedbot_list(_protect_wp_initial_bot_list_array());
}
}
function set_prohibitedbot_list($botList) {