[PHP] Don't call prefetchUpdateChecks() when WordPress is disabled - #3589
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts Blueprint boot behavior so PHP-only Playground runs (WordPress disabled via preferredVersions.wp: false / wp="none") don’t attempt WordPress update prefetching, preventing crashes due to missing WP files.
Changes:
- Gate
prefetchUpdateChecks()behindinstallWordPressinBlueprintsV1Handler. - Add Vitest regression coverage for PHP-only vs WordPress-installed boot paths.
- Extend the demo page + Playwright e2e coverage with a PHP-only “toolkit” snippet example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/playground/client/src/blueprints-v1-handler.ts | Skips update prefetch when WordPress isn’t installed. |
| packages/playground/client/src/blueprints-v1-handler.spec.ts | Adds unit regression tests for prefetch gating. |
| packages/playground/website/public/php-code-snippet-demo.html | Adds a new PHP-only toolkit demo snippet driven by a Blueprint. |
| packages/playground/website/playwright/e2e/php-code-snippet.spec.ts | Adds e2e coverage for the new quickstart snippet and toolkit scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What it does
Fixes
wp="none"PHP snippets that boot through a Blueprint. PHP-only Blueprints now skip WordPress update prefetching, so the runtime no longer tries to load WordPress files that were intentionally not installed.The demo page also includes a
quickstart.phpexample that installs a tiny/tmp/php-toolkit/vendor/autoload.phpthrough a Blueprint and runsWP_HTML_Tag_Processoroutside WordPress.Rationale
wp="none"maps topreferredVersions.wp: false, which means the runtime boots PHP without a/wordpressdirectory.BlueprintsV1Handlerstill calledprefetchUpdateChecks()after boot when networking was enabled, and that path expects WordPress to exist.That made PHP-only snippets fail even when their own code and Blueprint did not require WordPress.
Implementation
BlueprintsV1Handleralready computes whether WordPress should be installed:This now gates
prefetchUpdateChecks()as well:Added a focused client regression test for both paths: PHP-only Blueprints do not prefetch, while normal WordPress boots still do.
Testing instructions
I also ran the focused
php-code-snippetPlaywright case against the bundledwasm-wordpress-netlayout in Chromium, where/client/index.jsis served and the snippet executes successfully.