WP-CLI not recognizing commercial plugin updates

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.

2

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.

Leave a Comment