Current File : /home/bdmcricketindia.in/public_html/wp-includes/class-wp-scripts.php
<?php
/**
 * Dependencies API: WP_Scripts class
 *
 * @since 2.6.0
 *
 * @package WordPress
 * @subpackage Dependencies
 */

/**
 * Core class used to register scripts.
 *
 * @since 2.1.0
 *
 * @see WP_Dependencies
 */
class WP_Scripts extends WP_Dependencies {
	/**
	 * Base URL for scripts.
	 *
	 * Full URL with trailing slash.
	 *
	 * @since 2.6.0
	 * @var string
	 */
	public $base_url;

	/**
	 * URL of the content directory.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $content_url;

	/**
	 * Default version string for scripts.
	 *
	 * @since 2.6.0
	 * @var string
	 */
	public $default_version;

	/**
	 * Holds handles of scripts which are enqueued in footer.
	 *
	 * @since 2.8.0
	 * @var array
	 */
	public $in_footer = array();

	/**
	 * Holds a list of script handles which will be concatenated.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $concat = '';

	/**
	 * Holds a string which contains script handles and their version.
	 *
	 * @since 2.8.0
	 * @deprecated 3.4.0
	 * @var string
	 */
	public $concat_version = '';

	/**
	 * Whether to perform concatenation.
	 *
	 * @since 2.8.0
	 * @var bool
	 */
	public $do_concat = false;

	/**
	 * Holds HTML markup of scripts and additional data if concatenation
	 * is enabled.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $print_html = '';

	/**
	 * Holds inline code if concatenation is enabled.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $print_code = '';

	/**
	 * Holds a list of script handles which are not in the default directory
	 * if concatenation is enabled.
	 *
	 * Unused in core.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $ext_handles = '';

	/**
	 * Holds a string which contains handles and versions of scripts which
	 * are not in the default directory if concatenation is enabled.
	 *
	 * Unused in core.
	 *
	 * @since 2.8.0
	 * @var string
	 */
	public $ext_version = '';

	/**
	 * List of default directories.
	 *
	 * @since 2.8.0
	 * @var array
	 */
	public $default_dirs;

	/**
	 * Holds a mapping of dependents (as handles) for a given script handle.
	 * Used to optimize recursive dependency tree checks.
	 *
	 * @since 6.3.0
	 * @var array
	 */
	private $dependents_map = array();

	/**
	 * Holds a reference to the delayed (non-blocking) script loading strategies.
	 * Used by methods that validate loading strategies.
	 *
	 * @since 6.3.0
	 * @var string[]
	 */
	private $delayed_strategies = array( 'defer', 'async' );

	/**
	 * Constructor.
	 *
	 * @since 2.6.0
	 */
	public function __construct() {
		$this->init();
		add_action( 'init', array( $this, 'init' ), 0 );
	}

	/**
	 * Initialize the class.
	 *
	 * @since 3.4.0
	 */
	public function init() {
		/**
		 * Fires when the WP_Scripts instance is initialized.
		 *
		 * @since 2.6.0
		 *
		 * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference).
		 */
		do_action_ref_array( 'wp_default_scripts', array( &$this ) );
	}

	/**
	 * Prints scripts.
	 *
	 * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
	 *
	 * @since 2.1.0
	 * @since 2.8.0 Added the `$group` parameter.
	 *
	 * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false),
	 *                                       single script (string), or multiple scripts (array of strings).
	 *                                       Default false.
	 * @param int|false             $group   Optional. Group level: level (int), no groups (false).
	 *                                       Default false.
	 * @return string[] Handles of scripts that have been printed.
	 */
	public function print_scripts( $handles = false, $group = false ) {
		return $this->do_items( $handles, $group );
	}

	/**
	 * Prints extra scripts of a registered script.
	 *
	 * @since 2.1.0
	 * @since 2.8.0 Added the `$display` parameter.
	 * @deprecated 3.3.0
	 *
	 * @see print_extra_script()
	 *
	 * @param string $handle  The script's registered handle.
	 * @param bool   $display Optional. Whether to print the extra script
	 *                        instead of just returning it. Default true.
	 * @return bool|string|void Void if no data exists, extra scripts if `$display` is true,
	 *                          true otherwise.
	 */
	public function print_scripts_l10n( $handle, $display = true ) {
		_deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' );
		return $this->print_extra_script( $handle, $display );
	}

	/**
	 * Prints extra scripts of a registered script.
	 *
	 * @since 3.3.0
	 *
	 * @param string $handle  The script's registered handle.
	 * @param bool   $display Optional. Whether to print the extra script
	 *                        instead of just returning it. Default true.
	 * @return bool|string|void Void if no data exists, extra scripts if `$display` is true,
	 *                          true otherwise.
	 */
	public function print_extra_script( $handle, $display = true ) {
		$output = $this->get_data( $handle, 'data' );
		if ( ! $output ) {
			return;
		}

		if ( ! $display ) {
			return $output;
		}

		wp_print_inline_script_tag( $output, array( 'id' => "{$handle}-js-extra" ) );

		return true;
	}

