• Hi, I was wondering if you ever had this issue before:

    I got the error “Notice: get_currentuserinfo is deprecated since version 4.5! Use wp_get_current_user() instead. In /public_html/wp-includes/functions.php on line 3658

    The file and line mentioned just refer to the error message itself, so I deactivated all the plugins to isolate the problem but it still showed up. The theme I’m using checked out too. I eventually found your wonderful plugin that (if I understand correctly) should show the exact location of the error, but strangely enough it’s not listed in its overview.

    Any idea why it’s not listed, and if there’s a way that the plugin is simply not able to find the location of the error?

    Thanks

    https://www.ads-software.com/plugins/query-monitor/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Timvg

    (@timvangorp)

    Found it by doing a manual search through the files… although Query Monitor looks awesome, I would have expected it to catch the location though.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    This sounds interesting.

    Is QM showing the notice at all, or is it missing it completely?
    Can you explain a little about where the get_currentuserinfo() call is being made? Is it in a plugin, a mu-plugin, or a drop-in?
    Is there anything out of the ordinary about your site’s configuration?

    Nope, no notice at all.

    I found 2 plugins that cause this deprecated notice (as of posting this reply), WPIDE and Duplicate Post but neither show up in the query monitor list. Maybe this will help you figure out how to capture this notice and what file/line generates it.

    I used the String Locator plugin to quickly find which files included this deprecated function.

    Both plugins mentioned above have been notified if this deprecated function within their code.

    Duplicate Post has updated their code to use wp_get_current_user(). WPIde hasn’t been updated in 10 months, so I doubt they’ve fixed their code.

    I used this code (link to GitHub Gist) to test how many notices QM receives, and compared that with the number of tally marks (“I”), as well as the number of errors in wp-content/debug.log (activated by adding define( 'WP_DEBUG_LOG', true ); to wp-config.php); all three sources recorded the error 15 times.

    Use the code to test on your own install, and see if the counts match up; drop the file into your wp-content/mu-plugins folder with QM activated, and then compare. Interested to see if the reports are all the same. If not, we can move from there.

    Oh man, I’m sorry to say I don’t recall what site I was working on at that time but I do recall reporting it to WPIDE and fixing the core plugin as needed. I expect when and if they get around to it the update will include it. In the case of Duplicate Post, it exists only as a fallback and that is why it showed up in the query. Thanks for the snippet, it can be useful for other debugging scenarios.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error not listed in Query Monitor’ is closed to new replies.