定制 iandunn/wp-cli-plugin-active-on-sites 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iandunn/wp-cli-plugin-active-on-sites

Composer 安装命令:

composer require iandunn/wp-cli-plugin-active-on-sites

包简介

A WP-CLI command to list all sites in a Multisite network that have activated a given plugin

README 文档

README

A WP-CLI command to list all sites in a Multisite network that have activated a given plugin.

Examples / Usage

Find all sites where a specific plugin is active:

> wp plugin active-on-sites eu-cookie-law-widget

Checking each site  100% [==================================================] 0:02 / 0:03

Sites where eu-cookie-law-widget is active:
+---------+----------------------------------------+
| blog_id | url                                    |
+---------+----------------------------------------+
| 320     | http://2014.madrid.wordcamp.test/      |
| 371     | http://2014.paris.wordcamp.test/       |
| 413     | http://2015.london.wordcamp.test/      |
| 464     | http://2015.milano.wordcamp.test/      |
| 522     | http://2016.geneva.wordcamp.test/      |
| 571     | http://2016.belfast.wordcamp.test/     |
| 654     | http://2017.europe.wordcamp.test/      |
+---------+----------------------------------------+

Find all installed plugins that aren't active on any site:

> wp plugin active-on-sites --none

Checking each site  100% [==================================================] 0:02 / 0:03

Plugins not active on any site:
+---------------------------+------------------------------+
| slug                      | name                         |
+---------------------------+------------------------------+
| akismet                   | Akismet Anti-Spam            |
| wordpress-seo             | Yoast SEO                    |
+---------------------------+------------------------------+

See wp help plugin active-on-sites for details specifying fields, output format, etc.

Installing

  1. Ensure your composer.json has composer/installers and an installer-paths entry for type:wordpress-plugin. Most Composer-managed WordPress projects already have this.

    {
        "require": {
            "composer/installers": "^2.0"
        },
        "extra": {
            "installer-paths": {
                "wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
            }
        }
    }
  2. Install the plugin:

    composer require iandunn/wp-cli-plugin-active-on-sites
  3. Activate the plugin:

    wp plugin activate wp-cli-plugin-active-on-sites --network

Local Development

git clone https://github.com/iandunn/wp-cli-plugin-active-on-sites
composer install
composer prepare-tests
composer test           # run all tests
composer test-rerun		# re-run only failed scenarios

composer test -- features/plugin-active-on-sites.feature        # run a single feature file
composer test -- features/plugin-active-on-sites.feature:42		# run a single scenario by line number
composer test -- --tags=@network                                # run only network-activation scenarios

When run inside a LocalWP shell, composer test routes to bin/behat-localwp, which auto-detects the MySQL socket. Outside LocalWP (e.g. CI), it falls back to run-behat-tests.

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 44
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 44
  • Watchers: 4
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固