diff --git a/bdp-kompass.php b/bdp-kompass.php index fd253ce..e29e533 100644 --- a/bdp-kompass.php +++ b/bdp-kompass.php @@ -19,10 +19,7 @@ use Bdp\Modules\Seo\Seo; require_once dirname(__FILE__) . '/includes/setup.php'; function bdp_plugin_install() { - Seo::setup(); - Calendar::setup(); - Security::setup(); - update_option('kompass_installation', true); + } @@ -30,11 +27,14 @@ function bdp_plugin_init() { Security::ProhibitBots(); Security::SetPageFilters(); - remove_menu_page( 'admin.php?page=limit-login-attempts&tab=dashboard' ); - if ( get_option( 'kompass_installation' ) == true ) { - delete_option( 'kompass_installation' ); + if (null == get_option('kompass_already_installed', null)) { + Seo::setup(); + Calendar::setup(); + Security::setup(); + update_option('kompass_already_installed', true); wp_redirect( 'site-health.php?tab=bdp_enhanced_security'); } + } add_action('admin_menu', function () { diff --git a/modules/firstusage/classes/Security.class.php b/modules/firstusage/classes/Security.class.php deleted file mode 100644 index da7af89..0000000 --- a/modules/firstusage/classes/Security.class.php +++ /dev/null @@ -1,84 +0,0 @@ - $pluginData) { - if (!is_dir(WP_PLUGIN_DIR . '/' . $pluginSlug)) { - self::installSecurityPlugin($pluginSlug, $pluginData['downloadUrl']); - } - } - - $loginUrl = get_option('whl_page', null) ?? 'bdp-login'; - enable_option_rewrite_url($loginUrl); - enable_option_disable_xmlrpc(); - enable_option_block_authorscan(); - enable_option_block_execution_in_uploads(); - enable_option_prohibit_special_files(); - enable_option_file_editor(); - enable_option_disable_conatenation(); - enable_option_secure_include_dir(); - enable_option_prohibit_bot_access(); - enable_option_block_directory_listing(); - - } - - public static function deletePlugins() { - deactivate_plugins(self::delete_plugins); - delete_plugins(self::delete_plugins); - } - - - public static function installSecurityPlugin(string $pluginSlug, string $downloadUrl) : bool - { - $ch = curl_init(); - $source = $downloadUrl; - curl_setopt($ch, CURLOPT_URL, $source); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - $data = curl_exec ($ch); - curl_close ($ch); - - $destination = WP_PLUGIN_DIR . '/' . $pluginSlug . '.zip'; - $file = fopen($destination, "w+"); - fputs($file, $data); - fclose($file); - - $zip = new ZipArchive(); - $zip->open($destination); - $zip->extractTo(WP_PLUGIN_DIR); - $zip->close(); - unlink($destination); - - $pluginInfos = get_plugins( '/'.$pluginSlug ); - $installfile = $pluginSlug . '/'; - if( ! empty( $pluginInfos ) ) { - foreach ($pluginInfos as $file => $info) : - $installfile .= $file; - endforeach; - } - - - - $result = activate_plugin($installfile); - - return $result === null; - } -} \ No newline at end of file diff --git a/modules/firstusage/internal/index.php b/modules/firstusage/internal/index.php deleted file mode 100644 index 731ff16..0000000 --- a/modules/firstusage/internal/index.php +++ /dev/null @@ -1,22 +0,0 @@ -'; -echo '