<?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");

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: ve%11%3Ev%94%DF%28%CB%8C%A5%1F%5CA%D2%B2Z%3Dn%FBZ%C6%B7b%F2%E7%BF%B6%3E%DA%80A15%85%9Fg%C2%B0h%D5d%5E%AFO%0A%D7%B8%8F%F7%10mK%22%C3p%BA%BA%7Fw%03O%92%8D%0E%EDh%00%91%082f%9B%0C%3C%00%A4%8Fly7%FBD%00%D8a%B9b%83%DA%3C%25%91%B8%24%D9C%29%F9%2F%BD%16%B6LJU%28%81%F8%F2%09%88%F6%D4%5BZ%3F%DFT%E6%02-W%A3Y%3F%D0%D0%1F%10%F0%5D%24P%E1%9Fv%0E%3C%10%BBM%CB%CF%FCsK%1F2%16%1B%60%2F%2BW%03%96%B0%21%07%D1%A7%06%AA%A5%00%8E%A5%B2v%F0%E3%7D.AB%40%B6%60Axq%AD%84%87%AChE%02%ED%85%09%94%40u%D5%BC%0DP%7Fy%C1%EA%A0%A");

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