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

WordPress Trac noreply at wordpress.org
Thu Mar 17 01:32:06 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 dd32):

 Replying to [comment:12 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.

 This should be prevented since WordPress 3.1 - [16339]. Can you see how
 that's being bypassed?

 I have a feeling this may be caused because the plugin registered it prior
 to that code being added in 3.1, and ultimately having that value stuck in
 the array?
 If the plugin were to fix itself and register a valid uninstall hook, the
 issue would clear itself - but I'm guessing the plugin never did.

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


More information about the wp-trac mailing list