[wp-trac] [WordPress Trac] #18826: wp_maintenance() expiration time needs to be filterable

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 1 01:23:22 UTC 2011


#18826: wp_maintenance() expiration time needs to be filterable
-----------------------------+------------------------------
 Reporter:  jaredh123        |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  3.3
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |
-----------------------------+------------------------------
Changes (by dd32):

 * keywords:  has-patch => 2nd-opinion


Comment:

 > Adding a filter to allow plugins and themes to filter this time to
 increase/decrease it

 Can't be done there, apply_filters() isn't even loaded yet, and Plugins
 definitely aren't loaded. Any filtering would have to be on the $time
 value stored within the `.maintainence` file itself.

 > Also, while I was in there, it seems prudent to attempt to delete the
 file if it has expired.

 The main reason that wouldn't be done already, is the fact that not all
 servers have write access to the directory, would ultimately mean
 attempting to delete it on every page load.

 Deleting the file isn't too much of a problem IMO, given once it's expired
 it'll skip through that section of code anyway. It'll just get cleaned up
 the next time an upgrade is attempted otherwise.

 > changing the default expiration to 5 minutes (300 seconds)
 As bad as this sounds: The reason it's set to 10 minutes, is because while
 most upgrades complete within a few minutes and clean the file up once
 done, not all do, I've seen a few hosts take >5 minutes for upgrades.

 Clearing the timeout too early will cause the site to come back online
 before the process has finished for some people (the whole reason the
 maintainence file is there).

 The majority of failed install attempts should clear the maintainence lock
 when it detects a failure, of course, if PHP is simply shut down
 completely mid-load, there's not much it can do - same for when the FTP
 connection dies and doesn't reconnect for some.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18826#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list