[wp-trac] [WordPress Trac] #14912: Introduce register_upgrade_hook()

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 7 08:11:43 UTC 2010


#14912: Introduce register_upgrade_hook()
-----------------------------+----------------------------------------------
 Reporter:  scribu           |       Owner:                
     Type:  enhancement      |      Status:  new           
 Priority:  normal           |   Milestone:  Future Release
Component:  Upgrade/Install  |     Version:                
 Severity:  normal           |    Keywords:  has-patch     
-----------------------------+----------------------------------------------

Comment(by Denis-de-Bernardy):

 Expanding on that last remark, there should probably be two procedures.
 One that tells the plugin to run the upgrade code on all page loads,
 regardless of where we are on the site. The other that tells the plugin to
 make these changes persistent, which runs in the admin area only,
 preferably only when the admin is logged in, and which updates the stored
 plugin version. This, to avoid hammering the DB on large sites.

 The two functions need to be well documented, too, so they're not misused.
 Most plugin devs don't realize that non-atomic upgrade code can wreck
 their data when it's run concurrently on multiple page loads.

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


More information about the wp-trac mailing list