> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wpos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Playground

> Instant local WordPress + Elementor: a WASM playground booted from a pre-baked snapshot, crash-supervised.

```bash theme={null}
npx @algorismus/elementor-ultra-playground
```

One command gives you a local WordPress with Elementor and the companion plugin,
ready for `exjsx deploy` and the MCP server. No Docker, no PHP, no MySQL, no git
clone: it runs on WordPress Playground (PHP-WASM, pure Node) and hydrates from a
**pre-baked site snapshot**, skipping the minutes a cold WordPress + Elementor
install costs. First run downloads a \~50 MB snapshot once (cached under your
home directory); later boots take a few seconds.

```text theme={null}
WordPress   http://127.0.0.1:8899/wp-admin   (admin / password)
Elementor   4.2.1 (free) + Elementor Ultra companion plugin

For the MCP server and `exjsx deploy`:
    WP_URL=http://127.0.0.1:8899
    WP_USER=admin
    WP_APP_PASSWORD=...
```

## What is inside the snapshot

WordPress (Playground build), Elementor 4.2.1 (free), the elementor-ultra
companion plugin, pretty permalinks, `WP_ENVIRONMENT_TYPE=local` baked into
`wp-config.php`, the V4 atomic / classes / variables experiments active, and a
minted local-dev application password.

<Warning>
  The application password is baked into the snapshot and printed on every boot.
  It is a throwaway credential for a local-only dev site. Never reuse it
  anywhere real.
</Warning>

## Flags and environment

| Flag               | Meaning                                                                                         |
| ------------------ | ----------------------------------------------------------------------------------------------- |
| `--port <n>`       | Serve on a different port (default `8899`)                                                      |
| `--fresh`          | Wipe the cached site and re-hydrate from the snapshot                                           |
| `--provision`      | Skip the snapshot; provision a fresh site from bundled assets (needs network for wordpress.org) |
| `--tarball <path>` | Hydrate from a local snapshot tarball instead of downloading                                    |
| `--dir <path>`     | Hydrate into a specific directory instead of the cache                                          |

Environment: `ELEMENTOR_ULTRA_HOME` overrides the cache location; `ULTRA_PORT`
sets the port.

## Crash supervision

PHP-WASM workers can crash (a bad CSS request was a reliable trigger in the
field). The playground runs supervised: a crashed worker respawns
automatically. If a request suddenly fails, wait about 15 seconds and retry
before diagnosing; right after a respawn the worker answers health checks while
still warming for tens of seconds.

## The single-worker reality

The site is served by a single PHP-WASM worker: requests queue, and one heavy
request blocks the rest. Treat a playground site as one-user-at-a-time. Two
consequences worth knowing:

* Right after boot or a bounce, allow generous timeouts; the provisioning
  tooling retries with growing timeouts for exactly this reason.
* Missing static files 301-redirect to the homepage on Playground-style hosts,
  which makes a dead stylesheet look alive to naive checks. The companion
  plugin's static-404 guard fixes this (see [Plugin](/ultra/plugin)), and the
  [doctor](/ultra/verify) checks content-type, not just status.

<Warning>
  Do not open playground-hosted pages in the Elementor editor. Editor sessions
  are the known trigger for global-class store wipes on this stack. If styles
  vanish after an editor visit, redeploy the bundle and run `eu-studio doctor`.
  On real sites the companion plugin's store guards make editor coexistence
  safe; the playground is a dev bench, treat it like one.
</Warning>

## Resetting and multiple sites

```bash theme={null}
npx @algorismus/elementor-ultra-playground --fresh          # wipe + re-hydrate
```

Run several isolated sites by giving each its own port and directory:

```bash theme={null}
npx @algorismus/elementor-ultra-playground --port 8901 --dir ~/sites/site-a
npx @algorismus/elementor-ultra-playground --port 8902 --dir ~/sites/site-b
```

For a site that also needs the plugin patched to the latest checkout and
Elementor Pro activated, use [`eu-studio newsite`](/ultra/provisioning), which
wraps the boot and verifies the result.
