dev-master
9999999-dev https://github.com/nirjharlo/wp-plugin-frameworkA framework for quick production of WordPress plugins.
GPL-2.0-or-later
The Requires
- php >=5.3.0
by Nirjhar Lo
wordpress framework
A framework for quick production of WordPress plugins.
A WordPress plugin framework is a simple and light-weight base to build any standard WP plugin on top of it. Easily achieve high productivity. It contains various items, such as Settings pages, Data tables, Widgets, Metaboxes, Custom Post Types, Shortcodes along with infrastructure for DB operations., (*2)
There are extra classes for API integration, AJAX, File upload and Cron jobs., (*3)
NOTE: Requires PHP 5.4 and up. Uses cURL
for API integration class., (*4)
composer install --no-dev
composer install
./vendor/bin/phpcs --config-set installed_paths ../../wp-coding-standards/wpcs
Change the class namespaces, file namespaces, declarations in wp-plugin-framework.php
and install.php
before you start coding.
Also, change the /asset
file paths in plugin file wp-plugin-framework.php
to your chosen folder path name.
It's a precaution to avoid conflict., (*5)
In plugin/PluginLoader.php
the PluginLoader
class includes all the files in instance and declares the classes inside them. You can remove existing files or add more files. It's recomended to put all the plugin features instances inside PluginLoader
. This will help in organising the code., (*6)
In plugin/PluginLoader.php
the installation and uninstallation classes contain possible situations, including DB installation and uninstallation features., (*7)
Go through the files in /lib/class-
and /src/class-
. First one contains classes for extra features, while the latter is using essential features., (*8)
/plugin/lib
Files/plugin/lib/Cron.php
:: Cron
to schedule operations., (*9)
/plugin/lib/Api.php
:: Api
to integrate 3rd party APIs., (*10)
/plugin/lib/Table.php
:: Table
to display data tables., (*11)
/plugin/lib/Ajax.php
:: Ajax
to make AJAX requests., (*12)
/plugin/lib/Upload.php
:: Upload
to upload a file., (*13)
/plugin/lib/Script.php
:: Script
to add required CSS and JS., (*14)
/plugin/src
Files/plugin/src/Install.php
:: Install
to handle activation process., (*15)
/plugin/src/Db.php
:: Db
to install database tables., (*16)
/plugin/src/Settings.php
:: Settings
to create admin settings pages., (*17)
/plugin/src/Cpt.php
:: Cpt
to create custom post type., (*18)
/plugin/src/Widget.php
:: Widget
to add custom widget., (*19)
/plugin/src/Metabox.php
:: Metabox
to add custom metabox in editor screen., (*20)
/plugin/src/Shortcode.php
:: Shortcode
to add and display shortcodes., (*21)
/plugin/src/Query.php
:: Query
to use post and user query. It uses wp_pagenavi()
for breadceumbs, (*22)
/plugin/src/RestApi.php
:: RestApi
to extend REST API., (*23)
A framework for quick production of WordPress plugins.
GPL-2.0-or-later
wordpress framework