Repository navigation
fix(theme): activate the required plugins in a fresh process on a first install - #584
Merged
Merged
Conversation
…st install A first install runs pollora:make:theme with WordPress only partly loaded (SHORTINIT): activate_plugin() crashed in plugin_basename() and the install stopped before the theme build. The activation now runs in its own process through the new pollora:plugin:activate command, with WordPress fully loaded.
This was referenced Nov 5, 2026
Merged
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.
Problem
On a first install, `pollora new` runs `pollora:make:theme` in the process that just installed WordPress. That process only has WordPress partly loaded (`SHORTINIT`): `wp-settings.php` returns before `$wp_plugin_paths` is set and before `plugins_loaded`. Answering yes to "Activate the WordPress plugin ...?" (always the case with the E-commerce template, which requires WooCommerce) calls `activate_plugin()`, which crashes in `plugin_basename()` with `arsort(): Argument #1 ($array) must be of type array, null given`. The install stops before the theme build and the theme activation.
Closes Pollora/pollora#274
Change
Tests
Feature tests for both paths of `MakeThemeCommand` and for `PluginActivateCommand`. Pint, PHPStan and Rector are clean.
Not covered: the real `pollora new --ddev` run with the E-commerce template (the sub-process itself is not exercised by the tests). `DatabaseConfigTest` and `MissingBuildNotice` fail in my DDEV environment; they do not touch this change.