_backwards_import(); } /** * Active plugins pre update option filter * * @param string $new_value * @return string */ function pre_update_option_active_plugins($new_value) { delete_transient('w3tc.verify_plugins'); return $new_value; } /** * Check that activated plugins are not incompatible with the plugin */ function verify() { if (is_network_admin()) { $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); $active_plugins = array_keys($active_plugins); } else $active_plugins = (array) get_option('active_plugins'); w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php'); $incomp_plugins = $this->_get_incompatible_plugins(); $message = ''; $matches = array_intersect($active_plugins, $incomp_plugins); if ($matches) { $message = $this->_custom_message($matches); } if ($message) w3_e_error_box($message); else set_transient('w3tc.verify_plugins', true,7*24*3600); } /** * List of incomatible plugins * @return array */ private function _get_incompatible_plugins() { return array( 'force-gzip/force-gzip.php' ,'wp-http-compression/wp-http-compression.php' ,'gzippy/gzippy.php' ,'wordpress-gzip-compression/ezgz.php' ,'wpcompressor/wpcompressor.php' ,'gzip-pages/filosofo-gzip-compression.php' ,'admin-flush-w3tc-cache/admin_flush_w3tc.php' ,'hyper-cache/plugin.php' ,'aio-cache/aio-cache.php' ,'lite-cache/plugin.php' ,'quick-cache/quick-cache.php' ,'wp-super-cache/wp-cache.php' ,'hyper-cache-extended/plugin.php' ,'batcache/batcache.php' ,'cachify/cachify.php' ,'flexicache/wp-plugin.php' ); } /** * Build incompatible plugins message * @param $plugins * @return string */ private function _custom_message($plugins) { $message = __('The following plugins are not compatible with W3 Total Cache and will cause unintended results:', 'w3-total-cache'); $plugin_names = array(); foreach ($plugins as $plugin) { $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin); $temp = "
$message