WordPress Plugin Starter
Minimal and sustainable WordPress theme for ChrisWiegman.com.
Setup and Usage of the Development Environment
A fully featured development environment is included using PHP 7.4 and more. Scripts to run commands including setup and more use make as a task runner. See the instructions below for getting started.
Before starting your workstation will need the following:
- Clone the repository
git clone https://github.com/chriswiegman/chriswiegman-theme.git
- Start Lando
cd chriswiegman-theme
make start
When finished, Lando will give you the local URL of your site. You can finish the WordPress setup there.
WordPress Credentials:
URL: https://chriswiegman-theme.lndo.site/wp-admin
Admin User: admin
Admin Password: _password
Using Xdebug
Xdebug 3 released a number of changes that affect the way Xdebug works. Namely, it no longer listens on every request and requires a "trigger" to enable the connection. Use one of the following plugins to enable the trigger on your machine:
- Xdebug Helper for Firefox (source).
- Xdebug Helper for Chrome (source).
- XDebugToggle for Safari (source).
Build and Testing
The theme minified versions of any JavaScript files:
make build
Note, assets will also build during the install phase.
The project uses the WP_Mock library for unit testing. Once setup run the following for unit tests:
make test-unit
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:
make test-lint
or, to run an individual lint, use one of the following:
make test-lint-php
make test-lint-javascript
You can run all testing (all lints and unit tests) together with the following:
make test