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

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 7 09:36:39 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 scribu):

 Replying to [comment:25 batmoo]:
 > Replying to [comment:23 scribu]:
 > > I've added an is_admin() at the beginning, to keep the front-end light
 and free of potential weirdness.
 >
 > The one potential problem with only firing the update hook on is_admin
 is that the front-end is going to have updated plugin code which likely
 expects updated data, and that's more likely to cause weirdness.

 Considering that 99.9% of plugin updates will be done through the admin, I
 don't think this is a problem.

 > And from the looks of it, the current patch fires
 update_option/update_site_option on every page load for all update hooks
 registered. It might be better be to fire those only if the version is
 different.

 update_option() and update_site_option() do an UPDATE only if the new
 value is different from the old value, so it's the same thing.

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


More information about the wp-trac mailing list