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

Don't overwrite user settings when the respective features are disabled #21314

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

leonidasmi
Copy link
Contributor

@leonidasmi leonidasmi commented Apr 12, 2024

Context

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where the yoast user settings would be wiped out after a user profile update, when the respective global settings were disabled.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

The user settings that we're interested in, along with their relations with global settings, are:

  • The Title to use for Author page and the Meta description to use for Author page fields - dependent on the Enable author archives global setting
  • The Do not allow search engines to show this author's archives in search results checkbox - dependent on the Enable author archives global feature setting
  • The Disable SEO analysis checkbox - dependent on the SEO analysis global feature setting is enabled
  • The Disable readability analysis checkbox - dependent on the Readability analysis global feature setting
  • The Disable inclusive language analysis checkbox - dependent on the Inclusive language analysis global feature setting

According to the above, for every setting the test is

  1. Go to a user's profile, while the Yoast SEO global feature settings are enabled.
  2. Fill the Title to use for Author page with something (or any of the other user settings, mentioned above)
  3. Go to Yoast SEO->Settings->Author archives and disable the Enable author archives (or any of the other respective global feature settings, mentioned above)
  4. Refresh the user's profile and save it again (for a totally unrelated thing, like for example enabling the Show Toolbar when viewing site setting )
  5. Go to Yoast SEO->Settings->Author archives and re-enable the Enable author archives setting
  6. Refresh the user's profile

With this PR/RC:

  • the Title to use for Author page setting has its original value persisted

Before this PR/RC:

  • the Title to use for Author page setting has no value

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.

Impact check

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

  • For wpseo_title (Title to use for Author page):
    • Confirm that every time we save a user profile, in the indexable for that user, we expect the value in the title field to be the one we have in the user profile, no matter if the respective global setting is enabled or not.
  • For wpseo_metadesc (Meta description to use for Author page):
    • Confirm that every time we save a user profile, in the indexable for that user, we expect the value in the description field to be the one we have in the user profile, no matter if the respective global setting is enabled or not.
  • For wpseo_noindex_author (Do not allow search engines to show this author's archives in search results):
    • Confirm that every time we save a user profile, in the indexable for that user, we expect the value in the is_robots_noindex field to be the one we have in the user profile, no matter if the respective global setting is enabled or not.
  • For wpseo_content_analysis_disable (Disable SEO analysis):
    • The readability tab in the post editor is shown or not, according to whether the Disable SEO analysis checkbox has been checked or not. Try while toggling the global SEO analysis feature as well.
  • For wpseo_inclusive_language_analysis_disable (Disable inclusive language analysis):
    • The inclusive language tab in the post editor is shown or not, according to whether the Disable inclusive language analysis checkbox has been checked or not. Try while toggling the global inclusive language feature as well.
  • For wpseo_keyword_analysis_disable (Disable readability analysis):
    • The readability tab in the post editor is shown or not, according to whether the Disable readability analysis checkbox has been checked or not. Try while toggling the global readability analysis feature as well.

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 #21313

@leonidasmi leonidasmi added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label Apr 12, 2024
@coveralls
Copy link

coveralls commented Apr 12, 2024

Pull Request Test Coverage Report for Build 22f0b06c03fbfc5918abcf49c9ba3ae591d48660

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 52.211%

Totals Coverage Status
Change from base Build 199aec6cb137c3bbf3fc1f0fa86edc98de12b256: 0.001%
Covered Lines: 28517
Relevant Lines: 55181

💛 - Coveralls

Base automatically changed from feature/21044-stop-empty-usermeta to trunk April 12, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Author settings can be wiped out if global features are toggled
2 participants