Skip to content

Always show readability assessments#22156

Merged
mhkuu merged 8 commits intotrunkfrom
remove-applicability-from-readability-assessments
Apr 1, 2025
Merged

Always show readability assessments#22156
mhkuu merged 8 commits intotrunkfrom
remove-applicability-from-readability-assessments

Conversation

@agnieszkaszuba
Copy link
Copy Markdown
Contributor

@agnieszkaszuba agnieszkaszuba commented Mar 31, 2025

Context

  • We want to show readability assessments even if there is little or no text.

Summary

This PR can be summarized in the following changelog entry:

  • Changes the applicability criteria of readability assessments so that they are shown even if there is little or no text.
  • [shopify-seo] Changes the applicability criteria of readability assessments so that they are shown even if there is little or no text.
  • [yoastseo] Removes applicability criteria from readability assessments that are related to a minimum text length.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Posts in WordPress

  • Activate Yoast SEO and Yoast SEO Premium
  • Create a new post without any content
Subheading distribution assessment
  • Confirm that the subheading distribution assessment returns a green traffic light with the following feedback: Subheading distribution: You are not using any subheadings, but your text is short enough and probably doesn't need them.
  • Add some text so that the post contains a bit under 300 words. Confirm that the feedback stays the same.
  • Add a subheading and confirm that the feedback changes to: Subheading distribution: Great job!
  • Remove the subheading and add more text so that the post contains more than 300 words. Confirm that the traffic light turns red and the feedback changes to: Subheading distribution: You are not using any subheadings, although your text is rather long. Try and add some subheadings.
  • Add a subheading to the text in such a way that both the text preceding the subheading, and the one following it, is less than 300 words.
  • Confirm that the traffic light turns green and the feedback changes to: Subheading distribution: Great job!
  • Add more text before the subheading so that the section before the subheading is between 300 and 350 words.
  • Confirm that the traffic light turns orange and the feedback changes to: Subheading distribution: The beginning of your text is longer than 300 words and is not separated by any subheadings. Add subheadings to improve readability.
  • Remove all text from the post.
Paragraph length assessment
  • Confirm that the paragraph length assessment returns a green traffic light and the following feedback: Paragraph length: There are no paragraphs that are too long. Great job!
  • Add a paragraph that's longer than 200 words.
  • Confirm that the paragraph length assessment returns a red traffic light and the following feedback: Paragraph length: 1 of the paragraphs contain more than the recommended maximum of X words. Shorten your paragraphs!
  • Split the paragraph so that no paragraphs are longer than 150 words.
  • Confirm that the paragraph length assessment returns a green traffic light and the following feedback: Paragraph length: There are no paragraphs that are too long. Great job!
  • Remove all text from the post.

Sentence length assessment

  • Confirm that the sentence length assessment returns a green traffic light and the following feedback: Sentence length: great!
  • Add the following sentence: "We express this by sponsoring events and organizations, by contributing to, for instance, WordPress, and by making SEO accessible for every person and every budget."
  • Confirm that the traffic light turns red and the assessment shows the following feedback: Sentence length: 100% of the sentences contain more than 20 words, which is more than the recommended maximum of 25%. Try to shorten the sentences.
  • Remove all text from the post.
Passive voice assessment
  • Confirm that the passive voice assessment returns a green traffic light with the following feedback: Passive voice: You're using enough active voice. That's great!
  • Add the following sentence: "The mouse is eaten by the cat."
  • Confirm that the traffic light turns red and the assessment shows the following feedback: Passive voice: 100% of the sentences contain passive voice, which is more than the recommended maximum of 10%. Try to use their active counterparts.
  • Remove all text from the post.
Transition words assessment
  • Confirm that the transition words assessment returns a green traffic light with the following feedback: Transition words: You are not using any transition words, but your text is short enough and probably doesn't need them.
  • Add the word "however" to the text.
  • Confirm that the feedback changes to: Transition words: Well done!
  • Remove the word and a lorem ipsum text longer than 200 words.
  • Confirm that the traffic light turns red and the assessment shows the following feedback: Transition words: None of the sentences contain transition words. Use some.
  • Remove all text and add the first 4 paragraphs from this blog post
  • Confirm that the traffic light turns green and the assessment shows the following feedback: Transition words: Well done!
  • Remove all text from the post.
Consecutive sentences assessment
  • Confirm that the consecutive sentences assessment returns a green traffic light with the following feedback: Consecutive sentences: There is enough variety in your sentences. That's great!
  • Add the following sentences to the text: "Cats are beautiful. Cats are adorable. Cats are the best animals."
  • Confirm that the traffic light turns red and the assessment shows the following feedback: Consecutive sentences: The text contains 3 consecutive sentences starting with the same word. Try to mix things up!
  • Remove all text from the post.
Word complexity assessment
  • Confirm that the word complexity assessment returns a green traffic light with the following feedback: Word complexity: You are not using too many complex words, which makes your text easy to read. Good job!
  • Add the word acknowledgment to the post and confirm that the traffic light turns orange with the following feedback: Word complexity: 100% of the words in your text are considered complex. Try to use shorter and more familiar words to improve readability.
  • Remove all text from the post.
Alignment assessment (only in the block editor)
  • Make sure your post consists of the word 'acknowledgment'
  • Make the text centre aligned
  • Confirm that the alignment assessment does not show up
  • Add the following text after 'acknowledgment': "Knowing how to write good content helps you get more visitors"
  • Confirm that the alignment assessment show up with a red traffic light and the following feedback: Alignment: There is a long section of center-aligned text. We recommend making it left-aligned.
Transition words assessment in Japanese

