Exemple #1
0
    protected function render_settings($form)
    {
        $available_modules = ITSEC_Modules::get_available_modules();
        $modules_to_activate = array('ban-users' => __('Banned Users', 'better-wp-security'), 'backup' => __('Database Backups', 'better-wp-security'), 'brute-force' => __('Local Brute Force Protection', 'better-wp-security'), 'malware-scheduling' => __('Malware Scan Scheduling', 'better-wp-security'), 'network-brute-force' => __('Network Brute Force Protection', 'better-wp-security'), 'strong-passwords' => __('Strong Passwords', 'better-wp-security'), 'two-factor' => __('Two-Factor Authentication', 'better-wp-security'), 'user-logging' => __('User Logging', 'better-wp-security'), 'wordpress-tweaks' => __('WordPress Tweaks', 'better-wp-security'));
        foreach ($modules_to_activate as $module => $val) {
            if (!in_array($module, $available_modules)) {
                unset($modules_to_activate[$module]);
            }
        }
        ?>
	<div id="itsec-security-check-details-container">
		<p><?php 
        _e('Some features and settings are recommended for every site to run. This tool will ensure that your site is using these recommendations.', 'better-wp-security');
        ?>
</p>
		<p><?php 
        _e('When the button below is clicked the following modules will be enabled and configured:', 'better-wp-security');
        ?>
</p>
		<ul class="itsec-security-check-list">
			<?php 
        foreach ($modules_to_activate as $name) {
            ?>
				<li><p><?php 
            echo $name;
            ?>
</p></li>
			<?php 
        }
        ?>
		</ul>
	</div>

	<p><?php 
        $form->add_button('secure_site', array('value' => 'Secure Site', 'class' => 'button-primary'));
        ?>
</p>
<?php 
    }
Exemple #2
0
 public static function run()
 {
     self::$available_modules = ITSEC_Modules::get_available_modules();
     self::enforce_activation('ban-users', __('Banned Users', 'better-wp-security'));
     self::enforce_setting('ban-users', 'enable_ban_lists', true, __('Enabled the Enable Ban Lists setting in Banned Users.', 'better-wp-security'));
     self::enforce_activation('backup', __('Database Backups', 'better-wp-security'));
     self::enforce_activation('brute-force', __('Local Brute Force Protection', 'better-wp-security'));
     self::enforce_activation('malware-scheduling', __('Malware Scan Scheduling', 'better-wp-security'));
     self::enforce_setting('malware-scheduling', 'email_notifications', true, __('Enabled the Email Notifications setting in Malware Scan Scheduling.', 'better-wp-security'));
     self::add_network_brute_force_signup();
     self::enforce_activation('strong-passwords', __('Strong Password Enforcement', 'better-wp-security'));
     self::enforce_activation('two-factor', __('Two-Factor Authentication', 'better-wp-security'));
     self::enable_all_two_factor_providers();
     self::enforce_activation('user-logging', __('User Logging', 'better-wp-security'));
     self::enforce_activation('wordpress-tweaks', __('WordPress Tweaks', 'better-wp-security'));
     self::enforce_setting('wordpress-tweaks', 'file_editor', true, __('Disabled the File Editor in WordPress Tweaks.', 'better-wp-security'));
     self::enforce_setting('wordpress-tweaks', 'allow_xmlrpc_multiauth', false, __('Changed the Multiple Authentication Attempts per XML-RPC Request setting in WordPress Tweaks to "Block".', 'better-wp-security'));
     self::enforce_setting('global', 'write_files', true, __('Enabled the Write to Files setting in Global Settings.', 'better-wp-security'));
     ob_start();
     echo implode("\n", self::$calls_to_action);
     echo implode("\n", self::$actions_taken);
     echo implode("\n", self::$confirmations);
     ITSEC_Response::set_response(ob_get_clean());
 }