	/**
	 * Checks whether all dependents of a given handle are in the footer.
	 *
	 * If there are no dependents, this is considered the same as if all dependents were in the footer.
	 *
	 * @since 6.4.0
	 *
	 * @param string $handle Script handle.
	 * @return bool Whether all dependents are in the footer.
	 */
	private function are_all_dependents_in_footer( $handle ) {
		foreach ( $this->get_dependents( $handle ) as $dep ) {
			if ( isset( $this->groups[ $dep ] ) && 0 === $this->groups[ $dep ] ) {
				return false;
			}
		}
		return true;
	}

	/**
	 * Processes a script dependency.
	 *
	 * @since 2.6.0
	 * @since 2.8.0 Added the `$group` parameter.
	 *
	 * @see WP_Dependencies::do_item()
	 *
	 * @param string    $handle The script's registered handle.
	 * @param int|false $group  Optional. Group level: level (int), no groups (false).
	 *                          Default false.
	 * @return bool True on success, false on failure.
	 */
	public function do_item( $handle, $group = false ) {
		if ( ! parent::do_item( $handle ) ) {
			return false;
		}

		if ( 0 === $group && $this->groups[ $handle ] > 0 ) {
			$this->in_footer[] = $handle;
			return false;
		}

		if ( false === $group && in_array( $handle, $this->in_footer, true ) ) {
			$this->in_footer = array_diff( $this->in_footer, (array) $handle );
		}

		$obj = $this->registered[ $handle ];

		if ( null === $obj->ver ) {
			$ver = '';
		} else {
			$ver = $obj->ver ? $obj->ver : $this->default_version;
		}

		if ( isset( $this->args[ $handle ] ) ) {
			$ver = $ver ? $ver . '&amp;' . $this->args[ $handle ] : $this->args[ $handle ];
		}

		$src                   = $obj->src;
		$strategy              = $this->get_eligible_loading_strategy( $handle );
		$intended_strategy     = (string) $this->get_data( $handle, 'strategy' );
		$ie_conditional_prefix = '';
		$ie_conditional_suffix = '';
		$conditional           = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';

		if ( ! $this->is_delayed_strategy( $intended_strategy ) ) {
			$intended_strategy = '';
		}

		/*
		 * Move this script to the footer if:
		 * 1. The script is in the header group.
		 * 2. The current output is the header.
		 * 3. The intended strategy is delayed.
		 * 4. The actual strategy is not delayed.
		 * 5. All dependent scripts are in the footer.
		 */
		if (
			0 === $group &&
			0 === $this->groups[ $handle ] &&
			$intended_strategy &&
			! $this->is_delayed_strategy( $strategy ) &&
			$this->are_all_dependents_in_footer( $handle )
		) {
			$this->in_footer[] = $handle;
			return false;
		}

		if ( $conditional ) {
			$ie_conditional_prefix = "<!--[if {$conditional}]>\n";
			$ie_conditional_suffix = "<![endif]-->\n";
		}

		$before_script = $this->get_inline_script_tag( $handle, 'before' );
		$after_script  = $this->get_inline_script_tag( $handle, 'after' );

		if ( $before_script || $after_script ) {
			$inline_script_tag = $ie_conditional_prefix . $before_script . $after_script . $ie_conditional_suffix;
		} else {
			$inline_script_tag = '';
		}

		/*
		 * Prevent concatenation of scripts if the text domain is defined
		 * to ensure the dependency order is respected.
		 */
		$translations_stop_concat = ! empty( $obj->textdomain );

		$translations = $this->print_translations( $handle, false );
		if ( $translations ) {
			$translations = wp_get_inline_script_tag( $translations, array( 'id' => "{$handle}-js-translations" ) );
		}

		if ( $this->do_concat ) {
			/**
			 * Filters the script loader source.
			 *
			 * @since 2.2.0
			 *
			 * @param string $src    Script loader source path.
			 * @param string $handle Script handle.
			 */
			$filtered_src = apply_filters( 'script_loader_src', $src, $handle );

			if (
				$this->in_default_dir( $filtered_src )
				&& ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) )
			) {
				$this->do_concat = false;

				// Have to print the so-far concatenated scripts right away to maintain the right order.
				_print_scripts();
				$this->reset();
			} elseif ( $this->in_default_dir( $filtered_src ) && ! $conditional ) {
				$this->print_code     .= $this->print_extra_script( $handle, false );
				$this->concat         .= "$handle,";
				$this->concat_version .= "$handle$ver";
				return true;
			} else {
				$this->ext_handles .= "$handle,";
				$this->ext_version .= "$handle$ver";
			}
		}

		$has_conditional_data = $conditional && $this->get_data( $handle, 'data' );

		if ( $has_conditional_data ) {
			echo $ie_conditional_prefix;
		}

		$this->print_extra_script( $handle );

		if ( $has_conditional_data ) {
			echo $ie_conditional_suffix;
		}

		// A single item may alias a set of items, by having dependencies, but no source.
		if ( ! $src ) {
			if ( $inline_script_tag ) {
				if ( $this->do_concat ) {
					$this->print_html .= $inline_script_tag;
				} else {
					echo $inline_script_tag;
				}
			}

			return true;
		}

		if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && str_starts_with( $src, $this->content_url ) ) ) {
			$src = $this->base_url . $src;
		}

		if ( ! empty( $ver ) ) {
			$src = add_query_arg( 'ver', $ver, $src );
		}

		/** This filter is documented in wp-includes/class-wp-scripts.php */
		$src = esc_url_raw( apply_filters( 'script_loader_src', $src, $handle ) );

		if ( ! $src ) {
			return true;
		}

		$attr = array(
			'src' => $src,
			'id'  => "{$handle}-js",
		);
		if ( $strategy ) {
			$attr[ $strategy ] = true;
		}
		if ( $intended_strategy ) {
			$attr['data-wp-strategy'] = $intended_strategy;
		}
		$tag  = $translations . $ie_conditional_prefix . $before_script;
		$tag .= wp_get_script_tag( $attr );
		$tag .= $after_script . $ie_conditional_suffix;

		/**
		 * Filters the HTML script tag of an enqueued script.
		 *
		 * @since 4.1.0
		 *
		 * @param string $tag    The `<script>` tag for the enqueued script.
		 * @param string $handle The script's registered handle.
		 * @param string $src    The script's source URL.
		 */
		$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );

		if ( $this->do_concat ) {
			$this->print_html .= $tag;
		} else {
			echo $tag;
		}

		return true;
	}

	/**
	 * Adds extra code to a registered script.
	 *
	 * @since 4.5.0
	 *
	 * @param string $handle   Name of the script to add the inline script to.
	 *                         Must be lowercase.
	 * @param string $data     String containing the JavaScript to be added.
	 * @param string $position Optional. Whether to add the inline script
	 *                         before the handle or after. Default 'after'.
	 * @return bool True on success, false on failure.
	 */
	public function add_inline_script( $handle, $data, $position = 'after' ) {
		if ( ! $data ) {
			return false;
		}

		if ( 'after' !== $position ) {
			$position = 'before';
		}

		$script   = (array) $this->get_data( $handle, $position );
		$script[] = $data;

		return $this->add_data( $handle, $position, $script );
	}

	/**
	 * Prints inline scripts registered for a specific handle.
	 *
	 * @since 4.5.0
	 * @deprecated 6.3.0 Use methods get_inline_script_tag() or get_inline_script_data() instead.
	 *
	 * @param string $handle   Name of the script to print inline scripts for.
	 *                         Must be lowercase.
	 * @param string $position Optional. Whether to add the inline script
	 *                         before the handle or after. Default 'after'.
	 * @param bool   $display  Optional. Whether to print the script tag
	 *                         instead of just returning the script data. Default true.
	 * @return string|false Script data on success, false otherwise.
	 */
	public function print_inline_script( $handle, $position = 'after', $display = true ) {
		_deprecated_function( __METHOD__, '6.3.0', 'WP_Scripts::get_inline_script_data() or WP_Scripts::get_inline_script_tag()' );

		$output = $this->get_inline_script_data( $handle, $position );
		if ( empty( $output ) ) {
			return false;
		}

		if ( $display ) {
			echo $this->get_inline_script_tag( $handle, $position );
		}
		return $output;
	}

	/**
	 * Gets data for inline scripts registered for a specific handle.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle   Name of the script to get data for.
	 *                         Must be lowercase.
	 * @param string $position Optional. Whether to add the inline script
	 *                         before the handle or after. Default 'after'.
	 * @return string Inline script, which may be empty string.
	 */
	public function get_inline_script_data( $handle, $position = 'after' ) {
		$data = $this->get_data( $handle, $position );
		if ( empty( $data ) || ! is_array( $data ) ) {
			return '';
		}

		return trim( implode( "\n", $data ), "\n" );
	}

	/**
	 * Gets tags for inline scripts registered for a specific handle.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle   Name of the script to get associated inline script tag for.
	 *                         Must be lowercase.
	 * @param string $position Optional. Whether to get tag for inline
	 *                         scripts in the before or after position. Default 'after'.
	 * @return string Inline script, which may be empty string.
	 */
	public function get_inline_script_tag( $handle, $position = 'after' ) {
		$js = $this->get_inline_script_data( $handle, $position );
		if ( empty( $js ) ) {
			return '';
		}

		$id = "{$handle}-js-{$position}";

		return wp_get_inline_script_tag( $js, compact( 'id' ) );
	}

	/**
	 * Localizes a script, only if the script has already been added.
	 *
	 * @since 2.1.0
	 *
	 * @param string $handle      Name of the script to attach data to.
	 * @param string $object_name Name of the variable that will contain the data.
	 * @param array  $l10n        Array of data to localize.
	 * @return bool True on success, false on failure.
	 */
	public function localize( $handle, $object_name, $l10n ) {
		if ( 'jquery' === $handle ) {
			$handle = 'jquery-core';
		}

		if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present.
			$after = $l10n['l10n_print_after'];
			unset( $l10n['l10n_print_after'] );
		}

		if ( ! is_array( $l10n ) ) {
			_doing_it_wrong(
				__METHOD__,
				sprintf(
					/* translators: 1: $l10n, 2: wp_add_inline_script() */
					__( 'The %1$s parameter must be an array. To pass arbitrary data to scripts, use the %2$s function instead.' ),
					'<code>$l10n</code>',
					'<code>wp_add_inline_script()</code>'
				),
				'5.7.0'
			);

			if ( false === $l10n ) {
				// This should really not be needed, but is necessary for backward compatibility.
				$l10n = array( $l10n );
			}
		}

		if ( is_string( $l10n ) ) {
			$l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' );
		} elseif ( is_array( $l10n ) ) {
			foreach ( $l10n as $key => $value ) {
				if ( ! is_scalar( $value ) ) {
					continue;
				}

				$l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
			}
		}

		$script = "var $object_name = " . wp_json_encode( $l10n ) . ';';

		if ( ! empty( $after ) ) {
			$script .= "\n$after;";
		}

		$data = $this->get_data( $handle, 'data' );

		if ( ! empty( $data ) ) {
			$script = "$data\n$script";
		}

		return $this->add_data( $handle, 'data', $script );
	}

	/**
	 * Sets handle group.
	 *
	 * @since 2.8.0
	 *
	 * @see WP_Dependencies::set_group()
	 *
	 * @param string    $handle    Name of the item. Should be unique.
	 * @param bool      $recursion Internal flag that calling function was called recursively.
	 * @param int|false $group     Optional. Group level: level (int), no groups (false).
	 *                             Default false.
	 * @return bool Not already in the group or a lower group.
	 */
	public function set_group( $handle, $recursion, $group = false ) {
		if ( isset( $this->registered[ $handle ]->args ) && 1 === $this->registered[ $handle ]->args ) {
			$calculated_group = 1;
		} else {
			$calculated_group = (int) $this->get_data( $handle, 'group' );
		}

		if ( false !== $group && $calculated_group > $group ) {
			$calculated_group = $group;
		}

		return parent::set_group( $handle, $recursion, $calculated_group );
	}

	/**
	 * Sets a translation textdomain.
	 *
	 * @since 5.0.0
	 * @since 5.1.0 The `$domain` parameter was made optional.
	 *
	 * @param string $handle Name of the script to register a translation domain to.
	 * @param string $domain Optional. Text domain. Default 'default'.
	 * @param string $path   Optional. The full file path to the directory containing translation files.
	 * @return bool True if the text domain was registered, false if not.
	 */
	public function set_translations( $handle, $domain = 'default', $path = '' ) {
		if ( ! isset( $this->registered[ $handle ] ) ) {
			return false;
		}

		/** @var \_WP_Dependency $obj */
		$obj = $this->registered[ $handle ];

		if ( ! in_array( 'wp-i18n', $obj->deps, true ) ) {
			$obj->deps[] = 'wp-i18n';
		}

		return $obj->set_translations( $domain, $path );
	}

	/**
	 * Prints translations set for a specific handle.
	 *
	 * @since 5.0.0
	 *
	 * @param string $handle  Name of the script to add the inline script to.
	 *                        Must be lowercase.
	 * @param bool   $display Optional. Whether to print the script
	 *                        instead of just returning it. Default true.
	 * @return string|false Script on success, false otherwise.
	 */
	public function print_translations( $handle, $display = true ) {
		if ( ! isset( $this->registered[ $handle ] ) || empty( $this->registered[ $handle ]->textdomain ) ) {
			return false;
		}

		$domain = $this->registered[ $handle ]->textdomain;
		$path   = '';

		if ( isset( $this->registered[ $handle ]->translations_path ) ) {
			$path = $this->registered[ $handle ]->translations_path;
		}

		$json_translations = load_script_textdomain( $handle, $domain, $path );

		if ( ! $json_translations ) {
			return false;
		}

		$output = <<<JS
( function( domain, translations ) {
	var localeData = translations.locale_data[ domain ] || translations.locale_data.messages;
	localeData[""].domain = domain;
	wp.i18n.setLocaleData( localeData, domain );
} )( "{$domain}", {$json_translations} );
JS;

		if ( $display ) {
			wp_print_inline_script_tag( $output, array( 'id' => "{$handle}-js-translations" ) );
		}

		return $output;
	}

	/**
	 * Determines script dependencies.
	 *
	 * @since 2.1.0
	 *
	 * @see WP_Dependencies::all_deps()
	 *
	 * @param string|string[] $handles   Item handle (string) or item handles (array of strings).
	 * @param bool            $recursion Optional. Internal flag that function is calling itself.
	 *                                   Default false.
	 * @param int|false       $group     Optional. Group level: level (int), no groups (false).
	 *                                   Default false.
	 * @return bool True on success, false on failure.
	 */
	public function all_deps( $handles, $recursion = false, $group = false ) {
		$result = parent::all_deps( $handles, $recursion, $group );
		if ( ! $recursion ) {
			/**
			 * Filters the list of script dependencies left to print.
			 *
			 * @since 2.3.0
			 *
			 * @param string[] $to_do An array of script dependency handles.
			 */
			$this->to_do = apply_filters( 'print_scripts_array', $this->to_do );
		}
		return $result;
	}

	/**
	 * Processes items and dependencies for the head group.
	 *
	 * @since 2.8.0
	 *
	 * @see WP_Dependencies::do_items()
	 *
	 * @return string[] Handles of items that have been processed.
	 */
	public function do_head_items() {
		$this->do_items( false, 0 );
		return $this->done;
	}

	/**
	 * Processes items and dependencies for the footer group.
	 *
	 * @since 2.8.0
	 *
	 * @see WP_Dependencies::do_items()
	 *
	 * @return string[] Handles of items that have been processed.
	 */
	public function do_footer_items() {
		$this->do_items( false, 1 );
		return $this->done;
	}

	/**
	 * Whether a handle's source is in a default directory.
	 *
	 * @since 2.8.0
	 *
	 * @param string $src The source of the enqueued script.
	 * @return bool True if found, false if not.
	 */
	public function in_default_dir( $src ) {
		if ( ! $this->default_dirs ) {
			return true;
		}

		if ( str_starts_with( $src, '/' . WPINC . '/js/l10n' ) ) {
			return false;
		}

		foreach ( (array) $this->default_dirs as $test ) {
			if ( str_starts_with( $src, $test ) ) {
				return true;
			}
		}
		return false;
	}

	/**
	 * This overrides the add_data method from WP_Dependencies, to support normalizing of $args.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle Name of the item. Should be unique.
	 * @param string $key    The data key.
	 * @param mixed  $value  The data value.
	 * @return bool True on success, false on failure.
	 */
	public function add_data( $handle, $key, $value ) {
		if ( ! isset( $this->registered[ $handle ] ) ) {
			return false;
		}

		if ( 'strategy' === $key ) {
			if ( ! empty( $value ) && ! $this->is_delayed_strategy( $value ) ) {
				_doing_it_wrong(
					__METHOD__,
					sprintf(
						/* translators: 1: $strategy, 2: $handle */
						__( 'Invalid strategy `%1$s` defined for `%2$s` during script registration.' ),
						$value,
						$handle
					),
					'6.3.0'
				);
				return false;
			} elseif ( ! $this->registered[ $handle ]->src && $this->is_delayed_strategy( $value ) ) {
				_doing_it_wrong(
					__METHOD__,
					sprintf(
						/* translators: 1: $strategy, 2: $handle */
						__( 'Cannot supply a strategy `%1$s` for script `%2$s` because it is an alias (it lacks a `src` value).' ),
						$value,
						$handle
					),
					'6.3.0'
				);
				return false;
			}
		}
		return parent::add_data( $handle, $key, $value );
	}

	/**
	 * Gets all dependents of a script.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle The script handle.
	 * @return string[] Script handles.
	 */
	private function get_dependents( $handle ) {
		// Check if dependents map for the handle in question is present. If so, use it.
		if ( isset( $this->dependents_map[ $handle ] ) ) {
			return $this->dependents_map[ $handle ];
		}

		$dependents = array();

		// Iterate over all registered scripts, finding dependents of the script passed to this method.
		foreach ( $this->registered as $registered_handle => $args ) {
			if ( in_array( $handle, $args->deps, true ) ) {
				$dependents[] = $registered_handle;
			}
		}

		// Add the handles dependents to the map to ease future lookups.
		$this->dependents_map[ $handle ] = $dependents;

		return $dependents;
	}

	/**
	 * Checks if the strategy passed is a valid delayed (non-blocking) strategy.
	 *
	 * @since 6.3.0
	 *
	 * @param string $strategy The strategy to check.
	 * @return bool True if $strategy is one of the delayed strategies, otherwise false.
	 */
	private function is_delayed_strategy( $strategy ) {
		return in_array(
			$strategy,
			$this->delayed_strategies,
			true
		);
	}

	/**
	 * Gets the best eligible loading strategy for a script.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle The script handle.
	 * @return string The best eligible loading strategy.
	 */
	private function get_eligible_loading_strategy( $handle ) {
		$intended_strategy = (string) $this->get_data( $handle, 'strategy' );

		// Bail early if there is no intended strategy.
		if ( ! $intended_strategy ) {
			return '';
		}

		/*
		 * If the intended strategy is 'defer', limit the initial list of eligible
		 * strategies, since 'async' can fallback to 'defer', but not vice-versa.
		 */
		$initial_strategy = ( 'defer' === $intended_strategy ) ? array( 'defer' ) : null;

		$eligible_strategies = $this->filter_eligible_strategies( $handle, $initial_strategy );

		// Return early once we know the eligible strategy is blocking.
		if ( empty( $eligible_strategies ) ) {
			return '';
		}

		return in_array( 'async', $eligible_strategies, true ) ? 'async' : 'defer';
	}

	/**
	 * Filter the list of eligible loading strategies for a script.
	 *
	 * @since 6.3.0
	 *
	 * @param string              $handle              The script handle.
	 * @param string[]|null       $eligible_strategies Optional. The list of strategies to filter. Default null.
	 * @param array<string, true> $checked             Optional. An array of already checked script handles, used to avoid recursive loops.
	 * @return string[] A list of eligible loading strategies that could be used.
	 */
	private function filter_eligible_strategies( $handle, $eligible_strategies = null, $checked = array() ) {
		// If no strategies are being passed, all strategies are eligible.
		if ( null === $eligible_strategies ) {
			$eligible_strategies = $this->delayed_strategies;
		}

		// If this handle was already checked, return early.
		if ( isset( $checked[ $handle ] ) ) {
			return $eligible_strategies;
		}

		// Mark this handle as checked.
		$checked[ $handle ] = true;

		// If this handle isn't registered, don't filter anything and return.
		if ( ! isset( $this->registered[ $handle ] ) ) {
			return $eligible_strategies;
		}

		// If the handle is not enqueued, don't filter anything and return.
		if ( ! $this->query( $handle, 'enqueued' ) ) {
			return $eligible_strategies;
		}

		$is_alias          = (bool) ! $this->registered[ $handle ]->src;
		$intended_strategy = $this->get_data( $handle, 'strategy' );

		// For non-alias handles, an empty intended strategy filters all strategies.
		if ( ! $is_alias && empty( $intended_strategy ) ) {
			return array();
		}

		// Handles with inline scripts attached in the 'after' position cannot be delayed.
		if ( $this->has_inline_script( $handle, 'after' ) ) {
			return array();
		}

		// If the intended strategy is 'defer', filter out 'async'.
		if ( 'defer' === $intended_strategy ) {
			$eligible_strategies = array( 'defer' );
		}

		$dependents = $this->get_dependents( $handle );

		// Recursively filter eligible strategies for dependents.
		foreach ( $dependents as $dependent ) {
			// Bail early once we know the eligible strategy is blocking.
			if ( empty( $eligible_strategies ) ) {
				return array();
			}

			$eligible_strategies = $this->filter_eligible_strategies( $dependent, $eligible_strategies, $checked );
		}

		return $eligible_strategies;
	}

	/**
	 * Gets data for inline scripts registered for a specific handle.
	 *
	 * @since 6.3.0
	 *
	 * @param string $handle   Name of the script to get data for. Must be lowercase.
	 * @param string $position The position of the inline script.
	 * @return bool Whether the handle has an inline script (either before or after).
	 */
	private function has_inline_script( $handle, $position = null ) {
		if ( $position && in_array( $position, array( 'before', 'after' ), true ) ) {
			return (bool) $this->get_data( $handle, $position );
		}

		return (bool) ( $this->get_data( $handle, 'before' ) || $this->get_data( $handle, 'after' ) );
	}

	/**
	 * Resets class properties.
	 *
	 * @since 2.8.0
	 */
	public function reset() {
		$this->do_concat      = false;
		$this->print_code     = '';
		$this->concat         = '';
		$this->concat_version = '';
		$this->print_html     = '';
		$this->ext_version    = '';
		$this->ext_handles    = '';
	}
}
Alexander Casino Avis 2024 Bonus Gratuit 100€ + 100 FS.1209 (2)

