PHPackages                             abuyoyo/plugincore - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abuyoyo/plugincore

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abuyoyo/plugincore
==================

WordPress plugin core helper class

0.34(2mo ago)2213BSD-3-ClausePHP

Since Sep 6Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/abuyoyo/PluginCore)[ Packagist](https://packagist.org/packages/abuyoyo/plugincore)[ RSS](/packages/abuyoyo-plugincore/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (31)Used By (0)

WPHelper \\ PluginCore
======================

[](#wphelper--plugincore)

> Helper class for registering WordPress plugins.

Plugin Boilerplates and boilerplate generator are a hassle. The file structure they impose is way too cumbersome (and redundant) to push into every single plugin. WPHelper\\PluginCore replaces boilerplates with one simple class (usually hidden away somewhere in your `vendor/` dir).

[WPHelper\\AdminMenuPage](https://github.com/abuyoyo/AdminMenuPage) can be used to register and generate admin menus if your plugin requires that.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- [Composer](https://getcomposer.org/)
- [WordPress](https://wordpress.org)

Installation
------------

[](#installation)

Install with [Composer](https://getcomposer.org/) or just drop PluginCore.php into your plugin folder and require it.

```
// Require the Composer autoloader anywhere in your code.
require __DIR__ . '/vendor/autoload.php';
```

OR

```
// Require the class file directly from your plugin.
require_once __DIR__ . 'PluginCore.php';
```

WPHelper\\PluginCore uses [PSR-4](https://www.php-fig.org/psr/psr-4/) to autoload.

Basic Usage
-----------

[](#basic-usage)

WpHelper/PluginCore replaces the many plugin core skeleton generators out there. Just add these lines of code at the top of your plugin file and you're good to go.

WpHelper/PluginCore will define %PLUGIN%\_BASENAME, %PLUGIN%\_PATH, %PLUGIN%\_URL, %PLUGIN%\_FILE constants available to your code.

```
/*
 * Plugin Name: My Awesome Plugin
 * Description: Plugin's description.
 * Version:  1.0.0
 */

// Import PluginCore.
use WPHelper\PluginCore;

// Register the plugin
$args = [
    'title' => 'My Awesome Plugin', // Optional - will fallback to plugin header Plugin Name.
    'slug' => 'my-awesome-plugin', // Optional - will generate slug based on plugin header Plugin Name
    'const' => 'MYPLUGIN' // Optional - slug used to define constants: MYPLUGIN_DIR, MYPLUGIN_URL etc. (if not provided will use 'slug' in ALLCAPS)
    'activate_cb' => 'activate_callback' // Optional - Provide a callable function to run on activation
    'deactivate_cb' => 'deactivate_callback' // Optional - Provide a callable function to run on deactivation
    'uninstall_cb' => 'uninstall_callback' // Optional - (@todo) Consider using uninstall.php and not this plugin. This plugin can run in the global scope and cause problems
];

// Setup plugin constants and activation/deactivation hooks
new PluginCore( __FILE__, $args );

// Start writing your code here..
include '/foo.php';
add_action( 'plugins_loaded' function() {
    // whatever..
});
```

### Constants

[](#constants)

WPHelper\\PluginCore defines constants for use in your code. Where `__FILE__` is the filename provided to the class and `%PLUGIN%` is the `'const'` option. Like so:

```
define( '%PLUGIN%_URL', plugin_dir_url( __FILE__ ) );
define( '%PLUGIN%_FILE', __FILE__ );
```

These are the constants defined by WPHelper\\PluginCore. There are some redundancies to account for different conventions.

- %PLUGIN%\_PATH: `plugin_dir_path( __FILE__ ) )`
- %PLUGIN%\_DIR: `plugin_dir_path( __FILE__ ) )`
- %PLUGIN%\_URL: `plugin_dir_url( __FILE__ ) )`
- %PLUGIN%\_BASENAME: `plugin_basename( __FILE__ ) )`
- %PLUGIN%\_FILE: `__FILE__`
- %PLUGIN%\_PLUGIN\_FILE: `__FILE__`

### Get Instance

[](#get-instance)

All PluginCore instances can be referenced anywhere in your code using static method `get()` and the plugin slug. Available on `plugins_loaded` hook or later.

```
PluginCore::get('my-awesome-plugin'); // returns PluginCore instance constructed with slug 'my-awesome-plugin'
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance84

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~170 days

Total

30

Last Release

82d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/973642e65a5584b10d7285df904ea7e52994714dab348eef12ec3bc9b5ad6cc5?d=identicon)[abuyoyo](/maintainers/abuyoyo)

---

Top Contributors

[![abuyoyo](https://avatars.githubusercontent.com/u/24979061?v=4)](https://github.com/abuyoyo "abuyoyo (106 commits)")

### Embed Badge

![Health badge](/badges/abuyoyo-plugincore/health.svg)

```
[![Health](https://phpackages.com/badges/abuyoyo-plugincore/health.svg)](https://phpackages.com/packages/abuyoyo-plugincore)
```

###  Alternatives

[andrefigueira/blog-article-faker

Generate random blog article titles and content (including markdown) using faker

1415.0k](/packages/andrefigueira-blog-article-faker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
