Help in code WordPress security header not working with a nitro pack

[ad_1]

I am adding a security header to my WordPress website, but nitro pack cache is all I can see is just a few I have tried the following ways can anyone guide me on how to do that I want to do the program way as I have no server access

function shp_send_hsts_header() { header( ‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’ ); header(“Content-Security-Policy-Report-Only: <your directives>”); header(‘X-Frame-Options: SAMEORIGIN’); header(‘Referrer-Policy: no-referrer; strict-origin-when-cross-origin’); header(‘Content-Security-Policy: upgrade-insecure-requests’); header(‘Permissions-Policy: geolocation=self’); header(‘X-Content-Type-Options:nosniff’); header(“Clear-Site-Data: none”); header(“Cross-Origin-Embedder-Policy: require-corp”); header(“Cross-Origin-Resource-Policy: same-site | same-origin | cross-origin”); header(“Cross-Origin-Opener-Policy: same-origin”); header(“X-Permitted-Cross-Domain-Policies: none”); } add_action( ‘send_headers’, ‘shp_send_hsts_header’ );

add_filter( ‘wp_headers’, ‘pagely_security_headers’ ); function pagely_security_headers( $headers ) { $headers[‘X-XSS-Protection’] = ‘1; mode=block’; $headers[‘X-Content-Type-Options’] = ‘nosniff’; $headers[‘X-Content-Security-Policy’] = ‘default-src \’self\’; script-src \’self\’;’; $headers[‘X-Permitted-Cross-Domain-Policies’] = ‘none’; $headers[‘Clear-Site-Data’] = ‘none’; $headers[‘Cross-Origin-Embedder-Policy’] = ‘require-corp’; $headers[‘Cross-Origin-Resource-Policy’] = ‘same-site | same-origin | cross-origin’; $headers[‘Cross-Origin-Opener-Policy’] = ‘same-origin’; $headers[‘cache-control’] = ‘maxage=31536000’; return $headers; }

after few minutes I get this result at first it shows all green then few minutes I get few missing results as shown in image please help me I am new and stuck in this from 4 days I don’t know how to get that with the nitro pack. I am getting my website scanned for a secure header from geek flare

[ad_2]
2 Comments
  1. [https://stackoverflow.com/questions/73666688/wordpress-security-header-not-working-with-nitropack])

    My question on StackOverflow also

    where no one answer

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer