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 | inc/class-wpseo-meta.php +16 -2 27.8 → trunk View file →
@@ -68,10 +68,8 @@
68 68 /**
69 69 * Meta box field definitions for the meta box form.
70 70 *
71 71 * {@internal
72 - * - Titles, help texts, description text and option labels are added via a translate_meta_boxes() method
73 - * in the relevant child classes (WPSEO_Metabox and WPSEO_Social_admin) as they are only needed there.
74 72 * - Beware: even though the meta keys are divided into subsets, they still have to be uniquely named!}}
75 73 *
76 74 * @var array
77 75 * Array format:
@@ -131,8 +129,16 @@
131 129 'inclusive_language_score' => [
132 130 'type' => 'hidden',
133 131 'default_value' => '0',
134 132 ],
133 + 'seo_title_score' => [
134 + 'type' => 'hidden',
135 + 'default_value' => '0',
136 + ],
137 + 'meta_description_score' => [
138 + 'type' => 'hidden',
139 + 'default_value' => '0',
140 + ],
135 141 'is_cornerstone' => [
136 142 'type' => 'hidden',
137 143 'default_value' => 'false',
138 144 ],
@@ -438,8 +444,16 @@
438 444 switch ( true ) {
439 445 case ( $meta_key === self::$meta_prefix . 'linkdex' ):
440 446 $int = WPSEO_Utils::validate_int( $meta_value );
441 447 if ( $int !== false && $int >= 0 ) {
448 + $clean = (string) $int; // Convert to string to make sure default check works.
449 + }
450 + break;
451 +
452 + case ( in_array( $meta_key, [ self::$meta_prefix . 'seo_title_score', self::$meta_prefix . 'meta_description_score' ], true ) ):
453 + // Per-field scores are 0-100 percentages; out-of-range input keeps the "never scored" default.
454 + $int = WPSEO_Utils::validate_int( $meta_value );
455 + if ( $int !== false && $int >= 0 && $int <= 100 ) {
442 456 $clean = (string) $int; // Convert to string to make sure default check works.
443 457 }
444 458 break;
445 459