Note for QA: the English feedback strings might be already translated to Japanese at the time of RC testing.

  • Switch your site language to Japanese.
  • Open/create a post with no content.
  • Confirm that the transition words assessment returns a green traffic light and the following feedback: Transition words: You are not using any transition words, but your text is short enough and probably doesn't need them.
  • Add the word ならば to the text.
  • Confirm that the feedback changes to: 転換語: いいですね !
  • Remove the word ならば and add the following text:
Japanese text with less than 400 characters 性ぎンれ戦藤メツイリ際48臓空ハネヤト賞無スばぜ全沸38門まじ駄望お支初離スワ姫児ム健葉うも済研ヌ場投シロス台来チヱスモ聞末ヒ潟国重せ版竹ねレばむ。民ろめ小63他ソカヘツ家理ごせた田掲おとりぶ更約みっ易出料セルメツ察元クぞ込朝びえむ画69繰シツウ全多ニヤヱチ両図ご大業どじスは拒用入べすや計勢せだ。 禁ぞれきゅ市代を批子ツユク遺増キミリ成美キヨ園質きべ治朝エマケ予法オウミ年当イト周前ソミヘ鳥併ゃ更8巨も頭稿原電響相とこか。98辞クケア国下使コ想反よごーり市画朝ヘ急在づリ反判クぞ家際都あ予見ユリチシ新試科ぎぽ。族せそ属倉ア手書てぼふ月務ミ株刊イ投向ざやフク聞気外就ずリそぞ恋告けラ例梨るま両図月6年モラ引抗近クひイだ米東ついぜわ短近モカ毎堪ぞそびう。
  • Confirm that the feedback changes to Transition words: You are not using any transition words, but your text is short enough and probably doesn't need them.
  • Copy and paste the text again, so that the text doubles in size.
  • Confirm that the assessment returns a red traffic light with the following feedback: 転換語: 文に転換語がありません。いくつか使用してください。
Subheading distribution assessment in Japanese
  • Keep the text from the previous steps in the editor.
  • Confirm that the subheading distribution assessment shows a red traffic light and the following feedback: 小見出し分布: テキストが比較的長いにも関わらず小見出しが使われていません。小見出しをいくつか追加してください。
  • Add a subheading somewhere in the middle of the text.
  • Confirm that the traffic light turns green and the feedback changes to: 小見出し分布: よくできています。

Product pages in WordPress

  • Switch your site language back to English
  • Activate Yoast SEO WooCommerce
  • Create a product page with no content
List assessment
  • Confirm that the list assessment shows a red traffic light with the following feedback: Lists: No lists appear on this page. Add at least one ordered or unordered list!
  • Add a list and confirm the traffic light turns green with the following feedback: Lists: There is at least one list on this page. Great!
  • Remove the list.
Subheading distribution
  • Confirm that the subheading distribution assessment returns a green traffic light with the following feedback: Subheading distribution: You are not using any subheadings, but your text is short enough and probably doesn't need them.

Shopify

  • Create a product with no content
  • Repeat the test instructions for WordPress for the following assessments:
    • Subheading distribution assessment
    • Sentence length assessment
    • Passive voice assessment
    • Transition words assessment
    • Word complexity assessment
    • List assessment
    • Transition words assessment in Japanese
    • Subheading distribution assessment in Japanese
Paragraph length assessment
  • Confirm that the paragraph length assessment returns a green traffic light and the following feedback: Paragraph length: There are no paragraphs that are too long. Great job!
  • Add a paragraph that's a bit over 100 words.
  • Confirm that the paragraph length assessment returns a red traffic light and the following feedback: Paragraph length: 1 of the paragraphs contains more than the recommended maximum number of words (70). Shorten your paragraphs!
  • Split the paragraph so that no paragraphs are longer than 70 words.
  • Confirm that the paragraph length assessment returns a green traffic light and the following feedback: Paragraph length: There are no paragraphs that are too long. Great job!

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

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

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

  • No impact outside of what's covered in the test instructions.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

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.

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.

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 https://github.com/Yoast/lingo-other-tasks/issues/543

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 31, 2025

Pull Request Test Coverage Report for Build 1000938e9894c7574da3e31239fa99de562a51b4

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 8 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 54.83%

Files with Coverage Reduction New Missed Lines %
packages/yoastseo/src/scoring/assessors/contentAssessor.js 4 82.19%
Totals Coverage Status
Change from base Build 17b5e5668cddb7f4d9014f667801941761aaedf3: -0.02%
Covered Lines: 29974
Relevant Lines: 55211

💛 - Coveralls

@agnieszkaszuba agnieszkaszuba added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Mar 31, 2025
@agnieszkaszuba agnieszkaszuba added the Shopify This PR impacts Shopify. label Mar 31, 2025
Copy link
Copy Markdown
Contributor

@mhkuu mhkuu left a comment

Choose a reason for hiding this comment

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

Really well done! 🎉 Just a few minor observations to correct.

Comment thread packages/yoastseo/src/scoring/assessments/SCORING READABILITY.md Outdated
@mhkuu
Copy link
Copy Markdown
Contributor

mhkuu commented Apr 1, 2025

ACC: Checked everything with English in WordPress for regular posts and products, works like a charm! 🎉
Once there are further instructions I will do a quick check with Japanese and Shopify but I don't expect any issues there.

@agnieszkaszuba agnieszkaszuba marked this pull request as ready for review April 1, 2025 08:51
@mhkuu mhkuu added this to the 24.9 milestone Apr 1, 2025
@mhkuu
Copy link
Copy Markdown
Contributor

mhkuu commented Apr 1, 2025

Also checked on Shopify, works! 🎉 Merging! :octocat:

@mhkuu mhkuu merged commit b8adbff into trunk Apr 1, 2025
29 checks passed
@mhkuu mhkuu deleted the remove-applicability-from-readability-assessments branch April 1, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog Shopify This PR impacts Shopify.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants