Conversation
After fixing one warning
mhkuu
reviewed
Apr 8, 2025
mhkuu
approved these changes
Apr 11, 2025
Contributor
mhkuu
left a comment
There was a problem hiding this comment.
CR: Nice work, especially like your function on retrieving feedback tests! 🎉
I've taken the opportunity to do a slight refactoring to remove duplicate code and work with constants instead of strings. I've also improved the JSDoc a bit while I was at it 😸
ACC: Works as advertised! 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
packages/yoastseo/src/scoring/assessments/readability/KeyphraseLengthAssessment.jsTest instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
WordPress
Post in English (a language with function word support)
Keyphrase length: No focus keyphrase was set for this page. Set a focus keyphrase in order to calculate your SEO score.Keyphrase length: Good job!cat food for indoor catscat food for sterilized indoor catsKeyphrase length: The keyphrase contains 5 content words. That's more than the recommended maximum of 4 content words. Make it shorter!grain-free cat food for sterilized indoor cats with kidney problemsKeyphrase length: The keyphrase contains 9 content words. That's way more than the recommended maximum of 4 content words. Make it shorter!Post in Catalan (a language without function word support)
gatKeyphrase length: Good job!menjar per a gats d'interiormenjar per a gats per a gats d'interior esterilitzatsKeyphrase length: The keyphrase contains 9 words. That's more than the recommended maximum of 6 words. Make it shorter!menjar per a gats per a gats d'interior esterilitzats amb problemes renalsKeyphrase length: The keyphrase contains 12 words. That's way more than the recommended maximum of 6 words. Make it shorter!Post in Japanese (a language that counts keyphrase length in characters)
Note for acceptance tester: It is possible that the strings get translated to Japanese during the RC period. In that case, the Japanese feedback strings will appear instead of English ones.
猫キーフレーズの長さ) returns a green traffic light with the following feedback:キーフレーズの長さ: いいですね !室内猫用のキャットフード室内猫用サーモンキャットフードKeyphrase length: The keyphrase contains 15 character. That's more than the recommended maximum of 12 character. Make it shorter!charactersinstead ofcharacter.消毒済みの室内飼い猫用のキャットフードKeyphrase length: The keyphrase contains 19 character. That's way more than the recommended maximum of 12 character. Make it shorter!charactersinstead ofcharacter.Product page in English
catKeyphrase length: The keyphrase contains 1 content word. That's way less than the recommended minimum of 4 content words. Make it longer!dry cat foodKeyphrase length: The keyphrase contains 3 content words. That's less than the recommended minimum of 4 content words. Make it longer!cat food for indoor catsKeyphrase length: Good job!grain-free cat food for sterilized indoor catsKeyphrase length: The keyphrase contains 7 content words. That's more than the recommended maximum of 6 content words. Make it shorter!grain-free cat food for sterilized indoor cats with kidney problemsKeyphrase length: The keyphrase contains 9 content words. That's way more than the recommended maximum of 6 content words. Make it shorter!Product page in Catalan
gatKeyphrase length: The keyphrase contains 1 word. That's way less than the recommended minimum of 4 words. Make it longer!aliments sense cerealsKeyphrase length: The keyphrase contains 3 words. That's less than the recommended minimum of 4 words. Make it longer!menjar per a gats d'interiorLongitud de la frase clau: bona feina!menjar per a gats per a gats d'interior esterilitzatsKeyphrase length: The keyphrase contains 9 words. That's more than the recommended maximum of 6 words. Make it shorter!menjar per a gats per a gats d'interior esterilitzats amb problemes renalsKeyphrase length: The keyphrase contains 12 words. That's way more than the recommended maximum of 6 words. Make it shorter!Product page in Japanese
Note for acceptance tester: It is possible that the strings get translated to Japanese during the RC period. In that case, the Japanese feedback strings will appear instead of English ones.
猫Keyphrase length: The keyphrase contains 1 character. That's way less than the recommended minimum of 8 character. Make it shorter!charactersinstead ofcharacter.健康的な猫の餌charactersinstead ofcharacter.室内猫用のキャットフードキーフレーズの長さ) returns a green traffic light with the following feedback:キーフレーズの長さ: いいですね !室内猫用サーモンキャットフードKeyphrase length: The keyphrase contains 15 character. That's more than the recommended maximum of 12 character. Make it shorter!charactersinstead ofcharacter.消毒済みの室内飼い猫用のキャットフードKeyphrase length: The keyphrase contains 19 character. That's way more than the recommended maximum of 12 character. Make it shorter!charactersinstead ofcharacter.Shopify
Relevant test scenarios
Test instructions for QA when the code is in the RC
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:
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes https://github.com/Yoast/lingo-other-tasks/issues/487