Opened 13 years ago
Last modified 5 years ago
#24925 new enhancement
Improve no disk space error handling when updating plugins
| Reported by: | Daedalon | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Filesystem API | Version: | |
| Severity: | minor | Keywords: | needs-patch 2nd-opinion |
| Cc: | Focuses: |
Description
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)
#4
@
10 years ago
- Keywords 2nd-opinion added
- Severity normal → minor
- Type defect (bug) → 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?
Greetings,
Thomas
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.