Warning notices in Slimbox2 v.1.0.3.2

Forums Forums Slimbox2 plugin Warning notices in Slimbox2 v.1.0.3.2

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1671
    jtlapp
    Member

    I’m a developer who is running WP_DEBUG with value true and PHP at error_level E_ALL, and when I visit the Slimbox2 settings page, I get many error notices of the form:

    "Use of undefined constant easeInQuad – assumed ‘easeInQuad’ in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 2"

    I also get the following notice, and I only get it with Slimbox2 installed (I have no other plugins installed):

    "PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /var/www/project/wp-includes/functions.php on line 3321"

    The undefined constant notices can be fixed by replacing line 2 of adminpage.php with the following, which quotes the constants:

    [code:35vyy549]
    $easingArray = array(‘swing’,’easeInQuad’,’easeOutQuad’,’easeInOutQuad’,’easeInCubic’,’easeOutCubic’,’easeInOutCubic’,’easeInQuart’,’easeOutQuart’,’easeInOutQuart’,’easeInQuint’,’easeOutQuint’,’easeInOutQuint’,’easeInSine’,’easeOutSine’,’easeInOutSine’,’easeInExpo’,’easeOutExpo’,’easeInOutExpo’,’easeInCirc’,’easeOutCirc’,’easeInOutCirc’,’easeInElastic’,’easeOutElastic’,’easeInOutElastic’,’easeInBack’,’easeOutBack’,’easeInOutBack’,’easeInBounce’,’easeOutBounce’,’easeInOutBounce’);
    [/code:35vyy549]

    I haven’t looked into addressing the has_cap problem, was hoping you might offer a fix. It’s a bit annoying because it always shows at the top of my admin page.

    Thank you for the wonderful plugin!

    ~joe

    P.S. I’m running WordPress 3.0.4, newly installed.

    #9170
    jtlapp
    Member

    I just saved a settings change for the first time and got all these notices too.  I hope you’re of the mind that notices don’t belong there, even when their particular instances happen to be harmless (it just creates a clutter on my screen, as I debug):

    [code:q7qxhres]
    Notice: Undefined index: wp_slimbox_autoload in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 14

    Notice: Undefined index: wp_slimbox_loop in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 15

    Notice: Undefined index: wp_slimbox_url in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 26

    Notice: Undefined index: wp_slimbox_picasaweb in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 32

    Notice: Undefined index: wp_slimbox_flickr in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 33

    Notice: Undefined index: wp_slimbox_mobile in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 34

    Notice: Undefined index: wp_slimbox_maintenance in /var/www/project/wp-content/plugins/wp-slimbox2/adminpage.php on line 35
    [/code:q7qxhres]

    #9171
    jtlapp
    Member

    Turns out that these notices really mess up admin. The has_cap notice gets emitted before WP intends the headers to be sent, and WP’s subsequent attempt to send headers therefore fails. I had to comment out the deprecated feature notice code in WP just to be able to use admin.

    I have to run with WP_DEBUG on, because otherwise I’m not getting my PHP syntax errors.

    Maybe this is a new problem with the latest release of WP?  It’s hard for me to imagine that you’d be debugging this in WP without WP_DEBUG enabled.

    #9172
    malcalevak
    Moderator

    Thanks for bringing this to my attention. I’ve been sick lately, or I’d stay more up to date on the plugin, but this looks major enough to warrant my attention.

    I’ve never heard of has_cap, but it’s possible it’s used by WPlize.

    I’ll try and take a look at things tomorrow, but if you stumble on anymore fixes yourself let me know!

    #9173
    malcalevak
    Moderator

    Looks like I find the issue, I’ll be posting an updated version shortly, but if you want to fix it yourself.
    index.php, line 123:
    change [code:2opcip00] $page = add_options_page(‘WP-Slimbox2 Options’, ‘WP-Slimbox2’, 8, ‘slimbox2options’, ‘slimbox_options’);[/code:2opcip00]
    to
    [code:2opcip00] $page = add_options_page(‘WP-Slimbox2 Options’, ‘WP-Slimbox2’, ‘edit_pages’, ‘slimbox2options’, ‘slimbox_options’);[/code:2opcip00]

    For the various undefined indexes, change them all as similar to below:
    [code:2opcip00]’autoload’  => $_POST[’wp_slimbox_autoload’],[/code:2opcip00]
    to
    [code:2opcip00]’autoload’  => (isset($_POST[’wp_slimbox_autoload’])?$_POST[’wp_slimbox_autoload’]:”),[/code:2opcip00]

    #9174

    You should ditch WPlize and move to register_settings(). It handles the use of arrays in options.

    Having said that, I have no intention of updating a few of my very old plugins to use this since they work okay as is. Was just point it out in case you didn’t know the function existed within WordPress – I don’t think it was present when you wrote the plugin.

    #9175
    malcalevak
    Moderator

    Yeah, I’ve thought of it, but it’s not really worth the hassle. If I make any other plugins, they won’t use it.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.