Alexander Casino Avis 2024 Bonus Gratuit 100€ + 100 FS.1209 (2)

Содержимое

Alexander Casino Avis 2024 | Bonus Gratuit 100€ + 100 FS

Depuis sa création, le casino Alexander a su se démarquer par son offre de jeux variés et sa qualité de service exceptionnelle. Grâce à sa connexion Alexander Casino Connexion, les joueurs peuvent accéder à une grande variété de jeux de hasard et de table, y compris les jeux de cartes, les jeux de roue et les jeux de machine à sous.

Le casino Alexander est également connu pour ses offres promotionnelles exceptionnelles, notamment son bonus gratuit de 100€ et 100 FS. Cela signifie que les nouveaux joueurs peuvent commencer à jouer avec un budget important et découvrir les nombreux jeux proposés par l’établissement.

Les joueurs expérimentés apprécieront également les nombreux avantages offerts par le casino Alexander, tels que la possibilité de gagner des récompenses et des prix, ainsi que des offres spéciales pour les joueurs réguliers.

En résumé, le casino Alexander est un établissement de confiance pour les amateurs de jeux d’argent, offrant une expérience de jeu exceptionnelle et des offres promotionnelles attrayantes. Si vous cherchez un endroit où passer des moments agréables et gagner de l’argent, le casino Alexander est le choix idéal.

