PATH:
home
/
sparklp6
/
public_html
/
website_356c8563
/
nitropack
/
classes
/
Integration
/
Hosting
<?php namespace NitroPack\Integration\Hosting; use NitroPack\SDK\Device; class Kinsta extends Hosting { const STAGE = "very_early"; public static function detect() { return defined("KINSTAMU_VERSION"); } public function init($stage) { if ($this->getHosting() == "kinsta") { add_action('nitropack_execute_purge_url', [$this, 'purgeUrl']); add_action('nitropack_execute_purge_all', [$this, 'purgeAll']); if ( ! empty($_SERVER["HTTP_USER_AGENT"]) && stripos($_SERVER["HTTP_USER_AGENT"], "Nitro-Optimizer-Agent") !== false) { add_filter("wp_is_mobile", function() { $device = new Device($_SERVER["HTTP_USER_AGENT"]); return $device->isMobile(); }, PHP_INT_MAX); } } } public function purgeUrl($url) { try { $data = array( 'single|nitropack' => preg_replace( '@^https?://@', '', $url) ); $httpClient = new \NitroPack\HttpClient\HttpClient("https://localhost/kinsta-clear-cache/v2/immediate"); $httpClient->setPostData($data); $httpClient->fetch(true, "POST"); return true; } catch (\Exception $e) { } return false; } public function purgeAll() { try { $httpClient = new \NitroPack\HttpClient\HttpClient("https://localhost/kinsta-clear-cache-all"); $httpClient->timeout = 5; $httpClient->fetch(); return true; } catch (\Exception $e) { } return false; } }
[-] Closte.php
[edit]
[-] Savvii.php
[edit]
[-] Pantheon.php
[edit]
[-] .htaccess
[edit]
[-] Pagely.php
[edit]
[-] WPEngine.php
[edit]
[-] Hosting.php
[edit]
[-] Kinsta.php
[edit]
[-] RocketNet.php
[edit]
[-] Flywheel.php
[edit]
[-] SiteGround.php
[edit]
[-] Cloudways.php
[edit]
[-] SpinupWp.php
[edit]
[-] DreamHost.php
[edit]
[-] Vimexx.php
[edit]
[-] GridPane.php
[edit]
[-] GoDaddyWPaaS.php
[edit]
[-] WPX.php
[edit]
[-] WPmudev.php
[edit]
[-] PagelyCachePurge.php
[edit]
[-] Raidboxes.php
[edit]
[+]
..
[-] Pressable.php
[edit]