最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cli - WP-CLI not recognizing commercial plugin updates

programmeradmin3浏览0评论

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 repository without any problems on this installation.

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 repository without any problems on this installation.

Share Improve this question asked Oct 22, 2015 at 9:46 NateWrNateWr 7924 silver badges14 bronze badges 8
  • 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 Commented Jun 30, 2016 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 Commented Jul 1, 2016 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 Commented Jul 1, 2016 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 Commented Jul 1, 2016 at 8:00
  • 2 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 Commented Aug 24, 2016 at 12:39
 |  Show 3 more comments

2 Answers 2

Reset to default 1

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/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/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.

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.

发布评论

评论列表(0)

  1. 暂无评论