Security Settings:
xmlrpc deaktivieren Autorenscan deaktivieren Scripting in /wp-content/uploads/ deaktivieren Zugriff auf potenziell sensible Dateien blockieren Dateieditor im WP Dashboard deaktivieren Skriptverkettung deaktivieren Skriptausführung im Include-Verzeichnis deaktivieren Zugriff von ungewollten Bots verbieten Auflistung von Verzeichnissen deaktivieren Debug-Ausgaben deaktivieren Login-URL ändern
This commit is contained in:
		@@ -1,21 +1,53 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
require_once dirname(__FILE__) . '/includes/settings_reader.php';
 | 
			
		||||
require_once dirname(__FILE__) . '/includes/settings_writer.php';
 | 
			
		||||
 | 
			
		||||
function wp_example_site_health_navigation_tabs( $tabs ) {
 | 
			
		||||
    // translators: Tab heading for Site Health navigation.
 | 
			
		||||
    $tabs['loginurl'] = esc_html_x( 'Login-URL', 'Site Health', 'text-domain' );
 | 
			
		||||
	$tabs['bdp_enhanced_security'] = esc_html_x('Erweiterte Sicherheit', 'Site Health', 'text-domain');
 | 
			
		||||
 | 
			
		||||
    return $tabs;
 | 
			
		||||
}
 | 
			
		||||
add_filter( 'site_health_navigation_tabs', 'wp_example_site_health_navigation_tabs' );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function wp_example_site_health_tab_content($tab)
 | 
			
		||||
{
 | 
			
		||||
    // Do nothing if this is not our tab.
 | 
			
		||||
    if ('loginurl' === $tab) {
 | 
			
		||||
        require_once dirname(__FILE__) . '/internal/index.php';
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
	if ('bdp_enhanced_security' === $tab) {
 | 
			
		||||
		if (isset($_GET['subpage']) && $_GET['subpage'] == 'botlist') {
 | 
			
		||||
			if (isset($_POST['save_settings']) && isset($_POST['existing_bots']) && isset($_POST['new_bots'])) {
 | 
			
		||||
				protect_wp_save_bots($_POST['existing_bots'], $_POST['new_bots']);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			echo '<div class="health-check-body health-check-status-tab hide-if-no-js">';
 | 
			
		||||
			echo '<form method="post" action="site-health.php?tab=' . BDP_LV_PLUGIN_SLUG . '&subpage=botlist">';
 | 
			
		||||
			echo '<input type="hidden" name="save_settings" value="true" />';
 | 
			
		||||
			require BDP_LV_PLUGIN_DIR . 'modules/security/internal/botlist-tab.php';
 | 
			
		||||
			echo '</form>';
 | 
			
		||||
			echo '</div>';
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		update_option('protect_wp_needs_attention', false);
 | 
			
		||||
		if (isset($_POST['save_settings'])) {
 | 
			
		||||
			$securitySettings = [];
 | 
			
		||||
			if (isset($_POST['security_settings'])) {
 | 
			
		||||
				$securitySettings = $_POST['security_settings'];
 | 
			
		||||
			}
 | 
			
		||||
			kompass_sec_save_settings($securitySettings);
 | 
			
		||||
		}
 | 
			
		||||
		if (isset($_GET['action']) && $_GET['action'] == 'updatesitekeys') {
 | 
			
		||||
			kompass_sec_site_keys();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		echo '<div class="health-check-body health-check-status-tab hide-if-no-js">';
 | 
			
		||||
		echo '<form method="post" action="site-health.php?tab=bdp_enhanced_security">';
 | 
			
		||||
		echo '<input type="hidden" name="save_settings" value="true" />';
 | 
			
		||||
		require BDP_LV_PLUGIN_DIR . 'modules/security/internal/site-health-tab.php';
 | 
			
		||||
		echo '</form>';
 | 
			
		||||
		echo '</div>';
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
add_action('site_health_tab_content', 'wp_example_site_health_tab_content');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user