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

WordPress Trac noreply at wordpress.org
Tue Jun 23 03:04:37 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:  4.3
Component:  Options, Meta APIs       |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------

Comment (by dd32):

 This shouldn't be causing any extra DB writes realistically.

 update_option() should (and does) notice that the array is unchanged,
 which prevents the writes occurring.
 The only way for this to trigger a write on every call of the function,
 would be if the callback value was changing every pageload, and if so,
 then that couldn't be used as a uninstall callback in the first place..

 That being said, there's nothing wrong with the attached patch, it just
 handles skipping the update at a higher level.

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


More information about the wp-trac mailing list