ACF.php
1 year ago
AdvancedMathCaptcha.php
1 year ago
AeliaCurrencySwitcher.php
11 months ago
BeaverBuilder.php
1 year ago
CF_Helper.php
5 months ago
CURCY_MultiCurrency.php
1 year ago
Cloudflare.php
5 months ago
CommonHelpers.php
1 year ago
CookieNotice.php
1 year ago
DownloadManager.php
1 year ago
Elementor.php
5 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
ShortPixel.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace NitroPack\Integration\Plugin; |
| 4 | |
| 5 | class ShortPixel { |
| 6 | const STAGE = "late"; |
| 7 | |
| 8 | public function init($stage) { |
| 9 | if (defined('SHORTPIXEL_AI_VERSION')) { // ShortPixel |
| 10 | if (nitropack_is_ajax()) { |
| 11 | if (version_compare(SHORTPIXEL_AI_VERSION, "2", ">=")) { // ShortPixel AI 2.x |
| 12 | remove_action('wp_enqueue_scripts', array(\ShortPixelAI::_(), 'enqueue_script')); |
| 13 | remove_action('init', array(\ShortPixelAI::_(), 'init_ob'), 1); |
| 14 | remove_filter('script_loader_tag', array(\ShortPixelAI::_(), 'disable_rocket-Loader'), 10); |
| 15 | } else { // ShortPixel AI 1.x |
| 16 | remove_action('wp_enqueue_scripts', array(\ShortPixelAI::instance(SHORTPIXEL_AI_PLUGIN_FILE), 'enqueue_script'), 11); |
| 17 | remove_action('init', array(\ShortPixelAI::instance(SHORTPIXEL_AI_PLUGIN_FILE), 'init_ob'), 1); |
| 18 | remove_filter('rocket_css_content', array(\ShortPixelAI::instance(SHORTPIXEL_AI_PLUGIN_FILE), 'parse_cached_css'), 10); |
| 19 | remove_filter('script_loader_tag', array(\ShortPixelAI::instance(SHORTPIXEL_AI_PLUGIN_FILE), 'disable_rocket-Loader'), 10); |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 |