Remove the AI Brand Insights modals from the Yoast SEO installation#23439
Remove the AI Brand Insights modals from the Yoast SEO installation#23439JorPV wants to merge 5 commits into
Conversation
…te introduction logic to prevent display on fresh sites.
There was a problem hiding this comment.
Pull request overview
This PR disables the “Discover Brand Insights now” post-install introduction modal in Yoast SEO to improve the first-run experience on fresh sites, and avoids UI competition with upcoming onboarding flows.
Changes:
- Disables the PHP introduction by making
AI_Brand_Insights_Post_Launch::should_show()always returnfalse(and marks related methods as@codeCoverageIgnore). - Unregisters the introduction’s JS modal component from the introductions component map.
- Removes the now-obsolete unit test for the post-launch introduction.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php |
Removes unit tests that are no longer applicable after disabling the introduction. |
src/introductions/application/ai-brand-insights-post-launch.php |
Permanently disables the post-launch introduction via should_show(): false and annotates methods for coverage exclusion. |
packages/js/src/introductions/initialize.js |
Removes the post-launch modal from the JS initialComponents map so it can’t be rendered client-side. |
| const initialComponents = { | ||
| "ai-brand-insights-free-trial": AiBrandInsightsFreeTrial, | ||
| "ai-brand-insights-post-launch": AiBrandInsightsPostLaunch, | ||
| "black-friday-announcement": BlackFridayAnnouncement, | ||
| "delayed-premium-upsell": DelayedPremiumUpsell, | ||
| "schema-aggregator-announcement": SchemaAggregatorAnnouncement, |
There was a problem hiding this comment.
Keeping it for consistency with the already-disabled ai-brand-insights-pre-launch.js, which is likewise left in place (unreferenced) while its introduction is off. Makes re-enabling trivial and keeps the two AIBI modals symmetric.
There was a problem hiding this comment.
Updated: we've now deleted the unused component files (post-launch, free-trial, and the already-disabled pre-launch) as you suggested. The PHP introduction classes are intentionally kept (should_show() => false) so their ids stay registered for the /introductions/{id}/seen route — removing a class, unlike the dead view files, could break a Premium version that interacts with the introductions system.
Disables the Premium "Your first brand analysis is free!" modal the same way as the post-launch modal, per the UX follow-up on the issue. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the now-unreferenced post-launch and free-trial modal component files (per PR review). The PHP introduction classes are kept (should_show() => false) so their ids stay registered in the collector and the introductions "seen" REST route keeps validating them — this avoids breaking any Premium version that interacts with the introductions system. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the already-disabled pre-launch modal component too, so no dead disabled-modal component files remain. Its PHP introduction class is kept (should_show() => false), matching the post-launch and free-trial handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Coverage Report for CI Build 0Warning No base build found for commit Coverage: 46.425%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
…ove-brand-insights-modal
Context
This disables the the "Discover Brand Insights now" modal.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
AI_Brand_Insights_Post_Launch::should_show()(Free) andAI_Brand_Insights_Free_Trial::should_show()(Premium) now returnfalse(methods marked@codeCoverageIgnore), mirroringAI_Brand_Insights_Pre_Launch.initialize.jscomponent map, their now-obsolete unit tests are removed, and the now-unused modal component files are deleted (including the already-disabledai-brand-insights-pre-launch, so no dead component files remain).should_show()→false), so their ids stay registered in the collector and the/introductions/{id}/seenREST route keeps validating them. This is deliberate: removing an introduction class would make that id invalid and could break a Premium version that interacts with the introductions system. No DI/constructor change, so no container recompile is needed.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Reset the introductions "seen" state so the modal can show. Reset via the database / WP-CLI (or use a brand-new admin user):
wp user meta delete <admin-login> _yoast_wpseo_introductionsDELETE FROM wp_usermeta WHERE meta_key = '_yoast_wpseo_introductions' AND user_id = <admin-id>;This affects two modals: "Discover Brand Insights now" (Free, no Premium subscription) and "Your first brand analysis is free!" (Premium). Test each on the matching setup.
First, on
trunk(before this change):Then, on this branch (with the fix):
grunt build:dev).Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand committed the results, if my PR introduces or edits images or SVGs.Innovation
Fixes #23431