I recently updated my WordPress to latest version, and now I'm getting following messages:

Notice: get_currentuserinfo is deprecated since version 4.5! Use wp_get_current_user() instead. in /X/wordpress/wp-includes/functions.php on line 3658

Notice: add_object_page is deprecated since version 4.5! Use add_menu_page() instead. in /X/wordpress/wp-includes/functions.php on line 3658

How can I pinpoint whoever is responsible for generating these PHP notices?

  • sorry if this is wrong place to ask my question, feel free to move, wherever is appropriate, thanks! – alexus May 31 '16 at 15:17
  • Thanks, that is exactly what I was thinking of doing) I guess that's the only way to know for sure... – alexus May 31 '16 at 15:20
  • Check your theme. Revert to Twenty Sixteen or other default wordpress theme and see if you still get the errors. If it is the theme, you won't have to go through and check all the plugins. – AntonChanning May 31 '16 at 15:24
  • maybe some day this core.trac.wordpress.org/ticket/36981 or equivalent will be implemented in core – Mark Kaplun May 31 '16 at 17:05

It is quite easy to pinpoint issues like this, that is, if you have a mirror installation locally. All you need is a fairly decent code editor with a basic search functionality. All you would need to do then is search your wp-content folder for the functions pinpointed in the debug notices. This way, you quickly and exactly know where these functions are used.

This is most probably the fastest and easiest way to track these type of issues. To be really honest, deactivating plugins and themes will only tell you which plugin and theme, not the file or line where the issue is


Thanks to @MarkKaplun in comments

If you have an SSH access to the server,the grep utility (assuming linux here) is more then enough for this as well

  • If you have an SSH access to the server,the grep utility (assuming linux here) is more then enough for this as well. – Mark Kaplun May 31 '16 at 16:56

There are multiple techniques that can apply to this, depending on your level of access and long term priorities:

  1. In development with access to source code just searching for the function calls is trivial in most IDEs.
  2. In runtime there are various solutions which enhance the content and presentation of errors for display and/or logging, including providing backtraces to the origin. For myself I prefer whoops error handler, for which I make a small wps plugin.
  3. There are solutions to track WP's deprecation messages specifically, for example Log Deprecated Notices plugin by one of core developers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.