BeaverBuilder.php
4 years ago
CF_Helper.php
4 years ago
Cloudflare.php
4 years ago
CookieNotice.php
4 years ago
DownloadManager.php
4 years ago
Ezoic.php
4 years ago
NginxHelper.php
4 years ago
RC.php
4 years ago
ShortPixel.php
4 years ago
WPCacheHelper.php
4 years ago
WPRocket.php
4 years ago
CF_Helper.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace NitroPack\Integration\Plugin; |
| 4 | |
| 5 | class CF_Helper extends \CF\WordPress\Hooks { |
| 6 | public function isApoEnabled() { |
| 7 | if (method_exists($this, "isAutomaticPlatformOptimizationEnabled")) { |
| 8 | return $this->isAutomaticPlatformOptimizationEnabled(); |
| 9 | } else { |
| 10 | return false; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | public function purgeUrl($url) { |
| 15 | $wpDomainList = $this->integrationAPI->getDomainList(); |
| 16 | if (!count($wpDomainList)) { |
| 17 | return; |
| 18 | } |
| 19 | $wpDomain = $wpDomainList[0]; |
| 20 | $urls = [$url]; |
| 21 | |
| 22 | $zoneTag = $this->api->getZoneTag($wpDomain); |
| 23 | |
| 24 | if (isset($zoneTag) && !empty($urls)) { |
| 25 | $chunks = array_chunk($urls, 30); |
| 26 | |
| 27 | foreach ($chunks as $chunk) { |
| 28 | $this->api->zonePurgeFiles($zoneTag, $chunk); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 |