GRAYBYTE WORDPRESS FILE MANAGER4451

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/includes//class-wc-frontend-scripts.php
<?php
/**
 * Handle frontend scripts
 *
 * @package WooCommerce\Classes
 * @version 3.9.0
 * @since 2.3.0
 */

 // phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment

use Automattic\Jetpack\Constants;

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

/**
 * Frontend scripts class.
 */
class WC_Frontend_Scripts {

	/**
	 * Contains an array of script handles registered by WC.
	 *
	 * @var array
	 */
	private static $scripts = array();

	/**
	 * Contains an array of script handles registered by WC.
	 *
	 * @var array
	 */
	private static $styles = array();

	/**
	 * Contains an array of script handles localized by WC.
	 *
	 * @var array
	 */
	private static $wp_localize_scripts = array();

	/**
	 * Hook in methods.
	 */
	public static function init() {
		add_action( 'wp_enqueue_scripts', array( __CLASS__, 'load_scripts' ) );
		add_action( 'wp_print_scripts', array( __CLASS__, 'localize_printed_scripts' ), 5 );
		add_action( 'wp_print_footer_scripts', array( __CLASS__, 'localize_printed_scripts' ), 5 );
	}

	/**
	 * Get styles for the frontend.
	 *
	 * @return array
	 */
	public static function get_styles() {
		$version = Constants::get_constant( 'WC_VERSION' );

		/**
		 * Filter list of WooCommerce styles to enqueue.
		 *
		 * @since 2.1.0
		 * @param array List of default WooCommerce styles.
		 * @return array List of styles to enqueue.
		 */
		$styles = apply_filters(
			'woocommerce_enqueue_styles',
			array(
				'woocommerce-layout'      => array(
					'src'     => self::get_asset_url( 'assets/css/woocommerce-layout.css' ),
					'deps'    => '',
					'version' => $version,
					'media'   => 'all',
					'has_rtl' => true,
				),
				'woocommerce-smallscreen' => array(
					'src'     => self::get_asset_url( 'assets/css/woocommerce-smallscreen.css' ),
					'deps'    => 'woocommerce-layout',
					'version' => $version,
					'media'   => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
					'has_rtl' => true,
				),
				'woocommerce-general'     => array(
					'src'     => self::get_asset_url( 'assets/css/woocommerce.css' ),
					'deps'    => '',
					'version' => $version,
					'media'   => 'all',
					'has_rtl' => true,
				),
				'woocommerce-blocktheme'  => wp_is_block_theme() ? array(
					'src'     => self::get_asset_url( 'assets/css/woocommerce-blocktheme.css' ),
					'deps'    => '',
					'version' => $version,
					'media'   => 'all',
					'has_rtl' => true,
				) : false,
			)
		);
		return is_array( $styles ) ? array_filter( $styles ) : array();
	}

	/**
	 * Return asset URL.
	 *
	 * @param string $path Assets path.
	 * @return string
	 */
	private static function get_asset_url( $path ) {
		return apply_filters( 'woocommerce_get_asset_url', plugins_url( $path, WC_PLUGIN_FILE ), $path );
	}

	/**
	 * Register a script for use.
	 *
	 * @uses   wp_register_script()
	 * @param  string   $handle    Name of the script. Should be unique.
	 * @param  string   $path      Full URL of the script, or path of the script relative to the WordPress root directory.
	 * @param  string[] $deps      An array of registered script handles this script depends on.
	 * @param  string   $version   String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
	 * @param  boolean  $in_footer Whether to enqueue the script before </body> instead of in the <head>. Default 'false'.
	 */
	private static function register_script( $handle, $path, $deps = array( 'jquery' ), $version = WC_VERSION, $in_footer = array( 'strategy' => 'defer' ) ) {
		self::$scripts[] = $handle;
		wp_register_script( $handle, $path, $deps, $version, $in_footer );
	}

	/**
	 * Register and enqueue a script for use.
	 *
	 * @uses   wp_enqueue_script()
	 * @param  string   $handle    Name of the script. Should be unique.
	 * @param  string   $path      Full URL of the script, or path of the script relative to the WordPress root directory.
	 * @param  string[] $deps      An array of registered script handles this script depends on.
	 * @param  string   $version   String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
	 * @param  boolean  $in_footer Whether to enqueue the script before </body> instead of in the <head>. Default 'false'.
	 */
	private static function enqueue_script( $handle, $path = '', $deps = array( 'jquery' ), $version = WC_VERSION, $in_footer = array( 'strategy' => 'defer' ) ) {
		if ( ! in_array( $handle, self::$scripts, true ) && $path ) {
			self::register_script( $handle, $path, $deps, $version, $in_footer );
		}
		wp_enqueue_script( $handle );
	}

