MyPlugin is a WordPress sample plugin that demonstrates how to use FastEndpoints.
- Follow up our guide at Quick Start FastEndpoints Wiki »
- Sample router to manipulate blog posts (create, update, retrieve and delete)
- Sample JSON schemas to validate those requests. For more schemas properties visit json/opis »
- Out of the box Unit tests + Integration tests using pestphp thanks to dingo-d/wp-pest
- PHP code style fixer using laravel/pint
- Composer scripts for running tests + linter + setting up WordPress
- PHP 8.1+
- WordPress 6.x
- matapatos/wp-fastendpoints
Add plugin to WordPress and then install all the dependencies:
composer install
composer test:lint
composer test # Runs linter + unit and integration tests
composer test:unit # Runs unit tests
composer test:integration # Runs integration tests
Please note that before running the integration tests you have to specify the WordPress version you want to use, via:
composer setup:wp:6.0 # For the latest 6.0.x version
composer setup:wp:6.1 # For the latest 6.1.x version
composer setup:wp:6.2 # For the latest 6.2.x version
composer setup:wp:6.3 # For the latest 6.3.x version
composer setup:wp:6.4 # For the latest 6.4.x version
composer setup:wp:latest # For the latest x.x.x version
Since WordPress have bumped the minimum MySQL version from 5.0 to 5.5.5 in WordPress
6.5.x the integration tests might not work for the latest version until
this PR changes is released.
In other words, composer setup:wp:latest
might not work so use composer setup:wp:6.4
instead.
MyPlugin was created by André Gil and is open-sourced software licensed under the MIT license.