L337xyz
Server: LiteSpeed
System: Linux in-mum-web831.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: u786315844 (786315844)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/.wp-cli/packages/vendor/wp-cli/extension-command/features/plugin-get.feature
Feature: Get WordPress plugin

  Scenario: Get plugin info
    Given a WP install
    And a wp-content/plugins/foo.php file:
      """
      /**
       * Plugin Name: Sample Plugin
       * Description: Description for sample plugin.
       * Requires at least: 6.0
       * Requires PHP: 5.6
       * Version: 1.0.0
       * Author: John Doe
       * Author URI: https://example.com/
       * License: GPLv2 or later
       * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
       * Text Domain: sample-plugin
       */
      """

    When I run `wp plugin get foo --fields=name,author,version,status`
    Then STDOUT should be a table containing rows:
      | Field   | Value    |
      | name    | foo      |
      | author  | John Doe |
      | version | 1.0.0    |
      | status  | inactive |

    When I run `wp plugin get foo --format=json`
    Then STDOUT should be:
      """
      {"name":"foo","title":"Sample Plugin","author":"John Doe","version":"1.0.0","description":"Description for sample plugin.","status":"inactive"}
      """

  @require-wp-6.5
  Scenario: Get Requires Plugins header of plugin
    Given a WP install
    And a wp-content/plugins/foo.php file:
      """
      <?php
      /**
       * Plugin Name: Foo
       * Description: Foo plugin
       * Author: John Doe
       * Requires Plugins: jetpack, woocommerce
       */
      """

    When I run `wp plugin get foo --field=requires_plugins`
    Then STDOUT should be:
      """
      jetpack, woocommerce
      """

  @require-wp-5.3
  Scenario: Get Requires PHP and Requires WP header of plugin
    Given a WP install
    And a wp-content/plugins/foo.php file:
      """
      <?php
      /**
       * Plugin Name: Foo
       * Description: Foo plugin
       * Author: John Doe
       * Requires at least: 6.2
       * Requires PHP: 7.4
       */
      """

    When I run `wp plugin get foo --fields=requires_wp,requires_php`
    Then STDOUT should be a table containing rows:
      | Field        | Value |
      | requires_wp  | 6.2   |
      | requires_php | 7.4   |