Automattic, the company behind WordPress, has recently released a new project called wp-now. This tool allows developers to create a local development environment in just a few seconds. Powered by WordPress Playground, an experimental project that uses WebAssembly (WASM) to run WordPress in the browser, wp-now is a NodeJS app that makes it easy to spin up a new WordPress site with your chosen theme and automatically log in as admin without having to enter any credentials.
One of the key features of wp-now is its use of the SQLite Database Integration plugin for its database. This allows developers to quickly swap out versions of PHP and WordPress for testing. According to Antonio Sejas, a software engineer at Automattic, when you use wp-now from a directory, the tool creates a php-wasm instance, downloads the selected WordPress version, and mounts the necessary directories in a virtual file system (VFS). Then, it initiates a NodeJS express server that listens and proxies all requests to the php-wasm. This allows wp-now to easily log you into WordPress automatically, activate plugins and themes, and automatically configure your WordPress site.
wp-now can be installed directly from npm and works across all platforms including Mac, Linux, and Windows. While it currently doesn’t support custom domains or SSL, Automattic has plans to add these features in the future. The wp-now contributors are also looking at adding features such as auto-detecting when a file is modified and automatically refreshing the browser, importing a database from another WordPress site, and adding a deploy feature for SSH/SFTP hosting.
Overall, wp-now is a powerful tool that makes it easy for developers to create a local development environment for WordPress in just a few seconds. With its use of WebAssembly and the SQLite Database Integration plugin, it’s also highly customizable and flexible. If you’re a developer looking for an easy way to test your WordPress site locally, wp-now is definitely worth checking out.