afragen/add-plugin-dependency-api
Composer 安装命令:
composer require afragen/add-plugin-dependency-api
包简介
Library that helps WordPress plugin dependency management.
README 文档
README
- Contributors: Andy Fragen, contributors
- Tags: plugin dependency
- Requires at least: 6.0
- Requires PHP: 5.6
- Stable tag: main
- Donate link: https://thefragens.com/git-updater-donate
- License: MIT
Composer library for adding a plugin dependency response based upon use with Git Updater v12 or greater.
Description
This is an example to developers of non dot-org plugins that wish to take advantage of the Plugin Dependencies feature from the Requires Plugins header.
You can use composer to install this package within your WordPress plugin / theme.
Please ensure you are using the latest version of this framework in your composer.json
- Within your plugin or theme root folder, run the following command:
composer require afragen/add-plugin-dependency-api
- Add a filter to your plugin that requires a dependency that returns an array or JSON response containing a REST endpoint that returns a valid
plugins_api()response.
A query arg of the plugin slug, ?slug=my-plugin-dependency, will be passed to the endpoint returned from the filter. The slug originates from the Require Plugins header.
// Add the sites with REST enpoints that return plugins_api() data when passed `slug` query arg. // You can also return URL to a JSON file containing the appropriate data. add_filter( 'plugin_dependency_endpoints', function () { return [ 'https://git-updater.com/wp-json/git-updater/v1/plugins-api/' ]; } );
To see an example REST endpoint return view https://git-updater.com/wp-json/git-updater/v1/plugins-api/?slug=git-updater in the browser.
Development
PRs are welcome against the develop branch.
afragen/add-plugin-dependency-api 适用场景与选型建议
afragen/add-plugin-dependency-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 6, 最近一次更新时间为 2022 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 afragen/add-plugin-dependency-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 afragen/add-plugin-dependency-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-02