Skip to content

Conversation

@brandonpayton
Copy link
Member

Motivation for the change, related issues

Providing a relative path to --auto-mount for Plugins and Themes is failing. For example, I am seeing the following when working from a test plugin dir:

npx @wp-playground/cli server --auto-mount=.                                             
Starting a PHP server...
Setting up WordPress latest
Resolved WordPress release URL: https://downloads.w.org/release/wordpress-6.8.3.zip
Fetching SQLite integration plugin...
Booting WordPress...
PHP.request() is deprecated. Please use new PHPRequestHandler() instead.
Booted!
Running the Blueprint...
Activating /wordpress/wp-content/plugins/. – 99%
Plugin /wordpress/wp-content/plugins/. activation printed the following bytes: The plugin does not have a valid header.
Activating /wordpress/wp-content/plugins/. – 100%
Error when executing the blueprint step #0 ({"step":"activatePlugin","pluginPath":"/wordpress/wp-content/plugins/."}) : 
Plugin /wordpress/wp-content/plugins/. could not be activated – WordPress exited with no error. Sometimes, when 
$_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in 
the console for more details. caused by Plugin /wordpress/wp-content/plugins/. could not be activated – WordPress exited 
with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 
redirect. Inspect the "debug" logs in the console for more details.

The main part is:
Error when executing the blueprint step #0 ({"step":"activatePlugin","pluginPath":"/wordpress/wp-content/plugins/."})

This PR updates the --auto-mount code to resolve the path passed to it, so it doesn't matter whether using the empty --auto-mount default or some other relative path. All paths will become absolute paths to avoid these issues.

Implementation details

This PR normalizes all auto-mounted paths to absolute paths before inspection.

Testing Instructions (or ideally a Blueprint)

  • CI

@brandonpayton brandonpayton requested a review from a team November 4, 2025 01:09
@brandonpayton brandonpayton self-assigned this Nov 4, 2025
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] CLI labels Nov 4, 2025
@brandonpayton
Copy link
Member Author

I think this change is fine, but I'd like to add some test cases for it first.

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

Labels

[Package][@wp-playground] CLI [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants