<?php
/**
* This file is created by Really Simple Security to test the CSP header length
* It will not load during regular wordpress execution
*/


if ( !headers_sent() ) {
if ( !function_exists("rsssl_is_ssl" ) ) {
  function rsssl_is_ssl() {
    if (    ( isset($_SERVER["HTTPS"]) && ("on" === $_SERVER["HTTPS"] || "1" === $_SERVER["HTTPS"]) )
    || (isset($_ENV["HTTPS"]) && ("on" === $_ENV["HTTPS"]))
    || (isset($_SERVER["SERVER_PORT"]) && ( "443" === $_SERVER["SERVER_PORT"] ) )
    || (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "1") !== false))
    || (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "on") !== false))
    || (isset($_SERVER["HTTP_CF_VISITOR"]) && (strpos($_SERVER["HTTP_CF_VISITOR"], "https") !== false))
    || (isset($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"], "https") !== false))
    || (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_X_FORWARDED_PROTO"], "https") !== false))
    || (isset($_SERVER["HTTP_X_PROTO"]) && (strpos($_SERVER["HTTP_X_PROTO"], "SSL") !== false))
    ) {
      return true;
    }
    return false;
  }
}
if ( rsssl_is_ssl() ) header("Strict-Transport-Security: max-age=63072000; includeSubDomains;preload");
header("X-XSS-Protection: 0");
header("X-Content-Type-Options: nosniff");
header("Referrer-Policy: strict-origin-when-cross-origin");
header("X-Frame-Options: SAMEORIGIN");
header("Cross-Origin-Opener-Policy: same-origin");
header("Cross-Origin-Resource-Policy: same-origin");
header("Cross-Origin-Embedder-Policy: same-origin");

if (function_exists('header_remove')) {
    header_remove('X-Powered-By');
} else {
    header('X-Powered-By: ');
}

header("Content-Security-Policy: frame-ancestors 'self' ; upgrade-insecure-requests;");

}
header("X-REALLY-SIMPLE-SSL-TEST: TP%87%B9%E7%C49%2C%FF%06%7B1A%E1Z%81O%12%7C+%BE-%16%90%EC%DD%3Dw%8D%1FDLFtI%D7L%C2E%856%A7q%D7E%00%FA%3E%D8%F6%1B%0AF%15%11%EF%D9Z4%8Fjp%DF%AC%E1%A4%8E2%FDzh%C8Y%F5%FF4L%29W%12%1E%21%02%97Y%18%C090%3C%13%0FF%00%3F%3C%7B%DCu%3A%A1%A7%02%82%13%F5%24%0B%3B%8A%25%AF%AC%8E%E60%3Dx6%11%D2%3Em%EE%A8%07%AB%A5%89%9FH+%3B%92%2A%21%13q+N%80%9E%03%2F%07%F2R%EE%862%F0%DD%A9pB%06%A6%EA5%D2%E0t%E0%2B%21%7D%A6%E1%F7%82%F2%E1%F9%1B%D5g%CD%89%CD%BBEa%2A%00.%B9%82%91u%D2%C7%10Cymp%82%0E%B5%E3%96%00%13%19%CE0sD%85q");

 echo '<html><head><meta charset="UTF-8"><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body>Really Simple Security headers test page</body></html>';