8

I'm running into an issue I haven't encountered before where WP-CLI is not recognizing plugin updates for commercial plugins.

The plugin updates appear in my WordPress dashboard, but running ../wp-cli.phar plugin update --all doesn't update them. If I run ../wp-cli.phar plugin list it doesn't show them as having updates.

I've run updates through WP-CLI for the same commercial plugins on other servers without any problem. The only thing different on this server is that I don't have sudo access, so, as you can see, I'm calling wp-cli.phar directly instead of via the wp command.

WP-CLI is processing plugin updates from the .org repository without any problems on this installation.

  • 1
    Hi Nate, I'm not able to replicate this calling wp-cli.phar directly with the pro version of Advanced Custom Fields. An update is available, and it shows as available in wp-cli's output. What plugins are you trying this with? Is it possible that they're bypassing WP's normal routines for this and thus not being picked up by wp-cli? – Tim Malone Jun 30 '16 at 5:41
  • Thanks for the reply Tim. I've found over the months that it's pretty sporadic, but tends to happen with plugins that use EDD's Software Licensing, which I believe use WP's normal techniques for updates. It's happened everywhere I've used WP-CLI (local dev, a few different servers). – NateWr Jul 1 '16 at 7:55
  • Hmm. I'll have to check if the commercial plugins I have use EDD as well. Have you logged an issue with wp-cli? – Tim Malone Jul 1 '16 at 7:57
  • No, I haven't logged an issue because it's so sporadic. I can't reliably reproduce it (I've wondered if it's an issue with transients). But Daniel has looked at this SE question and said he hadn't heard of a problem and couldn't think of anything that would cause it. – NateWr Jul 1 '16 at 8:00
  • 1
    Nate I ran in to a similar issue only last month, after a few hours scratching my head I found that my issue was directly related to a DNS resolver issue on the host. Ultimately the host was timing out while resolving DNS so it never was able to connect to the update's source to perform the check. The sporadic nature of your issue would suggest you are having a similar problem. I'd take a few minutes to verify DNS resolution and outbound connections from the host. – Steve Aug 24 '16 at 12:39
0

What you experienced may be some network level problem or someone temporary removed the download resources. For instance before the update.

Most of the details you can get from the source code https://github.com/wp-cli/wp-cli.

Plugin update function in there looks like this.

function update( $args, $assoc_args ) {
        if ( isset( $assoc_args['version'] ) ) {
            foreach ( $this->fetcher->get_many( $args ) as $plugin ) {
                $assoc_args['force'] = 1;
                $this->install( array( $plugin->name ), $assoc_args );
            }
        } else {
            parent::update_many( $args, $assoc_args );
        }
    }

And when you specify wp plugin update --all it actually goes through the parent::update_many function, where the parent is actually CommandWithUpgrade class.

Bottomline, wp-cli uses resources provided by plugins like this:

# Install from a remote zip file
wp plugin install http://s3.amazonaws.com/bucketname/my-plugin.zip?AWSAccessKeyId=123&Expires=456&Signature=abcdef

But there you can see the information you should not see.

Sidenote

Please note that some premium plugins does not support being upgraded via WP-CLI. E.g. I know BackupBuddy and Gravity Forms works fine, but the plugins from Yoast does not. This may change.

0

The user who executes wp-cli needs write permissions on wp-content and subdirectories – if only some plugins fail, maybe these plugins' directories are read-only for that user.

There is a bug in wp cli which will not report missing file permissions, and instead reports that the plugin is already updated.

The described symptoms apply to that situation, hence this will be a solution for some.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.