• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 6a2466a743a8601266bb3f4e55bebb23b2cf4330

21 Jul 2026 11:53AM UTC coverage: 55.357% (+0.2%) from 55.156%
6a2466a743a8601266bb3f4e55bebb23b2cf4330

push

github

vraja-pro
Merge branch 'trunk' into feature/bulk-editor-ph2

10491 of 18781 branches covered (55.86%)

Branch coverage included in aggregate %.

419 of 469 new or added lines in 24 files covered. (89.34%)

40038 of 72497 relevant lines covered (55.23%)

41513.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.79
/src/abilities/user-interface/abilities-integration.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4
namespace Yoast\WP\SEO\Abilities\User_Interface;
5

6
use Yoast\WP\SEO\Abilities\Application\Post_SEO_Data_Collector;
7
use Yoast\WP\SEO\Abilities\Application\Post_SEO_Data_Updater;
8
use Yoast\WP\SEO\Abilities\Application\Score_Retriever;
9
use Yoast\WP\SEO\Conditionals\Abilities_API_Conditional;
10
use Yoast\WP\SEO\Conditionals\Should_Index_Indexables_Conditional;
11
use Yoast\WP\SEO\Config\Schema_Types;
12
use Yoast\WP\SEO\Editors\Application\Analysis_Features\Enabled_Analysis_Features_Repository;
13
use Yoast\WP\SEO\Editors\Framework\Inclusive_Language_Analysis;
14
use Yoast\WP\SEO\Editors\Framework\Keyphrase_Analysis;
15
use Yoast\WP\SEO\Editors\Framework\Readability_Analysis;
16
use Yoast\WP\SEO\Helpers\Capability_Helper;
17
use Yoast\WP\SEO\Integrations\Integration_Interface;
18

19
/**
20
 * Integration that registers Yoast SEO abilities with the WordPress Abilities API.
21
 */
