This Cloudflare Worker serves as a dynamic blueprint generator for testing WooCommerce releases in WordPress Playground. It provides a JSON configuration that automatically installs and configures WooCommerce with predefined settings.
The worker is designed to work with WordPress Playground (https://playground.wordpress.net) to create reproducible WooCommerce testing environments. It generates a blueprint that:
- Installs a specified WooCommerce release
- Configures pretty permalinks
- Sets up basic store information
- Skips the onboarding wizard
- Configures basic WooCommerce settings
To test a specific WooCommerce release:
https://playground.wordpress.net/?blueprint-url=https://woocommerce-worker.briancoords-com.workers.dev/?release=9.8.0-beta.1
Replace 9.8.0-beta.1 with any WooCommerce version you want to test. The release must match the tag on Github.
If no release is specified, the worker will use 'latest':
https://playground.wordpress.net/?blueprint-url=https://woocommerce-worker.briancoords-com.workers.devYou can also access the JSON blueprint directly:
https://woocommerce-worker.briancoords-com.workers.dev/?release=9.8.0-beta.1- Install Wrangler:
npm install -g wrangler- Login to Cloudflare:
wrangler login- Deploy the worker:
wrangler deployThe blueprint configures the following:
- Store Location: Poland (Wrocław)
- Currency: PLN (Polish Złoty)
- Measurement Units:
- Weight: Ounces (oz)
- Dimensions: Inches (in)
- Payment Methods: Check payments enabled
- Tracking: Disabled
- Onboarding: Skipped for faster testing
The worker consists of two main files:
worker.js: Contains the main logic and blueprint templatewrangler.toml: Cloudflare Worker configuration
To modify the blueprint, edit the template object in worker.js.
Feel free to submit issues and enhancement requests!
To run the worker locally for development and testing:
- Install dependencies (if any):
npm install- Start the local development server:
wrangler dev- The worker will be available at a local address (usually
http://localhost:8787). You can use this URL as yourblueprint-urlin WordPress Playground for local testing (ex:https://playground.wordpress.net/?blueprint-url=http://localhost:8787)
Refer to the Cloudflare Workers documentation for more details.