miya0001 / wp-cli-plugins-api
WP-CLI 的插件 API 命令
1.0.1
2016-10-20 19:59 UTC
Requires (Dev)
- behat/behat: ~2.5
This package is not auto-updated.
Last update: 2024-09-20 21:42:33 UTC
README
这是一个用于从 WordPress.org 插件 API 获取插件信息的 WP-CLI 命令。
wp plugins-api author <author>
- 获取特定作者的插件列表。wp plugins-api browse <browse>
- 获取热门/新/更新/高分评级的插件列表。wp plugins-api info <slug>
- 获取特定插件的详细信息。
$ wp plugins-api author miyauchi
+---------------------------------+---------+--------+----------+--------+-------------+
| name | version | tested | requires | rating | downloaded |
+---------------------------------+---------+--------+----------+--------+-------------+
| Nginx Cache Controller | 3.1.0 | 4.0.1 | 3.4 | 100.0 | 33,423 |
| Simple Map | 2.2.0 | 4.0.1 | 3.3 | 100.0 | 61,506 |
| Content Bootstrap | 0.7.0 | 4.0.1 | 3.4 | 100.0 | 2,715 |
| oEmbed Gist | 1.6.1 | 4.0.1 | 3.5.2 | 100.0 | 3,733 |
| Posts from a Category Widget | 1.0.1 | 4.0.1 | 3.4 | 100.0 | 8,784 |
| Child Pages Shortcode | 1.9.1 | 4.0.1 | 3.4 | 95.6 | 43,401 |
| WP Total Hacks | 1.9.0 | 4.0.1 | 3.5 | 99.4 | 173,521 |
+---------------------------------+---------+--------+----------+--------+-------------+
30 plugins. 449,591 downloads.
系统要求
- PHP >=5.3
- wp-cli >=0.17.0
安装
不使用 composer 安装。
$ mkdir ~/.wp-cli
$ touch ~/.wp-cli/config.yml
$ mkdir ~/.wp-cli/commands
然后进行安装。
$ cd ~/.wp-cli/commands
$ git clone git@github.com:miya0001/wp-plugins-api.git
然后编辑 ~/.wp-cli/config.yml 文件,使其看起来像以下内容。
require:
- commands/wp-plugins-api/cli.php
使用 composer 安装。
- 设置包索引
php composer.phar require miya0001/wp-plugins-api=dev-master
请参阅文档。
https://github.com/wp-cli/wp-cli/wiki/Community-Packages
如何开发
$ git clone git@github.com:miya0001/wp-plugins-api.git
$ composer install
然后创建或编辑 ~/.wp-cli/config.yml 文件,使其看起来像这样
require:
- /path/to/wp-plugins-api/cli.php
功能测试
在本地初始化测试环境。
$ WP_CLI_BIN_DIR=/tmp/wp-cli-phar WP_CLI_CONFIG_PATH=/tmp/wp-cli-phar/config.yml bash bin/install-package-tests.sh
然后运行测试。
$ WP_CLI_BIN_DIR=/tmp/wp-cli-phar WP_CLI_CONFIG_PATH=/tmp/wp-cli-phar/config.yml vendor/bin/behat
另请参阅