
WordPress Complete REST API + WP Scripts + WP Data + PHPUnitTesting + Jest Unit Testing Setup
Hei, WordPress developer, if you’re struggling with enhancing your career with React, TypeScript, WordPress Rest API, PHP Unit and many more, then this tutorial is for you. Let’s see a simple starter kit for WordPress plugin development.
¶WP-React-Kit
A simple starter kit to work in WordPress plugin development using WordPress Rest API, WP-script, React, React Router, Tailwind CSS, PostCSS, Eslint, WP-Data, WP-Data Store, React Components, React CRUD, i18n, PHPUnit Test, JestUnit Test, e2e Test and PHP OOP plugin architecture easily in a minute.
¶Github Link -
https://github.com/ManiruzzamanAkash/wp-react-kit
¶What’s included?
- WordPress Rest API
- WP-script Setup
- React
- React Router
- TypeScript
- Tailwind CSS [Nested + ]
- Scss
- PostCSS
- Eslint
- WP-Data
- WP-Data Redux Store [Redux Saga, Generator function, Thunk, Saga Middleware]
- React Components
- React CRUD Operations [Continuing…]
- Internationalization - WP i18n
- PHPUnit Test [Test + Fix]
- JestUnit Test
- e2e Test
- PHP OOP plugin architecture [Traits + Interfaces + Abstract Classes]
¶Quick Start
# Clone the Git repository
git clone https://github.com/ManiruzzamanAkash/wp-react-kit.git
# Install PHP-composer dependencies [It's empty]
composer install
# Install node module packages
npm i
# Start development mode
npm start
# Start development with hot reload (Frontend components will be updated automatically if any changes are made)
npm run start:hot
# To run in production
npm run build
After running start
, or build
command, there will be a folder called /build
will be generated at the root directory.
¶Activate the plugin
You need activate the plugin from plugin list page. http://localhost/wpex/wp-admin/plugins.php
¶Run PHP Unit Test
./vendor/bin/phpunit
¶Run Jest Unit Test
npm run test:unit --maxWorkers=10
¶PHP Coding Standards - PHPCS
Get all errors of the project:
vendor/bin/phpcs .
Fix all errors of the project:
vendor/bin/phpcbf .
¶Browse Plugin
http://localhost/wpex/wp-admin/admin.php?page=jobplace#/
Where, /wpex
is the project root folder inside /htdocs
.
Or, it could be your custom processed URL.
¶REST API’s
Postman API Link - https://www.getpostman.com/collections/f94073131fc1411506e8
¶REST API Documentation
-
Job Types
- Method:
GET
- URL: http://localhost/wpex/wp-json/job-place/v1/job-types
- Method:
-
Job Lists
- Method:
GET
- URL: http://localhost/wpex/wp-json/job-place/v1/jobs
- Method:
-
Job Details
- Method:
GET
- URL By ID: http://localhost/wpex/wp-json/job-place/v1/jobs/1
- URL By Slug: http://localhost/wpex/wp-json/job-place/v1/jobs/first-job
- Method:
-
Create Job
- Method:
POST
- URL: http://localhost/wpex/wp-json/job-place/v1/Jobs
- Body:
{ "title": "Simple Job Post", "slug": "simple-job-post", "description": "Simple job post description", "company_id": 1, "job_type_id": 2, "is_active": 1 }
- Method:
-
Update Job
- Method:
PUT
- URL: http://localhost/wpex/wp-json/job-place/v1/jobs/1
- Body:
{ "title": "Simple Job Post Updated", "slug": "simple-job-post-updated", "description": "Simple job post description", "company_id": 1, "job_type_id": 2, "is_active": 1 }
- Method:
-
Delete Jobs
- Method:
DELETE
- URL: http://localhost/wpex/wp-json/job-place/v1/jobs
- Body:
{ "ids": [1, 2] }
- Method:
Detailed Documentation - View Detailed documentations with parameters and responses of the REST API
Get specific file errors of the project:
vendor/bin/phpcs job-place.php
Fix specific file errors of the project:
vendor/bin/phpcbf job-place.php
¶Versions
Simple Version with raw PHP
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vSimple
Version with EsLint and i18n Setup
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vSimpleEslint
Version with EsLint, i18n and React Router Setup
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vReactRouter
Version with PostCSS and Tailwind CSS Setup
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vTailwindCss
Version with PHPCS setup
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vPHPCS
Version with PHP OOP Architecture
https://github.com/ManiruzzamanAkash/wp-react-kit/releases/tag/vPhpOOP
¶Final Demos
Job List Page

Job List Page with Pagination

Job List Page with search

PHP If-else-elseif and Switch-case
PHP String Functions - All necessary String functions in PHP to manage strings better.
Popular Tutorials
Popular Tutorials
Categories
-
Artificial Intelligence (AI)
11
-
Bash Scripting
1
-
Bootstrap CSS
0
-
C Programming
14
-
C#
0
-
ChatGPT
1
-
Code Editor
2
-
Computer Engineering
3
-
CSS
28
-
Data Structure and Algorithm
18
-
Design Pattern in PHP
2
-
Design Patterns - Clean Code
1
-
E-Book
1
-
Git Commands
1
-
HTML
19
-
Interview Prepration
2
-
Java Programming
0
-
JavaScript
12
-
Laravel PHP Framework
37
-
Mysql
1
-
Node JS
1
-
Online Business
0
-
PHP
28
-
Programming
8
-
Python
12
-
React Js
19
-
React Native
1
-
Redux
2
-
Rust Programming
15
-
SEO - Search Engine Optimization
1
-
Tailwind CSS
1
-
Typescript
10
-
Uncategorized
0
-
Vue JS
1
-
Windows Operating system
1
-
Woocommerce
1
-
WordPress Development
2
Tags
- Artificial Intelligence (AI)
- Bash Scripting
- Business
- C
- C Programming
- C-sharp programming
- C++
- Code Editor
- Computer Engineering
- CSS
- Data Structure and Algorithm
- Database
- Design pattern
- Express JS
- git
- Git Commands
- github
- HTML
- Java
- JavaScript
- Laravel
- Mathematics
- MongoDB
- Mysql
- Node JS
- PHP
- Programming
- Python
- React Js
- Redux
- Rust Programming Language
- SEO
- TypeScript
- Vue JS
- Windows terminal
- Woocommerce
- WordPress
- WordPress Plugin Development