HEX
Server: LiteSpeed
System: Linux us-phx-web629.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User: u756937133 (756937133)
PHP: 8.2.30
Disabled: passthru,chgrp
Upload Files
File: //opt/.wp-cli/packages/vendor/wp-cli/doctor-command/features/check-plugin-active-count.feature
Feature: Check whether a high number of plugins are activated

  Scenario: Verify check description
    Given an empty directory

    When I run `wp doctor list --fields=name,description`
    Then STDOUT should be a table containing rows:
      | name                       | description                                                                    |
      | plugin-active-count        | Warns when there are greater than 80 plugins activated.                        |

  Scenario: Less than threshold plugins are active
    Given a WP install
    And I run `wp plugin activate --all`

    When I run `wp doctor check plugin-active-count`
    Then STDOUT should be a table containing rows:
      | name                | status  | message                                                   |
      | plugin-active-count | success | Number of active plugins (2) is less than threshold (80). |

  # WordPress Importer requirement.
  @require-wp-5.2
  Scenario: Greater than threshold plugins are active
    Given a WP install
    And a config.yml file:
      """
      plugin-active-count:
        class: WP_CLI\Doctor\Check\Plugin_Active_Count
        options:
          threshold_count: 3
      """
    And I run `wp plugin install debug-bar wordpress-importer`
    And I run `wp plugin activate --all`

    When I run `wp doctor check plugin-active-count --config=config.yml`
    Then STDOUT should be a table containing rows:
      | name                | status  | message                                             |
      | plugin-active-count | warning | Number of active plugins (4) exceeds threshold (3). |

  Scenario: Include network-enabled plugins in active plugin count
    Given a WP multisite installation
    And I run `wp plugin activate --network --all`

    When I run `wp doctor check plugin-active-count`
    Then STDOUT should be a table containing rows:
      | name                | status  | message                                                   |
      | plugin-active-count | success | Number of active plugins (2) is less than threshold (80). |