22
class Abilities_Integration implements Integration_Interface {
23

24
        /**
25
         * The score retriever.
26
         *
27
         * @var Score_Retriever
28
         */
29
        private $score_retriever;
30

31
        /**
32
         * The capability helper.
33
         *
34
         * @var Capability_Helper
35
         */
36
        private $capability_helper;
37

38
        /**
39
         * The enabled analysis features repository.
40
         *
41
         * @var Enabled_Analysis_Features_Repository
42
         */
43
        private $enabled_analysis_features_repository;
44

45
        /**
46
         * The post SEO data collector.
47
         *
48
         * @var Post_SEO_Data_Collector
49
         */
50
        private $post_seo_data_collector;
51

52
        /**
53
         * The post SEO data updater.
54
         *
55
         * @var Post_SEO_Data_Updater
56
         */
57
        private $post_seo_data_updater;
58

59
        /**
60
         * Returns the conditionals based on which this loadable should be active.
61
         *
62
         * @return array<string> The conditionals.
63
         */
64
        public static function get_conditionals() {
2✔
65
                return [
2✔
66
                        Abilities_API_Conditional::class,
2✔
67
                        Should_Index_Indexables_Conditional::class,
2✔
68
                ];
2✔
69
        }
70

71
        /**
72
         * Constructor.
73
         *
74
         * @param Score_Retriever                      $score_retriever                      The score retriever.
75
         * @param Capability_Helper                    $capability_helper                    The capability helper.
76
         * @param Enabled_Analysis_Features_Repository $enabled_analysis_features_repository The enabled analysis features repository.
77
         * @param Post_SEO_Data_Collector              $post_seo_data_collector              The post SEO data collector.
78
         * @param Post_SEO_Data_Updater                $post_seo_data_updater                The post SEO data updater.
79
         */
80
        public function __construct(
×
81
                Score_Retriever $score_retriever,
82
                Capability_Helper $capability_helper,
83
                Enabled_Analysis_Features_Repository $enabled_analysis_features_repository,
84
                Post_SEO_Data_Collector $post_seo_data_collector,
85
                Post_SEO_Data_Updater $post_seo_data_updater
86
        ) {
87
                $this->score_retriever                      = $score_retriever;
×
88
                $this->capability_helper                    = $capability_helper;
×
89
                $this->enabled_analysis_features_repository = $enabled_analysis_features_repository;
×
NEW
90
                $this->post_seo_data_collector              = $post_seo_data_collector;
×
NEW
91
                $this->post_seo_data_updater                = $post_seo_data_updater;
×
92
        }
93

94
        /**
95
         * Registers hooks with WordPress.
96
         *
97
         * @return void
98
         */
99
        public function register_hooks() {
2✔
100
                \add_action( 'wp_abilities_api_init', [ $this, 'register_abilities' ] );
2✔
101
        }
102

103
        /**
104
         * Registers the Yoast SEO abilities.
105
         *
106
         * @return void
107
         */
108
        public function register_abilities() {
12✔
109
                $enabled_features = $this->enabled_analysis_features_repository->get_features_by_keys(
12✔
110
                        [
12✔
111
                                Keyphrase_Analysis::NAME,
12✔
112
                                Readability_Analysis::NAME,
12✔
113
                                Inclusive_Language_Analysis::NAME,
12✔
114
                        ],
12✔
115
                )->to_array();
12✔
116

117
                if ( $enabled_features[ Keyphrase_Analysis::NAME ] === true ) {
12✔
118
                        $this->register_seo_scores_ability();
4✔
119
                }
120

121
                if ( $enabled_features[ Readability_Analysis::NAME ] === true ) {
12✔
122
                        $this->register_readability_scores_ability();
2✔
123
                }
124

125
                if ( $enabled_features[ Inclusive_Language_Analysis::NAME ] === true ) {
12✔
126
                        $this->register_inclusive_language_scores_ability();
2✔
127
                }
128

129
                // Metadata read/write is independent of which analysis features are enabled.
130
                $this->register_get_post_seo_data_ability();
12✔
131
                $this->register_update_post_seo_data_ability();
12✔
132
        }
133

134
        /**
135
         * Checks whether the current user can manage Yoast SEO.
136
         *
137
         * Gates every ability — reading scores, reading post SEO data, and updating it —
138
         * behind the same Yoast SEO management capability.
139
         *
140
         * @return bool Whether the current user can manage Yoast SEO.
141
         */
142
        public function can_manage_seo(): bool {
4✔
143
                return $this->capability_helper->current_user_can( 'wpseo_manage_options' );
4✔
144
        }
145

146
        /**
147
         * Checks whether the current user can read scores.
148
         *
149
         * @deprecated 28.2
150
         * @codeCoverageIgnore Because of deprecation.
151
         *
152
         * @return bool Whether the current user can read scores.
153
         */
154
        public function can_read_scores(): bool {
155
                \_deprecated_function( __METHOD__, 'Yoast SEO 28.2', 'Use can_manage_seo() instead.' );
156

157
                return $this->can_manage_seo();
158
        }
159

160
        /**
161
         * Registers the SEO scores ability.
162
         *
163
         * @return void
164
         */
165
        private function register_seo_scores_ability(): void {
×
166
                $output_schema                                  = $this->get_score_output_schema();
×
167
                $output_schema['properties']['focus_keyphrase'] = [
×
168
                        'type'        => [ 'string', 'null' ],
×
169
                        'description' => \__( 'The focus keyphrase for the post, or null if not set.', 'wordpress-seo' ),
×
170
                ];
×
171

172
                \wp_register_ability(
×
173
                        Ability_Categories_Integration::CATEGORY_SLUG . '/get-seo-scores',
×
174
                        $this->get_shared_ability_args(
×
175
                                [
×
176
                                        'label'            => \__( 'Get SEO Scores', 'wordpress-seo' ),
×
177
                                        'description'      => \__( 'Get the SEO scores for the most recently modified posts.', 'wordpress-seo' ),
×
178
                                        'output_schema'    => $this->wrap_in_array_schema( $output_schema ),
×
179
                                        'execute_callback' => [ $this->score_retriever, 'get_seo_scores' ],
×
180
                                ],
×
181
                        ),
×
182
                );
×
183
        }
184

185
        /**
186
         * Registers the readability scores ability.
187
         *
188
         * @return void
189
         */
190
        private function register_readability_scores_ability(): void {
×
191
                \wp_register_ability(
×
192
                        Ability_Categories_Integration::CATEGORY_SLUG . '/get-readability-scores',
×
193
                        $this->get_shared_ability_args(
×
194
                                [
×
195
                                        'label'            => \__( 'Get Readability Scores', 'wordpress-seo' ),
×
196
                                        'description'      => \__( 'Get the readability scores for the most recently modified posts.', 'wordpress-seo' ),
×
197
                                        'output_schema'    => $this->wrap_in_array_schema( $this->get_score_output_schema() ),
×
198
                                        'execute_callback' => [ $this->score_retriever, 'get_readability_scores' ],
×
199
                                ],
×
200
                        ),
×
201
                );
×
202
        }
203

204
        /**
205
         * Registers the inclusive language scores ability.
206
         *
207
         * @return void
208
         */
209
        private function register_inclusive_language_scores_ability(): void {
×
210
                \wp_register_ability(
×
211
                        Ability_Categories_Integration::CATEGORY_SLUG . '/get-inclusive-language-scores',
×
212
                        $this->get_shared_ability_args(
×
213
                                [
×
214
                                        'label'            => \__( 'Get Inclusive Language Scores', 'wordpress-seo' ),
×
215
                                        'description'      => \__( 'Get the inclusive language scores for the most recently modified posts.', 'wordpress-seo' ),
×
216
                                        'output_schema'    => $this->wrap_in_array_schema( $this->get_score_output_schema() ),
×
217
                                        'execute_callback' => [ $this->score_retriever, 'get_inclusive_language_scores' ],
×
218
                                ],
×
219
                        ),
×
220
                );
×
221
        }
222

223
        /**
224
         * Registers the get post SEO data ability.
225
         *
226
         * @return void
227
         */
228
        private function register_get_post_seo_data_ability(): void {
2✔
229
                \wp_register_ability(
2✔
230
                        Ability_Categories_Integration::CATEGORY_SLUG . '/get-post-seo-data',
2✔
231
                        $this->get_shared_ability_args(
2✔
232
                                [
2✔
233
                                        'label'               => \__( 'Get Post SEO Data', 'wordpress-seo' ),
2✔
234
                                        'description'         => \__( 'Get the SEO data for a post. Identify the post by post_id, by permalink (URL), or by title keywords; the title may be a comma-separated list and returns the SEO data for every post matching any of the values, paginated most recently modified first (use the page parameter to reach older matches). At least one identifier is required.', 'wordpress-seo' ),
2✔
235
                                        'input_schema'        => $this->get_post_identifier_input_schema(),
2✔
236
                                        'output_schema'       => $this->wrap_in_array_schema( $this->get_post_seo_data_output_schema() ),
2✔
237
                                        'execute_callback'    => [ $this->post_seo_data_collector, 'get_post_seo_data' ],
2✔
238
                                ],
2✔
239
                        ),
2✔
240
                );
2✔
241
        }
242

243
        /**
244
         * Registers the update post SEO data ability.
245
         *
246
         * @return void
247
         */
248
        private function register_update_post_seo_data_ability(): void {
6✔
249
                \wp_register_ability(
6✔
250
                        Ability_Categories_Integration::CATEGORY_SLUG . '/update-post-seo-data',
6✔
251
                        $this->get_shared_ability_args(
6✔
252
                                [
6✔
253
                                        'label'               => \__( 'Update Post SEO Data', 'wordpress-seo' ),
6✔
254
                                        'description'         => \__( 'Update the SEO data for a single post. Identify the post by post_id or by permalink (URL). Only the fields you provide are changed; a provided empty value clears that field.', 'wordpress-seo' ),
6✔
255
                                        'input_schema'        => $this->get_update_post_seo_data_input_schema(),
6✔
256
                                        'output_schema'       => $this->get_post_seo_data_output_schema(),
6✔
257
                                        'execute_callback'    => [ $this->post_seo_data_updater, 'update_post_seo_data' ],
6✔
258
                                        'meta'                => [
6✔
259
                                                'show_in_rest' => true,
6✔
260
                                                'annotations'  => [
6✔
261
                                                        'readonly'    => false,
6✔
262
                                                        'destructive' => false,
6✔
263
                                                        'idempotent'  => true,
6✔
264
                                                ],
6✔
265
                                                'mcp'          => [
6✔
266
                                                        'public' => true,
6✔
267
                                                ],
6✔
268
                                        ],
6✔
269
                                ],
6✔
270
                        ),
6✔
271
                );
6✔
272
        }
273

274
        // phpcs:disable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint -- Too complicated of a param declaration for this case.
275

276
        /**
277
         * Returns the shared ability arguments merged with ability-specific arguments.
278
         *
279
         * @param array<string, mixed> $ability_specific_args The ability-specific arguments.
280
         *
281
         * @return array<string, mixed> The merged ability arguments.
282
         */
283
        private function get_shared_ability_args( array $ability_specific_args ): array {
×
284
        // phpcs:enable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint
285
                return \array_merge(
×
286
                        [
×
287
                                'category'            => Ability_Categories_Integration::CATEGORY_SLUG,
×
288
                                'input_schema'        => [
×
NEW
289
                                        'type'                 => 'object',
×
NEW
290
                                        'additionalProperties' => false,
×
NEW
291
                                        'properties'           => [
×
292
                                                'number_of_posts' => [
×
293
                                                        'type'        => 'integer',
×
294
                                                        'description' => \__( 'The number of recently modified posts to retrieve scores for. Defaults to 10.', 'wordpress-seo' ),
×
295
                                                        'minimum'     => 1,
×
296
                                                        'maximum'     => 100,
×
297
                                                        'default'     => 10,
×
298
                                                ],
×
299
                                        ],
×
300
                                ],
×
NEW
301
                                'permission_callback' => [ $this, 'can_manage_seo' ],
×
302
                                'meta'                => [
×
303
                                        'show_in_rest' => true,
×
304
                                        'annotations'  => [
×
305
                                                'readonly'    => true,
×
306
                                                'destructive' => false,
×
307
                                                'idempotent'  => true,
×
308
                                        ],
×
309
                                        'mcp'          => [
×
310
                                                'public' => true,
×
311
                                        ],
×
312
                                ],
×
313
                        ],
×
314
                        $ability_specific_args,
×
315
                );
×
316
        }
317

318
        /**
319
         * Wraps an item schema in an array schema.
320
         *
321
         * @param array<string, array<string, string>> $item_schema The item schema.
322
         *
323
         * @return array<string, array<string, string>> The array schema.
324
         */
325
        private function wrap_in_array_schema( array $item_schema ): array {
×
326
                return [
×
327
                        'type'  => 'array',
×
328
                        'items' => $item_schema,
×
329
                ];
×
330
        }
331

332
        /**
333
         * Returns the score output schema, including the title property.
334
         *
335
         * @return array<string, array<string, string>> The score output schema.
336
         */
337
        private function get_score_output_schema(): array {
×
338
                return [
×
339
                        'type'       => 'object',
×
340
                        'properties' => [
×
341
                                'title' => [
×
342
                                        'type'        => 'string',
×
343
                                        'description' => \__( 'The post title.', 'wordpress-seo' ),
×
344
                                ],
×
345
                                'score' => [
×
346
                                        'type'        => 'string',
×
347
                                        'enum'        => [ 'na', 'bad', 'ok', 'good' ],
×
348
                                        'description' => \__( 'The score slug.', 'wordpress-seo' ),
×
349
                                ],
×
350
                                'label' => [
×
351
                                        'type'        => 'string',
×
352
                                        'description' => \__( 'A human-readable label for the score.', 'wordpress-seo' ),
×
353
                                ],
×
354
                        ],
×
355
                ];
×
356
        }
357

358
        // phpcs:disable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint -- The JSON schema arrays are heterogeneous by nature.
359

360
        /**
361
         * Returns the input schema for identifying a post (read path).
362
         *
363
         * @return array<string, mixed> The input schema.
364
         */
NEW
365
        private function get_post_identifier_input_schema(): array {
×
NEW
366
                return [
×
NEW
367
                        'type'                 => 'object',
×
NEW
368
                        'additionalProperties' => false,
×
NEW
369
                        'properties'           => [
×
NEW
370
                                'post_id'   => [
×
NEW
371
                                        'type'        => 'integer',
×
NEW
372
                                        'description' => \__( 'The ID of the post to retrieve.', 'wordpress-seo' ),
×
NEW
373
                                        'minimum'     => 1,
×
NEW
374
                                ],
×
NEW
375
                                'permalink' => [
×
NEW
376
                                        'type'        => 'string',
×
NEW
377
                                        'description' => \__( 'The permalink (URL) of the post to retrieve.', 'wordpress-seo' ),
×
NEW
378
                                ],
×
NEW
379
                                'title'     => [
×
NEW
380
                                        'type'        => 'string',
×
NEW
381
                                        'description' => \__( 'Keywords to search for in post titles. Provide a comma-separated list to search for several titles at once; each value is matched as a whole phrase against the post title, and a post matching any value is returned. At most 10 phrases are used per request; any beyond the first 10 are ignored. Results are paginated to 10 entities per page; see the page parameter.', 'wordpress-seo' ),
×
NEW
382
                                ],
×
NEW
383
                                'page'      => [
×
NEW
384
                                        'type'        => 'integer',
×
NEW
385
                                        'description' => \__( 'The page of title-search results to return, 1-based and defaulting to 1. Matches are ordered most recently modified first, so request a later page to reach older matches. An empty result means there are no further pages. Only applies to a title search.', 'wordpress-seo' ),
×
NEW
386
                                        'minimum'     => 1,
×
NEW
387
                                        'default'     => 1,
×
NEW
388
                                ],
×
NEW
389
                        ],
×
NEW
390
                ];
×
391
        }
392

393
        /**
394
         * Returns the input schema for updating a post's SEO data (write path).
395
         *
396
         * @return array<string, mixed> The input schema.
397
         */
398
        private function get_update_post_seo_data_input_schema(): array {
2✔
399
                $nullable_string = [ 'type' => [ 'string', 'null' ] ];
2✔
400

401
                return [
2✔
402
                        'type'                 => 'object',
2✔
403
                        'additionalProperties' => false,
2✔
404
                        'properties'           => [
2✔
405
                                'post_id'                => [
2✔
406
                                        'type'        => 'integer',
2✔
407
                                        'description' => \__( 'The ID of the post to update.', 'wordpress-seo' ),
2✔
408
                                        'minimum'     => 1,
2✔
409
                                ],
2✔
410
                                'permalink'              => [
2✔
411
                                        'type'        => 'string',
2✔
412
                                        'description' => \__( 'The permalink (URL) of the post to update.', 'wordpress-seo' ),
2✔
413
                                ],
2✔
414
                                'seo_title'              => $nullable_string,
2✔
415
                                'meta_description'       => $nullable_string,
2✔
416
                                'focus_keyphrase'        => \array_merge( $nullable_string, [ 'maxLength' => 191 ] ),
2✔
417
                                'canonical'              => $nullable_string,
2✔
418
                                'is_cornerstone'         => [ 'type' => 'boolean' ],
2✔
419
                                'noindex'                => [
2✔
420
                                        'type'        => [ 'boolean', 'null' ],
2✔
421
                                        'description' => \__( 'Whether search engines should be told not to index this post. true sets noindex (the post is excluded from search results); false forces the post to be indexed; null clears the setting and falls back to the post-type default.', 'wordpress-seo' ),
2✔
422
                                ],
2✔
423
                                'nofollow'               => [ 'type' => 'boolean' ],
2✔
424
                                'noimageindex'           => [ 'type' => 'boolean' ],
2✔
425
                                'noarchive'              => [ 'type' => 'boolean' ],
2✔
426
                                'nosnippet'              => [ 'type' => 'boolean' ],
2✔
427
                                'open_graph_title'       => $nullable_string,
2✔
428
                                'open_graph_description' => $nullable_string,
2✔
429
                                'twitter_title'          => $nullable_string,
2✔
430
                                'twitter_description'    => $nullable_string,
2✔
431
                                'schema_page_type'       => $this->nullable_enum_schema(
2✔
432
                                        \array_keys( Schema_Types::PAGE_TYPES ),
2✔
433
                                        \__( 'The Schema.org page type for the post. Must be one of the supported page types. Use null to clear it and fall back to the default.', 'wordpress-seo' ),
2✔
434
                                ),
2✔
435
                                'schema_article_type'    => $this->nullable_enum_schema(
2✔
436
                                        $this->get_schema_article_types(),
2✔
437
                                        \__( 'The Schema.org article type for the post. Must be one of the supported article types. Use null to clear it and fall back to the default.', 'wordpress-seo' ),
2✔
438
                                ),
2✔
439
                        ],
2✔
440
                ];
2✔
441
        }
442

443
        /**
444
         * Returns the allowed Schema.org article type values.
445
         *
446
         * Mirrors the validation in WPSEO_Option_Titles so the ability accepts exactly the
447
         * article types the editor does, including any registered through the filter.
448
         *
449
         * @return array<int, string> The allowed article type values.
450
         */
NEW
451
        private function get_schema_article_types(): array {
×
452
                /**
453
                 * Filter: 'wpseo_schema_article_types' - Allow developers to filter the available article types.
454
                 *
455
                 * Make sure when you filter this to also filter `wpseo_schema_article_types_labels`.
456
                 *
457
                 * @param array $schema_article_types The available schema article types.
458
                 */
NEW
459
                return \array_keys( \apply_filters( 'wpseo_schema_article_types', Schema_Types::ARTICLE_TYPES ) );
×
460
        }
461

462
        /**
463
         * Returns a nullable-string input schema constrained to a fixed set of allowed values.
464
         *
465
         * Null and the empty string are always allowed on top of the enum so the field can be
466
         * cleared, matching the patch-clear semantics of the other write fields.
467
         *
468
         * @param array<int, string> $allowed_values The allowed string values.
469
         * @param string             $description    The field description.
470
         *
471
         * @return array<string, mixed> The input schema fragment.
472
         */
NEW
473
        private function nullable_enum_schema( array $allowed_values, string $description ): array {
×
NEW
474
                return [
×
NEW
475
                        'type'        => [ 'string', 'null' ],
×
NEW
476
                        'description' => $description,
×
NEW
477
                        'enum'        => \array_merge( $allowed_values, [ '', null ] ),
×
NEW
478
                ];
×
479
        }
480

481
        /**
482
         * Returns the output schema describing a post's SEO data.
483
         *
484
         * @return array<string, mixed> The output schema.
485
         */
486
        private function get_post_seo_data_output_schema(): array {
2✔
487
                $nullable_string = [
2✔
488
                        'type' => [ 'string', 'null' ],
2✔
489
                ];
2✔
490
                $score           = static function ( $analysis ) {
2✔
491
                        return [
2✔
492
                                'type'        => 'string',
2✔
493
                                'enum'        => [ 'na', 'bad', 'ok', 'good' ],
2✔
494
                                'description' => \sprintf(
2✔
495
                                        /* translators: %s expands to the name of the analysis, e.g. "SEO analysis". */
496
                                        \__( 'The result of the %s that ran on the post when it was last saved.', 'wordpress-seo' ),
2✔
497
                                        $analysis,
2✔
498
                                ),
2✔
499
                        ];
2✔
500
                };
2✔
501

502
                // The rendered companion of a field carries the value as actually output on the front end: the global default template applied where no custom value is set, with replacement variables expanded.
503
                $rendered = static function ( $field ) {
2✔
504
                        return [
2✔
505
                                'type'        => [ 'string', 'null' ],
2✔
506
                                'description' => \sprintf(
2✔
507
                                        /* translators: %s expands to the name of the SEO field, e.g. "SEO title". */
508
                                        \__( 'The %s as output on the front end: the global default template applied when no custom value is set, with replacement variables expanded. Null when nothing is output.', 'wordpress-seo' ),
2✔
509
                                        $field,
2✔
510
                                ),
2✔
511
                        ];
2✔
512
                };
2✔
513

514
                return [
2✔
515
                        'type'       => 'object',
2✔
516
                        'properties' => [
2✔
517
                                'post_id'                         => [ 'type' => 'integer' ],
2✔
518
                                'post_title'                      => $nullable_string,
2✔
519
                                'permalink'                       => $nullable_string,
2✔
520
                                'post_type'                       => [ 'type' => 'string' ],
2✔
521
                                'post_status'                     => $nullable_string,
2✔
522
                                'seo_title'                       => $nullable_string,
2✔
523
                                'seo_title_rendered'              => $rendered( \__( 'SEO title', 'wordpress-seo' ) ),
2✔
524
                                'meta_description'                => $nullable_string,
2✔
525
                                'meta_description_rendered'       => $rendered( \__( 'meta description', 'wordpress-seo' ) ),
2✔
526
                                'focus_keyphrase'                 => $nullable_string,
2✔
527
                                'canonical'                       => $nullable_string,
2✔
528
                                'canonical_rendered'              => $rendered( \__( 'canonical URL', 'wordpress-seo' ) ),
2✔
529
                                'is_cornerstone'                  => [ 'type' => 'boolean' ],
2✔
530
                                'noindex'                         => [
2✔
531
                                        'type'        => [ 'boolean', 'null' ],
2✔
532
                                        'description' => \__( 'Whether search engines are told not to index this post. true means noindex (the post is excluded from search results); false means the post is forced to be indexed; null means no setting is stored and the post-type default applies.', 'wordpress-seo' ),
2✔
533
                                ],
2✔
534
                                'nofollow'                        => [ 'type' => 'boolean' ],
2✔
535
                                'noimageindex'                    => [ 'type' => 'boolean' ],
2✔
536
                                'noarchive'                       => [ 'type' => 'boolean' ],
2✔
537
                                'nosnippet'                       => [ 'type' => 'boolean' ],
2✔
538
                                'open_graph_title'                => $nullable_string,
2✔
539
                                'open_graph_title_rendered'       => $rendered( \__( 'Open Graph title', 'wordpress-seo' ) ),
2✔
540
                                'open_graph_description'          => $nullable_string,
2✔
541
                                'open_graph_description_rendered' => $rendered( \__( 'Open Graph description', 'wordpress-seo' ) ),
2✔
542
                                'twitter_title'                   => $nullable_string,
2✔
543
                                'twitter_title_rendered'          => $rendered( \__( 'Twitter title', 'wordpress-seo' ) ),
2✔
544
                                'twitter_description'             => $nullable_string,
2✔
545
                                'twitter_description_rendered'    => $rendered( \__( 'Twitter description', 'wordpress-seo' ) ),
2✔
546
                                'schema_page_type'                => $nullable_string,
2✔
547
                                'schema_article_type'             => $nullable_string,
2✔
548
                                'seo_score'                       => $score( \__( 'SEO analysis', 'wordpress-seo' ) ),
2✔
549
                                'readability_score'               => $score( \__( 'readability analysis', 'wordpress-seo' ) ),
2✔
550
                                'inclusive_language_score'        => $score( \__( 'inclusive language analysis', 'wordpress-seo' ) ),
2✔
551
                        ],
2✔
552
                ];
2✔
553
        }
554

555
        // phpcs:enable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint
556
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc