[wp-trac] [WordPress Trac] #32086: AJAX plugin update says it updated when in reality it didn't

WordPress Trac noreply at wordpress.org
Fri Apr 24 19:26:02 UTC 2015


#32086: AJAX plugin update says it updated when in reality it didn't
-------------------------------------+-----------------------------
 Reporter:  Viper007Bond             |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.2.1
Component:  Plugins                  |     Version:  4.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  administration
-------------------------------------+-----------------------------

Comment (by magicroundabout):

 One more thing...sorry.

 It was bugging me, as a travelled home from the office, that in my case
 (with a disconnected network) only the FIRST update incorrectly reported
 success. I've not xdebugged it to be sure, but I THINK this is because
 `Plugin_Upgrader->bulk_upgrade()` calls `wp_clean_plugins_cache()` at the
 end, regardless.

 My guess is that this wipes out any stored data about plugin updates.
 Successive attempts to run updates, with the network offline, then fail
 because the plugins_cache is empty (it won't be refreshed because the
 network is offline) and implies that there is nothing to do.

 So I can explain the behaviour, I think. But I wonder, more generally, if
 clearing the cache here is the right thing to do. Let me explain:

 It's unlikely but I can imagine a situation where (with the network
 online):
  - User visits the plugins screen and sees some updates for plugins X, Y,
 and Z.
  - The update for plugin Z is a minor update, say, v1.0.0 to 1.0.1
  - User clicks update for plugins X and Y
  - AT THIS EXACT MOMENT the author of plugin Z releases a new major
 version with breaking changes (we'll ignore time from commit to actually
 being available to download from the repo)

 The user's screen now does not reflect reality.  They could click the
 update for plugin Z thinking it's a non-breaking minor update, only to
 find that they get a major update that breaks their site.

 So, my other question: should `wp_ajax_update_plugin()` in `ajax-
 actions.php` pass `clear_update_cache => false` to
 `$upgrader->bulk_upgrade()` ?  This is possibly a question for another
 ticket?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32086#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list