Run WordPress within Cloudflare Worker memory limits#1872
Merged
Conversation
chubes4
marked this pull request as ready for review
July 18, 2026 21:51
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.
Summary
Run a full seeded WordPress 7.0.2 runtime inside Cloudflare Workers' fixed 128 MB isolate limit, with canonical Markdown/JSON revisions persisted in R2 and mutation coordination limited to a Durable Object lease/CAS protocol.
What changed
wp_install()in the isolate.94b9f875ffb8402d5e8eb726893a12324e20f45c.Stack
Tracking issue: #1838.
How to test
npm install.@php-wasm/stream-compressionartifact produced from that PR.npm run generate:cloudflare-mdi-runtime-bundle; expect nine deterministic MDI runtime files from revision94b9f875ffb8402d5e8eb726893a12324e20f45c.npm run test:cloudflare-runtime; expect all Cloudflare runtime tests and TypeScript checks to pass.npm run cloudflare:dry-run; expect Wrangler to package the Worker with theWORDPRESS_STATEDurable Object andWORDPRESS_STATE_BUCKETR2 bindings.npm run cloudflare:local-gate; expect two HTTP 200 WordPress health envelopes.POST /?phase=r2-mutaterequests. Expect monotonic revision values,previousPostFound: true, deterministiccanonicalChanges, andsqlitePersisted: false.Verification
npm run test:cloudflare-runtimepassed: 5 tests.npm run cloudflare:dry-runpassed. Wrangler reports a pre-existing duplicatetest:php-browser-preview-only-sessionpackage-script warning.php -l.workflow-lintpassed;contractsis pending.Supplementary deployed proof
Disposable Worker commit
a900ae51, version5c9c2452-9cf8-478f-8318-81c61eaaccc1:7.0.2and PHP8.5.8.4to5.post/cloudflare-r2-proof-5.mdas created and_options/wp_codebox_mdi_revision.jsonas changed.6and7, each recovering the preceding post and promoting a distinct pointer.b35e7137-71e0-4551-97fb-23bee79e76f8.sqlitePersisted: false.Worker: https://wp-codebox-cloudflare-runtime.chubes.workers.dev
Compatibility
This is an additive draft runtime package. Existing WP Codebox runtime behavior and extension APIs are unchanged. The Cloudflare path depends on unreleased upstream contracts in WordPress/wordpress-playground#4110 and Automattic/markdown-database-integration#126.
AI assistance
openai/gpt-5.6-terra