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
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 |