Forums › Forums › Slimbox2 plugin › Warning notices in Slimbox2 v.1.0.3.2
- This topic has 6 replies, 3 voices, and was last updated 13 years, 10 months ago by malcalevak.
-
AuthorPosts
-
January 16, 2011 at 6:08 am #1671jtlappMember
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.
January 16, 2011 at 7:01 am #9170jtlappMemberI 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 14Notice: 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]January 16, 2011 at 7:35 am #9171jtlappMemberTurns 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.
January 16, 2011 at 9:56 am #9172malcalevakModeratorThanks 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!
January 18, 2011 at 9:35 pm #9173malcalevakModeratorLooks 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]January 19, 2011 at 1:46 am #9174imported_RyanMemberYou 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.
January 19, 2011 at 3:26 am #9175malcalevakModeratorYeah, I’ve thought of it, but it’s not really worth the hassle. If I make any other plugins, they won’t use it.
-
AuthorPosts
- You must be logged in to reply to this topic.