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

Use the Person piece only for publishers. #20827

Conversation

pls78
Copy link
Member

@pls78 pls78 commented Nov 6, 2023

Context

  • The Person schema piece is wrongly generated on authors archive pages ( so when indexable type = 'user') and the site was previously setup to represent a Person different than the author. We want to avoid this.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where an additional Organization, Person schema piece would be wrongly generated for author pages when a website representing an organization was set to represent a person different than the author.

Relevant technical choices:

  • The is_needed method of the Person schema piece generator has been updated to not take into account the case in which indexable_type = 'user'. This is because this piece, being of type Organization, Person is meant to represent the website publisher in case the website represents a person. Giving the fact we create a 'user' indexable only for authors, the case is covered by the Author schema piece generator.

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 - reproduce the bug

  • Make sure you have at least two authors in your website
  • Go to Yoast SEO -> General First-time configuration tab
  • Perform the SEO optimization in step 1
  • In step 2 Site representation choose the website to represent a person and choose an author
  • Specify the website name and select a picture for the author
  • Finish the first-time configuration
  • Edit the Site representation step and change the website to represent an organization
  • Set both the organization name and the organization logo, then save the changes
  • Now visit an author archive page for an author different than the one you have previously selected to be represented by the webpage
    • Verify that you still have a schema piece of type Organization, Person representing the previously selected author

With this PR

  • Again, visit an author archive page for an author different than the one you have previously selected to be represented by the webpage
    • Verify that the schema piece of type Organization, Person representing the previously selected author is not generated anymore

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 (Block/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:

  • Please perform a regression test on schema generation

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.

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

This schema piece is also wrongly output on authors archive pages
( so when indexable type = 'user') and the site was previously setup
to represent a Person different than the author.
the Author schema piece will take care of representing authors.
@pls78 pls78 added the changelog: bugfix Needs to be included in the 'Bugfixes' category in the changelog label Nov 6, 2023
@pls78 pls78 marked this pull request as ready for review November 6, 2023 15:09
Copy link
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome works great! CR + ACC 👍

@thijsoo thijsoo added this to the 21.7 milestone Nov 8, 2023
@thijsoo thijsoo merged commit 3ffcdba into trunk Nov 8, 2023
21 checks passed
@thijsoo thijsoo deleted the mixed-schema-output-when-both-company-and-person-information-is-stored-in-database branch November 8, 2023 09:16
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.

Mixed schema output when both Company and Person information is stored in database
2 participants