PHPackages                             morningtrain/wp-plugin-info - 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. morningtrain/wp-plugin-info

ActiveLibrary

morningtrain/wp-plugin-info
===========================

Helper class to handle info about a plugin

v3.2.0(2y ago)0353MITPHP

Since Mar 6Pushed 2y ago3 watchersCompare

[ Source](https://github.com/Morning-Train/wp-plugin-info)[ Packagist](https://packagist.org/packages/morningtrain/wp-plugin-info)[ RSS](/packages/morningtrain-wp-plugin-info/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

Morningtrain\\WP\\PluginInfo
============================

[](#morningtrainwpplugininfo)

Get information information about a plugin, based on the plugin file.

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

[](#table-of-contents)

- [Introduction](#introduction)
- [Getting Started](#getting-started)
    - [Installation](#installation)
- [Usage](#usage)
    - [Initialize](#initialize)
    - [Retrieve Information](#retrieve-information)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [Testing](#testing)
- [License](#license)

Introduction
------------

[](#introduction)

Get information information about a plugin, based on the plugin file.

Getting Started
---------------

[](#getting-started)

To get started install the package as described below in [Installation](#installation).

To use the tool have a look at [Usage](#usage)

### Installation

[](#installation)

Install with composer

```
composer require morningtrain/wp-plugin-info
```

Usage
-----

[](#usage)

### Initialize

[](#initialize)

To get started register a plugin file;

```
// plugin.php
require __DIR__ . "/vendor/autoload.php";

$plugin_info = Morningtrain\WP\PluginUpdater\PluginInfo::register(__FILE__);
```

### Set Slug

[](#set-slug)

You can set a slug by setting `Plugin Slug` header in the plugin header. Alternatively you can set the slug with the `setSlug` method on the `PluginInfo` instance. This is useful get the information about your plugin later.

### Set a named path

[](#set-a-named-path)

You can set a named path, that you can use to get the path later. It must be an absolute path. You can set a path in the plugin folder or any other place.

```
$plugin_info->setNamedPath('app', __DIR__ . '/app');
$plugin_info->setNamedPath('logs', WP_CONTENT_DIR . '/logs');
```

### Set a named URL

[](#set-a-named-url)

You can set a named URL, that you can use to get the URL later. It must be an absolute URL. You can set a URL in the plugin folder or any other place.

```
$plugin_info->setNamedUrl('images', $plugin_info->getRootUrl() . 'public/iamges');
$plugin_info->setNamedUrl('invoices', content_url('private/invoices'));
```

### Set a named Parameter

[](#set-a-named-parameter)

You can set a named parameter, that you can use to get the parameter later. You can set anything with relevance to your plugin.

```
$plugin_info->setNamedParameter('license', $license);
```

### Retrieve a PluginInfo instance

[](#retrieve-a-plugininfo-instance)

You can retrieve a PluginInfo instance by using the `get` method on the `PluginInfo` class.

```
$plugin_info = Morningtrain\WP\PluginUpdater\PluginInfo::get('pluginSlug');
```

### Retrieve Information

[](#retrieve-information)

FunctionExampleDescriptiongetData`$plugin_info->getData('Name', 'Default')`Get data from plugins datagetNamedPath`$plugin_info->getNamedPath('pathName')`Get named pathgetNamedUrl`$plugin_info->getNamedUrl('urlName')`Get named URLgetNamedParameter`$plugin_info->getNamedParameter('parameterName')`Get named parametergetRoot`$plugin_info->getRoot()`Get root path for the plugingetRootUrl`$plugin_info->getRootUrl()`Get root URL for the plugingetPluginFilePath`$plugin_info->getPluginFilePath()`Get path to plugin filegetBaseName`$plugin_info->getBaseName()`Base name of plugin ex. "plugin-name/plugin-name.php"getSlug`$plugin_info->getSlug()`Get slug of plugingetName`$plugin_info->getName()`Get name of plugingetPluginURI`$plugin_info->getPluginURI()`Get plugin URIgetVersion`$plugin_info->getVersion()`Get version of plugingetDescription`$plugin_info->getDescription()`Get description of plugingetAuthor`$plugin_info->getAuthor()`Get author of plugin - Formatted as linkgetAuthorURI`$plugin_info->getAuthorURI()`Get author URIgetTextDomain`$plugin_info->getTextDomain()`Get textdomain of plugingetDomainPath`$plugin_info->getDomainPath()`Get Translations pathgetRequiresWPVersion`$plugin_info->getRequiresWPVersion()`Get which WordPress version is required at leastgetRequiresWPVersion`$plugin_info->getRequiresPHPVersion()`Get which PHP version is required at leastgetUpdateURI`$plugin_info->getUpdateURI()`Get update URIgetTitle`$plugin_info->getTitle()`Get title of plugingetAuthorName`$plugin_info->getAuthorName()`Get author of plugin - Formatted as textContributing
------------

[](#contributing)

Thank you for your interest in contributing to the project.

### Bug Report

[](#bug-report)

If you found a bug, we encourage you to make a pull request.

To add a bug report, create a new issue. Please remember to add a telling title, detailed description and how to reproduce the problem.

### Support Questions

[](#support-questions)

We do not provide support for this package.

### Pull Requests

[](#pull-requests)

1. Fork the Project
2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
3. Commit your Changes (git commit -m 'Add some AmazingFeature')
4. Push to the Branch (git push origin feature/AmazingFeature)
5. Open a Pull Request

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

[](#contributors)

- [Martin Schadegg Brønniche](https://github.com/mschadegg)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

---

Developed by

[![Morningtrain logo](https://camo.githubusercontent.com/e5c33559f0458f056816ab1a75dc9fe3bbd5a141e5d8630d85ec32fa45c01526/68747470733a2f2f6d6f726e696e67747261696e2e646b2f77702d636f6e74656e742f7468656d65732f6d74742d776f726470726573732d7468656d652f6173736574732f696d672f6c6f676f2d6f6e6c792d746578742e737667)](https://morningtrain.dk)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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 ~41 days

Total

5

Last Release

1003d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/278725?v=4)[morningtrain](/maintainers/morningtrain)[@morningtrain](https://github.com/morningtrain)

---

Top Contributors

[![mschadegg](https://avatars.githubusercontent.com/u/11231039?v=4)](https://github.com/mschadegg "mschadegg (21 commits)")

---

Tags

phpwordpresswp

### Embed Badge

![Health badge](/badges/morningtrain-wp-plugin-info/health.svg)

```
[![Health](https://phpackages.com/badges/morningtrain-wp-plugin-info/health.svg)](https://phpackages.com/packages/morningtrain-wp-plugin-info)
```

PHPackages © 2026

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