You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support separate web root and WordPress core directory (#217)
## Summary
On WP Cloud sites, the web root and WordPress core directory are
separate paths:
- Web root: `/srv/htdocs` (contains `wp-content/`)
- WP root: `/srv/htdocs/__wp__/` (contains `wp-load.php`,
`wp-includes/`, `wp-admin/`)
The blueprint runner previously assumed these were always the same
directory. All subprocess scripts used `DOCROOT` to find both
`wp-content/` and `wp-load.php`, which breaks on split layouts.
This PR introduces a `WP_CORE_DIR` environment variable that points to
where WordPress core files live, independent of `DOCROOT` (the web
root). On standard installs they're identical; on WP Cloud they differ.
The `ExistingSiteResolver` auto-detects the core directory by scanning
immediate subdirectories for `wp-load.php`, so existing blueprints work
without changes. A `--wp-core-path` CLI flag is also available for
explicit configuration.
## Test plan
- [ ] New unit tests for `detect_wordpress_core_dir()` (standard layout,
`__wp__/` subdirectory, custom subdirectory, no WP found, deeply nested,
nonexistent path)
- [ ] New unit tests for `RunnerConfiguration` (default fallback,
explicit override, reset to null)
- [ ] Verify existing CI tests still pass (the change is
backwards-compatible since `WP_CORE_DIR` defaults to `DOCROOT`)
- [ ] Test on a WP Cloud site with split web/core roots
0 commit comments