PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/integrations/admin/integrations-page.php +37 -3 27.5 → trunk View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace Yoast\WP\SEO\Integrations\Admin;
4 4
5 5 use WPSEO_Admin_Asset_Manager;
6 +use Yoast\WP\SEO\Conditionals\Abilities_API_Conditional;
6 7 use Yoast\WP\SEO\Conditionals\Admin_Conditional;
7 8 use Yoast\WP\SEO\Conditionals\Jetpack_Conditional;
8 9 use Yoast\WP\SEO\Conditionals\Third_Party\Elementor_Activated_Conditional;
9 10 use Yoast\WP\SEO\Dashboard\Infrastructure\Endpoints\Site_Kit_Consent_Management_Endpoint;
@@ -9,8 +10,9 @@
9 10 use Yoast\WP\SEO\Dashboard\Infrastructure\Endpoints\Site_Kit_Consent_Management_Endpoint;
10 11 use Yoast\WP\SEO\Dashboard\Infrastructure\Integrations\Site_Kit;
11 12 use Yoast\WP\SEO\Helpers\Options_Helper;
12 13 use Yoast\WP\SEO\Integrations\Integration_Interface;
14 +use Yoast\WP\SEO\MyYoast_Client\User_Interface\Integrations_Page_Script_Data as MyYoast_Connection_Script_Data;
13 15 use Yoast\WP\SEO\Schema\Application\Configuration\Schema_Configuration;
14 16
15 17 /**
16 18 * Integrations_Page class
@@ -17,8 +19,15 @@
17 19 */
18 20 class Integrations_Page implements Integration_Interface {
19 21
20 22 /**
23 + * The page identifier of the integrations page.
24 + *
25 + * @var string
26 + */
27 + public const PAGE = 'wpseo_integrations';
28 +
29 + /**
21 30 * The admin asset manager.
22 31 *
23 32 * @var WPSEO_Admin_Asset_Manager
24 33 */
@@ -66,8 +75,22 @@
66 75 */
67 76 private $schema_configuration;
68 77
69 78 /**
79 + * The MyYoast connection script-data provider.
80 + *
81 + * @var MyYoast_Connection_Script_Data
82 + */
83 + private $myyoast_connection_script_data;
84 +
85 + /**
86 + * The Abilities API conditional.
87 + *
88 + * @var Abilities_API_Conditional
89 + */
90 + private $abilities_api_conditional;
91 +
92 + /**
70 93 * {@inheritDoc}
71 94 */
72 95 public static function get_conditionals() {
73 96 return [ Admin_Conditional::class ];
@@ -84,8 +107,11 @@
84 107 * configuration data.
85 108 * @param Site_Kit_Consent_Management_Endpoint $site_kit_consent_management_endpoint The site kit consent
86 109 * management endpoint.
87 110 * @param Schema_Configuration $schema_configuration The schema configuration.
111 + * @param MyYoast_Connection_Script_Data $myyoast_connection_script_data The MyYoast connection
112 + * script-data provider.
113 + * @param Abilities_API_Conditional $abilities_api_conditional The Abilities API conditional.
88 114 */
89 115 public function __construct(
90 116 WPSEO_Admin_Asset_Manager $admin_asset_manager,
91 117 Options_Helper $options_helper,
@@ -92,9 +118,11 @@
92 118 Elementor_Activated_Conditional $elementor_conditional,
93 119 Jetpack_Conditional $jetpack_conditional,
94 120 Site_Kit $site_kit_integration_data,
95 121 Site_Kit_Consent_Management_Endpoint $site_kit_consent_management_endpoint,
96 - Schema_Configuration $schema_configuration
122 + Schema_Configuration $schema_configuration,
123 + MyYoast_Connection_Script_Data $myyoast_connection_script_data,
124 + Abilities_API_Conditional $abilities_api_conditional
97 125 ) {
98 126 $this->admin_asset_manager = $admin_asset_manager;
99 127 $this->options_helper = $options_helper;
100 128 $this->elementor_conditional = $elementor_conditional;
@@ -101,8 +129,10 @@
101 129 $this->jetpack_conditional = $jetpack_conditional;
102 130 $this->site_kit_integration_data = $site_kit_integration_data;
103 131 $this->site_kit_consent_management_endpoint = $site_kit_consent_management_endpoint;
104 132 $this->schema_configuration = $schema_configuration;
133 + $this->myyoast_connection_script_data = $myyoast_connection_script_data;
134 + $this->abilities_api_conditional = $abilities_api_conditional;
105 135 }
106 136
107 137 /**
108 138 * {@inheritDoc}
@@ -124,9 +154,9 @@
124 154 'wpseo_dashboard',
125 155 '',
126 156 \__( 'Integrations', 'wordpress-seo' ),
127 157 'wpseo_manage_options',
128 - 'wpseo_integrations',
158 + self::PAGE,
129 159 [ $this, 'render_target' ],
130 160 ];
131 161
132 162 \array_splice( $submenu_pages, 1, 0, [ $integrations_page ] );
@@ -140,9 +170,9 @@
140 170 * @return void
141 171 */
142 172 public function enqueue_assets() {
143 173 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Date is not processed or saved.
144 - if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wpseo_integrations' ) {
174 + if ( ! isset( $_GET['page'] ) || $_GET['page'] !== self::PAGE ) {
145 175 return;
146 176 }
147 177
148 178 $this->admin_asset_manager->enqueue_style( 'admin-css' );
@@ -147,8 +177,9 @@
147 177
148 178 $this->admin_asset_manager->enqueue_style( 'admin-css' );
149 179 $this->admin_asset_manager->enqueue_style( 'tailwind' );
150 180 $this->admin_asset_manager->enqueue_style( 'monorepo' );
181 + $this->admin_asset_manager->enqueue_style( 'integrations-page' );
151 182
152 183 $this->admin_asset_manager->enqueue_script( 'integrations-page' );
153 184
154 185 $acf_seo_file = 'acf-content-analysis-for-yoast-seo/yoast-acf-analysis.php';
@@ -225,8 +256,11 @@
225 256 'plugin_url' => \plugins_url( '', \WPSEO_FILE ),
226 257 'site_kit_configuration' => $this->site_kit_integration_data->to_array(),
227 258 'site_kit_consent_management_url' => $this->site_kit_consent_management_endpoint->get_url(),
228 259 'schema_framework_enabled' => $this->options_helper->get( 'enable_schema', true ) === true && ! $this->schema_configuration->is_schema_disabled_programmatically(),
260 + 'myyoast_connection' => $this->myyoast_connection_script_data->present(),
261 + 'schema_aggregation_active' => $this->options_helper->get( 'enable_schema_aggregation_endpoint', false ) === true,
262 + 'abilities_api_active' => $this->abilities_api_conditional->is_met(),
229 263 ],
230 264 );
231 265 }
232 266