Le casino Alexander : un établissement de confiance pour les amateurs de jeux d’argent

Profitez de votre expérience de jeu avec le casino Alexander et découvrez les nombreux avantages qu’il offre

Le casino Alexander est un établissement en ligne qui offre une expérience de jeu exceptionnelle et des offres promotionnelles attrayantes. Avec sa connexion Alexander Casino Connexion, les joueurs peuvent accéder à une grande variété de jeux de hasard et de table, y compris les jeux de cartes, les jeux de roue et les jeux de machine à sous.

Les joueurs peuvent également profiter de son bonus gratuit de 100€ et 100 FS, ce qui leur permet de commencer à jouer avec un budget important et de découvrir les nombreux jeux proposés par l’établissement.

Le casino Alexander est également connu pour ses offres spéciales pour les joueurs réguliers, ainsi que des récompenses et des prix à gagner. En résumé, le casino Alexander est un établissement de confiance pour les amateurs de jeux d’argent, offrant une expérience de jeu exceptionnelle et des offres promotionnelles attrayantes.

Profitez de votre expérience de jeu avec le casino Alexander et découvrez les nombreux avantages qu’il offre

Avis du casino Alexander : alexander casino bonus un établissement de confiance pour les amateurs de jeux d’argent

Le Casino Alexandre : Un Avis 2024 sur les Bonus Gratuits de 100€ + 100 FS

