PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.18.4
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.18.4
1.19.8 1.19.7 1.19.6 1.19.5 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.12.0 1.13.0 1.14.0 1.15.0 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.16.6 1.16.7 1.16.8 1.17.0 1.17.6 1.17.7 1.17.8 1.17.9 1.18.0 1.18.1 1.18.2 1.18.3 1.18.4 1.18.5 1.18.6 1.18.7 1.18.8 1.18.9 1.19.0 1.19.1 1.19.2 1.19.3 1.19.4 1.3.19 1.3.20 1.4.0 1.4.1 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.16 1.5.17 1.5.18 1.5.19 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.8.1 1.8.3 1.9.0 1.9.1 1.9.2
nitropack / classes / WordPress / ConflictingPlugins.php
nitropack / classes / WordPress Last commit date
Notifications 11 months ago Settings 1 year ago Config.php 1 year ago ConflictingPlugins.php 11 months ago Cron.php 1 year ago NitroPack.php 11 months ago Settings.php 1 year ago
ConflictingPlugins.php
129 lines
1 <?php
2 namespace NitroPack\WordPress;
3
4 /**
5 * Class ConflictingPlugins
6 *
7 * This class is responsible for managing conflicting plugins in WordPress.
8 * It provides methods to retrieve a list of known conflicting plugins and check if any are active.
9 */
10 class ConflictingPlugins {
11 private static $instance = NULL;
12 public static function getInstance() {
13 if ( ! self::$instance ) {
14 self::$instance = new ConflictingPlugins();
15 }
16
17 return self::$instance;
18 }
19 /**
20 * Returns an array of conflicting plugins with their names and plugin paths.
21 *
22 * @return array<string, string>
23 */
24
25 public function nitropack_get_conflicting_plugins() {
26 $clashingPlugins = array();
27
28 if ( defined( 'BREEZE_PLUGIN_DIR' ) ) {
29 $clashingPlugins[] = array( 'name' => 'Breeze', 'plugin' => 'breeze/breeze.php' );
30 }
31
32 if ( defined( 'WP_ROCKET_VERSION' ) ) {
33 $clashingPlugins[] = array( 'name' => 'WP-Rocket', 'plugin' => 'wp-rocket/wp-rocket.php' );
34 }
35
36 if ( defined( 'W3TC' ) ) {
37 $clashingPlugins[] = array( 'name' => 'W3 Total Cache', 'plugin' => 'w3-total-cache/w3-total-cache.php' );
38 }
39
40 if ( defined( 'WPFC_MAIN_PATH' ) ) {
41 $clashingPlugins[] = array( 'name' => 'WP Fastest Cache', 'plugin' => 'wp-fastest-cache/wpFastestCache.php' );
42 }
43
44 if ( defined( 'PHASTPRESS_VERSION' ) ) {
45 $clashingPlugins[] = array( 'name' => 'PhastPress', 'plugin' => 'phastpress/phastpress.php' );
46 }
47
48 if ( defined( 'WPCACHEHOME' ) && function_exists( "wp_cache_phase2" ) ) {
49 $clashingPlugins[] = array( 'name' => 'WP Super Cache', 'plugin' => 'wp-super-cache/wp-cache.php' );
50 }
51
52 if ( defined( 'LSCACHE_ADV_CACHE' ) || defined( 'LSCWP_DIR' ) ) {
53 $clashingPlugins[] = array( 'name' => 'LiteSpeed Cache', 'plugin' => 'litespeed-cache/litespeed-cache.php' );
54 }
55
56 if ( class_exists( 'Swift_Performance' ) || class_exists( 'Swift_Performance_Lite' ) ) {
57 $clashingPlugins[] = array( 'name' => 'Swift Performance Lite', 'plugin' => 'swift-performance-lite/performance.php' );
58 }
59
60 if ( class_exists( 'PagespeedNinja' ) ) {
61 $clashingPlugins[] = array( 'name' => 'PageSpeed Ninja', 'plugin' => 'psn-pagespeed-ninja/pagespeedninja.php' );
62 }
63
64 if ( defined( 'AUTOPTIMIZE_PLUGIN_VERSION' ) ) {
65 $clashingPlugins[] = array( 'name' => 'Autoptimize', 'plugin' => 'autoptimize/autoptimize.php' );
66 }
67
68 if ( class_exists( 'WP_Hummingbird' ) || class_exists( 'Hummingbird\\WP_Hummingbird' ) ) {
69 $clashingPlugins[] = array( 'name' => 'Hummingbird', 'plugin' => 'hummingbird-performance/wp-hummingbird.php' );
70 }
71
72 if ( defined( 'WP_SMUSH_VERSION' ) ) {
73 if ( class_exists( 'Smush\\Core\\Settings' ) && defined( 'WP_SMUSH_PREFIX' ) ) {
74 $smushLazy = \Smush\Core\Settings::get_instance()->get( 'lazy_load' );
75 if ( $smushLazy ) {
76 $clashingPlugins[] = array( 'name' => 'Smush - Lazy Load', 'plugin' => 'wp-smushit/wp-smush.php' );
77 }
78 } else {
79 $clashingPlugins[] = array( 'name' => 'Smush', 'plugin' => 'wp-smushit/wp-smush.php' );
80 }
81 }
82
83 if ( defined( 'COMET_CACHE_PLUGIN_FILE' ) ) {
84 $clashingPlugins[] = array( 'name' => 'Comet Cache', 'plugin' => 'comet-cache/comet-cache.php' );
85 }
86
87 if ( defined( 'WPO_VERSION' ) && class_exists( 'WPO_Cache_Config' ) ) {
88 $wpo_cache_config = \WPO_Cache_Config::instance();
89 if ( $wpo_cache_config->get_option( 'enable_page_caching', false ) ) {
90 $clashingPlugins[] = array( 'name' => 'WP Optimize page caching', 'plugin' => 'wp-optimize/wp-optimize.php' );
91 }
92 }
93
94 if ( class_exists( 'BJLL' ) ) {
95 $clashingPlugins[] = array( 'name' => 'BJ Lazy Load', 'plugin' => 'bj-lazy-load/bj-lazy-load.php' );
96 }
97
98 if ( defined( 'SHORTPIXEL_IMAGE_OPTIMISER_VERSION' ) && class_exists( '\ShortPixel\ShortPixelPlugin' ) ) {
99 $sp_config = \ShortPixel\ShortPixelPlugin::getInstance();
100 if ( $sp_config->settings()->createWebp ) {
101 $clashingPlugins[] = array( 'name' => 'ShortPixel Image Optimizer', 'plugin' => 'shortpixel-image-optimiser/shortpixel-plugin.php' );
102 }
103 }
104 if ( defined( 'RAPIDLOAD_PLUGIN_URL' ) ) {
105 $clashingPlugins[] = array( 'name' => 'RapidLoad AI', 'plugin' => 'unusedcss/unusedcss.php' );
106 }
107 if ( defined( 'JETPACK_BOOST_VERSION' ) ) {
108 $clashingPlugins[] = array( 'name' => 'Jetpack Boost', 'plugin' => 'jetpack-boost/jetpack-boost.php' );
109 }
110 if ( defined( 'SiteGround_Optimizer\VERSION' ) ) {
111 $clashingPlugins[] = array( 'name' => 'SiteGround Optimizer', 'plugin' => 'sg-cachepress/sg-cachepress.php' );
112 }
113 if ( defined( 'A3_LAZY_VERSION' ) ) {
114 $clashingPlugins[] = array( 'name' => 'a3 Lazy Load', 'plugin' => 'a3-lazy-load/a3-lazy-load.php' );
115 }
116
117 return $clashingPlugins;
118 }
119
120 /**
121 * Checks if any conflicting plugin is active.
122 *
123 * @return bool
124 */
125 public function nitropack_is_conflicting_plugin_active() {
126 $conflictingPlugins = $this->nitropack_get_conflicting_plugins();
127 return ! empty( $conflictingPlugins );
128 }
129 }