This is a rough, experimental Electron app to get started with WordPress Core development. It's meant to work on Windows, macOS, and Linux with zero system dependencies.
It handles the following tasks:
- Clones the
wordpress-develop
repository into a local folder – without requiring a system install ofgit
. - Runs
npm install
,npm run build
,npm run dev
– without requiring a system install ofnode
ornpm
. - Launches a local WordPress dev server – without requiring a system install of
apache
,php
ormysql
. - Generates a Core patch from your local changes
See How does it work? for more details.
Getting a Core dev environment running (Node, npm, git, PHP/MySQL or an alternative) is a common source of friction for new contributors. This app removes most of that friction by bundling the tooling and using WordPress Playground locally for the server.
video.mp4
- Download the latest packaged build for your platform from the workflows page.
- Open the app
- If on mac, sign it and remove it from the quarantine – the app is not officially signed at this point. First, make sure you have a code signing identity: apple guide, StackOverflow thread. Then, follow these steps with the downloaded .app file:
❯ security find-identity -p codesigning ❯ codesign --deep --force --verify --verbose --sign "selfsigned" electron-setup-wordpress-core.app ❯ xattr -d com.apple.quarantine electron-setup-wordpress-core.app
- Click "Create WordPress Core site" and choose a destination folder for your site.
- Click "Install dependencies"
- Click "Run command > npm run build"
- Click "Start dev server"
- A browser window should open automatically. If not, you can manually open it by clicking "Launch site".
- Make changes in the code
- Click "Generate patch" to create a diff of your changes.
Requirements: a recent Node.js to build the Electron app itself (runtime for the app is bundled).
npm install
npm run build:once # bundle renderer
npm start # run Electron + renderer in watch mode
# Package installers (no publishing):
npm run dist # all configured targets
npm run dist:win # Windows (x64 by default)
npm run dist:win:arm64
Output goes to dist/
(e.g., Windows installer .exe
).
- Git operations are handled by the
isomorphic-git
npm package. It is a pure JS implementation of Git that works in the browser and Node.js. - Node scripts and npm commands are run using the Node.js runtime bundled with the Electron app. A small shim directory is injected into the PATH so subprocesses can find
node
,npm
, andnpx
without requiring a system install. - WordPress server is run using the
@wp-playground/cli
npm package from WordPress Playground. - Patches are generated using the
diff
npm package.
- WordPress core relies on Node.js, npm, and webpack for its build system. Electron is an easy way to install Node.js on all major platforms.
- It's a single, self-contained file. It's easy to distribute and install – it can be distributed on a USB sticks if everything else fails.
SQLite should suffice for most new contributors. The SQLite support is miles ahead of where it used to be (e.g. most plugins and core unit tests work, query monitor works, we track failures and missing features and, thanks to the query parser, we can improve things fairly easily).
For cases when MySQL is required, local Playground can work with MySQL. The only missing part is shipping the MySQL server with the app.
- Integrate Playground's XDebug.
- Explore bundling MySQL server with the app.
- Built‑in SMTP catcher for local email testing.
- Migrate to the PHP Git client in https://github.com/wordpress/php-toolkit.
- Potentially integrate with Studio to benefit from PHP version selector, wp-cli integration and other Studio features.
- An ergonomic way of managing the git repository from the UI (commit, conflicts, pushes etc.) Or would it make sense to just endorse another git client?
- Integrate with Trac and GitHub to apply and submit patches directly. Related: grunt-patch-wordpress
GPLv2.