-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude links and email addresses from prominent words analysis #19137
Conversation
…http(s), ftp, or www For example 'yoast.com' - this can be used as a word, not necessarily a link, like "There was so much traffic on yoast.com today"
…el domain This was added as a fix to WP editor converting & to &
…C-865-exclude-links-from-prominent-words
…m:Yoast/wordpress-seo into PC-865-exclude-links-from-prominent-words
…C-865-exclude-links-from-prominent-words
CR done ✅ Specifically, sections
Section
|
…clude-links-from-prominent-words
I tested Test prominent words for insights in Shopify. It works as expected 🎉 In order to test this PR checkout to the latest working commit: |
Findings when testing Japanese in Shopify, some good and some not so good:
The results are also somewhat inconsistent, so it would be better to test at least in another environment. |
After testing the issue on Shopify one more time and testing the behaviour in the released version too, there seems to be only one problem left, which is specific to this branch. Namely, that when a URL with formatting is added and then removed, the additional +1 character remains in the character count. While in the released version, removing the URL decreases the character count back to what it was before the URL was added. Otherwise, both in this branch and in the released version:
|
CR of the new commits: ✅ (confirmed |
I fixed the issue with formatted URLs adding an extra character. And I also couldn't replicate the issue where adding |
…clude-links-from-prominent-words
Acceptance test:
Everything works as expected 👍🏽 |
Context
yoast.com
) since those can be used as words (e.g. "Let's publish this article on yoast.com").Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
countCharacters.js
helper for Japanese is moved to a separate file, since it can be re-used to exclude URLs from the prominent words analysis.https://www.example.com/foo/?bar=baz&inga=42&quux
) and so that it doesn't match domain names (e.g.yoast.com
) While domain names can be used as URLs, it might be more common to use them as proper nouns in a sentence, for exampleWe got so much traffic on yoast.com after the latest release
)countCharacters.js
helper. Also a technical debt issue was created to try fixing this more upstream (i.e. inside thestripHTMLTags
helper.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
You will need the following texts for testing:
Prominent words testing text 1
Prominent words testing text 2
Prominent words testing text 3
Test in WordPress
Note that the behaviour of the internal links suggestions is inconsistent, both in the current released versions (19.11 Free and 19.5 Premium) and on this branch (same for trunk). If a certain post/page/CPT doesn’t appear as a suggested link, rerun the SEO optimization and confirm that it appears afterwards. (To do that go to Tools/Yoast Test/Reset Indexables & migrations and then click on the
Run SEO Optimization
button.) Taxonomies appear ONLY after rerunning SEO optimization. You need to create the term only by entering a title, and then add text when you open the text editor.Activate Yoast SEO Free and Premium (for acceptance tester: make sure to link to the Free branch when building Premium)
Test prominent words for insights
Not prominent words
do not show up in the list of prominent wordsProminent words
do show up in the list of prominent wordsTest internal linking
Test prominent words created when clicking the SEO data optimization button
Test Japanese character count
Test whether adding URLs doesn't increase the character count
Testing the text length assessment
section of the PR that excluded URLs from Japanese character count (regression testing)ぜらス床ぜらスhttps://example.comぜらス床ぜらス
). The Japanese characters should be included in the character count, while the URL shouldn't.https://www.example.com/foo/?bar=baz&inga=42&quux
yoast.com
to your text and make sure that the character count increases by 9 characters.Test whether adding spaces and HTML tags doesn't increase the character count
Confirm that the character count shown by the Text length assessment does not increase in any of the following cases:
<i>
or<span>
tags.Test upgrade routine
Test in Shopify
Test prominent words for insights
YOAST_INSIGHTS_ACTIVE=1
in your.env.local
fileNot prominent words
do not show up in the list of prominent wordsProminent words
do show up in the list of prominent wordsTest Japanese character count
Test whether adding URLs doesn't increase the character count
ぜらス床ぜらスhttps://example.comぜらス床ぜらス
). The Japanese characters should be included in the character count, while the URL shouldn't.https://www.example.com/foo/?bar=baz&inga=42&quux
yoast.com
to your text and make sure that the character count increases by 9 characters.Test whether adding spaces and HTML tags doesn't increase the character count
Confirm that the character count shown by the Text length assessment does not increase in any of the following cases:
<i>
or<span>
tags.Relevant test scenarios
Test the
Test prominent words for insight
,Test internal linking
andTest Japanese character count
steps in all post types and in the Block, Classic, Gutenberg, and Elementor editors. TheTest prominent words created when clicking the SEO data optimization button
andTest upgrade routine
parts only need to be tested in one content type and editor.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:
under each subheading, if there are any).
should be applicable for texts with at least 400 characters)
should be applicable for texts with at least 200 characters)
should be applicable for texts with at least 200 characters)
Testing of these functionalities was not added to the test instructions because the helper is used in the exact same way for all those functionalities. And if counting characters works correctly in the Text length assessment (which looks at the whole text), it is also assumed counting characters works when counting the length of (parts of) the text in other assessments. But a quick smoke test to make sure that this functionality still works as expected might be a good safety check.
UI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Fixes https://yoast.atlassian.net/browse/PC-865, https://yoast.atlassian.net/browse/PRODUCT-851