Sindbad~EG File Manager

Current Path : /home/infinitibizsol/www.mediaeclips.com/wp-content/
Upload File :
Current File : /home/infinitibizsol/www.mediaeclips.com/wp-content/advanced-cache.php

<?php
# WP SUPER CACHE 1.2
# WP SUPER CACHE 0.8.9.1
# AL ADVANCED CACHE 1.0
$cache_fname = dirname( __FILE__ ) . "/plugins/airlift/buffer/cache.php";
$helper_fname = dirname( __FILE__ ) . '/plugins/airlift/helper.php';

if (file_exists($cache_fname) && file_exists($helper_fname)) {
	require_once $cache_fname;
	require_once $helper_fname;

	$GLOBALS['al_cache_skip_cookies'] = ["woocommerce_cart_hash", "woocommerce_items_in_cart"];

	function hasIgnoredCookies($ignored_cookies, $skip_cookies) {
		if (!is_array($_COOKIE) || empty($_COOKIE)) {
			return false;
		}

		foreach (array_keys($_COOKIE) as $cookie_name) {
			$is_skipped = false;
			
			// First check if cookie should be skipped from ignore list
			foreach ($skip_cookies as $skip_cookie) {
				if (ALHelper::safePregMatch($skip_cookie, $cookie_name)) {
					$is_skipped = true;
					break;
				}
			}

			// If cookie is not in skip list, check if it matches ignore patterns
			if (!$is_skipped) {
				foreach ($ignored_cookies as $ignored_cookie) {
					if (ALHelper::safePregMatch($ignored_cookie, $cookie_name)) {
						return true;
					}
				}
			}
		}
		return false;
	}

	function hasIgnoredUserAgents($ignored_user_agents) {
		foreach ($ignored_user_agents as $ignored_ua) {
			if(ALHelper::safePregMatch($ignored_ua, $_SERVER['HTTP_USER_AGENT'])) {
				return true;
			}
		}
		return false;
	}

	function isIgnoredRequestMethod($allowed_methods) {
		if (in_array($_SERVER['REQUEST_METHOD'], $allowed_methods)) {
			return false;
		}
		return true;
	}

	function canCachePage() {
		$ignored_cookies = array("/^wp/", "/^wordpress/", "/^comment_author/");
		$ignored_user_agents = array();
		$skip_cookies_to_ignore_optimization = array("/wordpress_test_cookie/");
		$allowed_methods = array("GET", "HEAD");
		if (hasIgnoredCookies($ignored_cookies, $skip_cookies_to_ignore_optimization) || hasIgnoredUserAgents($ignored_user_agents) || isIgnoredRequestMethod($allowed_methods)) {
			return false;
		}
		return true;
	}

	if (canCachePage()) {
		$socache = new ALCache();
		$socache->startCaching();
	}
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists