Skip to content

Added wp-env based local development setup - #283

Merged
MatzeKitt merged 3 commits into
epiphyt:mainfrom
mgiannopoulos24:tooling/wp-env
Nov 14, 2026
Merged

MatzeKitt merged 3 commits into
epiphyt:mainfrom
mgiannopoulos24:tooling/wp-env

Conversation

@mgiannopoulos24

@mgiannopoulos24 mgiannopoulos24 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a reproducible local WordPress environment via @wordpress/env, running on the WordPress Playground runtime by default (no Docker needed), pinned to PHP 8.3 to match CI. No plugin code is modified.

  • .wp-env.json: loads and activates the plugin and Plugin Check, enables WP_DEBUG / SCRIPT_DEBUG, port 8888
  • package.json / package-lock.json: adds @wordpress/env and the scripts below (lockfile changes are additive only)
  • .distignore: excludes .wp-env.json from the release archive

Usage

npm ci
npm run build          # required, see notes
npm run start:wp-env   # http://localhost:8888 (admin / password)
Script Does
start:wp-env Starts WordPress via Playground
start:wp-env:docker Starts WordPress via Docker (needed for WP-CLI)
stop:wp-env / reset:wp-env / destroy:wp-env Stop, reset, remove the environment
shell:wp-env Shell into the CLI container (Docker only)
plugin-check:wp-env Runs wp plugin check embed-privacy (Docker only)

Notes

  • Playground doesn't support wp-env run yet, so WP-CLI commands need the Docker runtime. Plugin Check can still be used from wp-admin under Playground.
  • npm run build is required first: with WP_DEBUG on, the plugin calls filemtime() on gitignored build artefacts (inc/class-frontend.php:62), which warns on a fresh clone. A file_exists() guard could be a follow-up.
  • PHP 8.3 matches CI, not Requires PHP: 5.6 in the plugin header.

@MatzeKitt

Copy link
Copy Markdown
Member

I guess it would be worth using the (experimental) Playground integration in wp-env to not being forced to work with Docker, which adds additional complexity, dependencies as well as more load and less performance for the environment.

@mgiannopoulos24

Copy link
Copy Markdown
Contributor Author

Good point, thanks! I switched the default to the Playground runtime (npm run start:wp-env), so Docker is no longer required.

I kept a Docker option (npm run start:wp-env:docker) because Playground doesn't support wp-env run yet, so WP-CLI only works with Docker. That's useful for things like wp plugin check and the i18n commands (wp i18n make-pot / make-json) for generating translation files.

@MatzeKitt
MatzeKitt self-requested a review November 14, 2026 10:13
@MatzeKitt

Copy link
Copy Markdown
Member

Thanks for implementing!

@MatzeKitt
MatzeKitt merged commit 19d3d28 into epiphyt:main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants