Skip to content
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

Extract the feedback strings for the non-Free assessments out of the assessments #21567

Open
wants to merge 27 commits into
base: trunk
Choose a base branch
from

Conversation

FAMarfuaty
Copy link
Contributor

@FAMarfuaty FAMarfuaty commented Aug 27, 2024

Context

  • Previously in this PR Update toolings and dependencies in yoastseo package, we exposed all non-Free code in the yoastseo module which was subsequently exposed and bundled in the Free plugin. As a result, all the translation strings that are part of the non-free code (e.g. Premium assessments) are also bundled in the Free plugin.
  • This PR is to make sure that those translation strings that are not meant for for the Free plugin, are not bundled and uploaded to translate.wordpress.org.

Summary

This PR can be summarized in the following changelog entry:

  • Removes translation strings that are not meant for the Yoast SEO Free version from the plugin.
  • [yoastseo] Removes the product assessment registration from product assessors. These assessments must now be registered via the worker worker.registerAssessment().
  • [yoastseo] Outputs the feedback strings of the following assessments as a non-translation string by default: image alt tags, keyphrase distribution, title, product SKU, product identifier, word complexity, lists, and text alignment assessments. The default feedback strings can be overridden through the assessment config callbacks.getResultTexts, for example with text in the form of translation strings.

Relevant technical choices:

  • The createAnchorOpeningTag inside the assessment is now called after the default and custom configs are merged. This is to make sure that custom urlTitle and urlCallToAction are always turned into an anchor opening tag.
  • The default feedback strings for the following assessments are also slightly changed so that they don't contain variables other than the anchor opening tag of the urlTitle and urlCallToAction:
    • word complexity
    • image alt tags
    • text alignment
  • More background on the approach taken can be found in this doc.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Checking translation strings

  • Build the plugin
  • In your IDE, go to js/dist/externals/analysis.js
  • Confirm that there are no translation strings inside the following assessments:
    • image alt tags, keyphrase distribution, title, product SKU, product identifier, word complexity, lists, and text alignment assessments.

Test premium assessments

⚠️ The purpose of this test scenario is to make sure that for the following assessments, we still get the same feedback strings for all criteria and the correct URLs that include tracking parameters (e.g. PHP version, WordPress version, etc.)

Keyphrase distribution
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Title
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Word complexity
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Text alignment
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))

Test product assessments in WooCommerce

  • ⚠️ The purpose of this test scenario is to make sure that for the following assessments:

    • we still get the same feedback strings for all criteria and the correct URLs that include tracking parameters (e.g. PHP version, WordPress version, etc.)
    • the edit button for product SKU and product identifier assessments are still working
  • Test together with this accompanying PR: https://github.com/Yoast/wpseo-woocommerce/pull/1014

  • Install and activate Yoast SEO, Yoast SEO Premium, WooCommerce Yoast SEO

Lists
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Image alt tags
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Product SKU
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
  • When the traffic light is not green, confirm that you can see the edit button next to the assessment feedback
  • Click on the edit button and confirm that this takes you to the Yoast metabox to fill in the product identifiers
Product identifier
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
  • When the traffic light is not green, confirm that you can see the edit button next to the assessment feedback
  • Click on the edit button and confirm that this takes you to the Yoast metabox to fill in the product identifiers

Test product assessments and premium assessments in Shopify

Keyphrase distribution
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA
Word complexity
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA
Lists
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA
Image alt tags
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA, including the parameters (it SHOULD include tracking parameters (e.g. PHP version, WordPress version, etc.))
Product SKU
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA
  • When the traffic light is not green, confirm that you DON'T see the edit button next to the assessment feedback
Barcode
  • Use this table as a guide and hit all assessment criteria
  • Confirm that you get the same feedback strings for each criterion
  • Confirm that you get the correct URL when hovering over the assessment's title and assessment's CTA
  • When the traffic light is not green, confirm that you DON'T see the edit button next to the assessment feedback

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 further impact other than what's covered in the testing instruction above.

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/417

@FAMarfuaty FAMarfuaty added the changelog: other Needs to be included in the 'Other' category in the changelog label Sep 4, 2024
@FAMarfuaty FAMarfuaty force-pushed the experiment/do-not-expose-non-free-code branch from c68d40e to 2645991 Compare September 5, 2024 08:00
@coveralls
Copy link

coveralls commented Sep 5, 2024

Pull Request Test Coverage Report for Build f0a09f8136ed2d4601ffbc45541a50c42c3b2592

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 83 of 83 (100.0%) changed or added relevant lines in 9 files are covered.
  • 4355 unchanged lines in 156 files lost coverage.
  • Overall coverage decreased (-5.1%) to 49.506%

Files with Coverage Reduction New Missed Lines %
admin/class-option-tabs-formatter.php 1 0.0%
packages/js/src/components/BlackFridayPromotion.js 1 0.0%
packages/js/src/elementor/components/fills/ElementorFill.js 1 0.0%
packages/yoastseo/src/scoring/assessments/seo/KeyphraseLengthAssessment.js 1 97.37%
packages/yoastseo/src/scoring/assessments/seo/ProductIdentifiersAssessment.js 1 96.34%
packages/yoastseo/src/scoring/assessments/seo/ProductSKUAssessment.js 1 95.12%
src/actions/configuration/first-time-configuration-action.php 1 91.84%
src/builders/indexable-home-page-builder.php 1 98.0%
src/builders/indexable-term-builder.php 1 99.15%
src/context/meta-tags-context.php 1 28.29%
Totals Coverage Status
Change from base Build 01bca0368771ccfb116d95ae462a97ce1a56810f: -5.1%
Covered Lines: 25754
Relevant Lines: 53685

💛 - Coveralls

@FAMarfuaty FAMarfuaty marked this pull request as ready for review September 5, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: other Needs to be included in the 'Other' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants