HEX
Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2k-fips
System: Linux f17.eelserver.com 3.10.0-1160.80.1.el7.x86_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86_64
User: zulfiqar (1155)
PHP: 8.2.0
Disabled: mail, exec, system, popen, proc_open, shell_exec, passthru, show_source
Upload Files
File: /home/zulfiqar/public_html/wp-content/plugins/astra-sites/inc/classes/class-astra-sites-utils.php
<?php
/**
 * Astra Sites Utlis
 *
 * @since  1.0.0
 * @package Astra Sites
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'Astra_Sites_Utils' ) ) :

	/**
	 * Astra_Sites_Utils
	 */
	class Astra_Sites_Utils {

		/**
		 * Third party cache plugin clear cache.
		 *
		 * @since 4.0.0
		 * @return void
		 */
		public static function third_party_cache_plugins_clear_cache() {
			// Clear LiteSpeed cache.
			if ( class_exists( '\LiteSpeed\Purge' ) ) {
				\LiteSpeed\Purge::purge_all();
			}

			// Clear cloudways cache.
			self::clear_cloudways_cache();
		}

		/**
		 * This function helps to purge all cache in clodways envirnoment.
		 * In presence of Breeze plugin (https://wordpress.org/plugins/breeze/)
		 *
		 * @since 4.0.0
		 * @return void
		 */
		public static function clear_cloudways_cache() {
			if ( ! class_exists( 'Breeze_Configuration' ) || ! class_exists( 'Breeze_CloudFlare_Helper' ) || ! class_exists( 'Breeze_Admin' ) ) {
				return;
			}

			// clear varnish cache.
			$admin = new Breeze_Admin();
			$admin->breeze_clear_varnish();

			// clear static cache.
			Breeze_Configuration::breeze_clean_cache();
			Breeze_CloudFlare_Helper::reset_all_cache();
		}
		
	}

endif;