|Chris Wiegman 9c0f6ea8d4||2 days ago|
|.vscode||1 month ago|
|Docker||1 month ago|
|plugin||3 weeks ago|
|tests||1 month ago|
|.gitignore||1 month ago|
|.jshintignore||1 month ago|
|.jshintrc||1 month ago|
|.lando.yml||1 month ago|
|Makefile||3 weeks ago|
|README.md||3 weeks ago|
|composer.json||2 days ago|
|composer.lock||2 days ago|
|gulpfile.js||1 month ago|
|package-lock.json||3 weeks ago|
|package.json||3 weeks ago|
|phpcs.xml||1 month ago|
|phpunit.xml.dist||1 month 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: