| @@ -300,25 +300,14 @@ | ||
| 300 | 300 | // applied over the correct server-side analysis this request had just |
| 301 | 301 | // run, then persisted by save_score(). That is what put "No content" |
| 302 | 302 | // on the dashboard for a page with a valid score (#778). With nothing |
| 303 | 303 | // measured, the analysis above is the better answer. |
| 304 | - // | |
| 305 | - // Non-empty `live_content` is not on its own proof that the editor | |
| 306 | - // measured anything: builder markup (Divi 5) is markup the editor | |
| 307 | - // has plenty of and can read no words from, so it sent that same | |
| 308 | - // "No content" pair alongside 450 characters of block comments. | |
| 309 | - // Treat the sentinel itself as "nothing measured" whenever this | |
| 310 | - // request's own analysis did find words, so a stale bundle cannot | |
| 311 | - // overwrite a valid analysis either. | |
| 312 | 304 | $editor_measured = '' !== trim((string) $live_content); |
| 313 | - $server_found_content = ($content_data['word_count'] ?? 0) > 0; | |
| 314 | 305 | |
| 315 | - if ($editor_measured && null !== $readability_score | |
| 316 | - && !($server_found_content && self::is_no_content_label($readability_score))) { | |
| 306 | + if ($editor_measured && null !== $readability_score) { | |
| 317 | 307 | $score_data['readability_score'] = $readability_score; |
| 318 | 308 | } |
| 319 | - if ($editor_measured && null !== $content_quality | |
| 320 | - && !($server_found_content && self::is_no_content_label($content_quality))) { | |
| 309 | + if ($editor_measured && null !== $content_quality) { | |
| 321 | 310 | $score_data['content_quality'] = $content_quality; |
| 322 | 311 | } |
| 323 | 312 | |
| 324 | 313 | // Save score if requested |
| @@ -342,25 +331,8 @@ | ||
| 342 | 331 | 'Failed to calculate SEO score: ' . $e->getMessage(), |
| 343 | 332 | ['status' => 500] |
| 344 | 333 | ); |
| 345 | 334 | } |
| 346 | - } | |
| 347 | - | |
| 348 | - /** | |
| 349 | - * Whether an editor-supplied label means "I could not read the content". | |
| 350 | - * | |
| 351 | - * `calculateReadabilityScore()` and `calculateContentQuality()` both return | |
| 352 | - * this exact untranslated string when handed an empty body, so it is the | |
| 353 | - * editor saying it measured nothing rather than a measurement in its own | |
| 354 | - * right. Every real label carries a level or a grade. | |
| 355 | - * | |
| 356 | - * @since 2.12.0 | |
| 357 | - * | |
| 358 | - * @param mixed $label Label sent by the editor. | |
| 359 | - * @return bool True when the label is the empty-content sentinel. | |
| 360 | - */ | |
| 361 | - private static function is_no_content_label($label): bool { | |
| 362 | - return is_string($label) && 'no content' === strtolower(trim($label)); | |
| 363 | 335 | } |
| 364 | 336 | |
| 365 | 337 | /** |
| 366 | 338 | * Get existing SEO score for a post |