Le casino Alexandre est l’un des plus populaires et des plus réputés du marché en ligne, avec une offre de jeux variée et des bonus attractifs. Dans cet article, nous allons vous présenter un aperçu détaillé de l’offre de bonus gratuit de 100€ + 100 FS proposée par le casino Alexandre en 2024.

Le casino Alexandre est connu pour sa connexion rapide et sécurisée, ce qui permet aux joueurs de commencer à jouer immédiatement. La plateforme est disponible en français, ce qui facilite l’accès pour les joueurs francophones. De plus, le casino offre une grande variété de jeux, allant des slots aux jeux de table, en passant par les jeux de cartes.

Le bonus gratuit de 100€ + 100 FS est un excellent moyen pour les nouveaux joueurs de commencer à jouer au casino Alexandre. Ce bonus est valable pour les nouveaux inscrits et peut être utilisé sur la plupart des jeux du casino. Pour obtenir ce bonus, il suffit de créer un compte et de déposer au moins 20€. Le bonus sera crédité automatiquement sur votre compte et vous pourrez commencer à jouer immédiatement.

En résumé, le casino Alexandre est un choix excellent pour les joueurs de casino en ligne, avec son offre de jeux variée, sa connexion rapide et sécurisée, et son bonus gratuit de 100€ + 100 FS pour les nouveaux inscrits. N’hésitez pas à créer un compte et à découvrir les avantages du casino Alexandre !

