$38 GRAYBYTE WORDPRESS FILE MANAGER $98

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.217.149
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/src/litespeed-wp-plugin/7.7/litespeed-cache/thirdparty/

HOME
Current File : /usr/src/litespeed-wp-plugin/7.7/litespeed-cache/thirdparty//aelia-currencyswitcher.cls.php
<?php
/**
 * The Third Party integration with the Aelia CurrencySwitcher plugin.
 *
 * @since      1.0.13
 * @since      2.6     Removed hook_vary as OLS supports vary header already
 * @package    LiteSpeed
 * @subpackage LiteSpeed_Cache/thirdparty
 */

namespace LiteSpeed\Thirdparty;

defined( 'WPINC' ) || exit();

/**
 * Integration layer for Aelia Currency Switcher.
 *
 * Registers the plugin cookies as Vary drivers so cached pages can differ by
 * selected currency / location. Hooks both the runtime vary list (headers)
 * and the rewrite-rules vary list (always needed).
 */
class Aelia_CurrencySwitcher {

	/**
	 * Cookie names used by Aelia Currency Switcher to determine currency & geo.
	 *
	 * @var string[]
	 */
	private static $_cookies = array( 'aelia_cs_selected_currency', 'aelia_customer_country', 'aelia_customer_state', 'aelia_tax_exempt' );

	/**
	 * Detects if WooCommerce + Aelia Currency Switcher are present and registers hooks.
	 *
	 * @since 1.0.13
	 * @access public
	 * @return void
	 */
	public static function detect() {
		if ( defined( 'WOOCOMMERCE_VERSION' ) && isset( $GLOBALS['woocommerce-aelia-currencyswitcher'] ) && is_object( $GLOBALS['woocommerce-aelia-currencyswitcher'] ) ) {
			// Not all pages need to add vary, so allow sites to restrict via filter.
			self::$_cookies = apply_filters( 'litespeed_3rd_aelia_cookies', self::$_cookies );

			// Add cookies to the active vary header list (conditionally used at runtime).
			add_filter( 'litespeed_vary_curr_cookies', __CLASS__ . '::check_cookies' );

			// Ensure rewrite rules are aware of these cookies (always include).
			add_filter( 'litespeed_vary_cookies', __CLASS__ . '::register_cookies' );
		}
	}

	/**
	 * Ensure Aelia cookies are part of the global vary cookie registry.
	 *
	 * @since 1.0.13
	 *
	 * @param string[] $cookies Current list of vary cookies.
	 * @return string[] Updated list including Aelia cookies.
	 */
	public static function register_cookies( $cookies ) {
		return array_merge( $cookies, self::$_cookies );
	}

	/**
	 * Conditionally append Aelia cookies to the vary header set for WooCommerce pages.
	 *
	 * If the page is not a WooCommerce page, leave the list unchanged.
	 * Otherwise, append Aelia's cookies so responses vary correctly.
	 *
	 * @since 1.0.13
	 * @access public
	 *
	 * @param string[] $cookies Current list of vary cookies for the response.
	 * @return string[] Potentially augmented list of vary cookies.
	 */
	public static function check_cookies( $cookies ) {
		// NOTE: is_cart and is_checkout are handled by WooCommerce itself.
		if ( ! function_exists( 'is_woocommerce' ) || ! is_woocommerce() ) {
			return $cookies;
		}

		return array_merge( $cookies, self::$_cookies );
	}
}


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Dec 2025 12.04 AM
root / root
0755
aelia-currencyswitcher.cls.php
2.669 KB
17 Dec 2025 12.04 AM
root / root
0644
amp.cls.php
2.441 KB
17 Dec 2025 12.04 AM
root / root
0644
autoptimize.cls.php
0.889 KB
17 Dec 2025 12.04 AM
root / root
0644
avada.cls.php
0.794 KB
17 Dec 2025 12.04 AM
root / root
0644
bbpress.cls.php
2.575 KB
17 Dec 2025 12.04 AM
root / root
0644
beaver-builder.cls.php
1.116 KB
17 Dec 2025 12.04 AM
root / root
0644
caldera-forms.cls.php
0.787 KB
17 Dec 2025 12.04 AM
root / root
0644
divi-theme-builder.cls.php
3.567 KB
17 Dec 2025 12.04 AM
root / root
0644
elementor.cls.php
3.254 KB
17 Dec 2025 12.04 AM
root / root
0644
entry.inc.php
1.51 KB
17 Dec 2025 12.04 AM
root / root
0644
facetwp.cls.php
1.444 KB
17 Dec 2025 12.04 AM
root / root
0644
gravity-forms.cls.php
1.144 KB
17 Dec 2025 12.04 AM
root / root
0644
litespeed-check.cls.php
5.411 KB
17 Dec 2025 12.04 AM
root / root
0644
nextgengallery.cls.php
6.513 KB
17 Dec 2025 12.04 AM
root / root
0644
perfmatters.cls.php
0.973 KB
17 Dec 2025 12.04 AM
root / root
0644
theme-my-login.cls.php
1.01 KB
17 Dec 2025 12.04 AM
root / root
0644
user-switching.cls.php
0.774 KB
17 Dec 2025 12.04 AM
root / root
0644
wc-pdf-product-vouchers.cls.php
0.969 KB
17 Dec 2025 12.04 AM
root / root
0644
wcml.cls.php
1.741 KB
17 Dec 2025 12.04 AM
root / root
0644
woo-paypal.cls.php
0.849 KB
17 Dec 2025 12.04 AM
root / root
0644
woocommerce.cls.php
27.9 KB
17 Dec 2025 12.04 AM
root / root
0644
woocommerce.content.tpl.php
3.905 KB
17 Dec 2025 12.04 AM
root / root
0644
woocommerce.tab.tpl.php
0.225 KB
17 Dec 2025 12.04 AM
root / root
0644
wp-polls.cls.php
0.788 KB
17 Dec 2025 12.04 AM
root / root
0644
wp-postratings.cls.php
0.879 KB
17 Dec 2025 12.04 AM
root / root
0644
wpdiscuz.cls.php
1.182 KB
17 Dec 2025 12.04 AM
root / root
0644
wplister.cls.php
0.85 KB
17 Dec 2025 12.04 AM
root / root
0644
wpml.cls.php
1.021 KB
17 Dec 2025 12.04 AM
root / root
0644
wptouch.cls.php
0.858 KB
17 Dec 2025 12.04 AM
root / root
0644
yith-wishlist.cls.php
5.232 KB
17 Dec 2025 12.04 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF