Yoast\WP\SEO\Conditionals

Old_Premium_AI_Conditional{} │ Yoast 1.0└─ Conditional

Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Conditional that is met when an older Yoast SEO Premium that predates the AI module restructure is active.

Used to gate the legacy src/ai-* integrations and routes so they only run when an older Premium relies on them.

Хуков нет.

Использование

$Old_Premium_AI_Conditional = new Old_Premium_AI_Conditional();
// use class methods

Методы

  1. public __construct( Product_Helper $product_helper )
  2. public is_met()

Список изменений

Устарела с 28.4

Код Old_Premium_AI_Conditional{} Yoast 28.7

class Old_Premium_AI_Conditional implements Conditional {

	/**
	 * The Premium version that ships with the new AI module structure.
	 *
	 * @var string
	 */
	private const NEW_AI_STRUCTURE_PREMIUM_VERSION = '27.5-RC0';

	/**
	 * Holds the Product_Helper.
	 *
	 * @var Product_Helper
	 */
	private $product_helper;

	/**
	 * Constructs Old_Premium_AI_Conditional.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 *
	 * @param Product_Helper $product_helper The Product_Helper.
	 */
	public function __construct( Product_Helper $product_helper ) {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		$this->product_helper = $product_helper;
	}

	/**
	 * Returns whether the legacy AI code paths should load.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 *
	 * @return bool `true` when Premium is active and predates the AI restructure.
	 */
	public function is_met() {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		if ( ! $this->product_helper->is_premium() ) {
			return false;
		}

		$premium_version = $this->product_helper->get_premium_version();
		if ( $premium_version === null ) {
			return false;
		}

		return \version_compare( $premium_version, self::NEW_AI_STRUCTURE_PREMIUM_VERSION, '<' );
	}
}