Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../themify/cache
File: class-themify-cache.php
$copy = empty($content) || strpos($content, 'class-themify-cache.php', 10) === false;
[500] Fix | Delete
if ($copy === false && md5($content) !== md5_file($fw_dir . 'advanced-cache.php')) {
[501] Fix | Delete
$copy = true;
[502] Fix | Delete
}
[503] Fix | Delete
}
[504] Fix | Delete
if ($copy === true && !copy($fw_dir . 'advanced-cache.php', $cache_dir . 'advanced-cache.php')) {
[505] Fix | Delete
Themify_Filesystem::delete($cache_config, 'f');
[506] Fix | Delete
self::disable_cache();
[507] Fix | Delete
return sprintf(__('Can`t copy %s to %s. Please check permission or do manually it.', 'themify'), $fw_dir . 'advanced-cache.php', $cache_dir . 'advanced-cache.php');
[508] Fix | Delete
}
[509] Fix | Delete
return self::write_wp_config();
[510] Fix | Delete
} else {
[511] Fix | Delete
self::disable_cache();
[512] Fix | Delete
return __('Themify Cache can not be enabled due to another cache plugin is activated.', 'themify');
[513] Fix | Delete
}
[514] Fix | Delete
} else {
[515] Fix | Delete
self::disable_cache();
[516] Fix | Delete
return sprintf(__('Folder %s isn`t writable.Please check permission to allow write cache.', 'themify'), $cache_dir);
[517] Fix | Delete
}
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
public static function get_wp_content_dir():string {
[521] Fix | Delete
return rtrim(WP_CONTENT_DIR, self::SEP) . self::SEP;
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
public static function get_cache_main_dir():string {
[525] Fix | Delete
return self::get_wp_content_dir() . 'tf_cache' . self::SEP;
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
public static function get_cache_blog_dir($blog_id = false):string {
[529] Fix | Delete
$dir = self::get_cache_main_dir();
[530] Fix | Delete
if (is_multisite()) {
[531] Fix | Delete
if ($blog_id === false) {
[532] Fix | Delete
static $bid = null;
[533] Fix | Delete
if ($bid === null) {
[534] Fix | Delete
$bid = get_current_blog_id();
[535] Fix | Delete
}
[536] Fix | Delete
$dir .= $bid . self::SEP;
[537] Fix | Delete
} else {
[538] Fix | Delete
$dir .= $blog_id . self::SEP;
[539] Fix | Delete
}
[540] Fix | Delete
}
[541] Fix | Delete
return $dir;
[542] Fix | Delete
}
[543] Fix | Delete
[544] Fix | Delete
public static function get_cache_folder(string $request,bool $create = false):string {
[545] Fix | Delete
$dir = explode('?', $request);
[546] Fix | Delete
$dir = $dir[0];
[547] Fix | Delete
if ($dir !== '/') {
[548] Fix | Delete
$dir = trim($dir, '/');
[549] Fix | Delete
//group the files in directory by the pre last slash(e.g /blog/slug return blog,2014/06/09/slug return 2014/06/09/)
[550] Fix | Delete
if (is_multisite()) {
[551] Fix | Delete
$domain = apply_filters('site_url', get_option('siteurl'), '', null, null);
[552] Fix | Delete
} else {
[553] Fix | Delete
$domain = parse_url($dir);
[554] Fix | Delete
$domain = isset($domain['host']) ? $domain['host'] : '';
[555] Fix | Delete
}
[556] Fix | Delete
$scheme = is_ssl() ? 'https' : 'http';
[557] Fix | Delete
$domain = str_replace(array('https:', 'http:'), '', trim($domain));
[558] Fix | Delete
$domain = $scheme . '://' . trim(ltrim($domain, '//'));
[559] Fix | Delete
$domain = trim(strtr($dir, array($domain => '')), '/');
[560] Fix | Delete
if ($domain === '') {
[561] Fix | Delete
$dir = '/';
[562] Fix | Delete
} elseif (strpos($domain, '/') !== false) {
[563] Fix | Delete
$domain = explode('/', $domain);
[564] Fix | Delete
array_pop($domain);
[565] Fix | Delete
$dir = implode('/', $domain);
[566] Fix | Delete
} else {
[567] Fix | Delete
$dir = $domain;
[568] Fix | Delete
}
[569] Fix | Delete
$domain = null;
[570] Fix | Delete
}
[571] Fix | Delete
$blog_dir = self::get_cache_blog_dir() . md5($dir);
[572] Fix | Delete
if ($create === true) {
[573] Fix | Delete
Themify_Filesystem::mkdir($blog_dir, true);
[574] Fix | Delete
}
[575] Fix | Delete
return $blog_dir . self::SEP;
[576] Fix | Delete
}
[577] Fix | Delete
[578] Fix | Delete
public static function admin_check() {
[579] Fix | Delete
if (false !== self::get_cache_plugins()) {
[580] Fix | Delete
self::disable_cache();
[581] Fix | Delete
}
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
public static function disable_cache() {
[585] Fix | Delete
$cache_dir = self::get_wp_content_dir();
[586] Fix | Delete
$config_f = self::get_cache_config_file();
[587] Fix | Delete
Themify_Filesystem::delete($config_f, 'f');
[588] Fix | Delete
if (!is_multisite()) {
[589] Fix | Delete
$config_f = $cache_dir . 'advanced-cache.php';
[590] Fix | Delete
if (Themify_Filesystem::is_file($config_f)) {
[591] Fix | Delete
$content = Themify_Filesystem::get_contents($config_f);
[592] Fix | Delete
$remove = !empty($content) && strpos($content, 'class-themify-cache.php', 10) !== false;
[593] Fix | Delete
} else {
[594] Fix | Delete
$remove = true;
[595] Fix | Delete
}
[596] Fix | Delete
if ($remove === true) {//only when advanced-cache.php belongs to us or file doesn't exist try to disable WP_CACHE
[597] Fix | Delete
if (WP_CACHE) {
[598] Fix | Delete
$wp_config = ABSPATH . 'wp-config.php';
[599] Fix | Delete
if (Themify_Filesystem::is_writable($wp_config)) {
[600] Fix | Delete
$content = Themify_Filesystem::get_contents($wp_config);
[601] Fix | Delete
if (!empty($content)) {
[602] Fix | Delete
$content = str_replace(array(self::get_replace_str(), "define('WP_CACHE',true);"), '', $content);
[603] Fix | Delete
if (strpos($content, 'Themify Cache', 2) !== false) {//try again
[604] Fix | Delete
$content = preg_replace('/define/', self::get_replace_str() . PHP_EOL . PHP_EOL . 'define', $content, 1);
[605] Fix | Delete
}
[606] Fix | Delete
if (!file_put_contents($wp_config, $content, LOCK_EX)) {
[607] Fix | Delete
$remove = false;
[608] Fix | Delete
}
[609] Fix | Delete
}
[610] Fix | Delete
} else {
[611] Fix | Delete
$remove = false; //otherwise will give error file doesn't exist,it's safe to keep it
[612] Fix | Delete
}
[613] Fix | Delete
}
[614] Fix | Delete
if ($remove === true) {
[615] Fix | Delete
Themify_Filesystem::delete($config_f, 'f');
[616] Fix | Delete
}
[617] Fix | Delete
}
[618] Fix | Delete
}
[619] Fix | Delete
}
[620] Fix | Delete
[621] Fix | Delete
private static function get_replace_str():string {
[622] Fix | Delete
$replace = '/* Themify Cache Start */' . PHP_EOL;
[623] Fix | Delete
$replace .= "define('WP_CACHE',true);";
[624] Fix | Delete
$replace .= PHP_EOL . '/* Themify Cache End */';
[625] Fix | Delete
return $replace;
[626] Fix | Delete
}
[627] Fix | Delete
[628] Fix | Delete
public static function ajax_write_wp_cache() {
[629] Fix | Delete
check_ajax_referer('tf_nonce', 'nonce');
[630] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[631] Fix | Delete
die;
[632] Fix | Delete
}
[633] Fix | Delete
[634] Fix | Delete
if (!empty($_POST['data'])) {
[635] Fix | Delete
$data = themify_normalize_save_data($_POST['data']);
[636] Fix | Delete
$msg = self::create_config($data);
[637] Fix | Delete
if ($msg === true) {
[638] Fix | Delete
die(json_encode(array('remove_after' => 1)));
[639] Fix | Delete
}
[640] Fix | Delete
die(json_encode(array('error' => $msg)));
[641] Fix | Delete
}
[642] Fix | Delete
die;
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
public static function write_wp_config() {
[646] Fix | Delete
$cache_dir = self::get_wp_content_dir();
[647] Fix | Delete
if (!WP_CACHE) {
[648] Fix | Delete
$wp_config = ABSPATH . 'wp-config.php';
[649] Fix | Delete
if (Themify_Filesystem::is_writable($wp_config)) {
[650] Fix | Delete
if (Themify_Filesystem::is_file(self::get_cache_config_file()) && Themify_Filesystem::is_file($cache_dir . 'advanced-cache.php')) {
[651] Fix | Delete
$content = Themify_Filesystem::get_contents($wp_config);
[652] Fix | Delete
$str = self::get_replace_str();
[653] Fix | Delete
if (!empty($content) && strpos($content, $str, 3) === false) {
[654] Fix | Delete
$content = preg_replace('/define/', $str . PHP_EOL . PHP_EOL . 'define', $content, 1);
[655] Fix | Delete
if (file_put_contents($wp_config, $content, LOCK_EX)) {
[656] Fix | Delete
return true;
[657] Fix | Delete
}
[658] Fix | Delete
}
[659] Fix | Delete
}
[660] Fix | Delete
} else {
[661] Fix | Delete
return sprintf(__('File %s is`t writable. Please add %s %s.', 'themify'), $wp_config, "define('WP_CACHE',true)", $wp_config);
[662] Fix | Delete
}
[663] Fix | Delete
} elseif (!Themify_Filesystem::is_file(self::get_cache_config_file())) {
[664] Fix | Delete
self::disable_cache();
[665] Fix | Delete
return false;
[666] Fix | Delete
}
[667] Fix | Delete
return true;
[668] Fix | Delete
}
[669] Fix | Delete
[670] Fix | Delete
public static function get_cache_config_file():string {
[671] Fix | Delete
$fname = 'site';
[672] Fix | Delete
if (is_multisite()) {
[673] Fix | Delete
$fname .= '-' . get_current_blog_id();
[674] Fix | Delete
}
[675] Fix | Delete
$fname .= '.php';
[676] Fix | Delete
$dir = self::get_wp_content_dir() . 'tf_cache_config';
[677] Fix | Delete
Themify_Filesystem::mkdir($dir, true,0755);
[678] Fix | Delete
return $dir . self::SEP . $fname;
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
public static function cache_menu($wp_admin_bar) {
[682] Fix | Delete
if (!current_user_can('manage_options')) {
[683] Fix | Delete
return;
[684] Fix | Delete
}
[685] Fix | Delete
$link = remove_query_arg(['tf-cache','nonce'], self::get_current_url());
[686] Fix | Delete
$isDevmode = themify_is_dev_mode();
[687] Fix | Delete
$args = array(
[688] Fix | Delete
array(
[689] Fix | Delete
'id' => 'tf_clear_cache',
[690] Fix | Delete
'title' => __('Themify Cache', 'themify')
[691] Fix | Delete
)
[692] Fix | Delete
);
[693] Fix | Delete
[694] Fix | Delete
$hasCache = false;
[695] Fix | Delete
$nonce= wp_create_nonce('tf_cache');
[696] Fix | Delete
$cache_plugins = false !== self::get_cache_plugins();
[697] Fix | Delete
$hasCache = WP_CACHE && $cache_plugins === false && Themify_Filesystem::is_file(self::get_cache_config_file());
[698] Fix | Delete
if ($isDevmode === true) {
[699] Fix | Delete
$args[0]['id'] = 'tf_dev_mode';
[700] Fix | Delete
$args[0]['title'] = '<span class="tf_admin_bar_tooltip">' . __('Warning: Dev Mode is enabled (Themify cache, menu cache, concate cache and .gz are disabled). Only enable this for development purposes.', 'themify') . '</span>' . esc_html__('Dev Mode', 'themify');
[701] Fix | Delete
$args[0]['meta'] = array('class' => 'tf_admin_bar_alert');
[702] Fix | Delete
$args[] = array(
[703] Fix | Delete
'id' => 'tf_disable_dev',
[704] Fix | Delete
'parent' => $args[0]['id'],
[705] Fix | Delete
'href' => add_query_arg(array('tf-cache' => 4,'nonce'=>$nonce), $link),
[706] Fix | Delete
'title' => __('Disable Dev Mode', 'themify')
[707] Fix | Delete
);
[708] Fix | Delete
} else {
[709] Fix | Delete
if (isset($_GET['tf-cache'],$_GET['nonce']) && wp_verify_nonce($_GET['nonce'],'tf_cache')) {
[710] Fix | Delete
$cache_type = (int) $_GET['tf-cache'];
[711] Fix | Delete
if ($cache_type === 3) {
[712] Fix | Delete
themify_clear_menu_cache();
[713] Fix | Delete
}
[714] Fix | Delete
elseif ($cache_type === 1) {
[715] Fix | Delete
add_filter('themify_concate_css', '__return_false');
[716] Fix | Delete
if ($hasCache === true) {
[717] Fix | Delete
$link = self::get_current_cache($link);
[718] Fix | Delete
Themify_Filesystem::delete($link . '_safari.html', 'f');
[719] Fix | Delete
Themify_Filesystem::delete($link . '_safari.html.gz', 'f');
[720] Fix | Delete
$link .= '.html';
[721] Fix | Delete
Themify_Filesystem::delete($link, 'f');
[722] Fix | Delete
$link .= '.gz';
[723] Fix | Delete
Themify_Filesystem::delete($link, 'f');
[724] Fix | Delete
}
[725] Fix | Delete
themify_clear_menu_cache();
[726] Fix | Delete
}
[727] Fix | Delete
}
[728] Fix | Delete
$args[] = array(
[729] Fix | Delete
'id' => 'tf_clear_html',
[730] Fix | Delete
'parent' => 'tf_clear_cache',
[731] Fix | Delete
'href' => add_query_arg(array('tf-cache' => 1,'nonce'=>$nonce), $link),
[732] Fix | Delete
'title' => $hasCache === true ? __('Purge Page Cache', 'themify') : __('Regenerate Page CSS', 'themify')
[733] Fix | Delete
);
[734] Fix | Delete
$args[] = array(
[735] Fix | Delete
'id' => 'tf_clear_all',
[736] Fix | Delete
'parent' => 'tf_clear_cache',
[737] Fix | Delete
'href' => add_query_arg(array('tf-cache' => 2,'nonce'=>$nonce), $link),
[738] Fix | Delete
'title' => $hasCache === true ? __('Purge All Cache', 'themify') : __('Regenerate All CSS', 'themify')
[739] Fix | Delete
);
[740] Fix | Delete
if ($hasCache === false && $cache_plugins === false && !themify_check('setting-cache-menu', true)) {
[741] Fix | Delete
$args[] = array(
[742] Fix | Delete
'id' => 'tf_clear_menu',
[743] Fix | Delete
'parent' => 'tf_clear_cache',
[744] Fix | Delete
'href' => add_query_arg(array('tf-cache' => 3,'nonce'=>$nonce), $link),
[745] Fix | Delete
'title' => __('Clear Menu Cache', 'themify')
[746] Fix | Delete
);
[747] Fix | Delete
}
[748] Fix | Delete
}
[749] Fix | Delete
$cache_plugins = null;
[750] Fix | Delete
foreach ($args as $arg) {
[751] Fix | Delete
$wp_admin_bar->add_node($arg);
[752] Fix | Delete
}
[753] Fix | Delete
}
[754] Fix | Delete
[755] Fix | Delete
public static function check_clear() {
[756] Fix | Delete
if (isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'],'tf_cache') && current_user_can('manage_options')) {
[757] Fix | Delete
if ($_GET['tf-cache'] === '2') {
[758] Fix | Delete
Themify_Enqueue_Assets::clearConcateCss();
[759] Fix | Delete
themify_clear_menu_cache();
[760] Fix | Delete
} else {
[761] Fix | Delete
$tmp = themify_get_data();
[762] Fix | Delete
unset($tmp['setting-dev-mode']);
[763] Fix | Delete
themify_set_data($tmp);
[764] Fix | Delete
}
[765] Fix | Delete
$link = remove_query_arg(['tf-cache','nonce'], self::get_current_url());
[766] Fix | Delete
if (wp_redirect($link)) {
[767] Fix | Delete
exit;
[768] Fix | Delete
}
[769] Fix | Delete
}
[770] Fix | Delete
}
[771] Fix | Delete
[772] Fix | Delete
public static function clear_3rd_plugins_cache($post_id = 0) {
[773] Fix | Delete
$cache_plugins = self::get_cache_plugins('others');
[774] Fix | Delete
if (false === $cache_plugins) {
[775] Fix | Delete
return;
[776] Fix | Delete
}
[777] Fix | Delete
$post_id = (int) $post_id <= 0 ? 0 : (int) $post_id;
[778] Fix | Delete
// Sometimes we need to clear all caches ex. when Pro template or Layout Part is edited
[779] Fix | Delete
if ($post_id > 0) {
[780] Fix | Delete
$type = get_post_type($post_id);
[781] Fix | Delete
$post_id = 'post' === $type || 'page' === $type ? $post_id : 0;
[782] Fix | Delete
}
[783] Fix | Delete
foreach ($cache_plugins as $k => $v) {
[784] Fix | Delete
switch ($k) {
[785] Fix | Delete
case 'SC':
[786] Fix | Delete
if ($post_id > 0) {
[787] Fix | Delete
wp_cache_post_change($post_id);
[788] Fix | Delete
} else {
[789] Fix | Delete
wp_cache_clear_cache();
[790] Fix | Delete
}
[791] Fix | Delete
break;
[792] Fix | Delete
case 'W3TC':
[793] Fix | Delete
if ($post_id > 0) {
[794] Fix | Delete
w3tc_flush_post($post_id);
[795] Fix | Delete
} else {
[796] Fix | Delete
w3tc_flush_all();
[797] Fix | Delete
}
[798] Fix | Delete
break;
[799] Fix | Delete
case 'WPFC':
[800] Fix | Delete
if ($post_id > 0) {
[801] Fix | Delete
wpfc_clear_post_cache_by_id($post_id);
[802] Fix | Delete
} else {
[803] Fix | Delete
wpfc_clear_all_cache(true);
[804] Fix | Delete
}
[805] Fix | Delete
break;
[806] Fix | Delete
case 'AO':
[807] Fix | Delete
if (0 === $post_id) {
[808] Fix | Delete
autoptimizeCache::clearall();
[809] Fix | Delete
}
[810] Fix | Delete
break;
[811] Fix | Delete
case 'WPO':
[812] Fix | Delete
if ($post_id > 0) {
[813] Fix | Delete
WPO_Page_Cache::delete_single_post_cache($post_id);
[814] Fix | Delete
} else {
[815] Fix | Delete
WP_Optimize()->get_page_cache()->purge();
[816] Fix | Delete
}
[817] Fix | Delete
break;
[818] Fix | Delete
case 'LSCWP':
[819] Fix | Delete
if ($post_id > 0) {
[820] Fix | Delete
do_action('litespeed_purge_post', $post_id);
[821] Fix | Delete
} else {
[822] Fix | Delete
do_action('litespeed_purge_all');
[823] Fix | Delete
}
[824] Fix | Delete
break;
[825] Fix | Delete
case 'WPHB':
[826] Fix | Delete
if ($post_id > 0) {
[827] Fix | Delete
do_action('wphb_clear_page_cache', $post_id);
[828] Fix | Delete
} else {
[829] Fix | Delete
do_action('wphb_clear_page_cache');
[830] Fix | Delete
}
[831] Fix | Delete
break;
[832] Fix | Delete
case 'CLFL':
[833] Fix | Delete
// Cloudflare use this hook to purge the cache
[834] Fix | Delete
if (0 === $post_id) {
[835] Fix | Delete
do_action('autoptimize_action_cachepurged');
[836] Fix | Delete
}
[837] Fix | Delete
break;
[838] Fix | Delete
case 'SGO':
[839] Fix | Delete
$post_id = $post_id > 0 ? get_permalink($post_id) : false;
[840] Fix | Delete
if ($post_id !== false) {
[841] Fix | Delete
sg_cachepress_purge_cache($post_id);
[842] Fix | Delete
} else {
[843] Fix | Delete
sg_cachepress_purge_cache();
[844] Fix | Delete
}
[845] Fix | Delete
break;
[846] Fix | Delete
case 'Breeze':
[847] Fix | Delete
if ($post_id === 0) {
[848] Fix | Delete
do_action('breeze_clear_all_cache');
[849] Fix | Delete
}
[850] Fix | Delete
break;
[851] Fix | Delete
case 'ROCKET':
[852] Fix | Delete
if ($post_id > 0) {
[853] Fix | Delete
rocket_clean_post($post_id);
[854] Fix | Delete
} else {
[855] Fix | Delete
rocket_clean_domain();
[856] Fix | Delete
}
[857] Fix | Delete
break;
[858] Fix | Delete
case 'Comet':
[859] Fix | Delete
if ($post_id > 0) {
[860] Fix | Delete
comet_cache::clearPost($post_id);
[861] Fix | Delete
} else {
[862] Fix | Delete
comet_cache::clear();
[863] Fix | Delete
}
[864] Fix | Delete
break;
[865] Fix | Delete
case 'CE':
[866] Fix | Delete
if ($post_id > 0) {
[867] Fix | Delete
do_action('cache_enabler_clear_page_cache_by_post', $post_id);
[868] Fix | Delete
} else {
[869] Fix | Delete
do_action('cache_enabler_clear_site_cache');
[870] Fix | Delete
}
[871] Fix | Delete
break;
[872] Fix | Delete
case 'WpeC':
[873] Fix | Delete
if (method_exists('WpeCommon', 'purge_memcached')) {
[874] Fix | Delete
WpeCommon::purge_memcached($post_id);
[875] Fix | Delete
}
[876] Fix | Delete
if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
[877] Fix | Delete
WpeCommon::clear_maxcdn_cache($post_id);
[878] Fix | Delete
}
[879] Fix | Delete
if (method_exists('WpeCommon', 'purge_varnish_cache')) {
[880] Fix | Delete
WpeCommon::purge_varnish_cache($post_id);
[881] Fix | Delete
}
[882] Fix | Delete
break;
[883] Fix | Delete
case 'Cachify':
[884] Fix | Delete
if ($post_id > 0) {
[885] Fix | Delete
do_action('cachify_remove_post_cache', $post_id);
[886] Fix | Delete
} else {
[887] Fix | Delete
do_action('cachify_flush_cache');
[888] Fix | Delete
}
[889] Fix | Delete
break;
[890] Fix | Delete
case 'RP':
[891] Fix | Delete
if ($post_id > 0) {
[892] Fix | Delete
rapidcache_clear_post_cache($post_id);
[893] Fix | Delete
} else {
[894] Fix | Delete
rapidcache_clear_cache();
[895] Fix | Delete
}
[896] Fix | Delete
break;
[897] Fix | Delete
case 'SWPC':
[898] Fix | Delete
if ($post_id > 0) {
[899] Fix | Delete
Swift_Performance_Cache::clear_post_cache($post_id);
[900] Fix | Delete
} else {
[901] Fix | Delete
Swift_Performance_Cache::clear_all_cache();
[902] Fix | Delete
}
[903] Fix | Delete
break;
[904] Fix | Delete
case 'NGXC':
[905] Fix | Delete
if ($post_id === 0) {
[906] Fix | Delete
$nginx_cache = new NginxCache();
[907] Fix | Delete
$nginx_cache->purge_zone_once();
[908] Fix | Delete
}
[909] Fix | Delete
break;
[910] Fix | Delete
}
[911] Fix | Delete
}
[912] Fix | Delete
}
[913] Fix | Delete
[914] Fix | Delete
public static function get_cache_plugins($slug = 'others') {
[915] Fix | Delete
static $items = null;
[916] Fix | Delete
if ($items === null) {
[917] Fix | Delete
$items = array();
[918] Fix | Delete
//W3 Total Cache plugin
[919] Fix | Delete
if (function_exists('w3tc_flush_post') && function_exists('w3tc_flush_all')) {
[920] Fix | Delete
$items['W3TC'] = true;
[921] Fix | Delete
}
[922] Fix | Delete
//WP Super Cache
[923] Fix | Delete
if (function_exists('wp_cache_clear_cache') && function_exists('wp_cache_post_change')) {
[924] Fix | Delete
$items['SC'] = true;
[925] Fix | Delete
}
[926] Fix | Delete
//Fastest Cache
[927] Fix | Delete
if (function_exists('wpfc_clear_post_cache_by_id') && function_exists('wpfc_clear_all_cache')) {
[928] Fix | Delete
$items['WPFC'] = true;
[929] Fix | Delete
}
[930] Fix | Delete
//WP Rocket
[931] Fix | Delete
if (function_exists('rocket_clean_domain') && function_exists('rocket_clean_post')) {
[932] Fix | Delete
$items['ROCKET'] = true;
[933] Fix | Delete
}
[934] Fix | Delete
//wp-cloudflare-page-cache
[935] Fix | Delete
if (class_exists('SW_CLOUDFLARE_PAGECACHE',false)) {
[936] Fix | Delete
$items['SWCFPC'] = true;
[937] Fix | Delete
}
[938] Fix | Delete
//WP-Optimiz
[939] Fix | Delete
if (method_exists('WP_Optimize', 'get_page_cache') && WP_Optimize()->get_page_cache()->is_enabled()) {
[940] Fix | Delete
$items['WPO'] = true;
[941] Fix | Delete
}
[942] Fix | Delete
//LiteSpeed Cache
[943] Fix | Delete
if (defined('LSCWP_CONTENT_DIR')) {
[944] Fix | Delete
$items['LSCWP'] = true;
[945] Fix | Delete
}
[946] Fix | Delete
[947] Fix | Delete
//Comet Cache
[948] Fix | Delete
if (method_exists('comet_cache', 'clear') && method_exists('comet_cache', 'clearPost')) {
[949] Fix | Delete
$items['Comet'] = true;
[950] Fix | Delete
}
[951] Fix | Delete
//Cache Enabler
[952] Fix | Delete
if (class_exists('Cache_Enabler',false)) {
[953] Fix | Delete
$items['CE'] = true;
[954] Fix | Delete
}
[955] Fix | Delete
//Breeze
[956] Fix | Delete
if (class_exists('Breeze_Admin',false)) {
[957] Fix | Delete
$items['Breeze'] = true;
[958] Fix | Delete
}
[959] Fix | Delete
//Hummingbird
[960] Fix | Delete
if (defined('WPHB_DIR_PATH')) {
[961] Fix | Delete
$items['WPHB'] = true;
[962] Fix | Delete
}
[963] Fix | Delete
//WP Speed of Light
[964] Fix | Delete
if (defined('WPSOL_PLUGIN_URL')) {
[965] Fix | Delete
$items['WPSOL'] = true;
[966] Fix | Delete
}
[967] Fix | Delete
//Auto optimize
[968] Fix | Delete
if (method_exists('autoptimizeCache', 'clearall')) {
[969] Fix | Delete
$items['AO'] = true;
[970] Fix | Delete
}
[971] Fix | Delete
//Cloudflare
[972] Fix | Delete
if (defined('CLOUDFLARE_PLUGIN_DIR')) {
[973] Fix | Delete
$items['CLFL'] = true;
[974] Fix | Delete
}
[975] Fix | Delete
//SG optimizer
[976] Fix | Delete
if (function_exists('sg_cachepress_purge_cache')) {
[977] Fix | Delete
$items['SGO'] = true;
[978] Fix | Delete
}
[979] Fix | Delete
//Cachify
[980] Fix | Delete
if (defined('CACHIFY_FILE')) {
[981] Fix | Delete
$items['Cachify'] = true;
[982] Fix | Delete
}
[983] Fix | Delete
//WPEngine Cache
[984] Fix | Delete
if (class_exists('WpeCommon',false)) {
[985] Fix | Delete
$items['WpeC'] = true;
[986] Fix | Delete
}
[987] Fix | Delete
//Rapid Cache
[988] Fix | Delete
if (function_exists('rapidcache_clear_post_cache') && function_exists('rapidcache_clear_cache')) {
[989] Fix | Delete
$items['RP'] = true;
[990] Fix | Delete
}
[991] Fix | Delete
[992] Fix | Delete
//Swift Cache
[993] Fix | Delete
if (class_exists('Swift_Performance_Cache',false)) {
[994] Fix | Delete
$items['SWPC'] = true;
[995] Fix | Delete
}
[996] Fix | Delete
//NginxCache Cache
[997] Fix | Delete
if (class_exists('NginxCache',false)) {
[998] Fix | Delete
$items['NGXC'] = true;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function