	/**
	 * Register a style for use.
	 *
	 * @uses   wp_register_style()
	 * @param  string   $handle  Name of the stylesheet. Should be unique.
	 * @param  string   $path    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
	 * @param  string[] $deps    An array of registered stylesheet handles this stylesheet depends on.
	 * @param  string   $version String specifying stylesheet version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
	 * @param  string   $media   The media for which this stylesheet has been defined. Accepts media types like 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'.
	 * @param  boolean  $has_rtl If has RTL version to load too.
	 */
	private static function register_style( $handle, $path, $deps = array(), $version = WC_VERSION, $media = 'all', $has_rtl = false ) {
		self::$styles[] = $handle;
		wp_register_style( $handle, $path, $deps, $version, $media );

		if ( $has_rtl ) {
			wp_style_add_data( $handle, 'rtl', 'replace' );
		}
	}

	/**
	 * Register and enqueue a styles for use.
	 *
	 * @uses   wp_enqueue_style()
	 * @param  string   $handle  Name of the stylesheet. Should be unique.
	 * @param  string   $path    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
	 * @param  string[] $deps    An array of registered stylesheet handles this stylesheet depends on.
	 * @param  string   $version String specifying stylesheet version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version number is automatically added equal to current installed WordPress version. If set to null, no version is added.
	 * @param  string   $media   The media for which this stylesheet has been defined. Accepts media types like 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'.
	 * @param  boolean  $has_rtl If has RTL version to load too.
	 */
	private static function enqueue_style( $handle, $path = '', $deps = array(), $version = WC_VERSION, $media = 'all', $has_rtl = false ) {
		if ( ! in_array( $handle, self::$styles, true ) && $path ) {
			self::register_style( $handle, $path, $deps, $version, $media, $has_rtl );
		}
		wp_enqueue_style( $handle );
	}