Alexander Casino Avis 2024 – Bonus Gratuit 100€ + 100 FS

En 2024, Alexander Casino est l’un des casinos en ligne les plus populaires et les plus fiables sur le marché. Avec son offre de bienvenue exceptionnelle, il attire de nombreux joueurs à travers le monde. Dans cet article, nous allons vous présenter les avantages et les inconvénients de ce casino en ligne, ainsi que les conditions de son bonus gratuit de 100€ + 100 FS.

Avantages

Offre de bienvenue exceptionnelle : 100€ de bonus gratuit + 100 FS

Le bonus de bienvenue d’Alexander Casino est l’un des plus généreux du marché. Vous pouvez obtenir 100€ de bonus gratuit, ainsi que 100 Free Spins (FS) sur le slot “Book of Cleopatra”. Pour obtenir ce bonus, vous devez simplement créer un compte et déposer au moins 20€.

Variété de jeux : plus de 1 000 jeux de casino

Alexander Casino propose une grande variété de jeux de casino, y compris des slots, des jeux de table, des jeux de cartes et des jeux de hasard. Vous pouvez jouer à des jeux de casino classiques, tels que le blackjack, le roulette, le craps, ainsi que des slots modernes et innovants.

Connexion rapide et sécurisée : Alexander Casino connexion

