' . esc_html__('Please consider disabling the following detected plugins, as they may conflict with LiteSpeed Cache:', 'litespeed-cache') . '
' . 'PageSpeed Ninja' . '
' . '', false, true ); } } public static function activated_plugin($plugin, $network_wide) { self::incompatible_plugin_notice($plugin, $network_wide, 'activated'); } public static function deactivated_plugin($plugin, $network_wide) { self::incompatible_plugin_notice($plugin, $network_wide, 'deactivated'); } /** * Detect any incompatible plugins that are currently `active` and `valid`. * Show a notification if there are any. */ public static function incompatible_plugin_notice($plugin, $_network_wide, $action) { self::update_messages(); /** * The 'deactivated_plugin' action fires before * `wp_get_active_and_valid_plugins` can see the change, so we'll need to * remove `$plugin` from the list. */ $deactivated = 'deactivated' === $action ? array($plugin) : array(); $incompatible_plugins = array_map(function ($plugin) { return WP_PLUGIN_DIR . '/' . $plugin; }, array_diff(self::$_incompatible_plugins, $deactivated)); $active_incompatible_plugins = array_map(function ($plugin) { $plugin = get_plugin_data($plugin, false, true); return $plugin['Name']; }, array_intersect($incompatible_plugins, wp_get_active_and_valid_plugins())); if (empty($active_incompatible_plugins)) { return; } \LiteSpeed\Admin_Display::error( '' . implode(', ', $active_incompatible_plugins) . '
' . '