| @@ -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 | |