# extendify/0.2.0/app/Plugin.php

Extendify, version 0.2.0. 35 lines.

- Page: https://pluginprobe.com/plugins/extendify/0.2.0/code/app/Plugin.php
- Raw: https://pluginprobe.com/plugins/extendify/0.2.0/raw/app/Plugin.php
- Modified: 2022-01-06T18:08:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/0.2.0/code/app/Plugin.php#L10-L20`.

```php
<?php
// phpcs:ignoreFile
// This class was copied from JetPack (mostly)
// so will be a bit of work to refactor
/**
 * Manage plugin dependencies
 */

namespace Extendify\Library;

class Plugin
{
    /**
     * Will return info about a plugin
     *
     * @param string $identifier The key of the plugin info.
     * @param string $plugin_id The plugin identifier string.
     * @return string
     */
    public static function getPluginInfo($identifier, $plugin_id)
    {
        if (!function_exists('get_plugins')) {
            include_once ABSPATH . 'wp-admin/includes/plugin.php';
        }

        foreach (get_plugins() as $plugin => $data) {
            if ($data[$identifier] === $plugin_id) {
                return $plugin;
            }
        }

        return false;
    }
}

```
