CyberAlphaWolf

Server : Apache
System : Linux 182.49.167.72.host.secureserver.net 4.18.0-553.92.1.el8_10.x86_64 #1 SMP Wed Jan 14 06:31:58 EST 2026 x86_64
User : kikai ( 1014)
PHP Version : 8.3.30
Disable Function : NONE
Directory :  /home/kikai/www/wp-content/plugins/hummingbird-performance/core/integration/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/kikai/www/wp-content/plugins/hummingbird-performance/core/integration/class-wpengine.php
<?php
/**
 * WP Engine integration.
 *
 * @since 2.1.0
 * @package Hummingbird\Core\Integration
 */

namespace Hummingbird\Core\Integration;

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

/**
 * Class Wpengine
 */
class Wpengine {

	/**
	 * Wpengine constructor.
	 *
	 * @since 2.1.0
	 */
	public function __construct() {
		if ( ! $this->should_run() ) {
			return;
		}

		// Do not cache pages for compatibility reasons.
		add_filter( 'wphb_should_cache_request_pre', '__return_false' );

		// Purge WP Engine cache.
		add_action( 'wphb_clear_cache_url', array( $this, 'purge_cache' ) );
	}

	/**
	 * Check if the integration module should be enabled.
	 *
	 * @since 2.1.0
	 * @return bool
	 */
	private function should_run() {
		if ( ! is_admin() ) {
			return false;
		}

		if ( ! class_exists( '\WpeCommon' ) || ! function_exists( 'wpe_param' ) ) {
			return false;
		}

		return true;
	}

	/**
	 * Purge cache.
	 *
	 * @since 2.1.0
	 *
	 * @param string $path  Path to purge for.
	 */
	public function purge_cache( $path = '' ) {
		// Only purge when full cache is cleared.
		if ( ! empty( $path ) ) {
			return;
		}

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

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

}

XYZEAZ - Cyber Alpha Wolf © All Rights Reserved