[wp-trac] [WordPress Trac] #31792: register_uninstall_hook causes large #s of unnecessary updates to wp_options
WordPress Trac
noreply at wordpress.org
Mon Jul 27 18:55:05 UTC 2015
#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):
Replying to [comment:5 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.
I missed this reply. I've seen this heavy write behavior on multiple
sites, the driver of writing this patch was seeing the query piling up in
the processlist. Any thoughts on what would drive update_option check to
fail, when the value isn't changing?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31792#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list