I’m running a local dev instance of WP on my MacBookPro (WP 4.6.1 and WP-CLI 0.24.1).

Can anyone explain why I might see a list of 5 or 6 plugins that have available updates when I go to Admin’s update page (/wp-admin/update-core.php?force-check=1) but when I run wp-cli from the command line (wp plugin update –all –dry-run) it tells me ‘No updates available’? Are they using different mechanisms to check?

To be clear, there are times when they agree but it seems most times they disagree. And to add to the confusion, it almost seems like wp-cli interferes in some way: I can have a list of updates showing in Admin, I use wp-cli to verify I get the same results but it tells me there are none, I go back to the Admin and refresh and now there are none in that list either. If I wait some TBD amount of time, I can get the list to show again in the Admin.

I’m still trying to sort out if there’s a predictable set of steps for the above but is this expected behavior?

1 Answer
1

The most typical reason is that your web server and WP CLI use different PHP runtimes. Then, for example, if you have Object Cache enabled web server might have proper access to it, but command line PHP might not.

This can create various out of sync kinks, if I remember right WP CLI have added checks that straight disable some functions for some of such scenarios.

Of course it’s just a general guess, which might not be your case. Practical troubleshooting would involve dumping the related data (such as value of related options and transient cache entries) in both contexts.

Leave a Reply

Your email address will not be published. Required fields are marked *