An easy way to check your site for PHP Compatibility.
Setup Development Environment
Before starting your workstation will need the following:
If using nvm, run nvm use in the project root to switch to the correct Node version.
- Clone the repository
git@github.com:wpengine/phpcompat.git
- Setup WP-Env
When finished, a local WordPress will be configured at http://localhost:8888/wp-admin.
WordPress Credentials:
URL: http://localhost:8888/wp-admin
Admin User: admin
Admin Password: password
If anything goes wrong and you suspect your local is frozen, you can always make choose-violence to rebuild the local environment and containers. Hopefully you never have to choose violence. :)
Build and Testing
Note, assets will also build during the install phase.
You can run all testing (all lints and unit tests) together with the following:
The project uses the Brain Monkey library for unit testing. Once setup run the following for unit tests:
The project uses the WordPress e2e tests. Run the following for e2e tests:
We also use PHP_CodeSniffer with WordPress Coding Standards and JSHint with WordPress' JS Standards. Linting will automagically be setup for you if you use Visual Studio Code. If you want to run it manually use the following:
or, to run an individual lint (php or javascript), use one of the following:
make test-lint-javascript
Screw something up? You can reset your environment with the following. It will stop the environment and cleanup and the build files as well as anything downloaded.
Preparing for release
To generate a .zip that can be uploaded through any normal WordPress plugin installation workflow, simply run the following: