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.

When I program a theme, I put WP-DEBUG on. Which ensure a proper PHP code.

Sadly most Plugin developers keeps using non existing vars :

echo $args['title'];

Notice: Undefined index: title in /wp-content/plugins/easy-fancybox/easy-fancybox.php on line 301

Instead of

echo ( isset($args['title']) ? $args['title'] : '' );

So I permanently get tens of Notice errors with some plugins (even MU gets one !)

Thanks to a Debugbar I don't see them on my websites, not in the middle, they are all deported to the bottom.

But how could I hide them in the Dashboard the same way? I would like to push them to the bottom of the page.

UPDATE: Actually, Debugbar hides them in Admin and Website the same way, I just didn't notice that it didn't work for this particular plugin for once. Notices errors were between <script> tags

share|improve this question
2  
+1 This **** is **** annoying! But I'm not really sure how this is on topic and not a PHP question better asked at SO. Anyway: The problem isn't really moving this stuff. You are also unable to find your own errors and warning in between the plugin warnings. So moving them to the bottom doesn't really help much... The question should be more like "How can I push/punch/force/knock-out developers offering such crappy coded plugins?"... –  kaiser Oct 10 '12 at 11:51
    
The way I deal with that is that I temporarily disable all the plugins. It's not perfect, but better than gazillion stupid errors from 9yo developers. –  Miha Rekar Oct 10 '12 at 14:51
2  
I keep warning the plugins programmers, and each of them replied positively. I thank them in first place for sharing their work and would never call them 9yo dev because their plugin is really efficient sometimes –  Christian Oct 10 '12 at 15:27

1 Answer 1

up vote 4 down vote accepted

I don’t know how to move the notices to the bottom or if that’s possible at all. To disable the debug mode in wp-admin write in wp-config.php:

define( 'WP_DEBUG', FALSE === strpos( $_SERVER['REQUEST_URI'], '/wp-admin/' ) );

Untested:

You could try to enable warnings in admin with:

// happens early in wp-admin/admin.php
add_filter( 'secure_auth_redirect', 'wpse_67728_error_warnings' );

function wpse_67728_error_warnings( $in )
{
    // anything but notices
    error_reporting(E_ALL ^ E_NOTICE);
    return $in;
}
share|improve this answer
    
Thank you it could be a good in-between solution, but we can't see any warning in the admin zone though :-/ I wish I could still see them somehow –  Christian Oct 10 '12 at 15:24
    
@Christian See my update. Not tested, please report back. –  toscho Oct 10 '12 at 16:40
    
tested, it makes all notices disappear from /wp-admin/ only. Thank you it will do until the new version of these plugins (the devs said they will correct them in next version) –  Christian Oct 11 '12 at 9:30
    
and I put an update: Actually, Debugbar hides them in Admin and Website the same way, I just didn't notice that it didn't work for this particular plugin for once. Notices errors were between <script> tags. So the problems laid somewhere else –  Christian Oct 11 '12 at 9:38

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.