Skip to content

Add Yoast tab to Plugins screen using WP 7.0 filters#23101

Merged
thijsoo merged 3 commits intotrunkfrom
1128-yoast-plugins-tab
Mar 30, 2026
Merged

Add Yoast tab to Plugins screen using WP 7.0 filters#23101
thijsoo merged 3 commits intotrunkfrom
1128-yoast-plugins-tab

Conversation

@enricobattocchi
Copy link
Copy Markdown
Member

@enricobattocchi enricobattocchi commented Mar 26, 2026

Context

WordPress 7.0 adds a plugins_list_status_text filter (core #60495) that allows plugins to register custom tabs on the Plugins screen. Combined with the existing plugins_list filter, this enables grouping plugins under a custom tab with a proper label. A dedicated "Yoast" tab on the Plugins screen groups all Yoast plugins in one view, making it easier for site admins to check versions, manage activation, and get an overview of their Yoast suite.

Summary

This PR can be summarized in the following changelog entry:

  • Adds a "Yoast" tab to the WordPress Plugins screen that groups all installed Yoast plugins when two or more are present. Requires WordPress 7.0+.

Relevant technical choices:

  • Yoast plugins are detected dynamically by checking for "Team Yoast" in the plugin's AuthorName header, rather than hardcoding a list of slugs. This is future-proof and covers all Yoast plugins (free, premium, addons, Duplicate Post, ACF Analysis, Test Helper, etc.).
  • Follows onion architecture under src/yoast-plugins-tab/ with domain, application, and user-interface layers.
  • The version guard compares against 7.0-alpha0 (not 7.0) to support pre-release versions (beta, RC).
  • The tab only appears when 2+ Yoast plugins are installed — a single plugin doesn't need its own tab.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Install WordPress 7.0 (beta6 or later).
  • Install Yoast SEO Free plus at least one other Yoast plugin (e.g., Yoast Duplicate Post, Yoast SEO Premium).
  • Navigate to the Plugins screen (wp-admin/plugins.php).
  • Verify that a "Yoast" tab appears alongside the standard tabs (All, Active, Inactive, etc.).
  • Click the "Yoast" tab and verify it lists only the installed Yoast plugins.
  • Delete all other Yoast plugins so only Yoast SEO Free remains and verify the "Yoast" tab disappears.

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:

  • The WordPress Plugins admin screen only. No other admin pages or front-end behavior is affected.

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.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on 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.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.

Fixes https://github.com/Yoast/reserved-tasks/issues/1128

enricobattocchi and others added 2 commits March 26, 2026 11:45
Registers `plugins_list` and `plugins_list_status_text` filters to group
all Yoast-authored plugins under a dedicated "Yoast" tab on the WordPress
Plugins admin screen. Plugins are detected dynamically by checking for
"Team Yoast" in the AuthorName header. The tab only appears when 2+
Yoast plugins are installed and requires WP 7.0+.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Compare against 7.0-alpha0 instead of 7.0 so that beta and RC
releases also pass the version guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@enricobattocchi enricobattocchi added the changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog label Mar 26, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 26, 2026

Pull Request Test Coverage Report for Build 1e8db9f9c41eeb8ef2fb677084083cb037b9c919

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

  • 29 of 33 (87.88%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 52.889%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/plugins-tab/application/plugins-list-handler.php 15 17 88.24%
src/plugins-tab/user-interface/plugins-tab-integration.php 10 12 83.33%
Totals Coverage Status
Change from base Build fd50e4f5fcaadc210eba1fae17a91707767b5835: -0.6%
Covered Lines: 33645
Relevant Lines: 63744

💛 - Coveralls

Copy link
Copy Markdown
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.

Some suggestions and an overal comment is that I think you should get rid of the Yoast_ prefix on all the classes+tests and I also think you can get rid of it in the folder structure and namespace since its a bit redundant since we are in the context of our codebase and this is not an external API just a couple of filters.

*
* @return array<string, array<string, array<string, string>>> The filtered plugins list.
*/
public function filter_plugins_list( array $plugins ): array {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to get rid of the type hints here since this is fed by a filter.

*
* @return string The status text.
*/
public function get_status_text( string $text, int $count, string $type ): string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to get rid of the type hints here since this is fed by a filter.

Address PR review feedback:
- Rename src/yoast-plugins-tab/ to src/plugins-tab/ and drop the
  Yoast_ prefix from all class names and namespaces since it is
  redundant within the Yoast codebase context.
- Remove parameter type hints from filter_plugins_list() and
  get_status_text() since they are called by WordPress filters
  which may pass unexpected types.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@enricobattocchi
Copy link
Copy Markdown
Member Author

Some suggestions and an overal comment is that I think you should get rid of the Yoast_ prefix on all the classes+tests and I also think you can get rid of it in the folder structure and namespace since its a bit redundant since we are in the context of our codebase and this is not an external API just a couple of filters.

makes total sense, on it

Copy link
Copy Markdown
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.

CR + ACC

@thijsoo thijsoo added this to the 27.4 milestone Mar 30, 2026
@thijsoo thijsoo merged commit 52f0c33 into trunk Mar 30, 2026
28 checks passed
@thijsoo thijsoo deleted the 1128-yoast-plugins-tab branch March 30, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants