Skip to content

Improve performance with disabled author-archives#22676

Merged
leonidasmi merged 3 commits intotrunkfrom
patch-1
Oct 30, 2025
Merged

Improve performance with disabled author-archives#22676
leonidasmi merged 3 commits intotrunkfrom
patch-1

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Oct 28, 2025

Context

  • In the case that author archives are disabled, the potentially-expensive author_has_public_posts_wp call can be skipped.

Summary

This PR can be summarized in the following changelog entry:

  • Improves performance when author archives are disabled and an author is created. Props to ErikBrendel.

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:

Mostly regression tests:

  • In a fresh site, make sure that the Show author archives without posts in search results setting in Author archives settings is disabled
  • Create an author while Yoast SEO is enabled
  • Try to find an indexable for that author (search for the indexable that has object_id equal to the user ID and object_type equal to user
    • Confirm there's none
  • Assign a post to that user and then re-search for an indexable for that author
    • Now you find one
  • Repeat the test but now make sure that the Show author archives without posts in search results setting is enabled before creating an author
    • This time an indexable will be created even before we assign a post to that author
  • Repeat the test but now make sure that the Enable author archives setting is disabled before creating an author
    • This time an indexable will never be created for that author even after we assign a post to them

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:

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

ErikBrendel and others added 3 commits July 7, 2025 09:51
In the case that author archives are disabled, skip the potentially-expesive author_has_public_posts_wp call
@vraja-pro vraja-pro added the changelog: other Needs to be included in the 'Other' category in the changelog label Oct 28, 2025
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 77a6270c9c6e19ce7505679e1f5e68515364f5a3

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 52.806%

Totals Coverage Status
Change from base Build fee34544afae64016963b87f2c3fda56176fa29f: -0.5%
Covered Lines: 31497
Relevant Lines: 59816

💛 - Coveralls

@leonidasmi leonidasmi added this to the 26.4 milestone Oct 30, 2025
@leonidasmi leonidasmi merged commit 0fe26b9 into trunk Oct 30, 2025
31 checks passed
@leonidasmi leonidasmi deleted the patch-1 branch October 30, 2025 13:21
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 community-patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants