|Chris Wiegman 9c0f6ea8d4||2 months ago|
|.vscode||4 months ago|
|Docker||4 months ago|
|plugin||3 months ago|
|tests||4 months ago|
|.gitignore||4 months ago|
|.jshintignore||4 months ago|
|.jshintrc||4 months ago|
|.lando.yml||4 months ago|
|Makefile||3 months ago|
|README.md||3 months ago|
|composer.json||2 months ago|
|composer.lock||2 months ago|
|gulpfile.js||4 months ago|
|package-lock.json||3 months ago|
|package.json||3 months ago|
|phpcs.xml||4 months ago|
|phpunit.xml.dist||4 months ago|
A starter plugin to get you going quickly with a new WordPress plugin.
Developing a real plugin with this code is easy.
First, rename all appropriate instances of the my name (Chris Wiegman) and the starter plugin name (wordpress-plugin-starter) throughout the codebase. For now, you'll want to do this manually as the case and spacing character can differ upon usage.
All plugin source code should go in the plugin folder. This is what is mapped as the plugin in your test site. Classes should go into the plugin/lib folder using any namespace as a subfolder. The plugin will automatically load all classes created in this fashion. See the autoloader in the main plugin file for more details.
While I plan to, at some point, setup a script that will handle renaming and more in the future, it just isn't there yet. Other planned improvements include using a more modern autoloader and switching off of Gulp.
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:
git clone https://gitea.chriswiegman.com/chriswiegman/wordpress-plugin-starter.git
cd wordpress-plugin-starter make start
When finished, Lando will give you the local URL of your site. You can finish the WordPress setup there.
URL: https://wordpress-plugin-starter.lndo.site/wp-admin Admin User: admin Admin Password: _password
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:
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, use one of the following:
You can run all testing (all lints and unit tests) together with the following: