2

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
    wp cli update --- 0.25.0 is out now. Might not change things now but 0.24.X won't work with WP 4.7 moving forward. – jgraup Nov 8 '16 at 5:05
  • if not too late, try to delete all transients wp transient delete --all, and try the dry run again wp plugin update --all --dry-run. – prosti Dec 24 '16 at 14:32
  • @prosti - Good idea but I just tried it and it made no difference. Admin's update page shows 6 available updates and WP-CLI shows none. Strange. – DaveBurns Jan 10 '17 at 20:30
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.

  • I wondered about that. I'm running MAMP PRO and I have object caches turned off. I dumped wp-cli's info (using 'wp cli info') and it's using the correct version of PHP and php.ini, i.e. same as MAMP. Any suggestions for what I could look for in logs or transients or options, etc.? – DaveBurns Nov 7 '16 at 19:38
  • Well, pick one thing that's failing, figure out what data it accesses, check the data... There is a lot of stuff going on in WordPress core to make a wild guess. – Rarst Nov 7 '16 at 20:18

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.