ACF.php
1 year ago
AdvancedMathCaptcha.php
1 year ago
AeliaCurrencySwitcher.php
11 months ago
BeaverBuilder.php
1 year ago
CF_Helper.php
1 year ago
CURCY_MultiCurrency.php
1 year ago
Cloudflare.php
1 year ago
CommonHelpers.php
1 year ago
CookieNotice.php
1 year ago
DownloadManager.php
1 year ago
Elementor.php
6 months ago
Ezoic.php
1 year ago
FusionBuilder.php
1 year ago
GeoTargetingWP.php
1 year ago
GravityForms.php
1 year ago
JetPackNP.php
1 year ago
MPG.php
11 months ago
NginxHelper.php
1 year ago
RC.php
11 months ago
RankMathNP.php
1 year ago
ShortPixel.php
1 year ago
SquirrlySEO.php
1 year ago
TheEventsCalendar.php
1 year ago
ThriveTheme.php
1 year ago
WCML.php
1 year ago
WPBakeryNP.php
1 year ago
WPCacheHelper.php
1 year ago
WPForms.php
1 year ago
WPML.php
1 year ago
WPRocket.php
1 year ago
WooCommerce.php
11 months ago
WoocommerceCacheHandler.php
1 year ago
YoastSEO.php
1 year ago
CF_Helper.php
43 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 isApoCacheByDeviceTypeEnabled() |
| 15 | { |
| 16 | if (method_exists($this, "isAutomaticPlatformOptimizationCacheByDeviceTypeEnabled")) { |
| 17 | return $this->isAutomaticPlatformOptimizationCacheByDeviceTypeEnabled(); |
| 18 | } else { |
| 19 | return false; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | public function purgeUrl($url) { |
| 24 | $wpDomainList = $this->integrationAPI->getDomainList(); |
| 25 | if (!count($wpDomainList)) { |
| 26 | return; |
| 27 | } |
| 28 | $wpDomain = $wpDomainList[0]; |
| 29 | $urls = [$url]; |
| 30 | |
| 31 | $zoneTag = $this->api->getZoneTag($wpDomain); |
| 32 | |
| 33 | if (isset($zoneTag) && !empty($urls)) { |
| 34 | $chunks = array_chunk($urls, 30); |
| 35 | |
| 36 | foreach ($chunks as $chunk) { |
| 37 | $this->api->zonePurgeFiles($zoneTag, $chunk); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } |
| 42 | |
| 43 |