An open API service indexing awesome lists of open source software.

https://github.com/attributes-php/wp-fastendpoints-my-plugin

Sample plugin that demonstrates how to use FastEndpoints
https://github.com/attributes-php/wp-fastendpoints-my-plugin

modern-wordpress wordpress wordpress-plugin wp-fastendpoints

Last synced: about 2 months ago
JSON representation

Sample plugin that demonstrates how to use FastEndpoints

Awesome Lists containing this project

README

          

# 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.

- Follow up our guide at **[Quick Start FastEndpoints Wiki »](https://github.com/attributes-php/wp-fastendpoints/wiki/Quick-start)**

## Features

- Sample router to manipulate blog posts (create, update, retrieve and delete)
- Out of the box Unit tests + Integration tests using [pestphp](https://pestphp.com/) thanks to [dingo-d/wp-pest](https://github.com/dingo-d/wp-pest)
- PHP code style fixer using [laravel/pint](https://github.com/laravel/pint)
- Composer scripts for running tests + linter + setting up WordPress

## Requirements

- PHP 8.1+
- WordPress 6.x
- [attributes-php/wp-fastendpoints](https://packagist.org/packages/attributes-php/wp-fastendpoints)

## Installation

Add plugin to WordPress and then install all the dependencies:

```bash
composer install
```

## Lint

```bash
composer test:lint
```

## Running tests

```bash
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:

```bash
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:6.5 # For the latest 6.5.x version
composer setup:wp:6.6 # For the latest 6.6.x version
composer setup:wp:6.7 # For the latest 6.7.x version
composer setup:wp:latest # For the latest x.x.x version
```

MyPlugin was created by **[André Gil](https://www.linkedin.com/in/andre-gil/)** and is open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.