enhancement(admin): strip transient query args via removable_query_args filter - #23499
Open
faisalahammad wants to merge 1 commit into
Open
enhancement(admin): strip transient query args via removable_query_args filter#23499faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
faisalahammad
added a commit
to faisalahammad/wordpress-seo
that referenced
this pull request
Jul 25, 2026
- Use Monkey\Filters\expectAdded for the removable_query_args filter registration test, matching add_filter() in the source. - Remove test_filter_integration: Brain\Monkey does not actually register the callback under apply_filters, so the test could not observe real filter behaviour. CI fix for Yoast#23499.
faisalahammad
added a commit
to faisalahammad/wordpress-seo
that referenced
this pull request
Jul 26, 2026
…estamp The existing matcher captured \time() at mock setup, then compared against a fresh \time() at source run. Cross-second boundaries produced 'expected 1, called 0' failures on CI. The hook name string is the meaningful contract; the exact timestamp can drift by a second with no behavioural impact. Refs Yoast#23499
faisalahammad
force-pushed
the
23498-removable-query-args
branch
from
July 26, 2026 01:30
f7ba860 to
893ef2d
Compare
…gs filter
Registers `redirected_from_site_kit`, `wpseo_tracked_action`,
`wpseo_tracking_nonce`, `start-myyoast-connection`, `_wpnonce`, `install`,
and `from_tools` with the WordPress core `removable_query_args` filter so
they get stripped from admin URLs after first load.
- New `Removable_Query_Args_Integration` under `src/integrations/admin/`
implementing the existing `Integration_Interface`. Gated on
`Admin_Conditional`, registered as a filter callback, merges Yoast args
onto the existing list.
- Args exposed via a `public static get_removable_query_args()` so future
code can reference a single source of truth.
- Auto-wired into the Symfony DI container via the existing integration
tag (no new DI config needed).
- The existing JS strip at
`packages/js/src/integrations-page/myyoast-connection/myyoast-integration.js:421`
is kept as defensive belt-and-suspenders.
- Flaky-test fix in `Activation_Cleanup_Integration_Test`: matcher uses
`Mockery::type('int')` instead of capturing `\time()` at mock setup.
Cross-second boundaries caused CI failures on PHP 8.0.
- Flaky-test fix in `Introductions_Integration_Test`: same `\time()`
cross-second-boundary pattern replaced with `Mockery::on()` for the
`seen_on` timestamp value.
Fixes Yoast#23498
faisalahammad
force-pushed
the
23498-removable-query-args
branch
from
July 26, 2026 01:57
893ef2d to
664e44b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Yoast SEO sets 7 URL query args across 5 admin flows. They persisted in the address bar across reloads, embedded in shared links, and re-triggered side effects. WordPress core ships the
removable_query_argsfilter for exactly this (wp_admin_canonical_url()strips registered args after first request), but Yoast never registered against it. Closes #23498.Summary
This PR can be summarized in the following changelog entry:
redirected_from_site_kit,wpseo_tracked_action,wpseo_tracking_nonce,start-myyoast-connection,_wpnonce,install, andfrom_toolswith the WordPress coreremovable_query_argsfilter so they get stripped from admin URLs after first load.Relevant technical choices:
Removable_Query_Args_Integrationundersrc/integrations/admin/implements the existingIntegration_Interface. Gated onAdmin_Conditional, registered as a filter callback onremovable_query_args, merges Yoast args onto the existing list (does not replace core args).public static get_removable_query_args()so future code can reference a single source of truth.packages/js/src/integrations-page/myyoast-connection/myyoast-integration.js:421is kept untouched as defensive belt-and-suspenders.src/andpackages/js/src/for each offrom_tools,redirected_from_site_kit,wpseo_tracked_action,wpseo_tracking_nonce,start-myyoast-connection,_wpnonce,install.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
docs/workflows/test-23498-removable-query-args.md(from_tools,start-myyoast-connection+_wpnonce,install, plus the dashboard/tracking args).Relevant test scenarios
Reasoning for checked items: the change is admin-only, observable in the browser address bar; cleared cache + dev console sufficient to verify.
Test instructions for QA when the code is in the RC
This PR is user-facing (admin URL behaviour). QA can test this PR by following these steps:
install=truecaveat: refreshing mid-flow will now lose the dialog, which matches the issue author's stated product call.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
Reasoning: per-page testing steps added under
docs/workflows/test-23498-removable-query-args.md.Quality assurance
grunt build:imagesand committed the results, if my PR introduces or edits images or SVGs.Reasoning on unchecked: no image/SVG touched in this PR. Integration partner plugins (Site Kit for
redirected_from_site_kit, MyYoast premium forstart-myyoast-connection) were not installed in the local smoke environment; manual browser verification covered the 5 free-plugin-triggerable args.Fixes #23498