Make WordPress Core

Opened 11 years ago

Last modified 3 years ago

#24925 new enhancement

Improve no disk space error handling when updating plugins

Reported by: daedalon's profile Daedalon Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Filesystem API Keywords: needs-patch 2nd-opinion
Focuses: Cc:


I received the following uninformative error message when trying to update a plugin (roughly translated from Finnish):

Error on updating BulletProof Security. Cannot create folder. /[WPDIR]/wp-content/upgrade/bulletproof-security.tmp.

The error was caused by not having enough disk space. The plugin update should check if that's the reason for the error and then display a more informative error message.

Change History (4)

#1 @csixty4
11 years ago

It's a great idea from a user experience standpoint, but complicated by the fact PHP's filesystem & FTP functions don't give any kind of useful error status. The filesystem code could do a set of triage checks after failures, but that would only identify reasons that *might* have prevented an upgrade from completing.

I'm working on a plugin called upgrade-first-aid that does those kinds of checks outside of the plugin upgrader itself. It might be a good idea to add a disk space check (disk_free_space()) to that plugin's code.

Last edited 11 years ago by csixty4 (previous) (diff)

#2 @SergeyBiryukov
11 years ago

  • Component changed from Plugins to Filesystem

#3 @chriscct7
9 years ago

  • Keywords needs-patch added

#4 @thomaschr
7 years ago

  • Keywords 2nd-opinion added
  • Severity changed from normal to minor
  • Type changed from defect (bug) to enhancement

I thought about adding a String Variable to the Filesystem Class called lasterrordetail.
With a new method getlasterrordetail() in the Filesystem Subclasses you can get a detailed errorstring for the last occured error.

This string can then be filled in the mkdir Method.

Sounds this to much like a dirty hack because I'm not using the WP Error Class?



PS: You can easily recreate the "Bug" when your disk is full and you're installing a new plugin.

PPS: Checking for a full filesystem in the path is simply a matter of calling disk_free_space($path). This holds true for the direct filesystem class, the others need to be handled differently.

Note: See TracTickets for help on using tickets.