Alexander Casino utilise une connexion sécurisée SSL pour protéger vos données personnelles et vos transactions financières. Vous pouvez vous connecter à votre compte en utilisant votre nom d’utilisateur et votre mot de passe, et vous pouvez déposer et retirer de l’argent en utilisant les méthodes de paiement les plus populaires, telles que Visa, Mastercard, Neteller et Skrill.

Inconvénients

Pas de support client 24/7

Malgré son offre de bienvenue exceptionnelle, Alexander Casino n’offre pas de support client 24/7. Vous pouvez contacter le support client par e-mail ou par téléphone, mais il n’y a pas de chat en direct ou de support en direct.

Pas de mobile app

Alexander Casino n’a pas de mobile app, ce qui peut être un inconvénient pour les joueurs qui préfèrent jouer sur leur smartphone ou leur tablette.

En résumé

Alexander Casino est un casino en ligne fiable et populaire qui offre une offre de bienvenue exceptionnelle. Cependant, il y a quelques inconvénients, tels que le manque de support client 24/7 et de mobile app. Nous vous recommandons de créer un compte et de découvrir les avantages de ce casino en ligne.

Présentation de l’entreprise

Le casino en ligne Alexander est une plateforme de jeu en ligne qui offre une expérience de jeu de qualité à ses clients. Créé en 2019, le casino a rapidement pris son envol en raison de sa variété de jeux, de ses promotions régulières et de sa sécurité renforcée.

Le casino Alexander est propriété de la société Alexander Casino N.V., une entreprise basée aux Antilles Néerlandaises. La société est licenciée et réglementée par la Commission des jeux d’État des Pays-Bas, ce qui garantit une expérience de jeu sécurisée et transparente.

Le casino propose une large gamme de jeux, allant des slots aux jeux de table, en passant par les jeux de cartes et les jeux de hasard. Les jeux sont fournis par des fournisseurs de jeu de renommée mondiale, tels que NetEnt, Microgaming et Evolution Gaming.

Les clients du casino Alexander peuvent bénéficier de plusieurs promotions régulières, telles que des bonus de bienvenue, des offres de reload et des tournois. Les joueurs peuvent également profiter d’une récompense de 100€ et de 100 FS pour leur inscription.

Informations clés
Valeurs

Licence Commission des jeux d’État des Pays-Bas Propriétaire Alexander Casino N.V. Création 2019 Langues Français, Anglais, Allemand, Espagnol, Italien

En résumé, le casino Alexander est une plateforme de jeu en ligne qui offre une expérience de jeu de qualité, une sécurité renforcée et des promotions régulières. Les clients peuvent y trouver une large gamme de jeux et bénéficier de récompenses attrayantes.

Le bonus gratuit de 100€ + 100 FS

