Skip to content

Attributes-PHP/wp-fastendpoints-my-plugin

Repository files navigation

Quick Start - WP-FastEndpoints

GitHub Actions Workflow Status (main) Supported WordPress Versions Software License

MyPlugin is a WordPress sample plugin that demonstrates how to use FastEndpoints.

Features

  • 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

Requirements

Installation

Add plugin to WordPress and then install all the dependencies:

composer install

Lint

composer test:lint

Running tests

composer test             # Runs linter + unit and integration tests
composer test:unit        # Runs unit tests
composer test:integration # Runs integration tests

Setup WordPress

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

Known errors

WordPress 6.5.x requires MySQL 5.5.5 or higher

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.

About

Sample plugin that demonstrates how to use FastEndpoints

Topics

Resources

License

Stars

Watchers

Forks

Languages