{"id":19450907,"url":"https://github.com/morning-train/wp-plugin-info","last_synced_at":"2026-05-19T03:15:11.198Z","repository":{"id":121679453,"uuid":"610347396","full_name":"Morning-Train/wp-plugin-info","owner":"Morning-Train","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-18T12:42:55.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-23T00:44:02.387Z","etag":null,"topics":["php","wordpress","wp"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Morning-Train.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T15:37:08.000Z","updated_at":"2023-04-11T07:54:42.000Z","dependencies_parsed_at":"2024-12-11T15:32:58.976Z","dependency_job_id":null,"html_url":"https://github.com/Morning-Train/wp-plugin-info","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"82f3aacfa81bc405e9b6b7a7c4bc7c95c3a427c8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-plugin-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-plugin-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-plugin-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-plugin-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morning-Train","download_url":"https://codeload.github.com/Morning-Train/wp-plugin-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240637767,"owners_count":19833190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","wordpress","wp"],"created_at":"2024-11-10T16:39:25.959Z","updated_at":"2026-05-19T03:15:11.167Z","avatar_url":"https://github.com/Morning-Train.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morningtrain\\WP\\PluginInfo\n\nGet information information about a plugin, based on the plugin file.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n- [Usage](#usage)\n  - [Initialize](#initialize)\n  - [Retrieve Information](#retrieve-information)\n- [Contributing](#contributing)\n- [Contributors](#contributors)\n- [Testing](#testing)\n- [License](#license)\n\n\n## Introduction\n\nGet information information about a plugin, based on the plugin file.\n\n## Getting Started\n\nTo get started install the package as described below in [Installation](#installation).\n\nTo use the tool have a look at [Usage](#usage)\n\n### Installation\n\nInstall with composer\n\n```bash\ncomposer require morningtrain/wp-plugin-info\n```\n\n## Usage\n\n### Initialize\n\nTo get started register a plugin file;\n\n```php\n// plugin.php\nrequire __DIR__ . \"/vendor/autoload.php\";\n\n$plugin_info = Morningtrain\\WP\\PluginUpdater\\PluginInfo::register(__FILE__);\n```\n\n### Set Slug\nYou can set a slug by setting `Plugin Slug` header in the plugin header.\nAlternatively you can set the slug with the `setSlug` method on the `PluginInfo` instance.\nThis is useful get the information about your plugin later.\n\n\n### Set a named path\nYou 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.\n\n```php\n$plugin_info-\u003esetNamedPath('app', __DIR__ . '/app');\n$plugin_info-\u003esetNamedPath('logs', WP_CONTENT_DIR . '/logs');\n```\n\n### Set a named URL\nYou 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.\n\n```php\n$plugin_info-\u003esetNamedUrl('images', $plugin_info-\u003egetRootUrl() . 'public/iamges');\n$plugin_info-\u003esetNamedUrl('invoices', content_url('private/invoices'));\n```\n\n### Set a named Parameter\nYou can set a named parameter, that you can use to get the parameter later. You can set anything with relevance to your plugin.\n\n```php\n$plugin_info-\u003esetNamedParameter('license', $license);\n```\n\n\n### Retrieve a PluginInfo instance\nYou can retrieve a PluginInfo instance by using the `get` method on the `PluginInfo` class.\n\n```php\n$plugin_info = Morningtrain\\WP\\PluginUpdater\\PluginInfo::get('pluginSlug');\n```\n\n### Retrieve Information\n\n| Function             | Example                                            | Description                                           |\n|----------------------|----------------------------------------------------|-------------------------------------------------------|\n| getData              | `$plugin_info-\u003egetData('Name', 'Default')`         | Get data from plugins data                            |\n| getNamedPath         | `$plugin_info-\u003egetNamedPath('pathName')`           | Get named path                                        |\n| getNamedUrl          | `$plugin_info-\u003egetNamedUrl('urlName')`             | Get named URL                                         |\n| getNamedParameter    | `$plugin_info-\u003egetNamedParameter('parameterName')` | Get named parameter                                   |\n| getRoot              | `$plugin_info-\u003egetRoot()`                          | Get root path for the plugin                          |\n| getRootUrl           | `$plugin_info-\u003egetRootUrl()`                       | Get root URL for the plugin                           |\n| getPluginFilePath    | `$plugin_info-\u003egetPluginFilePath()`                | Get path to plugin file                               |\n| getBaseName          | `$plugin_info-\u003egetBaseName()`                      | Base name of plugin ex. \"plugin-name/plugin-name.php\" |\n| getSlug              | `$plugin_info-\u003egetSlug()`                          | Get slug of plugin                                    |\n| getName              | `$plugin_info-\u003egetName()`                          | Get name of plugin                                    |\n| getPluginURI         | `$plugin_info-\u003egetPluginURI()`                     | Get plugin URI                                        |\n| getVersion           | `$plugin_info-\u003egetVersion()`                       | Get version of plugin                                 |\n| getDescription       | `$plugin_info-\u003egetDescription()`                   | Get description of plugin                             |\n| getAuthor            | `$plugin_info-\u003egetAuthor()`                        | Get author of plugin - Formatted as link              |\n| getAuthorURI         | `$plugin_info-\u003egetAuthorURI()`                     | Get author URI                                        |\n| getTextDomain        | `$plugin_info-\u003egetTextDomain()`                    | Get textdomain of plugin                              |\n| getDomainPath        | `$plugin_info-\u003egetDomainPath()`                    | Get Translations path                                 |\n| getRequiresWPVersion | `$plugin_info-\u003egetRequiresWPVersion()`             | Get which WordPress version is required at least      |\n| getRequiresWPVersion | `$plugin_info-\u003egetRequiresPHPVersion()`            | Get which PHP version is required at least            |\n| getUpdateURI         | `$plugin_info-\u003egetUpdateURI()`                     | Get update URI                                        |\n| getTitle             | `$plugin_info-\u003egetTitle()`                         | Get title of plugin                                   |\n| getAuthorName        | `$plugin_info-\u003egetAuthorName()`                    | Get author of plugin - Formatted as text              |\n\n## Contributing\n\nThank you for your interest in contributing to the project.\n\n### Bug Report\n\nIf you found a bug, we encourage you to make a pull request.\n\nTo add a bug report, create a new issue. Please remember to add a telling title, detailed description and how to reproduce the problem.\n\n### Support Questions\n\nWe do not provide support for this package.\n\n### Pull Requests\n\n1. Fork the Project\n2. Create your Feature Branch (git checkout -b feature/AmazingFeature)\n3. Commit your Changes (git commit -m 'Add some AmazingFeature')\n4. Push to the Branch (git push origin feature/AmazingFeature)\n5. Open a Pull Request\n\n## Contributors\n\n- [Martin Schadegg Brønniche](https://github.com/mschadegg)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n\n---\n\n\u003cdiv align=\"center\"\u003e\nDeveloped by \u003cbr\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://morningtrain.dk\" target=\"_blank\"\u003e\n\u003cimg src=\"https://morningtrain.dk/wp-content/themes/mtt-wordpress-theme/assets/img/logo-only-text.svg\" width=\"200\" alt=\"Morningtrain logo\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorning-train%2Fwp-plugin-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorning-train%2Fwp-plugin-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorning-train%2Fwp-plugin-info/lists"}