Repository navigation
Description
Summary
Page_Sync saves each synced page's file locations as absolute paths in post meta (_blockstudio_page_template_path, _blockstudio_page_content_path, _blockstudio_page_source, _blockstudio_page_layout, _blockstudio_page_directory). Later web requests read those paths back and call is_file() on them, for example in Tailwind::compile_editor_css() (via Page_Registry::hydrate_from_posts()), Pages::negotiates_markdown(), and the static prerender's page_source_dependencies().
If wp bs pages sync runs in an environment where the theme sits under a different absolute path than the web server sees, every stored path is wrong for web requests. On hosts with open_basedir, each one logs a warning on every request.
Environment
- Host: InstaWP. Its WP-CLI runs in a jailed shell, where the site is at
/web/<site>/public_html. PHP-FPM sees the same files at/home/<user>/web/<site>/public_htmland hasopen_basedirlimited to that tree. - The same thing happens after any migration that changes the absolute path (a host move, a new Docker mount or a staging clone) until a sync is run again from the new location.
Steps to reproduce
- Use a theme that has file-based pages under
pages/<slug>/(bothindex.phpandindex.md). - Run
wp bs pages syncfrom a shell whereget_stylesheet_directory()resolves to a different absolute path than it does under PHP-FPM, for example InstaWP's SSH/WP-CLI. - Load any page on the front end with
WP_DEBUG_LOGon.
Actual
Each page logs a warning like this (once from includes/classes/tailwind.php, and once from the Markdown negotiation for .md pages):
PHP Warning: is_file(): open_basedir restriction in effect. File(/web/live-example.instawp.site/public_html/wp-content/themes/<theme>/pages/refunds/index.md) is not within the allowed path(s): (/home/<user>/web/live-example.instawp.site/public_html:/home/<user>/tmp:/opt:...:/tmp:/usr/share:/usr/bin:/usr/local/bin:/bin:/var/www/html) in .../wp-content/plugins/blockstudio/includes/classes/tailwind.php
The files exist, but Blockstudio cannot find them from the web side, so:
- Tailwind's editor compile misses candidates from page templates.
- Markdown negotiation stops serving
.mdpages. - Prerender signatures don't pick up changes to those source files.
Expected
The stored paths should still work if the install's absolute root changes. Two options:
- Store paths relative to the theme (or to the pages root), e.g.
pages/refunds/index.md, and resolve them againstget_stylesheet_directory()/get_template_directory()when they're read._blockstudio_page_dependenciesalready does this with itstheme:ids. - Or, when a stored absolute path isn't under the current theme root, rebase it with string logic before calling
is_file(). Probing it withis_file()first is what triggers the open_basedir warning.
Workaround
Run the sync from the web context (for example the admin) rather than the jailed CLI, so the stored paths match what PHP-FPM sees.
Activity
dnnsjsk commentedon Oct 23, 2026
Fixed and released in 7.7.7, implemented in e0f6d59f. Synced theme sources now use portable locations, and legacy absolute theme paths are rebased before filesystem checks. Markdown, layouts, editor Tailwind sources, and prerender dependencies use the resolved paths. Ordinary requests do not synchronize content or rewrite metadata. Regression tests include different CLI/web roots and open_basedir restrictions.