Why security headers matter
Security headers are instructions your server sends with every page. The browser enforces them for you: only load this site over HTTPS, don't let other sites frame this page, don't guess file types, don't send full URLs to other sites.
A few lines of configuration close off whole classes of attack such as clickjacking, content sniffing and cross-site scripting. Many sites never switch them on.
How the grade works
Each header has a weight out of 100: Content-Security-Policy 25, Strict-Transport-Security 20, X-Frame-Options or frame-ancestors 15, X-Content-Type-Options 10, Referrer-Policy 10, Permissions-Policy 10, Cross-Origin-Opener-Policy 5 and Cross-Origin-Resource-Policy 5. A header that is present but weak earns half.
A Server header with a version number, or any X-Powered-By header, costs 5 points each. The score becomes a grade: A+ from 95, A from 85, B from 70, C from 55, D from 40 and F below that.
How to add the missing headers
On Apache, add them to .htaccess; on Nginx, add an add_header line per header to the server block; on Next.js, return them from the headers option in next.config. On WordPress, a plugin can send them without touching server files.
Switch on the safe headers first. Add Content-Security-Policy last, in report-only mode, because a strict policy can block scripts and embeds your site needs.