Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
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. –  Johannes Pille Nov 17 '11 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 '11 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... –  Johannes Pille Nov 17 '11 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 '11 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. –  Johannes Pille Nov 17 '11 at 23:48
show 3 more comments

4 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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