6

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

Sadly most Plugin developers keep 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

3
  • 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
    Commented Oct 10, 2012 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
    Commented Oct 10, 2012 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
    Commented Oct 10, 2012 at 15:27

3 Answers 3

4

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;
}
4
  • 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
    Commented Oct 10, 2012 at 15:24
  • @Christian See my update. Not tested, please report back.
    – fuxia
    Commented Oct 10, 2012 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
    Commented Oct 11, 2012 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
    Commented Oct 11, 2012 at 9:38
0

If you want to remove the notice error in fontend use this code:

ini_set( 'display_errors', 'Off' );
ini_set( 'error_reporting', E_ALL );
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
0

put these lines in your wp-config.php file

define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', false );

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.