JFIF $ d d 7 * Z qn )ZP 0 !1 A "#a$2Qr D8 a Ri [f \m I ykI w0 c u F c Rı?lO7 к _f˓ [C $殷WF< _W ԣ s Kc ëI zyQy /_LK ℂ ;C",p F A : /] =H ~ , l s / 9 ć: [=/#f ; ) x { ٛE Q )~ = 𘙲r*2~ a _V = ' ku m F D } KYYC )( { * g& f `툪 r y ` = ^ c J. I ]( * `wq 1dđ #̩ ͑ 0 ; H ] u 搂 @:~ ו K L N s h } O I R* 8 :2 ! lD JV o ( 3 = M ( z Ȱ+i *N A r6K n S l ) ! J J Ӂ* % ݉?|D } d5: eP0 R; {$X' x F @ .ÊB {,WJ uQ ɲRI ;9 Q E琯 6 2fT .DU J ;*c P A\IL Nj! J ۱+ O\ ͔ ] ޒ S J ȧ c%A N ol ՎprU L Zԛe r E2= X D Xg VQeӓ k y P7 U* o m Q I s ,K `) 6\G3t?pgjr m ۛجw luGt f h 9uyP 0D;Uڽ"OXl i f $ ) &|ML 0 Z rm1 [ H XP l P R0 'G=i 2N +0 e 2 ]] 9 VT P O 7 h(F * 癈 ' = Q VZD F,d ߬ ~ T X G[ `le 69C R(!S2! P < 0 x < !1AQ "Raq 02Br #S CTb ? Ζ "]mH5WR 7 k.ۛ ! } Q~ + yԏ z |@ T20 S~ K e k *zF f^2X *( @ 8 r ? C I uI|֓>^Ex LgNU Y+{.R Ѫ τV YT D I 6 2 '8Y2 7'\T P.6 d &˦ @V q i |8 -O Ε ] ʔ U= T L 8= ;6c | !qfF3 a ů& ~$ l} 'NW U s$U k^S V : U#6w + +s &r+n ڐ { @ 29gL u " T Ù M=6 (^ "7 r}=6Yݾ lC u hquymp Ǧ G jhs ǜNl ɻ} o 7 #S6 a w 4 ! OS r D 5 7 % | ?x> L | / nD 6?/8 w # [ ) L 7 +6〼T A T g ! %5 Mm Z /c -{1_Je "| ^$ 'O & ޱմ < H vNqϡQ$ < 6 &Nݛ ֨tǻN (9 n ru~'όN sMG& ,uH Kw *Ī 5@ u6 BԒ i YN * f 0 _ GhKW u lT <nj- 0{ M L~ | /a v\ E = ?1 \ɟuq Ђ Y O a K ޡP q $ H8o Q˼EV ~ k 0 h' L Pp M -M" m^ !6l nմ 쮝C U T . ! :vMǨb h ډ Vc r @~p # !1QAa q ? AL0L x LU 4 d ; x " 16ad0 7.\ߋ 0 = P l v/ " c A Ay A|2pO8"d MV #1] = \ " ˡ ] k v I9 d ۓ & q ) ǐq E ꞅ v "P )q X &Q З non]я u ג./ ; gZ$ M QР 2M ]h ni 0 P $ێ 3CɏGjώy : m c # S_ l@ '_ \m|C 2`K _ 1 cIvGc $? PCQ S+D ? K aײ k Fr b 8 ύ NEدg ĝ U 3 6 #Ik+ v { v i ( ވ ? a e) X xy/*@Q Ǽ Ծ ) $ IWO l c G; !i k{ gOŀ L ('x T rb $ w) R $ & N1E td U3Uȉ1p M"N* (DNy d96.(jQ) X 5 c QɎMy W ? Q *!R > 6=7)Xj 5`J ] e 8%t ! + ' ! 1Q 5 !1 AQaq ё #2 "0BRb ? G t^ ## .l lQ T $ v , ,m 㵜5u bV =sY+ @d { N ! dn O < .- B; _w J t 6;Q Jd. Q c%p{ 1 ,sND dF H I0 Гo X ш e黅X ۢ F :)[ F G X ƹ / w _c MeD ,ʡc c . W D tA $ j@ : ) - #u c1< @ۗ9F ) KJ- hpP] _ x [ q B lb p ʖ w q " LFGd ƶ * s +ډ_Zc " ? % t[I P 6 J ]# =ɺ V v v CGs Gh1 > )6 |e y ? L ӣ m,4 G W Ui ` ] uJVo VDG< SB 6ϏQ @ TiU l y O U 0 kfV ~ ~}S Z @ *WU Ui ## ; s /[ = ! 7}" W N ] ' (L ! ~ y5 g9T̅J kbM' +s :S +B) v @ M j e C f j E 0 Y\Qn z G 1 д~ W o{T 9?` Rm yhsy3 !HAD ] m c1 ~ 2 L S u7x T ;j$ `} 4-> L# vzŏ I L S ֭ T { r jGK C ; b pU= - ` Bs K. S F w4 M q] Z dH S 0 ) tLg
<?php
namespace Yoast\WP\SEO\Integrations\Admin;
use WPSEO_Admin_Asset_Manager;
use Yoast\WP\SEO\Conditionals\Abilities_API_Conditional;
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Conditionals\Jetpack_Conditional;
use Yoast\WP\SEO\Conditionals\Third_Party\Elementor_Activated_Conditional;
use Yoast\WP\SEO\Dashboard\Infrastructure\Endpoints\Site_Kit_Consent_Management_Endpoint;
use Yoast\WP\SEO\Dashboard\Infrastructure\Integrations\Site_Kit;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast\WP\SEO\MyYoast_Client\User_Interface\Integrations_Page_Script_Data as MyYoast_Connection_Script_Data;
use Yoast\WP\SEO\Schema\Application\Configuration\Schema_Configuration;
/**
* Integrations_Page class
*/
class Integrations_Page implements Integration_Interface {
/**
* The page identifier of the integrations page.
*
* @var string
*/
public const PAGE = 'wpseo_integrations';
/**
* The admin asset manager.
*
* @var WPSEO_Admin_Asset_Manager
*/
private $admin_asset_manager;
/**
* The options helper.
*
* @var Options_Helper
*/
private $options_helper;
/**
* The elementor conditional.
*
* @var Elementor_Activated_Conditional
*/
private $elementor_conditional;
/**
* The jetpack conditional.
*
* @var Jetpack_Conditional
*/
private $jetpack_conditional;
/**
* The site kit integration configuration data.
*
* @var Site_Kit
*/
private $site_kit_integration_data;
/**
* The site kit consent management endpoint.
*
* @var Site_Kit_Consent_Management_Endpoint
*/
private $site_kit_consent_management_endpoint;
/**
* The schema configuration.
*
* @var Schema_Configuration
*/
private $schema_configuration;
/**
* The MyYoast connection script-data provider.
*
* @var MyYoast_Connection_Script_Data
*/
private $myyoast_connection_script_data;
/**
* The Abilities API conditional.
*
* @var Abilities_API_Conditional
*/
private $abilities_api_conditional;
/**
* {@inheritDoc}
*/
public static function get_conditionals() {
return [ Admin_Conditional::class ];
}
/**
* Workouts_Integration constructor.
*
* @param WPSEO_Admin_Asset_Manager $admin_asset_manager The admin asset manager.
* @param Options_Helper $options_helper The options helper.
* @param Elementor_Activated_Conditional $elementor_conditional The elementor conditional.
* @param Jetpack_Conditional $jetpack_conditional The Jetpack conditional.
* @param Site_Kit $site_kit_integration_data The site kit integration
* configuration data.
* @param Site_Kit_Consent_Management_Endpoint $site_kit_consent_management_endpoint The site kit consent
* management endpoint.
* @param Schema_Configuration $schema_configuration The schema configuration.
* @param MyYoast_Connection_Script_Data $myyoast_connection_script_data The MyYoast connection
* script-data provider.
* @param Abilities_API_Conditional $abilities_api_conditional The Abilities API conditional.
*/
public function __construct(
WPSEO_Admin_Asset_Manager $admin_asset_manager,
Options_Helper $options_helper,
Elementor_Activated_Conditional $elementor_conditional,
Jetpack_Conditional $jetpack_conditional,
Site_Kit $site_kit_integration_data,
Site_Kit_Consent_Management_Endpoint $site_kit_consent_management_endpoint,
Schema_Configuration $schema_configuration,
MyYoast_Connection_Script_Data $myyoast_connection_script_data,
Abilities_API_Conditional $abilities_api_conditional
) {
$this->admin_asset_manager = $admin_asset_manager;
$this->options_helper = $options_helper;
$this->elementor_conditional = $elementor_conditional;
$this->jetpack_conditional = $jetpack_conditional;
$this->site_kit_integration_data = $site_kit_integration_data;
$this->site_kit_consent_management_endpoint = $site_kit_consent_management_endpoint;
$this->schema_configuration = $schema_configuration;
$this->myyoast_connection_script_data = $myyoast_connection_script_data;
$this->abilities_api_conditional = $abilities_api_conditional;
}
/**
* {@inheritDoc}
*/
public function register_hooks() {
\add_filter( 'wpseo_submenu_pages', [ $this, 'add_submenu_page' ], 10 );
\add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ], 11 );
}
/**
* Adds the integrations submenu page.
*
* @param array $submenu_pages The Yoast SEO submenu pages.
*
* @return array The filtered submenu pages.
*/
public function add_submenu_page( $submenu_pages ) {
$integrations_page = [
'wpseo_dashboard',
'',
\__( 'Integrations', 'wordpress-seo' ),
'wpseo_manage_options',
self::PAGE,
[ $this, 'render_target' ],
];
\array_splice( $submenu_pages, 1, 0, [ $integrations_page ] );
return $submenu_pages;
}
/**
* Enqueue the integrations app.
*
* @return void
*/
public function enqueue_assets() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Date is not processed or saved.
if ( ! isset( $_GET['page'] ) || $_GET['page'] !== self::PAGE ) {
return;
}
$this->admin_asset_manager->enqueue_style( 'admin-css' );
$this->admin_asset_manager->enqueue_style( 'tailwind' );
$this->admin_asset_manager->enqueue_style( 'monorepo' );
$this->admin_asset_manager->enqueue_style( 'integrations-page' );
$this->admin_asset_manager->enqueue_script( 'integrations-page' );
$acf_seo_file = 'acf-content-analysis-for-yoast-seo/yoast-acf-analysis.php';
$acf_seo_file_github = 'yoast-acf-analysis/yoast-acf-analysis.php';
$algolia_file = 'wp-search-with-algolia/algolia.php';
$old_algolia_file = 'search-by-algolia-instant-relevant-results/algolia.php';
$schema_api_integrations = $this->schema_configuration->get_schema_api_integrations();
$woocommerce_seo_installed = $schema_api_integrations['woocommerce']['isInstalled'];
$woocommerce_seo_active = $schema_api_integrations['woocommerce']['isActive'];
$woocommerce_active = $schema_api_integrations['woocommerce']['isPrerequisiteActive'];
$woocommerce_seo_activate_url = $schema_api_integrations['woocommerce']['activationLink'];
$edd_active = $schema_api_integrations['edd']['isActive'];
$tec_active = $schema_api_integrations['tec']['isActive'];
$ssp_active = $schema_api_integrations['ssp']['isActive'];
$wp_recipe_maker_active = $schema_api_integrations['wp-recipe-maker']['isActive'];
$acf_seo_installed = \file_exists( \WP_PLUGIN_DIR . '/' . $acf_seo_file );
$acf_seo_github_installed = \file_exists( \WP_PLUGIN_DIR . '/' . $acf_seo_file_github );
$acf_seo_active = \is_plugin_active( $acf_seo_file );
$acf_seo_github_active = \is_plugin_active( $acf_seo_file_github );
$acf_active = \class_exists( 'acf' );
$algolia_active = \is_plugin_active( $algolia_file );
$old_algolia_active = \is_plugin_active( $old_algolia_file );
$mastodon_active = $this->is_mastodon_active();
if ( $acf_seo_installed ) {
$acf_seo_activate_url = \wp_nonce_url(
\self_admin_url( 'plugins.php?action=activate&plugin=' . $acf_seo_file ),
'activate-plugin_' . $acf_seo_file,
);
}
else {
$acf_seo_activate_url = \wp_nonce_url(
\self_admin_url( 'plugins.php?action=activate&plugin=' . $acf_seo_file_github ),
'activate-plugin_' . $acf_seo_file_github,
);
}
$acf_seo_install_url = \wp_nonce_url(
\self_admin_url( 'update.php?action=install-plugin&plugin=acf-content-analysis-for-yoast-seo' ),
'install-plugin_acf-content-analysis-for-yoast-seo',
);
$this->admin_asset_manager->localize_script(
'integrations-page',
'wpseoIntegrationsData',
[
'semrush_integration_active' => $this->options_helper->get( 'semrush_integration_active', true ),
'allow_semrush_integration' => $this->options_helper->get( 'allow_semrush_integration_active', true ),
'algolia_integration_active' => $this->options_helper->get( 'algolia_integration_active', false ),
'allow_algolia_integration' => $this->options_helper->get( 'allow_algolia_integration_active', true ),
'wincher_integration_active' => $this->options_helper->get( 'wincher_integration_active', true ),
'allow_wincher_integration' => null,
'elementor_integration_active' => $this->elementor_conditional->is_met(),
'jetpack_integration_active' => $this->jetpack_conditional->is_met(),
'woocommerce_seo_installed' => $woocommerce_seo_installed,
'woocommerce_seo_active' => $woocommerce_seo_active,
'woocommerce_active' => $woocommerce_active,
'woocommerce_seo_activate_url' => $woocommerce_seo_activate_url,
'acf_seo_installed' => $acf_seo_installed || $acf_seo_github_installed,
'acf_seo_active' => $acf_seo_active || $acf_seo_github_active,
'acf_active' => $acf_active,
'acf_seo_activate_url' => $acf_seo_activate_url,
'acf_seo_install_url' => $acf_seo_install_url,
'algolia_active' => $algolia_active || $old_algolia_active,
'edd_integration_active' => $edd_active,
'ssp_integration_active' => $ssp_active,
'tec_integration_active' => $tec_active,
'wp-recipe-maker_integration_active' => $wp_recipe_maker_active,
'mastodon_active' => $mastodon_active,
'is_multisite' => \is_multisite(),
'plugin_url' => \plugins_url( '', \WPSEO_FILE ),
'site_kit_configuration' => $this->site_kit_integration_data->to_array(),
'site_kit_consent_management_url' => $this->site_kit_consent_management_endpoint->get_url(),
'schema_framework_enabled' => $this->options_helper->get( 'enable_schema', true ) === true && ! $this->schema_configuration->is_schema_disabled_programmatically(),
'myyoast_connection' => $this->myyoast_connection_script_data->present(),
'schema_aggregation_active' => $this->options_helper->get( 'enable_schema_aggregation_endpoint', false ) === true,
'abilities_api_active' => $this->abilities_api_conditional->is_met(),
],
);
}
/**
* Renders the target for the React to mount to.
*
* @return void
*/
public function render_target() {
?>
<div class="wrap yoast wpseo-admin-page page-wpseo">
<div class="wp-header-end" style="height: 0; width: 0;"></div>
<div id="wpseo-integrations"></div>
</div>
<?php
}
/**
* Checks whether the Mastodon profile field has been filled in.
*
* @return bool
*/
private function is_mastodon_active() {
return \apply_filters( 'wpseo_mastodon_active', false );
}
}