PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.19.7
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.19.7
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 2 months ago Settings 1 month ago Admin.php 1 month ago CLI.php 2 weeks ago Config.php 1 year ago ConflictingPlugins.php 10 months ago Connect.php 2 weeks ago Cron.php 1 year ago Invalidations.php 2 months ago NitroPack.php 2 weeks ago Settings.php 4 months ago
ConflictingPlugins.php
136 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 //free version
74 $name = 'Smush';
75 $plugin_path = 'wp-smushit/wp-smush.php';
76 if ( is_plugin_active( 'wp-smush-pro/wp-smush.php' ) ) {
77 $name = 'Smush Pro';
78 $plugin_path = 'wp-smush-pro/wp-smush.php';
79 }
80 if ( class_exists( 'Smush\\Core\\Settings' ) && defined( 'WP_SMUSH_PREFIX' ) ) {
81 $smushLazy = \Smush\Core\Settings::get_instance()->get( 'lazy_load' );
82 if ( $smushLazy ) {
83 $clashingPlugins[] = array( 'name' => $name . ' - Lazy Load', 'plugin' => $plugin_path );
84 }
85 } else {
86 $clashingPlugins[] = array( 'name' => $name, 'plugin' => $plugin_path );
87 }
88 }
89
90 if ( defined( 'COMET_CACHE_PLUGIN_FILE' ) ) {
91 $clashingPlugins[] = array( 'name' => 'Comet Cache', 'plugin' => 'comet-cache/comet-cache.php' );
92 }
93
94 if ( defined( 'WPO_VERSION' ) && class_exists( 'WPO_Cache_Config' ) ) {
95 $wpo_cache_config = \WPO_Cache_Config::instance();
96 if ( $wpo_cache_config->get_option( 'enable_page_caching', false ) ) {
97 $clashingPlugins[] = array( 'name' => 'WP Optimize page caching', 'plugin' => 'wp-optimize/wp-optimize.php' );
98 }
99 }
100
101 if ( class_exists( 'BJLL' ) ) {
102 $clashingPlugins[] = array( 'name' => 'BJ Lazy Load', 'plugin' => 'bj-lazy-load/bj-lazy-load.php' );
103 }
104
105 if ( defined( 'SHORTPIXEL_IMAGE_OPTIMISER_VERSION' ) && class_exists( '\ShortPixel\ShortPixelPlugin' ) ) {
106 $sp_config = \ShortPixel\ShortPixelPlugin::getInstance();
107 if ( $sp_config->settings()->createWebp ) {
108 $clashingPlugins[] = array( 'name' => 'ShortPixel Image Optimizer', 'plugin' => 'shortpixel-image-optimiser/shortpixel-plugin.php' );
109 }
110 }
111 if ( defined( 'RAPIDLOAD_PLUGIN_URL' ) ) {
112 $clashingPlugins[] = array( 'name' => 'RapidLoad AI', 'plugin' => 'unusedcss/unusedcss.php' );
113 }
114 if ( defined( 'JETPACK_BOOST_VERSION' ) ) {
115 $clashingPlugins[] = array( 'name' => 'Jetpack Boost', 'plugin' => 'jetpack-boost/jetpack-boost.php' );
116 }
117 if ( defined( 'SiteGround_Optimizer\VERSION' ) ) {
118 $clashingPlugins[] = array( 'name' => 'SiteGround Optimizer', 'plugin' => 'sg-cachepress/sg-cachepress.php' );
119 }
120 if ( defined( 'A3_LAZY_VERSION' ) ) {
121 $clashingPlugins[] = array( 'name' => 'a3 Lazy Load', 'plugin' => 'a3-lazy-load/a3-lazy-load.php' );
122 }
123
124 return $clashingPlugins;
125 }
126
127 /**
128 * Checks if any conflicting plugin is active.
129 *
130 * @return bool
131 */
132 public function nitropack_is_conflicting_plugin_active() {
133 $conflictingPlugins = $this->nitropack_get_conflicting_plugins();
134 return ! empty( $conflictingPlugins );
135 }
136 }