Support » Plugin: Dashboard: Scheduled Posts » Notice: attribute_escape and Undefined index on WP 3.1.3

  • Resolved  

    (@cor-van-noorloos)


    Hello,

    Using WordPress 3.1.3 I’m receiving a few notices:

    Notice: attribute_escape is deprecated since version 2.8! Use esc_attr() instead. in /home/design24/public_html/klanten/23/wp-includes/functions.php on line 3303

    which was an easy fix, but

    Notice: Undefined index: dashboard_scheduled_posts in /home/design24/public_html/klanten/23/wp-admin/includes/dashboard.php on line 120

    is a bit beyond my knowledge.

    Would someone know a solution for this perhaps?

    Best regards,

    Cor

Viewing 5 replies - 1 through 5 (of 5 total)
  • It means the script is trying to use an array index that doesn’t exist. For example:

    $pets = array('cats'=>2,'dogs'=>5);
    echo $pets['dogs']; // this is fine
    echo $pets['rabbits']; // this will give the notice you see
     

    (@cor-van-noorloos)

    Thanks apljdi,

    In this case it seemed to be somewhat else.
    For future reference the first noticed is pretty much self-explanatory, changing attribute_escape with esc_attr.

    Thanks to Utkarsh the second can be solved by changing wp_register_sidebar_widget('dashboard_scheduled_posts', __('Scheduled', 'dashboard-scheduled-posts'), array(&$this, 'widget')); to wp_add_dashboard_widget('dashboard_scheduled_posts', __('Scheduled', 'dashboard-scheduled-posts'), array(&$this, 'widget'));

    Plugin Author Alex Mills (Viper007Bond)

    (@viper007bond)

    Change your error reporting level in PHP. You shouldn’t be displaying notices in production environments, only development environments.

    Notices are just minor error messages that don’t really affect anything.

     

    (@cor-van-noorloos)

    Hello Alex,

    Thanks! As I don’t have the experience, I can’t really comment on how these notices would affect.
    But as they still remain as error messages, being displayed or not, I’m sure you can understand I don’t really want them at all.

    Hope you won’t blame me for being a bit overly tidy in that sort of things sometimes (:

    I try to get rid of the notices too, but as Alex M. said, they don’t really effect anything. The (PHP) script should work fine. Under some circumstances (the details of which I haven’t quite worked out) printing those notices can break Javascript though.

    The reason you don’t want the notices to print on a production site is that they can give a knowledgeable, and malicious, visitor clues that might help in attacking the site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notice: attribute_escape and Undefined index on WP 3.1.3’ is closed to new replies.