[codex] Add remote WordPress COW mount experiment#9
Draft
adamziel wants to merge 39 commits into
Draft
Conversation
Contributor
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
Adds
experiments/remote-wp-cow, a Linux-only lab for running a remote WordPress site locally without copying the whole site first.That command creates or reuses a clone descriptor, mounts a lazy FUSE filesystem, starts the local DB control/proxy layer, and launches PHP/FrankenPHP. Remote files are the lower layer, local edits live in
upper/, cached reads live infile-cache/, and DB writes route to the local materialized layer instead of production.Docker wrappers are included for macOS testing through
docker compose exec wp-cow-lab bash.cc @JanJakes
Rationale
A 500 GB WordPress site cannot be cloned by eagerly copying files or dumping every table. The useful shape is a local runtime where production is a lazy lower layer and only files, rows, and tables touched by local requests become materialized.
The branch explores the hard parts directly: avoiding browser hangs during cold start, refusing to treat the WordPress installer as success, keeping production DB writes impossible, preserving local-only edits, and avoiding arbitrary production plugin side effects.
Implementation
The experiment wires together:
wp-content/uploadsandwp-config.phpstay lazy.wp-config.php,wp-content/db.php, router, and safety mu-plugin that point URLs/DB locally and reject installer/runtime failure pages.DB_HOSTstill hit the COW routing layer.wp-cow sever, which writesrun/offline.json, stops remote lower reads, can set a local-only admin password, and keeps already materialized local edits refreshable offline.WPCOW_PLUGIN_MODE=auto, which starts with production plugins disabled, smoke-boots active plugin candidates one at a time, admits passing plugins, and quarantines failing plugins locally.mail(), raw sockets, cURL execution, URL includes, cron, WordPress HTTP API calls, and indexing headers by default.lazysizes.min.js, preserve SG lazyload image markup, localize menu/content URLs, and suppress WP emoji assets to match the optimized frontend.This is still an experiment. The default path is designed to be safe and lazy, but
WPCOW_PLUGIN_MODE=fullis an escape hatch rather than a guarantee that every arbitrary production plugin is safe or fast.Measured on the real SiteGround site:
Testing instructions
Run the standard checks:
Run the Docker lab from macOS:
Real-site acceptance template: