HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: afleverb (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //var/www/drakkar_site/wp-content/themes/blocksy/inc/classes/db-versioning/utils/cache-manager.php
<?php

namespace Blocksy\DbVersioning;

class CacheManager {
	public function __construct() {
		add_action(
			'blocksy:cache-manager:purge-all',
			function () {
				$this->run_cache_purge();
			}
		);
	}

	public function run_cache_purge() {
		# Purge all W3 Total Cache
		if (function_exists('w3tc_pgcache_flush')) {
			w3tc_pgcache_flush();
		}

		if (function_exists('w3tc_flush_all')) {
			w3tc_flush_all();
		}

		# Purge WP Super Cache
		if (function_exists('wp_cache_clear_cache')) {
			wp_cache_clear_cache();
		}

		if (isset($GLOBALS['wp_fastest_cache'])) {
			if (method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')) {
				$GLOBALS['wp_fastest_cache']->deleteCache();
				$GLOBALS['wp_fastest_cache']->deleteCache(true);
			}
		}

		if (function_exists('cachify_flush_cache')) {
			cachify_flush_cache();
		}

		if (class_exists("comet_cache")) {
			\comet_cache::clear();
		}

		if (class_exists("zencache")) {
			\zencache::clear();
		}

		if (class_exists('LiteSpeed_Cache_Tags')) {
			\LiteSpeed_Cache_Tags::add_purge_tag('*');
		}

		if (function_exists('sg_cachepress_purge_cache')) {
			sg_cachepress_purge_cache();
		}

		if (function_exists('sg_cachepress_purge_everything')) {
			sg_cachepress_purge_everything();
		}

		if (class_exists('LiteSpeed_Cache_Purge')) {
			\LiteSpeed_Cache_Purge::purge_all('Clear Cache For Me');
		}

		if (class_exists('WP_Optimize') && defined('WPO_PLUGIN_MAIN_PATH')) {
			ob_start();
			if (! class_exists('WP_Optimize_Cache_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'cache/class-cache-commands.php');
			if (! class_exists('WP_Optimize_Minify_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-commands.php');
			if (! class_exists('WP_Optimize_Minify_Cache_Functions')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-cache-functions.php');

			if (class_exists('WP_Optimize_Cache_Commands')) {
				$wpoptimize_cache_commands = new \WP_Optimize_Cache_Commands();
				$wpoptimize_cache_commands->purge_page_cache();
			}

			if (class_exists('WP_Optimize_Minify_Commands')) {
				$wpoptimize_minify_commands = new \WP_Optimize_Minify_Commands();
				$wpoptimize_minify_commands->purge_minify_cache();
			}

			ob_get_clean();
		}

		if (
			class_exists('WPaaS\Plugin')
			&&
			function_exists('fastvelocity_godaddy_request')
		) {
			fastvelocity_godaddy_request('BAN');
		}

		# Purge WP Engine
		if (class_exists("WpeCommon")) {
			if (method_exists('WpeCommon', 'purge_memcached')) {
				\WpeCommon::purge_memcached();
			}

			if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
				\WpeCommon::clear_maxcdn_cache();
			}

			if (method_exists('WpeCommon', 'purge_varnish_cache')) {
				\WpeCommon::purge_varnish_cache();
			}
		}

		if (function_exists('rocket_clean_domain')) {
			rocket_clean_domain();

			$container = apply_filters( 'rocket_container', null );

			if ($container) {
				$event_manager = $container->get('event_manager');
				$rucss_admin_subscriber = $container->get('rucss_admin_subscriber');

				if (
					$rucss_admin_subscriber
					&&
					method_exists($rucss_admin_subscriber, 'truncate_used_css')
				) {
					$rucss_admin_subscriber->truncate_used_css();
				}
			}
		}

		if (function_exists('rocket_clean_minify')) {
			rocket_clean_minify();
		}

		if (function_exists('wp_cache_clean_cache')) {
			global $file_prefix;
			wp_cache_clean_cache( $file_prefix, true );
		}

		if (class_exists('autoptimizeCache')) {
			\autoptimizeCache::clearall();
		}

		if (function_exists('fvm_purge_all')) {
			fvm_purge_all();
		}

		if (function_exists('fastvelocity_purge_others')) {
			fastvelocity_purge_others();
		}

		# wordpress default cache
		if (function_exists('wp_cache_flush')) {
			wp_cache_flush();
		}

		# https://wordpress.org/plugins/hummingbird-performance/
		do_action('wphb_clear_page_cache');

		if (class_exists('Swift_Performance_Cache')) {
			\Swift_Performance_Cache::clear_all_cache();
		}

		if (class_exists('ShortPixelAI')) {
			\ShortPixelAI::clear_css_cache();
		}
	}
}