PHPackages                             oblak/wp-plugin-installer - 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. oblak/wp-plugin-installer

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

oblak/wp-plugin-installer
=========================

Simplifies the installation and activation of WordPress plugins

v2.1.8(11mo ago)25102[1 issues](https://github.com/oblakstudio/wp-plugin-installer/issues)[6 PRs](https://github.com/oblakstudio/wp-plugin-installer/pulls)GPL-2.0-onlyPHPPHP &gt;= 8.0CI passing

Since Oct 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/oblakstudio/wp-plugin-installer)[ Packagist](https://packagist.org/packages/oblak/wp-plugin-installer)[ GitHub Sponsors](https://github.com/seebeen)[ RSS](/packages/oblak-wp-plugin-installer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (28)Used By (0)

📦 WordPress plugin installer / activator
========================================

[](#-wordpress-plugin-installer--activator)

### Simplifies the installation and activation of WordPress plugins.

[](#simplifies-the-installation-and-activation-of-wordpress-plugins)

[![Packagist Version](https://camo.githubusercontent.com/79d283293cd8f1da8238a90d06ae41a3db677a16bbe6254b37cd61c6b5a144e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f626c616b2f77702d706c7567696e2d696e7374616c6c6572)](https://camo.githubusercontent.com/79d283293cd8f1da8238a90d06ae41a3db677a16bbe6254b37cd61c6b5a144e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f626c616b2f77702d706c7567696e2d696e7374616c6c6572)[![Packagist PHP Version](https://camo.githubusercontent.com/9c2e40af8fe85c95ef4d3dc87ec07f17eaef0833cf415cc8a69c2540796c6a52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6f626c616b2f77702d706c7567696e2d696e7374616c6c65722f706870)](https://camo.githubusercontent.com/9c2e40af8fe85c95ef4d3dc87ec07f17eaef0833cf415cc8a69c2540796c6a52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6f626c616b2f77702d706c7567696e2d696e7374616c6c65722f706870)[![semantic-release: angular](https://camo.githubusercontent.com/9cdd34ac7322a84f2cf0ff00d590f5cc32229560a89e898aa2c5a5eeecbd5dfc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73656d616e7469632d2d72656c656173652d616e67756c61722d6531303037393f6c6f676f3d73656d616e7469632d72656c65617365)](https://github.com/semantic-release/semantic-release)

[![Code Climate maintainability](https://camo.githubusercontent.com/9e657c6ebe88a8734e1a243f15c24a6e326eacaf6d132bfa3876ab8a1852200d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6f626c616b73747564696f2f77702d706c7567696e2d696e7374616c6c6572)](https://camo.githubusercontent.com/9e657c6ebe88a8734e1a243f15c24a6e326eacaf6d132bfa3876ab8a1852200d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f6f626c616b73747564696f2f77702d706c7567696e2d696e7374616c6c6572)[![Release](https://github.com/oblakstudio/wp-plugin-installer/actions/workflows/release.yml/badge.svg)](https://github.com/oblakstudio/wp-plugin-installer/actions/workflows/release.yml)

[![GitHub](https://camo.githubusercontent.com/2d69cf93cbbb44e7129839a9cf68aa5ba9975e807753b81c855b7d858abb4d1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f626c616b73747564696f2f77702d706c7567696e2d696e7374616c6c6572)](https://camo.githubusercontent.com/2d69cf93cbbb44e7129839a9cf68aa5ba9975e807753b81c855b7d858abb4d1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f626c616b73747564696f2f77702d706c7567696e2d696e7374616c6c6572)[![Packagist Downloads](https://camo.githubusercontent.com/c35701c47e7aaa342e15e0c72e0a4dde178922dacc9f681103200dbe91fc99d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6f626c616b2f77702d706c7567696e2d696e7374616c6c6572)](https://camo.githubusercontent.com/c35701c47e7aaa342e15e0c72e0a4dde178922dacc9f681103200dbe91fc99d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6f626c616b2f77702d706c7567696e2d696e7374616c6c6572)

Highlights
----------

[](#highlights)

- Based on [WooCommerce](https://woocommerce.com) installation and activation process.
- Automatically updates plugin and database schema versions.
- Handles database table creation and updates (Schema enforcement).
- Provides [WP-CLI](https://wp-cli.org) commands for manual updates, and database table creation / verification.
- Easily extendable

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

[](#installation)

We officially support installing via composer only

### Via composer

[](#via-composer)

```
composer require oblak/wp-plugin-installer
```

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

[](#basic-usage)

`Base_Plugin_Installer` is an **abstract** singleton class which can be extended to create a plugin installer class. The class is responsible for installing and activating the plugin, and updating the plugin and database schema versions. You need to extend it and implement the `set_defaults()` method, which is responsible for setting the default values for the class.

If your plugin needs non-wp database tables, you need to implement the `get_schema()` method, and set the `has_db_tables` property to `true`, so that the installer can create and update the tables.

Class depends on [Action Scheduler](https://actionscheduler.org) for running update callbacks in the background. If your plugin uses Action Scheduler, or depends on an another plugin, which has Action Scheduler, you can skip the activation step.

### 1. Define your installer class

[](#1-define-your-installer-class)

```
