[wp-trac] [WordPress Trac] #31792: register_uninstall_hook causes large #s of unnecessary updates to wp_options

WordPress Trac noreply at wordpress.org
Fri Mar 27 19:21:40 UTC 2015


#31792: register_uninstall_hook causes large #s of unnecessary updates to
wp_options
--------------------------+-----------------------------
 Reporter:  jeichorn      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 register_uninstall_hook hook causes a write to wp_options everytime it is
 run.  Plugin authors don't seem to have noticed this (this fact isn't made
 clear in the documentation), so they are registering it like any other
 hook instead of inside of their activation hook.

 While you could update the documentation, fixing all the existing themes
 would be a huge chore (in a same of 100 plugins 5 are calling the hook on
 every page load).

 Removing the write is easily doable with a couple line patch (attached).
 This is not optimal since it still causes an extra database read, but its
 much better at least.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31792>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list