PHPackages                             wordpress-phoenix/abstract-plugin-base - 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. [Framework](/categories/framework)
4. /
5. wordpress-phoenix/abstract-plugin-base

ActiveLibrary[Framework](/categories/framework)

wordpress-phoenix/abstract-plugin-base
======================================

PHP class to extend when building a WordPress plugin allowing you to follow smart plugin setup standards.

2.6.4(6y ago)1013.0k—3.6%2[3 issues](https://github.com/WordPress-Phoenix/abstract-plugin-base/issues)1GPL-3.0-or-laterPHP

Since Nov 17Pushed 5y ago9 watchersCompare

[ Source](https://github.com/WordPress-Phoenix/abstract-plugin-base)[ Packagist](https://packagist.org/packages/wordpress-phoenix/abstract-plugin-base)[ Docs](https://github.com/WordPress-Phoenix/abstract-plugin-base)[ RSS](/packages/wordpress-phoenix-abstract-plugin-base/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (25)Used By (1)

Abstract Plugin Base
====================

[](#abstract-plugin-base)

Used as a base class to help standardize the way we build WordPress plugins.

CircleCI Build: [![CircleCI](https://camo.githubusercontent.com/fec5931159687155ac3fdeb965ddef548fe75ea50c69cb4ad2e1a7b3a862bc27/68747470733a2f2f636972636c6563692e636f6d2f67682f576f726450726573732d50686f656e69782f61627374726163742d706c7567696e2d626173652e7376673f7374796c653d737667)](https://circleci.com/gh/WordPress-Phoenix/abstract-plugin-base)

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)

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

[](#installation)

You can use this library to start a new plugin from scratch, or you can enhance your existing plugins with this library. Once you have read over the installation instructions it should make sense which direction to go.

### Composer style (recommended)

[](#composer-style-recommended)

1. Confirm that composer is installed in your development environment using `which composer`. If CLI does not print any path, you need to [install Composer](https://getcomposer.org/download/).
2. Set CLI working directory to wp-content/plugins/{your-plugin-name}
3. Install Abstract\_Plugin class via composer command line like ```
    composer require wordpress-phoenix/abstract-plugin-base
    ```
4. Look at sample code below to see how to include this library in your plugin.

### Manual Installation

[](#manual-installation)

1. Download the most updated copy of this repository from `https://api.github.com/repos/WordPress-Phoenix/abstract-plugin-base/zipball`
2. Extract the zip file, and copy the PHP file into your plugin project.
3. Include the file in your plugin.

Usage
-----

[](#usage)

### Why should you use this library when building your plugin?

[](#why-should-you-use-this-library-when-building-your-plugin)

By building your plugin using OOP principals, and extending this Plugin\_Base class object, you will be able to quickly and efficiently build your plugin, allowing it to be simple to start, but giving it the ability to grow complex without changing its architecture.

Immediate features include:

- Built in SPL Autoload for your includes folder, should you follow WordPress codex naming standards for class files.
- Template class provides you all the best practices for standard plugin initialization
- Minimizes code needed / maintenance of your main plugin file.
- Assists developers new to WordPress plugin development in file / folder architecture.
- By starting all your plugins with the same architecture, we create a standard that is better for the dev community.

### Simplest example of the main plugin file, and required plugin class file

[](#simplest-example-of-the-main-plugin-file-and-required-plugin-class-file)

`custom-my-plugin.php`:

```
