wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Move generic site data into self contained objects.

Open thijsoo opened this issue 1 year ago • 1 comments

Context

  • We want to refactor our script data and put all site information in one place.

Summary

This PR can be summarized in the following changelog entry:

  • Refactors site information script data.

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:

  • Without this PR open a post and category. Add the following to your console and mark down the result:
wpseoScriptData.dismissedAlerts
wpseoScriptData.currentPromotions
wpseoScriptData.webinarIntroBlockEditorUrl
wpseoScriptData.blackFridayBlockEditorUrl
wpseoScriptData.linkParams
wpseoScriptData.pluginUrl
wpseoScriptData.wistiaEmbedPermission

wpseoScriptData.metabox.site_name
wpseoScriptData.metabox.contentLocale
wpseoScriptData.metabox.userLocale
wpseoScriptData.metabox.isRtl
wpseoScriptData.metabox.isPremium
wpseoScriptData.metabox.siteIconUrl
wpseoScriptData.metabox.search_url
wpseoScriptData.metabox.post_edit_url
wpseoScriptData.metabox.base_url

Only

 wpseoScriptData.metabox.search_url
wpseoScriptData.metabox.post_edit_url
wpseoScriptData.metabox.base_url

Should be different between posts and terms.

  • With the PR do this again and make sure the results are the same.

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

  • [X] 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:

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

  • [X] I have tested this code to the best of my abilities.
  • [ ] During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • [X] 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

  • [X] 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 #

thijsoo avatar May 06 '24 13:05 thijsoo

Pull Request Test Coverage Report for Build c14d9cacb5591800e88e09c1ae4db325be0d9b75

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

  • 85 of 131 (64.89%) changed or added relevant lines in 6 files are covered.
  • 1008 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 50.425%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/editors/framework/site/term-site-information.php 34 35 97.14%
src/editors/framework/site/post-site-information.php 47 49 95.92%
src/editors/application/site/website-information-repository.php 0 7 0.0%
admin/metabox/class-metabox.php 0 11 0.0%
src/editors/framework/site/base-site-information.php 0 25 0.0%
<!-- Total: 85 131
Files with Coverage Reduction New Missed Lines %
src/generated/container.php 1008 0.16%
<!-- Total: 1008
Totals Coverage Status
Change from base Build 5596f6efc499e2e6f3a0eb6beba30bfbcb912a83: 0.004%
Covered Lines: 16077
Relevant Lines: 31883

💛 - Coveralls

coveralls avatar May 07 '24 10:05 coveralls