# Playground zip

> A WordPress Playground blueprint bundle that boots a site with the exported content, media, theme and plugins — how it's built and how to run it.

Source: https://eizport.github.io/docs/formats/playground-zip/

With the **Playground** format, the export is a `.zip` ready for [WordPress Playground](https://wordpress.org/playground/): a blueprint bundle that installs the themes and plugins you chose and imports the content.

*Screenshot: Playground themes and plugins: what the .zip installs.*

## Run it

```bash
npx @wp-playground/cli@latest server --blueprint=./site.zip
```

Or open its link on playground.wordpress.net (new screen: the **Open in Playground** action in [Copies](https://eizport.github.io/docs/settings/copies/); classic screen: *Keep a copy to open by link*). The copy is served with the CORS headers Playground needs.

**Even from a local server.** Playground runs in your browser, so a copy made on WordPress Studio or any `localhost` site opens on playground.wordpress.net without uploading it anywhere — the browser fetches it from your machine (the link works on your computer only).

## Themes and plugins

Any **installed** theme or plugin can go in. The ones from the WordPress.org directory aren't copied: the blueprint installs them from the directory, **in the version this site has** (`woocommerce.11.2.1.zip`). The others — premium, custom, in-house — are zipped from the site into the bundle, and Playground installs them from there. WordPress's own update check says which ones are from the directory.

> **Use it responsibly.** Premium and custom themes and plugins are copied into the file. Share a Playground `.zip` only where their licenses allow — keep the ones with paid licenses to yourself or your team.

## Inside

```text
blueprint.json
<site>.WordPress.<date>.xml        the plain WXR (content inside, not in post_content/)
uploads/…                          media files, when Media files is on
post_content/…                     content files, when Content as .html files is on
themes/<stylesheet>.zip            each theme chosen that isn't in the directory (a child brings its parent)
plugins/<slug>.zip                 each plugin chosen that isn't in the directory
```

## What the blueprint does

1. Installs the themes (parents first) — from the directory or from the bundle — and activates the active one, if chosen, else the first.
2. Installs and activates the plugins, the same way.
3. Writes the media and content files and two temporary must-use plugins: one answers the importer's media downloads from the files and puts each `.html` back into its post (`wp_import_post_data_raw`); the other sets the options when the import ends, with IDs mapped.
4. Runs `importWxr` (Playground installs the WordPress Importer itself).
5. Removes the temporary plugins and files.

The [`eizport_playground_blueprint`](https://eizport.github.io/docs/developers/hooks/#eizport_playground_blueprint) filter changes the blueprint before it is written.
