PHP code example of generoi / gds-security-hardening

1. Go to this page and download the library: Download generoi/gds-security-hardening library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

generoi / gds-security-hardening example snippets


add_filter('gds_security_hardening_modules', fn ($modules) => array_diff(
    $modules,
    [\GeneroWP\SecurityHardening\Modules\AuthorArchives::class],
));

add_filter('gds_security_hardening_modules', fn ($modules) => [
    ...$modules,
    \GeneroWP\SecurityHardening\Modules\TwoFactor::class,
]);

add_filter('wp_is_application_passwords_available_for_user', function ($available, $user) {
    return $available || $user->user_login === 'some-integration-user';
}, 20, 2);