Skip to content

Latest commit

 

History

History
158 lines (121 loc) · 6.6 KB

process.md

File metadata and controls

158 lines (121 loc) · 6.6 KB

WP React Plugin Boilerplate

WP React Plugin Boilerplate is a starter WordPress plugin to develop WordPress Plugin via React and Rest API.

Self Introduction

Santosh Kunwar

Santosh Kunwar, Founder/CEO at Acme Themes, Acme Information Technology, and a popular Gutenberg Page Builder - Gutentor creator, who loves working on WordPress Themes, Plugins and recently on Gutenberg Templates. A dynamic person who evolving with WordPress and has more than a decade of experience working with WordPress. WordPress Profile of codersantosh In short, I just love WordPress more…

Output of Project

WP React Plugin Boilerplate output

Basic Introduction to WordPress plugin

A WordPress plugin is a piece of software that extends or enhances the functionality of a WordPress website. It is a set of PHP, HTML, CSS, and possibly JavaScript files that can be easily added to a WordPress site to introduce new features or modify existing ones. WordPress plugins are designed to be modular and customizable, allowing users to tailor the functionality of their websites without directly modifying the core WordPress code.

Reference: Plugin Handbook

Basic Introduction to ReactJS

  • ReactJS is a component-based front-end JavaScript library.
  • It is open-source.
  • Components: A small and isolated piece of code. Build Complex UIs combining “components”. Components are reusable.
  • JSX (JavaScript XML): Markup syntax, similar to HTML.
  • React component “STATE”: An object that determines how that component renders & and behaves. Use “state” to create dynamic and interactive components.
  • Created by Jordan Walke, who was a software engineer at Facebook. Introduced in 2011 on Facebook's News Feed, and open-sourced in 2013.

Reference: ReactJS

Basic Introduction to WordPress Rest API

  • An interface or communication protocol for sending and receiving data as JSON (JavaScript Object Notation) objects between the client site and server site.
  • Released on the core in version 4.7 in December 2016.
  • Provide an application platform for WordPress.
  • Rest Route: URI which can be mapped to different HTTP methods for Request and Get Response.

Reference: REST API Handbook

Development Process

Install Activate and Basic Introduction of the Plugin

git checkout 1basicplugin

Setting Plugin Default Options, Getting Options, Deleting Options, and Setting Options

git checkout 2optionsfunctions

Adding WordPress Admin Menu for Our Plugin

git checkout 3adminmenu

Reference:

Adding ReactJS to our Plugin

Should have Installed Node.js + npm (https://nodejs.org/en/download/)

git checkout 4initreact
npm install
npm run start

Reference:

Implementing ReactJS on the WordPress Admin Menu

git checkout 5ReactOnWpMenu

Reference:

Adding Default Gutenberg Components

git checkout 6GutenbergComponents

Reference:

State and Lifecycle to Components

git checkout 7StateLifecycle

Reference:

Custom Components

git checkout 8CustomComponents

Reference:

Using Rest API to get Plugin Options and Setting it on React Component Setting Fields

git checkout 9RestApiGetOptions

Reference:

Using Rest API to set Plugin Options and Setting it on the Database ( WordPress Option Table )

git checkout 10RestApiSetOptions

Real-Time Use of Option

git checkout 10RestApiSetOptions

Finalization

git checkout master

Queries?

Any queries?

Exercise to create new fields

  • Create Each New Field on Each General and Advanced Tab
  • Rename Existing Tab
  • Add New Tab with New Settings

Thanks