| @@ -291,12 +291,23 @@ | ||
| 291 | 291 | // provided. `!== null`, not `!empty()`: 0 is a legitimate score and |
| 292 | 292 | // empty() discarded it, so a post the editor scored as 0 kept |
| 293 | 293 | // whatever the calculator had produced instead (#394). Both params |
| 294 | 294 | // already default to null above, so null means "not sent". |
| 295 | - if (null !== $readability_score) { | |
| 295 | + // | |
| 296 | + // Only when the editor actually measured something, though. Inside a | |
| 297 | + // page builder there is no editor content to read, so Refresh sent an | |
| 298 | + // empty `live_content` along with the two labels derived from that | |
| 299 | + // empty string — the literal words "No content" — and they were | |
| 300 | + // applied over the correct server-side analysis this request had just | |
| 301 | + // run, then persisted by save_score(). That is what put "No content" | |
| 302 | + // on the dashboard for a page with a valid score (#778). With nothing | |
| 303 | + // measured, the analysis above is the better answer. | |
| 304 | + $editor_measured = '' !== trim((string) $live_content); | |
| 305 | + | |
| 306 | + if ($editor_measured && null !== $readability_score) { | |
| 296 | 307 | $score_data['readability_score'] = $readability_score; |
| 297 | 308 | } |
| 298 | - if (null !== $content_quality) { | |
| 309 | + if ($editor_measured && null !== $content_quality) { | |
| 299 | 310 | $score_data['content_quality'] = $content_quality; |
| 300 | 311 | } |
| 301 | 312 | |
| 302 | 313 | // Save score if requested |