You may be seeing warnings like this if you have WordPress Debug mode enabled:

“Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/USERNAME/public_html/wp-includes/functions.php on line 2913”

I am getting this with WordPress version 3.8.1, and the Domain Mapping plugin wordpress-mu-domain-mapping version 0.5.4.3 but “deprecated” messages happen with many, many plugins.

The wp-includes/functions.php is a WordPress core file. The function at the line mentioned is reporting the error, not the line with the error. To fix the error, you need to know where the error originates. I’m going to show you how to find that.

To see the back-trace (which program line is causing the ‘deprecated’ error), modify functions.php, about line 2900 (_deprecated_function begins a few lines above what the original error message says).

Add this line before the closing } of the “if (WP_DEBUG”, before two }’s from the end of that function. (I know, modifying a WP Core file??? but this is a temporary debugging fix, and you don’t care if a WordPress update undoes it) :
/* Added by GL 2014-06-23 */ echo '<pre>';trigger_error(print_r(debug_backtrace(), TRUE)); echo '</pre>';
so the function looks like this:

Thanks to vicchi.org for the technique.

Your PHP error log will have all this information, and it will display on screen. (You may have to select from the bottom of the messages, use shift-uparrow to select all the way to the start of the messages, underneath the WordPress bar, Ctrl-C to copy to clipboard):

See the “/wp-content/sunrise.php” and line 11, in “[1] => Array”, [file] and [line]? That’s the plugin file that generated the error. If you look in that file, at the line specified, there’s the deprecated function. Contact the plugin author to get it fixed, giving them the entire error message and backtrace.

Pin It on Pinterest

Share This