	/**
	 * Register all WC scripts.
	 */
	private static function register_scripts() {
		$suffix  = Constants::is_true( 'SCRIPT_DEBUG' ) ? '' : '.min';
		$version = Constants::get_constant( 'WC_VERSION' );

		$register_scripts = array(
			'flexslider'                 => array(
				'src'     => self::get_asset_url( 'assets/js/flexslider/jquery.flexslider' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '2.7.2-wc.' . $version,
			),
			'js-cookie'                  => array(
				'src'     => self::get_asset_url( 'assets/js/js-cookie/js.cookie' . $suffix . '.js' ),
				'deps'    => array(),
				'version' => '2.1.4-wc.' . $version,
			),
			'jquery-blockui'             => array(
				'src'     => self::get_asset_url( 'assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '2.7.0-wc.' . $version,
			),
			'jquery-cookie'              => array( // deprecated.
				'src'     => self::get_asset_url( 'assets/js/jquery-cookie/jquery.cookie' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '1.4.1-wc.' . $version,
			),
			'jquery-payment'             => array(
				'src'     => self::get_asset_url( 'assets/js/jquery-payment/jquery.payment' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '3.0.0-wc.' . $version,
			),
			'photoswipe'                 => array(
				'src'     => self::get_asset_url( 'assets/js/photoswipe/photoswipe' . $suffix . '.js' ),
				'deps'    => array(),
				'version' => '4.1.1-wc.' . $version,
			),
			'photoswipe-ui-default'      => array(
				'src'     => self::get_asset_url( 'assets/js/photoswipe/photoswipe-ui-default' . $suffix . '.js' ),
				'deps'    => array( 'photoswipe' ),
				'version' => '4.1.1-wc.' . $version,
			),
			'prettyPhoto'                => array( // deprecated.
				'src'     => self::get_asset_url( 'assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '3.1.6-wc.' . $version,
			),
			'prettyPhoto-init'           => array( // deprecated.
				'src'     => self::get_asset_url( 'assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'prettyPhoto' ),
				'version' => $version,
			),
			'select2'                    => array(
				'src'     => self::get_asset_url( 'assets/js/select2/select2.full' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '4.0.3-wc.' . $version,
			),
			'selectWoo'                  => array(
				'src'     => self::get_asset_url( 'assets/js/selectWoo/selectWoo.full' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '1.0.9-wc.' . $version,
			),
			'wc-address-i18n'            => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/address-i18n' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'wc-country-select' ),
				'version' => $version,
			),
			'wc-add-payment-method'      => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/add-payment-method' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'woocommerce' ),
				'version' => $version,
			),
			'wc-cart'                    => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/cart' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'woocommerce', 'wc-country-select', 'wc-address-i18n' ),
				'version' => $version,
			),
			'wc-cart-fragments'          => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/cart-fragments' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'js-cookie' ),
				'version' => $version,
			),
			'wc-checkout'                => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/checkout' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'woocommerce', 'wc-country-select', 'wc-address-i18n' ),
				'version' => $version,
			),
			'wc-country-select'          => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/country-select' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => $version,
			),
			'wc-credit-card-form'        => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/credit-card-form' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'jquery-payment' ),
				'version' => $version,
			),
			'wc-add-to-cart'             => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/add-to-cart' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'jquery-blockui' ),
				'version' => $version,
			),
			'wc-add-to-cart-variation'   => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/add-to-cart-variation' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'wp-util', 'jquery-blockui' ),
				'version' => $version,
			),
			'wc-geolocation'             => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/geolocation' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => $version,
			),
			'wc-lost-password'           => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/lost-password' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'woocommerce' ),
				'version' => $version,
			),
			'wc-account-i18n'            => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/account-i18n' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => $version,
			),
			'wc-password-strength-meter' => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/password-strength-meter' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'password-strength-meter' ),
				'version' => $version,
			),
			'wc-single-product'          => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/single-product' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => $version,
			),
			'woocommerce'                => array(
				'src'     => self::get_asset_url( 'assets/js/frontend/woocommerce' . $suffix . '.js' ),
				'deps'    => array( 'jquery', 'jquery-blockui', 'js-cookie' ),
				'version' => $version,
			),
			'zoom'                       => array(
				'src'     => self::get_asset_url( 'assets/js/zoom/jquery.zoom' . $suffix . '.js' ),
				'deps'    => array( 'jquery' ),
				'version' => '1.7.21-wc.' . $version,
			),
		);
		foreach ( $register_scripts as $name => $props ) {
			self::register_script( $name, $props['src'], $props['deps'], $props['version'] );
		}
	}

	/**
	 * Register all WC styles.
	 */
	private static function register_styles() {
		$version = Constants::get_constant( 'WC_VERSION' );

		$register_styles = array(
			'photoswipe'                  => array(
				'src'     => self::get_asset_url( 'assets/css/photoswipe/photoswipe.min.css' ),
				'deps'    => array(),
				'version' => $version,
				'has_rtl' => false,
			),
			'photoswipe-default-skin'     => array(
				'src'     => self::get_asset_url( 'assets/css/photoswipe/default-skin/default-skin.min.css' ),
				'deps'    => array( 'photoswipe' ),
				'version' => $version,
				'has_rtl' => false,
			),
			'select2'                     => array(
				'src'     => self::get_asset_url( 'assets/css/select2.css' ),
				'deps'    => array(),
				'version' => $version,
				'has_rtl' => false,
			),
			'woocommerce_prettyPhoto_css' => array( // deprecated.
				'src'     => self::get_asset_url( 'assets/css/prettyPhoto.css' ),
				'deps'    => array(),
				'version' => $version,
				'has_rtl' => true,
			),
		);
		foreach ( $register_styles as $name => $props ) {
			self::register_style( $name, $props['src'], $props['deps'], $props['version'], 'all', $props['has_rtl'] );
		}
	}

	/**
	 * Register/queue frontend scripts.
	 */
	public static function load_scripts() {
		global $post;

		if ( ! did_action( 'before_woocommerce_init' ) ) {
			return;
		}

		self::register_scripts();
		self::register_styles();

		if ( 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ) {
			self::enqueue_script( 'wc-add-to-cart' );
		}
		if ( is_cart() ) {
			self::enqueue_script( 'wc-cart' );
		}
		if ( is_cart() || is_checkout() || is_account_page() ) {
			self::enqueue_script( 'selectWoo' );
			self::enqueue_style( 'select2' );

			// Password strength meter. Load in checkout, account login and edit account page.
			if ( ( 'no' === get_option( 'woocommerce_registration_generate_password' ) && ! is_user_logged_in() ) || is_edit_account_page() || is_lost_password_page() ) {
				self::enqueue_script( 'wc-password-strength-meter' );
			}
		}
		if ( is_account_page() ) {
			self::enqueue_script( 'wc-account-i18n' );
		}
		if ( is_checkout() ) {
			self::enqueue_script( 'wc-checkout' );
		}
		if ( is_add_payment_method_page() ) {
			self::enqueue_script( 'wc-add-payment-method' );
		}
		if ( is_lost_password_page() ) {
			self::enqueue_script( 'wc-lost-password' );
		}

		// Load gallery scripts on product pages only if supported.
		if ( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) {
			if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) {
				self::enqueue_script( 'zoom' );
			}
			if ( current_theme_supports( 'wc-product-gallery-slider' ) ) {
				self::enqueue_script( 'flexslider' );
			}
			if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) {
				self::enqueue_script( 'photoswipe-ui-default' );
				self::enqueue_style( 'photoswipe-default-skin' );
				add_action( 'wp_footer', 'woocommerce_photoswipe' );
			}
			self::enqueue_script( 'wc-single-product' );
		}

		// Only enqueue the geolocation script if the Default Current Address is set to "Geolocate
		// (with Page Caching Support) and outside of the cart, checkout, account and customizer preview.
		if (
			'geolocation_ajax' === get_option( 'woocommerce_default_customer_address' )
			&& ! ( is_cart() || is_account_page() || is_checkout() || is_customize_preview() )
		) {
			$ua = strtolower( wc_get_user_agent() ); // Exclude common bots from geolocation by user agent.

			if ( ! strstr( $ua, 'bot' ) && ! strstr( $ua, 'spider' ) && ! strstr( $ua, 'crawl' ) ) {
				self::enqueue_script( 'wc-geolocation' );
			}
		}

		// Global frontend scripts.
		self::enqueue_script( 'woocommerce' );

		// CSS Styles.
		$enqueue_styles = self::get_styles();
		if ( $enqueue_styles ) {
			foreach ( $enqueue_styles as $handle => $args ) {
				if ( ! isset( $args['has_rtl'] ) ) {
					$args['has_rtl'] = false;
				}

				self::enqueue_style( $handle, $args['src'], $args['deps'], $args['version'], $args['media'], $args['has_rtl'] );
			}
		}

		// Placeholder style.
		wp_register_style( 'woocommerce-inline', false ); // phpcs:ignore
		wp_enqueue_style( 'woocommerce-inline' );

		if ( true === wc_string_to_bool( get_option( 'woocommerce_checkout_highlight_required_fields', 'yes' ) ) ) {
			wp_add_inline_style( 'woocommerce-inline', '.woocommerce form .form-row .required { visibility: visible; }' );
		} else {
			wp_add_inline_style( 'woocommerce-inline', '.woocommerce form .form-row .required { visibility: hidden; }' );
		}
	}

	/**
	 * Localize a WC script once.
	 *
	 * @since 2.3.0 this needs less wp_script_is() calls due to https://core.trac.wordpress.org/ticket/28404 being added in WP 4.0.
	 * @param string $handle Script handle the data will be attached to.
	 */
	private static function localize_script( $handle ) {
		if ( ! in_array( $handle, self::$wp_localize_scripts, true ) && wp_script_is( $handle ) ) {
			$data = self::get_script_data( $handle );

			if ( ! $data ) {
				return;
			}

			$name                        = str_replace( '-', '_', $handle ) . '_params';
			self::$wp_localize_scripts[] = $handle;
			wp_localize_script( $handle, $name, apply_filters( $name, $data ) );
		}
	}

	/**
	 * Return data for script handles.
	 *
	 * @param  string $handle Script handle the data will be attached to.
	 * @return array|bool
	 */
	private static function get_script_data( $handle ) {
		global $wp;

		switch ( $handle ) {
			case 'woocommerce':
				$params = array(
					'ajax_url'           => WC()->ajax_url(),
					'wc_ajax_url'        => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'i18n_password_show' => esc_attr__( 'Show password', 'woocommerce' ),
					'i18n_password_hide' => esc_attr__( 'Hide password', 'woocommerce' ),
				);
				break;
			case 'wc-geolocation':
				$params = array(
					'wc_ajax_url' => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'home_url'    => remove_query_arg( 'lang', home_url() ), // FIX for WPML compatibility.
				);
				break;
			case 'wc-single-product':
				$params = array(
					'i18n_required_rating_text'         => esc_attr__( 'Please select a rating', 'woocommerce' ),
					'i18n_rating_options'               => array(
						esc_attr__( '1 of 5 stars', 'woocommerce' ),
						esc_attr__( '2 of 5 stars', 'woocommerce' ),
						esc_attr__( '3 of 5 stars', 'woocommerce' ),
						esc_attr__( '4 of 5 stars', 'woocommerce' ),
						esc_attr__( '5 of 5 stars', 'woocommerce' ),
					),
					'i18n_product_gallery_trigger_text' => esc_attr__( 'View full-screen image gallery', 'woocommerce' ),
					'review_rating_required'            => wc_review_ratings_required() ? 'yes' : 'no',
					'flexslider'                        => apply_filters(
						'woocommerce_single_product_carousel_options',
						array(
							'rtl'            => is_rtl(),
							'animation'      => 'slide',
							'smoothHeight'   => true,
							'directionNav'   => false,
							'controlNav'     => 'thumbnails',
							'slideshow'      => false,
							'animationSpeed' => 500,
							'animationLoop'  => false, // Breaks photoswipe pagination if true.
							'allowOneSlide'  => false,
						)
					),
					'zoom_enabled'                      => apply_filters( 'woocommerce_single_product_zoom_enabled', get_theme_support( 'wc-product-gallery-zoom' ) ),
					'zoom_options'                      => apply_filters( 'woocommerce_single_product_zoom_options', array() ),
					'photoswipe_enabled'                => apply_filters( 'woocommerce_single_product_photoswipe_enabled', get_theme_support( 'wc-product-gallery-lightbox' ) ),
					'photoswipe_options'                => apply_filters(
						'woocommerce_single_product_photoswipe_options',
						array(
							'shareEl'               => false,
							'closeOnScroll'         => false,
							'history'               => false,
							'hideAnimationDuration' => 0,
							'showAnimationDuration' => 0,
						)
					),
					'flexslider_enabled'                => apply_filters( 'woocommerce_single_product_flexslider_enabled', get_theme_support( 'wc-product-gallery-slider' ) ),
				);
				break;
			case 'wc-checkout':
				$params = array(
					'ajax_url'                  => WC()->ajax_url(),
					'wc_ajax_url'               => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'update_order_review_nonce' => wp_create_nonce( 'update-order-review' ),
					'apply_coupon_nonce'        => wp_create_nonce( 'apply-coupon' ),
					'remove_coupon_nonce'       => wp_create_nonce( 'remove-coupon' ),
					'option_guest_checkout'     => get_option( 'woocommerce_enable_guest_checkout' ),
					'checkout_url'              => WC_AJAX::get_endpoint( 'checkout' ),
					'is_checkout'               => is_checkout() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0,
					'debug_mode'                => Constants::is_true( 'WP_DEBUG' ),
					/* translators: %s: Order history URL on My Account section */
					'i18n_checkout_error'       => sprintf( esc_attr__( 'There was an error processing your order. Please check for any charges in your payment method and review your <a href="%s">order history</a> before placing the order again.', 'woocommerce' ), esc_url( wc_get_account_endpoint_url( 'orders' ) ) ),

				);
				break;
			case 'wc-address-i18n':
				$params = array(
					'locale'             => wp_json_encode( WC()->countries->get_country_locale() ),
					'locale_fields'      => wp_json_encode( WC()->countries->get_country_locale_field_selectors() ),
					'i18n_required_text' => esc_attr__( 'required', 'woocommerce' ),
					'i18n_optional_text' => esc_html__( 'optional', 'woocommerce' ),
				);
				break;
			case 'wc-cart':
				$params = array(
					'ajax_url'                     => WC()->ajax_url(),
					'wc_ajax_url'                  => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'update_shipping_method_nonce' => wp_create_nonce( 'update-shipping-method' ),
					'apply_coupon_nonce'           => wp_create_nonce( 'apply-coupon' ),
					'remove_coupon_nonce'          => wp_create_nonce( 'remove-coupon' ),
				);
				break;
			case 'wc-cart-fragments':
				$params = array(
					'ajax_url'        => WC()->ajax_url(),
					'wc_ajax_url'     => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'cart_hash_key'   => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ),
					'fragment_name'   => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) . get_template() ) ),
					'request_timeout' => 5000,
				);
				break;
			case 'wc-add-to-cart':
				$params = array(
					'ajax_url'                => WC()->ajax_url(),
					'wc_ajax_url'             => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'i18n_view_cart'          => esc_attr__( 'View cart', 'woocommerce' ),
					'cart_url'                => apply_filters( 'woocommerce_add_to_cart_redirect', wc_get_cart_url(), null ),
					'is_cart'                 => is_cart(),
					'cart_redirect_after_add' => get_option( 'woocommerce_cart_redirect_after_add' ),
				);
				break;
			case 'wc-add-to-cart-variation':
				// We also need the wp.template for this script :).
				wc_get_template( 'single-product/add-to-cart/variation.php' );

				$params = array(
					'wc_ajax_url'                      => WC_AJAX::get_endpoint( '%%endpoint%%' ),
					'i18n_no_matching_variations_text' => esc_attr__( 'Sorry, no products matched your selection. Please choose a different combination.', 'woocommerce' ),
					'i18n_make_a_selection_text'       => esc_attr__( 'Please select some product options before adding this product to your cart.', 'woocommerce' ),
					'i18n_unavailable_text'            => esc_attr__( 'Sorry, this product is unavailable. Please choose a different combination.', 'woocommerce' ),
					'i18n_reset_alert_text'            => esc_attr__( 'Your selection has been reset. Please select some product options before adding this product to your cart.', 'woocommerce' ),
				);
				break;
			case 'wc-country-select':
				$params = array(
					'countries'                 => wp_json_encode( array_merge( WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states() ) ),
					'i18n_select_state_text'    => esc_attr__( 'Select an option&hellip;', 'woocommerce' ),
					'i18n_no_matches'           => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
					'i18n_ajax_error'           => _x( 'Loading failed', 'enhanced select', 'woocommerce' ),
					'i18n_input_too_short_1'    => _x( 'Please enter 1 or more characters', 'enhanced select', 'woocommerce' ),
					'i18n_input_too_short_n'    => _x( 'Please enter %qty% or more characters', 'enhanced select', 'woocommerce' ),
					'i18n_input_too_long_1'     => _x( 'Please delete 1 character', 'enhanced select', 'woocommerce' ),
					'i18n_input_too_long_n'     => _x( 'Please delete %qty% characters', 'enhanced select', 'woocommerce' ),
					'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'woocommerce' ),
					'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'woocommerce' ),
					'i18n_load_more'            => _x( 'Loading more results&hellip;', 'enhanced select', 'woocommerce' ),
					'i18n_searching'            => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
				);
				break;
			case 'wc-password-strength-meter':
				$params = array(
					'min_password_strength' => apply_filters( 'woocommerce_min_password_strength', 3 ),
					'stop_checkout'         => apply_filters( 'woocommerce_enforce_password_strength_meter_on_checkout', false ),
					'i18n_password_error'   => esc_attr__( 'Please enter a stronger password.', 'woocommerce' ),
					'i18n_password_hint'    => esc_attr( wp_get_password_hint() ),
				);
				break;
			default:
				$params = false;
		}

		$params = apply_filters_deprecated( $handle . '_params', array( $params ), '3.0.0', 'woocommerce_get_script_data' );

		return apply_filters( 'woocommerce_get_script_data', $params, $handle );
	}

	/**
	 * Localize scripts only when enqueued.
	 */
	public static function localize_printed_scripts() {
		foreach ( self::$scripts as $handle ) {
			self::localize_script( $handle );
		}
	}
}

