perry-rylance / wordpress-plugin
A basic boilerplate WordPress plugin, including activation and de-activation hooks, first run, update detection, admin menu and script loading callbacks.
Installs: 179
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 3
pkg:composer/perry-rylance/wordpress-plugin
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2025-10-13 21:53:12 UTC
README
A basic boilerplate WordPress plugin, including activation and de-activation hooks, first run, update detection, admin menu and script loading callbacks.
Installation
I recommend installing this library via Composer:
composer require perry-rylance/wordpress-plugin
Usage
Extend from PerryRylance\WordPress\Plugin to use the plugin.
You must define the following methods, which are abstract in the base class:
getPluginSluggetPluginDirPath
The following methods can be overridden as and where you need to do so:
onActivate(Please remember to call the base method)onDeactivateonFirstRunonUpdated($prevVersion)onTextDomainonAdminMenuonAdminEnqueueScriptsonEnqueueScripts
It is recommended that your plugin instantiates itself immediately (eg do not wait for plugins_loaded or init) so that activation and de-activation hooks work correctly.