2

I'm using a few plugins and UpThemes framework on my new website and if I turn on Wp Debug I can see that there are a few errors related to Deprecated functions (but website is working). What I would like to know is if there is a plugin, a software or a pray (lol) that I can use to know exactly where the deprecated code is so I'll be able to use the new one.

Which is the plugin/software that you use to debug your plugins, themes?

8
  • 1
    No plugin or software involved. Including define('WP_DEBUG', true); in wp-config.php (located in your wordpress installation's root folder) tells you the file and the line of every warning. Nov 17, 2011 at 23:17
  • @Johannes Pille no, I'm sorry, it doesn't... it only says that inside my wp-include at line blablabla is written that has_cap is deprecated... ok thank you but where is has_cap in my code? :-)
    – maisdesign
    Nov 17, 2011 at 23:23
  • Mkay. There is a misconception here. If the warning is about something in /wp-icludes/xxx.php, then the faulty code is in that file. It has nothing to do with your code. The core has its flaws as well... Nov 17, 2011 at 23:30
  • Really so I have to upgrade my wp-include??? I didn't check it yet 'cause I tought that the problem was in my files :-)
    – maisdesign
    Nov 17, 2011 at 23:33
  • Nope, you don't have to change nothing. 1. Warnings and Notices are not Errors. 2. If there are flaws in the core, they will most likely be sorted out in the next wp upgrade. One clarification: Does it report that something is wrong in said file or does it report that according to said file something has been deprected? If the latter is the case, the flaw is not in said file. But again it need not be connected to your own code. Often plugins you have installed produce warnings as well. The older a plugin, the more likely it is to make use of deprecated stuff. Nov 17, 2011 at 23:48

5 Answers 5

1

What you're looking for is the Log Deprecated Notices plugin. (Don't run it on a production site, as it is a direct-to-database log.)

What it'll do is convert those cryptic messages that are likely to reference has_cap() or some line in functions.php, to what's actually going on.

The Debug Bar plugin is also nice. It tracks notices of that pageload, using the conversion code from Log Deprecated Notices.

2

I've used Theme Check in the past and found it very good. If I recall correctly, it checks against deprecated functions but most of all it suggests better functions to future-proof your theme, and alerts you when you're forgetting to implement features which WordPress' users have learnt to rely on.

1

The quickest way to do this is just using grep for the function name in it's theme/plugin folder. If your on windows you can use grepWin or agent ransack/powershell, etc.

Also install debug-bar, it's a lot nicer to look at.

0

During theme development you can make debug mode on by changing Debug value to 'true' in root config.php

This will keep debug and show error during development.

-2

Zend's Z-Ray has a theme profiler. Also useful for seeing SQL queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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