WC_Frontend_Scripts::init();

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 24 2025 08:34:23
giriqfky / giriqfky
0755
abstracts
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
admin
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
blocks
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
cli
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
customizer
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
data-stores
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
emails
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
export
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
gateways
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
import
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
integrations
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
interfaces
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
legacy
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
libraries
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
log-handlers
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
payment-tokens
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
product-usage
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
queue
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
react-admin
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
rest-api
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
shipping
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
shortcodes
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
theme-support
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
tracks
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
traits
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
walkers
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
wccom-site
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
widgets
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
class-wc-ajax.php
118.694 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-auth.php
12.69 KB
July 30 2024 19:31:16
giriqfky / giriqfky
0644
class-wc-autoloader.php
3.321 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
class-wc-background-emailer.php
4.575 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644
class-wc-background-updater.php
3.452 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644
class-wc-brands-brand-settings-manager.php
1.783 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
class-wc-brands-coupons.php
6.894 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-brands.php
33.975 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-breadcrumb.php
9.494 KB
October 21 2020 03:38:50
giriqfky / giriqfky
0644
class-wc-cache-helper.php
11.17 KB
August 27 2024 23:04:44
giriqfky / giriqfky
0644
class-wc-cart-fees.php
3.367 KB
September 26 2023 21:42:36
giriqfky / giriqfky
0644
class-wc-cart-session.php
18.921 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-cart-totals.php
28.399 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-cart.php
70.182 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-checkout.php
50.146 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-cli.php
2.866 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-comments.php
22.191 KB
June 02 2025 20:47:42
giriqfky / giriqfky
0644
class-wc-countries.php
49.162 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-coupon.php
39.642 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-customer-download-log.php
3.371 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644
class-wc-customer-download.php
10.339 KB
July 30 2024 19:31:16
giriqfky / giriqfky
0644
class-wc-customer.php
32.034 KB
May 12 2025 15:44:58
giriqfky / giriqfky
0644
class-wc-data-exception.php
1.29 KB
May 23 2018 19:30:10
giriqfky / giriqfky
0644
class-wc-data-store.php
6.594 KB
October 19 2022 00:34:38
giriqfky / giriqfky
0644
class-wc-datetime.php
2.256 KB
April 20 2022 06:50:54
giriqfky / giriqfky
0644
class-wc-deprecated-action-hooks.php
6.588 KB
February 27 2024 18:59:46
giriqfky / giriqfky
0644
class-wc-deprecated-filter-hooks.php
7.342 KB
February 22 2023 07:17:34
giriqfky / giriqfky
0644
class-wc-discounts.php
36.509 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-download-handler.php
28.372 KB
December 18 2024 22:19:16
giriqfky / giriqfky
0644
class-wc-emails.php
28.2 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-embed.php
4.24 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-form-handler.php
45.735 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-frontend-scripts.php
27.843 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-geo-ip.php
30.407 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
class-wc-geolite-integration.php
1.988 KB
January 16 2020 06:10:02
giriqfky / giriqfky
0644
class-wc-geolocation.php
11.322 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-https.php
4.335 KB
June 20 2023 23:45:50
giriqfky / giriqfky
0644
class-wc-install.php
106.709 KB
June 02 2025 15:59:32
giriqfky / giriqfky
0644
class-wc-integrations.php
1.277 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644
class-wc-log-levels.php
3.898 KB
January 30 2024 23:24:56
giriqfky / giriqfky
0644
class-wc-logger.php
9.376 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-meta-data.php
2.207 KB
April 20 2022 06:50:54
giriqfky / giriqfky
0644
class-wc-order-factory.php
8.523 KB
April 30 2024 19:35:34
giriqfky / giriqfky
0644
class-wc-order-item-coupon.php
4.077 KB
December 22 2021 00:24:58
giriqfky / giriqfky
0644
class-wc-order-item-fee.php
9.21 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-order-item-meta.php
5.803 KB
December 22 2021 00:24:58
giriqfky / giriqfky
0644
class-wc-order-item-product.php
15.841 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-order-item-shipping.php
8.802 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-order-item-tax.php
6.488 KB
December 22 2021 00:24:58
giriqfky / giriqfky
0644
class-wc-order-item.php
18.545 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-order-query.php
2.554 KB
July 28 2021 04:11:34
giriqfky / giriqfky
0644
class-wc-order-refund.php
5.991 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-order.php
74.093 KB
June 02 2025 15:59:32
giriqfky / giriqfky
0644
class-wc-payment-gateways.php
11.897 KB
May 26 2025 19:11:58
giriqfky / giriqfky
0644
class-wc-payment-tokens.php
6.24 KB
November 23 2022 05:58:58
giriqfky / giriqfky
0644
class-wc-post-data.php
21.725 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-post-types.php
32.003 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-privacy-background-process.php
1.79 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-privacy-erasers.php
13.608 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
class-wc-privacy-exporters.php
14.691 KB
July 28 2021 04:11:34
giriqfky / giriqfky
0644
class-wc-privacy.php
17.189 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-product-attribute.php
6.97 KB
January 19 2022 02:24:34
giriqfky / giriqfky
0644
class-wc-product-download.php
12.253 KB
April 10 2024 16:54:10
giriqfky / giriqfky
0644
class-wc-product-external.php
4.984 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-product-factory.php
3.881 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-product-grouped.php
5.603 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-product-query.php
2.277 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-product-simple.php
2.697 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-product-variable.php
24.576 KB
June 02 2025 15:59:32
giriqfky / giriqfky
0644
class-wc-product-variation.php
20.177 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-query.php
33.36 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-rate-limiter.php
4.004 KB
December 01 2021 04:23:30
giriqfky / giriqfky
0644
class-wc-regenerate-images-request.php
7.737 KB
January 25 2023 03:19:12
giriqfky / giriqfky
0644
class-wc-regenerate-images.php
15.436 KB
June 25 2024 21:17:40
giriqfky / giriqfky
0644
class-wc-register-wp-admin-settings.php
5.05 KB
June 22 2021 15:24:06
giriqfky / giriqfky
0644
class-wc-rest-authentication.php
21.551 KB
June 25 2024 21:17:40
giriqfky / giriqfky
0644
class-wc-rest-exception.php
0.27 KB
September 23 2020 01:16:50
giriqfky / giriqfky
0644
class-wc-session-handler.php
15.611 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-shipping-rate.php
8.065 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-shipping-zone.php
13.078 KB
September 23 2020 01:16:50
giriqfky / giriqfky
0644
class-wc-shipping-zones.php
4.01 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644
class-wc-shipping.php
12.852 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
class-wc-shortcodes.php
18.822 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
class-wc-structured-data.php
23.796 KB
March 03 2025 22:28:12
giriqfky / giriqfky
0644
class-wc-tax.php
37.079 KB
June 20 2023 23:45:50
giriqfky / giriqfky
0644
class-wc-template-loader.php
21.38 KB
June 09 2025 15:55:46
giriqfky / giriqfky
0644
class-wc-tracker.php
48.207 KB
June 02 2025 15:59:32
giriqfky / giriqfky
0644
class-wc-validation.php
5.79 KB
May 28 2024 14:28:20
giriqfky / giriqfky
0644
class-wc-webhook.php
29.405 KB
December 18 2024 22:19:16
giriqfky / giriqfky
0644
class-woocommerce.php
49.085 KB
June 23 2025 15:50:22
giriqfky / giriqfky
0644
wc-account-functions.php
14.014 KB
December 18 2024 22:19:16
giriqfky / giriqfky
0644
wc-attribute-functions.php
21.179 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
wc-brands-functions.php
4.17 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
wc-cart-functions.php
20.049 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-conditional-functions.php
14.199 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-core-functions.php
86.207 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-coupon-functions.php
3.095 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-deprecated-functions.php
38.115 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-formatting-functions.php
47.764 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-notice-functions.php
8.057 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-order-functions.php
40.503 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-order-item-functions.php
5.032 KB
January 25 2023 03:19:12
giriqfky / giriqfky
0644
wc-order-step-logger-functions.php
5.015 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-page-functions.php
9.431 KB
September 23 2024 20:44:04
giriqfky / giriqfky
0644
wc-product-functions.php
58.515 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-rest-functions.php
12.951 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-stock-functions.php
17.133 KB
January 21 2025 18:53:44
giriqfky / giriqfky
0644
wc-template-functions.php
132.676 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-template-hooks.php
12.653 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-term-functions.php
23.81 KB
June 16 2025 19:21:28
giriqfky / giriqfky
0644
wc-update-functions.php
91.822 KB
June 02 2025 15:59:32
giriqfky / giriqfky
0644
wc-user-functions.php
33.352 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
wc-webhook-functions.php
5.767 KB
June 25 2024 21:17:40
giriqfky / giriqfky
0644
wc-widget-functions.php
2.015 KB
August 20 2020 23:18:50
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF