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

WordPress Trac noreply at wordpress.org
Wed Mar 16 23:56:31 UTC 2016


#31792: register_uninstall_hook causes large #s of unnecessary updates to
wp_options
-------------------------------------+-----------------------------
 Reporter:  jeichorn                 |       Owner:  jorbin
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  Future Release
Component:  Options, Meta APIs       |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------------

Comment (by jeichorn):

 So this finally happened to me again.  I was able to trace down the cause.

 Objects are being stored in the uninstall_plugins due to the uninstall
 being callbacks being on classes.  The un-serization happens in the first
 plugin that calls register_uninstall_hook, but the classes used by other
 plugins aren't loaded yet, set they un-serialize as
 __PHP_Incomplete_Class.  Then when the next plugin calls
 register_uninstall_hook, its serializing an object with the actual class
 name so its a different value in PHP, so the comparison in update_option
 fails.

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


More information about the wp-trac mailing list