Skip to content

[Personal-WP] Fix ?plugin= URL parameter not installing plugins#3218

Merged
akirk merged 1 commit intotrunkfrom
fix/personal-wp-plugin-url-param
Jan 29, 2026
Merged

[Personal-WP] Fix ?plugin= URL parameter not installing plugins#3218
akirk merged 1 commit intotrunkfrom
fix/personal-wp-plugin-url-param

Conversation

@akirk
Copy link
Copy Markdown
Member

@akirk akirk commented Jan 29, 2026

Motivation for the change, related issues

When visiting a Personal WordPress site with ?plugin=abc, the plugin was not being installed. The URL parameter would simply disappear without the plugin being added to the site. Similarly, ?url= for setting the landing page was not working.

Supported URL Parameters for Existing Sites

The following URL parameters can be used to modify an existing Personal WordPress site:

Parameter Description Example
plugin Install plugin(s) from wordpress.org ?plugin=woocommerce&plugin=jetpack
theme Install and activate a theme from wordpress.org ?theme=flavor
url Set the landing page after blueprint executes ?url=/wp-admin/plugins.php
blueprint-url Apply a full blueprint from a URL ?blueprint-url=https://...
import-site Import a site from a ZIP file URL ?import-site=https://...
import-wxr Import content from a WXR file URL ?import-wxr=https://...

Not supported for existing sites: gutenberg-pr, gutenberg-branch, core-pr (these are meant for fresh temporary installs)

Implementation details

Issue 1: Plugins property lost during merge

In boot-site-client.ts where URL blueprints are merged into the boot blueprint, the merge only preserved steps and landingPage, but ignored the plugins shorthand property.

Issue 2: Query overrides not applied for existing sites

The applyQueryOverrides function (which handles ?url=, ?language=, etc.) was not being called in resolveUrlParamsForExistingSite.

Changes:

  • Pass through plugins property in boot-site-client.ts merge (when present)
  • Call applyQueryOverrides in resolveUrlParamsForExistingSite to handle query parameters
  • Remove gutenberg-pr, gutenberg-branch, core-pr from actionable params for existing sites
  • Add unit tests for resolveUrlParamsForExistingSite

Testing Instructions (or ideally a Blueprint)

  1. Open Personal WordPress Playground with an existing site
  2. Test plugin installation: Navigate to ?plugin=friends
    • Verify the plugin is installed
  3. Test theme installation: Navigate to ?theme=flavor
    • Verify the theme is installed and activated
  4. Test landing page: Navigate to ?plugin=friends&url=/wp-admin/options-general.php
    • Verify you land on the General Settings page after the plugin installs
  5. Run unit tests: npx nx test playground-personal-wp --testFile=index.spec.ts

@akirk akirk force-pushed the fix/personal-wp-plugin-url-param branch 2 times, most recently from 39f6894 to 8f6d4cb Compare January 29, 2026 14:17
@akirk akirk force-pushed the fix/personal-wp-plugin-url-param branch from 8f6d4cb to 3d39c44 Compare January 29, 2026 14:22
The plugins shorthand property from URL blueprints was being lost
during the merge in bootSiteClient. The merge only preserved steps
and landingPage, ignoring the plugins array.

Also, query overrides like ?url= (landing page) were not being applied
when resolving blueprints for existing sites.

Changes:
- Pass through plugins property in boot-site-client.ts merge
- Call applyQueryOverrides in resolveUrlParamsForExistingSite to handle
  ?url=, ?login=, ?language=, etc. parameters
- Remove gutenberg-pr, gutenberg-branch, core-pr from actionable params
  (these are for fresh installs, not existing sites)
- Add unit tests for resolveUrlParamsForExistingSite
@akirk akirk force-pushed the fix/personal-wp-plugin-url-param branch from 3d39c44 to 0ad97ed Compare January 29, 2026 14:45
@akirk akirk merged commit 215a44e into trunk Jan 29, 2026
35 checks passed
@akirk akirk deleted the fix/personal-wp-plugin-url-param branch January 29, 2026 18:58
@Apozulpaul
Copy link
Copy Markdown

Nice one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants