Skip to content

Fix edge case where readability being 0 breaks the task list#23023

Merged
thijsoo merged 4 commits intofeature/task-list-phase-2from
1081-task-list-unreleased-bug-edge-case-when-readability-score-is-0-the-task-list-breaks
Feb 25, 2026
Merged

Fix edge case where readability being 0 breaks the task list#23023
thijsoo merged 4 commits intofeature/task-list-phase-2from
1081-task-list-unreleased-bug-edge-case-when-readability-score-is-0-the-task-list-breaks

Conversation

@leonidasmi
Copy link
Contributor

@leonidasmi leonidasmi commented Feb 24, 2026

Context

Summary

This PR can be summarized in the following changelog entry:

  • Fixes an edge case unreleased bug where having a post have a readability equal to 0 breaks the task list.

Relevant technical choices:

  • Not sure how a post can get a 0 readability score, but we have to treat it the same as we did in the dashboard widget.
  • In https://github.com/Yoast/wordpress-seo/pull/22947/changes, we did a refactoring that created the Abstract_Score_Groups_Repository class for both SEO and Readability score groups. It wrongly assumed that SEO and Readability score groups have identical logic
  • One difference between SEO and Readability score groups is that in the dashboard widget, when a post has a 0 SEO score, it is always classified as a not analyzed post. But when a post has a a 0 readability score, it might be classified as not analyzed OR as bad, depending on the estimated reading time

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Have a couple of posts modified the last 2 months
    • One with Good readability score
    • One with Ok readability score
    • One with Needs Improvement readability score
    • One that's created while Yoast was disabled - so it's Not analyzed in the relevant dashboard widget
  • Confirm that with this PR and without, the Improve the readability of your recent content: Posts task shows exactly the same tasks, with exactly the same priorities to each child task
  • Confirm that the number of child tasks in that task, match the number of not Not analyzed posts in the Readability scores dashboard widget.
    • More specifically, take a look at the analyzers inside each child tasks and confirm that the analysis result match what that Readability scores dashboard widget says.
    • For example, if there's only one child task that has the Needs Improvement analysis result, the Readability Scores dashboard widget should also say that there's one post that is classified as Needs Improvement.
  • Go to one of the analyzed tasks' indexable and edit it likeso: Make its readability_score column into 0.
    • To be extra sure, do the same change in the _yoast_wpseo_content_score column in the postmeta table for that post
  • Delete all transients and refresh the task list
  • Confirm that you no longer get a Fatal error (you would, without this PR)
  • Confirm that the post whose indexable you tweaked, is now shown with HIGH priority and if you open it, it says Needs improvement
  • Lastly, confirm that again the child tasks match to what the Readability scores dashboard widget says.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • [z] QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 24, 2026
@leonidasmi leonidasmi added this to the feature/task-list-phase-2 milestone Feb 24, 2026
@coveralls
Copy link

coveralls commented Feb 24, 2026

Pull Request Test Coverage Report for Build 04ba16691d2be39ed29aaedc39c35e9a4d3b878a

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-3.2%) to 53.247%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/task-list/infrastructure/indexables/recent-content-indexable-collector.php 0 5 0.0%
Totals Coverage Status
Change from base Build 8c08e42cc37b02d75d66d8edd429eb7c0454f677: -3.2%
Covered Lines: 33463
Relevant Lines: 62802

💛 - Coveralls

@leonidasmi leonidasmi marked this pull request as ready for review February 24, 2026 14:41
Copy link
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR + ACC 👍

@thijsoo thijsoo merged commit 678b511 into feature/task-list-phase-2 Feb 25, 2026
32 of 37 checks passed
@thijsoo thijsoo deleted the 1081-task-list-unreleased-bug-edge-case-when-readability-score-is-0-the-task-list-breaks branch February 25, 2026 10:59
@leonidasmi leonidasmi mentioned this pull request Mar 2, 2026
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants