PHP code example of carloswph / wp-secure-headers

1. Go to this page and download the library: Download carloswph/wp-secure-headers 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/ */

    

carloswph / wp-secure-headers example snippets


use WPH\Security\Headers;

s();
$sec_headers->set('Content-Security-Policy', 'connect-src "self"'); // Add new headers to the class array property.

use WPH\Security\Headers;
use WPH\Security\ContentSecurityPolicy

le.com https://microsoft.com')
    ->setConnect('https://*');

$sec_headers = new Headers($csp); // Adds the Content-Security-Policy to the headers pool, with all set parameters