PHPackages                             lapsrj/wp-dependencies-manager - 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. lapsrj/wp-dependencies-manager

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

lapsrj/wp-dependencies-manager
==============================

Library that helps WordPress plugin dependency management.

077↓54.5%PHP

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/LAPSrj/wp-dependencies-manager)[ Packagist](https://packagist.org/packages/lapsrj/wp-dependencies-manager)[ RSS](/packages/lapsrj-wp-dependencies-manager/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

WP Dependencies Manager
=======================

[](#wp-dependencies-manager)

- Tags: plugin, dependency, install
- Requires at least: 5.1
- Requires PHP: 5.6
- License: MIT

A lightweight WordPress library for managing plugin dependencies. Declare required and recommended plugins via JSON, auto-install and activate them, and provide admins with a Dependencies page under the Plugins menu. Supports WordPress.org, GitHub, GitLab, Bitbucket, Gitea, direct URLs, and bundled ZIP files.

Based on [WP Dependency Installer](https://github.com/afragen/wp-dependency-installer).

Description
-----------

[](#description)

You can use **composer** to install this package within your WordPress plugin / theme.

1. Within your plugin or theme root folder, run the following command:

```
composer require lapsrj/wp-dependencies-manager
```

2. Then create a `wp-dependencies.json` file:

```
[
  {
    "name": "Classic Editor",
    "host": "wordpress",
    "slug": "classic-editor/classic-editor.php",
    "uri": "https://wordpress.org/plugins/classic-editor/",
    "required": true
  },
  {
    "name": "Query Monitor",
    "host": "wordpress",
    "slug": "query-monitor/query-monitor.php",
    "uri": "https://wordpress.org/plugins/query-monitor/",
    "optional": true
  }
]
```

3. Add the following lines to your plugin or theme's `functions.php` file:

```
require_once __DIR__ . '/vendor/autoload.php';
add_action( 'after_setup_theme', static function() {
  WP_Dependencies_Manager::instance( __DIR__ )->run();
});
```

For plugins, use the `plugins_loaded` hook instead of `after_setup_theme`.

Bundled Plugins (Local ZIP)
---------------------------

[](#bundled-plugins-local-zip)

You can bundle plugin ZIP files directly within your theme or plugin to distribute premium or private plugins. Place the ZIP file in a directory (e.g. `bundled-plugins/`) and reference it using `"host": "local"`:

```
{
  "name": "My Premium Plugin",
  "host": "local",
  "slug": "my-premium-plugin/my-premium-plugin.php",
  "uri": "bundled-plugins/my-premium-plugin.zip",
  "required": true
}
```

The `uri` is a relative path from your theme or plugin root to the ZIP file.

### Using PHP instead of JSON

[](#using-php-instead-of-json)

You can also register dependencies programmatically, which works the same way for bundled plugins:

```
require_once __DIR__ . '/vendor/autoload.php';
add_action( 'after_setup_theme', static function() {
  $manager = WP_Dependencies_Manager::instance( __DIR__ );
  $manager->register( [
    [
      'name'     => 'My Premium Plugin',
      'host'     => 'local',
      'slug'     => 'my-premium-plugin/my-premium-plugin.php',
      'uri'      => 'bundled-plugins/my-premium-plugin.zip',
      'required' => true,
    ],
    [
      'name'     => 'Classic Editor',
      'host'     => 'wordpress',
      'slug'     => 'classic-editor/classic-editor.php',
      'uri'      => 'https://wordpress.org/plugins/classic-editor/',
      'required' => true,
    ],
  ], __DIR__ );
  $manager->run();
});
```

When using `register()` directly, pass the caller directory as the second argument so that local paths resolve correctly.

Contributors
------------

[](#contributors)

- [Leandro](https://github.com/lapsrj)
- [Andy Fragen](https://github.com/afragen) (original author)
- [Matt Gibbs](https://github.com/mgibbs189) (original author)
- [Raruto](https://github.com/Raruto) (original author)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance55

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e1c3b91b119615ba1d754e7c1b4e7b64962d601713f0adfd19592eb93f791f1?d=identicon)[LAPSrj](/maintainers/LAPSrj)

---

Top Contributors

[![afragen](https://avatars.githubusercontent.com/u/1296790?v=4)](https://github.com/afragen "afragen (324 commits)")[![Raruto](https://avatars.githubusercontent.com/u/9614886?v=4)](https://github.com/Raruto "Raruto (22 commits)")[![sc0ttkclark](https://avatars.githubusercontent.com/u/709662?v=4)](https://github.com/sc0ttkclark "sc0ttkclark (4 commits)")[![LAPSrj](https://avatars.githubusercontent.com/u/4451552?v=4)](https://github.com/LAPSrj "LAPSrj (3 commits)")[![paulgoodchild](https://avatars.githubusercontent.com/u/10562196?v=4)](https://github.com/paulgoodchild "paulgoodchild (2 commits)")[![brandonjp](https://avatars.githubusercontent.com/u/199599?v=4)](https://github.com/brandonjp "brandonjp (1 commits)")[![SteveJonesDev](https://avatars.githubusercontent.com/u/2895788?v=4)](https://github.com/SteveJonesDev "SteveJonesDev (1 commits)")

### Embed Badge

![Health badge](/badges/lapsrj-wp-dependencies-manager/health.svg)

```
[![Health](https://phpackages.com/badges/lapsrj-wp-dependencies-manager/health.svg)](https://phpackages.com/packages/lapsrj-wp-dependencies-manager)
```

###  Alternatives

[ozdemirburak/iris

PHP library for color manipulation and conversion.

1201.8M20](/packages/ozdemirburak-iris)[tobimori/kirby-icon-field

A simple Icon field plugin for Kirby CMS

5219.8k2](/packages/tobimori-kirby-icon-field)[lara-zeus/inline-chart

Zeus Inline Chart easily add a chart in filamentPHP table column

2343.9k](/packages/lara-zeus-inline-chart)

PHPackages © 2026

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