[wp-trac] [WordPress Trac] #50612: Cancelling a plugin update from an uploaded .zip file leaves the plugin .zip in the uploads directory

WordPress Trac noreply at wordpress.org
Thu Jul 9 18:53:25 UTC 2020


#50612: Cancelling a plugin update from an uploaded .zip file leaves the plugin
.zip in the uploads directory
-----------------------------+-----------------------
 Reporter:  psykro           |       Owner:  (none)
     Type:  defect (bug)     |      Status:  reopened
 Priority:  normal           |   Milestone:  5.5
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+-----------------------

Comment (by azaozz):

 > if the user chooses to cancel the update, the uploaded plugin file is
 left in the relevant uploads directory.

 Yes, that happens for all packages if the installing/updating was
 interrupted for some reason. There's a cron job to do cleanup:
 https://github.com/WordPress/WordPress/blob/master/wp-admin/includes
 /class-file-upload-upgrader.php#L87 in two hours.

 However these can be deleted immediately when the user has clicked "Cancel
 and go back". Patch coming up.

 > I assume there's a technical reason for that.

 Right. The packages are handled by creating a "private attachment" (to
 reuse the file upload functionality). Perhaps can look into not listing
 these attachments in the Media Library "list view". They will disappear in
 couple of hours anyway.

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


More information about the wp-trac mailing list