Debugging duplicate query exec in WordPress

During debugging a plugin malfunction I had duplicate option update SQL queries and after som thinking I came up with the following debug line to catch the trace of duplicate function call:

 error_log(var_export(debug_backtrace(), true));

I placed it above the return line in update_option() function in wp-includes/option.php

Finally had a trace in php/apache error_log file.

The second query came from an action hook in another plugin 😦


Author: Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at Co-founded Blog at

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s