✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.98
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/profile-git-objects/cloudflare/user-interface//ai-generator-integration.php
<?php

namespace Yoast\WP\SEO\AI_Generator\User_Interface;

use WPSEO_Addon_Manager;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\AI\Consent\Application\Consent_Endpoints_Repository;
use Yoast\WP\SEO\AI\Free_Sparks\Application\Free_Sparks_Endpoints_Repository;
use Yoast\WP\SEO\AI\Generator\Application\Generator_Endpoints_Repository;
use Yoast\WP\SEO\AI_HTTP_Request\Infrastructure\API_Client;
use Yoast\WP\SEO\Conditionals\AI_Conditional;
use Yoast\WP\SEO\Conditionals\AI_Editor_Conditional;
use Yoast\WP\SEO\Conditionals\Old_Premium_AI_Conditional;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\User_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\Introductions\Application\Ai_Fix_Assessments_Upsell;
use Yoast\WP\SEO\Introductions\Infrastructure\Introductions_Seen_Repository;

/**
 * Ai_Generator_Integration class.
 */
class Ai_Generator_Integration implements Integration_Interface {

	/**
	 * Represents the admin asset manager.
	 *
	 * @var WPSEO_Admin_Asset_Manager
	 */
	private $asset_manager;

	/**
	 * Represents the add-on manager.
	 *
	 * @var WPSEO_Addon_Manager
	 */
	private $addon_manager;

	/**
	 * Holds the API client instance.
	 *
	 * @var API_Client
	 */
	private $api_client;

	/**
	 * Represents the current page helper.
	 *
	 * @var Current_Page_Helper
	 */
	private $current_page_helper;

	/**
	 * Represents the options manager.
	 *
	 * @var Options_Helper
	 */
	private $options_helper;

	/**
	 * Represents the user helper.
	 *
	 * @var User_Helper
	 */
	private $user_helper;

	/**
	 * Represents the introductions seen repository.
	 *
	 * @var Introductions_Seen_Repository
	 */
	private $introductions_seen_repository;

	/**
	 * Represents the endpoints repository.
	 *
	 * @var Generator_Endpoints_Repository
	 */
	private $generator_endpoints_repository;

	/**
	 * Represents the consent endpoints repository.
	 *
	 * @var Consent_Endpoints_Repository
	 */
	private $consent_endpoints_repository;

	/**
	 * Represents the free sparks endpoints repository.
	 *
	 * @var Free_Sparks_Endpoints_Repository
	 */
	private $free_sparks_endpoints_repository;

	/**
	 * Returns the conditionals based in which this loadable should be active.
	 *
	 * @return array<string>
	 */
	public static function get_conditionals() {
		return [ AI_Conditional::class, AI_Editor_Conditional::class, Old_Premium_AI_Conditional::class ];
	}

	/**
	 * Constructs the class.
	 *
	 * @param WPSEO_Admin_Asset_Manager        $asset_manager                    The admin asset manager.
	 * @param WPSEO_Addon_Manager              $addon_manager                    The addon manager.
	 * @param API_Client                       $api_client                       The API client.
	 * @param Current_Page_Helper              $current_page_helper              The current page helper.
	 * @param Options_Helper                   $options_helper                   The options helper.
	 * @param User_Helper                      $user_helper                      The user helper.
	 * @param Introductions_Seen_Repository    $introductions_seen_repository    The introductions seen repository.
	 * @param Generator_Endpoints_Repository   $generator_endpoints_repository   The Generator endpoints repository.
	 * @param Consent_Endpoints_Repository     $consent_endpoints_repository     The Consent endpoints repository.
	 * @param Free_Sparks_Endpoints_Repository $free_sparks_endpoints_repository The Free Sparks endpoints repository.
	 */
	public function __construct(
		WPSEO_Admin_Asset_Manager $asset_manager,
		WPSEO_Addon_Manager $addon_manager,
		API_Client $api_client,
		Current_Page_Helper $current_page_helper,
		Options_Helper $options_helper,
		User_Helper $user_helper,
		Introductions_Seen_Repository $introductions_seen_repository,
		Generator_Endpoints_Repository $generator_endpoints_repository,
		Consent_Endpoints_Repository $consent_endpoints_repository,
		Free_Sparks_Endpoints_Repository $free_sparks_endpoints_repository
	) {
		$this->asset_manager                    = $asset_manager;
		$this->addon_manager                    = $addon_manager;
		$this->api_client                       = $api_client;
		$this->current_page_helper              = $current_page_helper;
		$this->options_helper                   = $options_helper;
		$this->user_helper                      = $user_helper;
		$this->introductions_seen_repository    = $introductions_seen_repository;
		$this->generator_endpoints_repository   = $generator_endpoints_repository;
		$this->consent_endpoints_repository     = $consent_endpoints_repository;
		$this->free_sparks_endpoints_repository = $free_sparks_endpoints_repository;
	}

	/**
	 * Initializes the integration.
	 *
	 * This is the place to register hooks and filters.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
		// Enqueue after Elementor_Premium integration, which re-registers the assets.
		\add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_assets' ], 11 );
	}

	/**
	 * Gets the subscription status for Yoast SEO Premium and Yoast WooCommerce SEO.
	 *
	 * @return array<string, bool>
	 */
	public function get_product_subscriptions() {
		return [
			'premiumSubscription'     => $this->addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ),
			'wooCommerceSubscription' => $this->addon_manager->has_valid_subscription( WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ),
		];
	}

	/**
	 * Returns the data that should be passed to the script.
	 *
	 * @return array<string|array<string>>
	 */
	public function get_script_data() {
		$user_id = $this->user_helper->get_current_user_id();

		$endpoints = $this->generator_endpoints_repository->get_all_endpoints()
			->merge_with(
				$this->consent_endpoints_repository->get_all_endpoints(),
			)->merge_with(
				$this->free_sparks_endpoints_repository->get_all_endpoints(),
			)->to_paths_array();

		return [
			'hasConsent'           => $this->user_helper->get_meta( $user_id, '_yoast_wpseo_ai_consent', true ),
			'productSubscriptions' => $this->get_product_subscriptions(),
			'hasSeenIntroduction'  => $this->introductions_seen_repository->is_introduction_seen( $user_id, AI_Fix_Assessments_Upsell::ID ),
			'requestTimeout'       => $this->api_client->get_request_timeout(),
			'isFreeSparks'         => $this->options_helper->get( 'ai_free_sparks_started_on', null ) !== null,
			'endpoints'            => $endpoints,
		];
	}

	/**
	 * Enqueues the required assets.
	 *
	 * @return void
	 */
	public function enqueue_assets() {

		$this->asset_manager->enqueue_script( 'ai-generator' );
		$this->asset_manager->localize_script( 'ai-generator', 'wpseoAiGenerator', $this->get_script_data() );
		$this->asset_manager->enqueue_style( 'ai-generator' );
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
22 Sep 2026 4.33 AM
docteuh / users
0755
utils
--
8 Sep 2026 4.42 AM
docteuh / users
0755
ai-generator-integration.php
6.727 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
banner-permanent-dismissal-route.php
3.249 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
bust-subscription-cache-route.php
2.146 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
content-planner-integration.php
4.349 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
get-outline-route.php
7.272 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
get-suggestions-route.php
4.724 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
get-usage-route.php
5.181 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827224220.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
loader.php
6.886 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
route-permission-trait.php
0.513 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF