Skip to content

1123 make limited yoast sidebar elements available to more user roles#23103

Merged
leonidasmi merged 10 commits intotrunkfrom
1123-make-limited-yoast-sidebar-elements-available-to-more-user-roles
May 4, 2026
Merged

1123 make limited yoast sidebar elements available to more user roles#23103
leonidasmi merged 10 commits intotrunkfrom
1123-make-limited-yoast-sidebar-elements-available-to-more-user-roles

Conversation

@thijsoo
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo commented Mar 26, 2026

Context

  • We want to show links to more user roles.

Summary

This PR can be summarized in the following changelog entry:

  • Makes the Academy, Upgrade and Brand insights links visible to more user roles.

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:

  • Create an account with the following user roles:
    • SEO Editor
    • Editor
    • Author
    • Contributor
    • Subscriber
  • Without this PR make sure these roles don't see any upsells except editor they should see the AIBI button.
  • With this PR make sure they all see the 3 upsell buttons . EXCEPT subscriber they should still see nothing.
  • The menu items should be added in the sidebar as well as the admin bar.
    • Make sure that the Academy menu item is added in the admin bar for all relevant roles, admin included
  • For the new roles that can now access the Academy page, visit that page:
    • Confirm that you don't see the Helpscout beacon
    • Confirm that you don't see the schema aggregation modal but you can see the AIBI introduction modals.
    • Smoke test the page itself.

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 helpscout beacon, as we made it not appear for users without the wpseo_manage_options capability - quick smoke test needed

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. 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.
  • 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.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@thijsoo thijsoo added the changelog: other Needs to be included in the 'Other' category in the changelog label Mar 26, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 26, 2026

Coverage Report for CI Build 171

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage at 50.018% (no base build to compare)

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 17 uncovered changes across 4 files (5 of 22 lines covered, 22.73%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
inc/class-wpseo-admin-bar-menu.php 15 1 6.67%
src/integrations/admin/brand-insights-page.php 1 0 0.0%
src/integrations/admin/helpscout-beacon.php 1 0 0.0%
src/plans/user-interface/upgrade-sidebar-menu-integration.php 1 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39228
Covered Lines: 19621
Line Coverage: 50.02%
Coverage Strength: 4.03 hits per line

💛 - Coveralls

@leonidasmi
Copy link
Copy Markdown
Contributor

I haven't finished my CR/Acceptance test yet, but I want to raise an early flag for the decision of opening the Academy page to users that have no other access in Yoast pages, which can have its issues.

For example, if you're an Author and visit the Academy page (which this PR makes now possible), you can eventually be greeted with the Schema Aggregation Endpoint modal:
image

which leads you to a Yoast page that you have no access, thus getting a 403 page:
image

We can safeguard this particular case, but I believe it's gonna be a matter of time until we get similar issues, so I would urge to double think whether we want to open up only a subsection of pages to new user roles.

cc: @manuelaugustin

thijsoo and others added 3 commits April 2, 2026 13:25
…ore-user-roles' of github.com:Yoast/wordpress-seo into 1123-make-limited-yoast-sidebar-elements-available-to-more-user-roles
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR: 🚧 I left some feedback on how to safeguard introductions to roles that just not got access to them.

Also another concern I have regarding the requirements and how we implement them:
I see that in the topbar, we moved the Academy menu item from the submenu level to the main menu level, which I am not sure it was what we wanted, so I would double check with Product.

To make the above point more clear, this is what we show to an admin in production:
image

and this is what we show to an admin with this PR:
image

If that was needed in order to be able to show the Academy link to users that dont have access to the SEO settings menu, then I think we should at least make it so that what admin see is the same with this PR and without (unless it's not an issue for Product)

Comment thread src/introductions/user-interface/introductions-integration.php Outdated
thijsoo and others added 2 commits April 30, 2026 10:51
…-limited-yoast-sidebar-elements-available-to-more-user-roles
…-wide

Reverts the Introductions_Integration-level User_Can_Manage_Wpseo_Options_Conditional
gate and moves the capability check into the should_show() of each introduction
that links to a wpseo_manage_options-only destination. Addresses CR feedback that
the blanket gate would also hide intros which should remain visible to lower-cap
roles (e.g. Premium's AI_Optimize_Classic_Introduction).

Gated this turn:
- Schema_Aggregator_Announcement (CTA points at Settings, admin-only)
- AI_Brand_Insights_Free_Trial
- AI_Brand_Insights_Post_Launch

Black_Friday_Announcement and Delayed_Premium_Upsell are intentionally left
ungated as general promos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thijsoo
Copy link
Copy Markdown
Contributor Author

thijsoo commented May 1, 2026

If that was needed in order to be able to show the Academy link to users that dont have access to the SEO settings menu, then I think we should at least make it so that what admin see is the same with this PR and without (unless it's not an issue for Product)

The academy move was approved by product :)

leonidasmi added 2 commits May 4, 2026 12:59
…ore-user-roles' of github.com:Yoast/wordpress-seo into 1123-make-limited-yoast-sidebar-elements-available-to-more-user-roles
@leonidasmi leonidasmi added this to the 27.7 milestone May 4, 2026
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR + Acceptance is ✅

@leonidasmi leonidasmi merged commit 4ca456d into trunk May 4, 2026
29 checks passed
@leonidasmi leonidasmi deleted the 1123-make-limited-yoast-sidebar-elements-available-to-more-user-roles branch May 4, 2026 13:33
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants