| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/prosvasi/wp-content/plugins/wp-statistics/src/Components/ |
Upload File : |
<?php
namespace WP_Statistics\Components;
/**
* Response headers shared by every tracking endpoint (custom event,
* hit record, REST /hit). Keeps the URLs out of search-engine indexes
* and out of reverse-proxy / CDN caches.
*
* @link https://wordpress.org/support/topic/request-for-cloudflare-html-caching-compatibility/
*/
class TrackingResponse
{
/**
* @return array<string,string>
*/
public static function getHeaders()
{
return [
'X-Robots-Tag' => 'noindex, nofollow',
'Cache-Control' => 'no-cache',
];
}
/**
* Emit headers via header(). For REST handlers, pass getHeaders()
* to $response->set_headers() instead.
*/
public static function sendHeaders()
{
if (headers_sent()) {
return;
}
foreach (self::getHeaders() as $name => $value) {
header($name . ': ' . $value, true);
}
}
}