| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/pia/wp-content/plugins/nitropack/classes/Integration/Server/ |
Upload File : |
<?php
namespace NitroPack\Integration\Server;
// We need this to control Sucuri in addition to any other proxy potentially provided by the origin host company
class Sucuri {
const STAGE = "very_early";
public static function detect() {
return !empty($_SERVER["HTTP_X_SUCURI_CLIENTIP"]) || !empty($_SERVER["HTTP_X_SUCURI_COUNTRY"]);
}
public static function isCacheEnabled() {
return self::detect() && !empty($_SERVER["HTTP_SEC_CH_UA_MOBILE"]);
}
public function init($stage) {
if (self::detect()) {
nitropack_header("Accept-CH: Sec-CH-UA-Mobile");
if (self::isCacheEnabled()) {
add_action('nitropack_cacheable_cache_headers', [$this, 'allowProxyCache'], PHP_INT_MAX-1);
add_action('nitropack_cachehit_cache_headers', [$this, 'allowProxyCache'], PHP_INT_MAX-1);
} else {
add_action('nitropack_cacheable_cache_headers', [$this, 'preventProxyCache'], PHP_INT_MAX-1);
add_action('nitropack_cachehit_cache_headers', [$this, 'preventProxyCache'], PHP_INT_MAX-1);
}
}
}
public function allowProxyCache() {
nitropack_header("Vary: sec-ch-ua-mobile");
nitropack_header("Cache-Control: public, max-age=0, s-maxage=15, stale-while-revalidate=3600");
}
public function preventProxyCache() {
nitropack_header("Cache-Control: no-cache");
}
}