wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
89 stars 80 forks source link

Search finds plugins, but install doesn't. #98

Closed jondkelley closed 2 years ago

jondkelley commented 6 years ago

I'm noticing wp plugin acting a bit odd. This is in WP-CLI 1.5.1. I haven't seen an explanation for this behavior in the docs.

Search

wp plugin search "Force Strong Passwords"
PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in . 
phar:///usr/bin/wp/php/WP_CLI/Runner.php(1138) : eval()'d code on line 99
Success: Showing 10 of 49 plugins.
+------------------------------------------------------------------------+------------------------------------+--------+
| name                                                                   | slug                                | rating |
+------------------------------------------------------------------------+-------------------------------------+--------+
| Force Strong Passwords                                                 | force-strong-passwords              | 84     |    +------------------------------------------------------------------------+-------------------------------------+--------+

Install

wp --path=/srv/wordpress plugin activate "force-strong-passwords"
PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in . 
phar:///usr/bin/wp/php/WP_CLI/Runner.php(1138) : eval()'d code on line 99
Warning: The 'force-strong-passwords' plugin could not be found.
Error: No plugins activated.
schlessera commented 6 years ago

@jondkelley The output shows that you have a configuration issue with the install you're using to install the plugin:

PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in . 
phar:///usr/bin/wp/php/WP_CLI/Runner.php(1138) : eval()'d code on line 99

This points to some problem with wp-config.php or other config files that redefine an existing constant.

Please make sure your setup is correctly configured and then test whether you can replicate the issue.

A quick test on my system let me install the above plugin without issues: image 2018-05-22 at 6 01 29 am

technosailor commented 3 years ago

I'm not clear if this issue is still a thing. I've tested on the master branch with WP_ALLOW_MULTISITE defined twice.

Search:

localhost/app/public wp plugin search "Enforce Strong Password"
PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48

Notice: Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48
Success: Showing 25 of 25 plugins.
+-------------------------------------------------------------------------------+----------------------------------------------------------+--------+
| name                                                                          | slug                                                     | rating |
+-------------------------------------------------------------------------------+----------------------------------------------------------+--------+
| iThemes Security (formerly Better WP Security)                                | better-wp-security                                       | 94     |
| Restrict Content Pro – Enforce Strong Passwords                         | rcp-strong-passwords                                     | 0      |
| All In One WP Security & Firewall                                         | all-in-one-wp-security-and-firewall                      | 96     |
| WP 2FA – Two-factor Authentication for WordPress                        | wp-2fa                                                   | 100    |
| WC Password Strength Settings                                                 | wc-password-strength-settings                            | 90     |
| Simple Membership                                                             | simple-membership                                        | 88     |
| WordPress Security – Firewall, Malware Scanner, Secure Login and Backup | wp-security-pro                                          | 88     |
| Pods – Custom Content Types and Fields                                  | pods                                                     | 98     |
| WordPress Membership Plugin – Restrict Content                          | restrict-content                                         | 74     |
| RegistrationMagic – Custom Registration Forms and User Login            | custom-registration-form-builder-with-submission-manager | 90     |
| WaterWoo PDF Plugin                                                           | waterwoo-pdf                                             | 90     |
| Photography Management – WordPress Photo Proofing Plugin                | photography-management                                   | 82     |
| WP User Manager – User Profile Builder & Membership                 | wp-user-manager                                          | 96     |
| Woocommerce Enforce Strong Password                                           | woocommerce-enforce-strong-password                      | 80     |
| IP Geo Block                                                                  | ip-geo-block                                             | 86     |
| Login Security Solution                                                       | login-security-solution                                  | 88     |
| WP PGP Encrypted Emails                                                       | wp-pgp-encrypted-emails                                  | 90     |
| Enforce Strong Password                                                       | enforce-strong-password                                  | 80     |
| WP Webdoctor                                                                  | wp-webdoctor                                             | 0      |
| Minimum Password Strength                                                     | minimum-password-strength                                | 66     |
| WP Smart Security                                                             | wp-smart-security                                        | 100    |
| s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)   | s2member                                                 | 78     |
| Skytells Guard – All-In-One Security Pack                               | skytells-guard                                           | 100    |
| Qualpay Payment Plugin for WooCommerce                                        | qualpay                                                  | 100    |
| Arevico Security Basic                                                        | arevico-security-basic                                   | 0      |
+-------------------------------------------------------------------------------+----------------------------------------------------------+--------+

Install:

localhost/app/public wp plugin install enforce-strong-password
PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48

Notice: Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48
Installing Enforce Strong Password (1.3.5)
Downloading installation package from https://downloads.wordpress.org/plugin/enforce-strong-password.1.3.5.zip...
Using cached file '/Users/aaronbrazell/.wp-cli/cache/plugin/enforce-strong-password-1.3.5.zip'...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Success: Installed 1 of 1 plugins.

List:

localhost/app/public wp plugin list
PHP Notice:  Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48

Notice: Constant WP_ALLOW_MULTISITE already defined in /Users/aaronbrazell/code/wp-cli/php/WP_CLI/Runner.php(1211) : eval()'d code on line 48
+----------------------------+----------+-----------+---------+
| name                       | status   | update    | version |
+----------------------------+----------+-----------+---------+
| advanced-custom-fields     | inactive | none      | 5.9.3   |
| acf-extended               | inactive | none      | 0.8.7.4 |
| akismet                    | inactive | available | 4.1.2   |
| amp                        | inactive | available | 2.0.5   |
| enforce-strong-password    | inactive | none      | 1.3.5   |
| hello-dolly                | inactive | none      | 1.7.2   |
| jetpack                    | inactive | none      | 9.1     |
| newspack-plugin            | inactive | none      | 1.24.0  |
| newspack-blocks            | inactive | none      | 1.14.0  |
| pwa                        | inactive | none      | 0.5.0   |
| google-site-kit            | inactive | available | 1.20.0  |
| wordpress-seo              | inactive | available | 15.2.1  |
| slt-force-strong-passwords | must-use | none      | 1.6.4   |
| wpe-wp-sign-on-plugin      | must-use | none      | 1.5.5   |
| wpengine-security-auditor  | must-use | none      | 1.0.9   |
| advanced-cache.php         | dropin   | none      |         |
+----------------------------+----------+-----------+---------+
Sidsector9 commented 2 years ago

I've tested with the same results as @technosailor. Closing this as issue is no loner reproducible.