Le Alexander Casino est un site de jeu en ligne qui attire l’attention des joueurs avec son offre de bienvenue exceptionnelle. En effet, en créant un compte, vous pouvez bénéficier d’un bonus gratuit de 100€, accompagné de 100 Free Spins (FS) pour vous aider à commencer votre aventure de jeu en ligne.

Pour obtenir ce bonus, il suffit de suivre les étapes suivantes : d’abord, créez un compte sur le site Alexander Casino, puis vérifiez votre adresse e-mail pour valider votre compte. Ensuite, déposez un minimum de 20€ pour activer votre bonus. Vous obtiendrez ainsi 100€ de bonus et 100 FS pour jouer à vos jeux préférés.

Il est important de noter que ce bonus est valable pour les nouveaux joueurs et que les conditions générales s’appliquent. Il est également important de vérifier les conditions de jeu et les règles du casino avant de commencer à jouer.

Le Alexander Casino est un site de jeu en ligne réputé pour son offre de jeu variée et ses conditions de jeu claires. Les joueurs peuvent choisir parmi une grande variété de jeux de casino, y compris les slots, les jeux de table, les jeux de cartes et les jeux de hasard. Le site est disponible en français et en plusieurs autres langues, ce qui en fait un choix idéal pour les joueurs internationaux.

En résumé, le bonus gratuit de 100€ + 100 FS offert par le Alexander Casino est un excellent moyen pour les nouveaux joueurs de commencer leur aventure de jeu en ligne. N’hésitez pas à créer un compte et à profiter de cette offre exceptionnelle !

Les jeux de casino proposés

Le casino Alexander est un endroit où vous pouvez trouver un large éventail de jeux de casino pour répondre à vos attentes. Vous pouvez choisir parmi plus de 500 jeux de casino, y compris les jeux de table, les jeux de machine à sous, les jeux de cartes et les jeux de loterie.

  • Les jeux de table
    • Roulette
    • Blackjack
    • Baccarat
    • Poker
  • Les jeux de machine à sous
    • Book of Ra
    • Starburst
    • Gonzo’s Quest
    • Jack and the Beanstalk
  • Les jeux de cartes
    • Video Poker
    • Keno
    • Scratch Cards
  • Les jeux de loterie
    • Loto
    • Keno
    • Bingo

Les jeux de casino proposés par le casino Alexander sont conçus pour offrir une expérience de jeu de haute qualité, avec des graphismes et des sons de haute qualité, ainsi que des règles de jeu claires et faciles à comprendre.

Vous pouvez également profiter de la connexion Alexander Casino pour jouer en direct avec d’autres joueurs, ce qui ajoute une nouvelle dimension à votre expérience de jeu.

En résumé, le casino Alexander propose un large éventail de jeux de casino pour répondre à vos attentes, avec des jeux de table, des jeux de machine à sous, des jeux de cartes et des jeux de loterie, ainsi que la possibilité de jouer en direct avec d’autres joueurs.

Conseils et astuces pour jouer à Alexander Casino

Pour commencer, il est important de noter que Alexander Casino est un casino en ligne réputé pour son offre de jeux variée et ses conditions de jeu favorables. Pour vous aider à maximiser vos chances de gagner, voici quelques conseils et astuces pour jouer à Alexander Casino :

Choisissez vos jeux avec soin : Alexander Casino propose une grande variété de jeux, allant des slots aux jeux de table, en passant par les jeux de cartes. Il est important de choisir les jeux qui vous plaisent le plus et de vous y concentrer pour maximiser vos gains.

Utilisez vos bonus : Alexander Casino offre des bonus réguliers à ses joueurs, notamment le bonus de bienvenue de 100€ + 100 FS. Il est important de bien lire les conditions de ces bonus pour comprendre les exigences de mise et les restrictions de jeu.

Créez un compte : Pour jouer à Alexander Casino, il est nécessaire de créer un compte. Il est important de fournir des informations précises et de vérifier que vous êtes âgé de 18 ans ou plus.

Connexion régulière : Pour éviter les problèmes de connexion, il est recommandé de vous connecter régulièrement à votre compte pour vérifier que tout fonctionne correctement.

Évitez les erreurs de jeu : Il est important de ne pas faire de erreurs de jeu, comme jouer trop vite ou trop lentement, car cela peut affecter vos chances de gagner. Il est également important de ne pas jouer en état d’ivresse ou sous l’influence de substances illicites.

Profitez de la communauté : Alexander Casino a une communauté active de joueurs qui partagent leurs expériences et leurs stratégies. Il est possible de discuter avec d’autres joueurs pour obtenir des conseils et des astuces.

Veillez à votre sécurité : Il est important de prendre soin de votre sécurité en ligne en utilisant un antivirus et un pare-feu pour protéger vos données personnelles.

En suivant ces conseils et astuces, vous serez prêt à commencer à jouer à Alexander Casino et à maximiser vos chances de gagner. N’oubliez pas de vérifier les conditions de jeu et les règles du casino avant de commencer à jouer.

Check Also

– Официальный сайт Pinco Casino.1586

Пинко Казино – Официальный сайт Pinco Casino ▶️ ИГРАТЬ Содержимое Преимущества игры на официальном сайте …