Plugin Author
Okoth1
(@okoth1)
I don’t see the error and would be happy to change it if there is any. Please let me know when you found it.
Plugin Author
Okoth1
(@okoth1)
Since you can test this faster than I, could you replace in reduce-bounce-rate.php this
function rbr_init() {
global $rbr_defaults;
foreach ($rbr_defaults as $optName => $optDefault) {
if (!get_option($optName)) {
update_option($optName, $optDefault);
}
}
}
add_action("init", "rbr_init");
with this
function rbr_init()
{
global $rbr_defaults;
if (is_array($rbr_defaults) || is_object($rbr_defaults))
{
foreach ($rbr_defaults as $optName => $optDefault)
{
if (!get_option($optName))
{
update_option($optName, $optDefault);
}
}
}
}
add_action("init", "rbr_init");
Please let me know if that’s enough to solve it.
Plugin Author
Okoth1
(@okoth1)
I cannot replicate the errors you’re getting. There is no = in my line 53. Could you check the code to see if the => isn’t written like = > ?
Plugin Author
Okoth1
(@okoth1)
Another question. Did the original plugin work or did you get errors using it?
I had to uninstall and reinstall the plugin to get it working again & the original plugin worked outside that error…
Plugin Author
Okoth1
(@okoth1)
That’s good enough for me at the moment, because I don’t have time to look at it now.
This error still occurs. It shows up every time I run WP-CLI:
PHP Warning: Invalid argument supplied for foreach() in FULL-PATH/wp-content/plugins/reduce-bounce-rate/reduce-bounce-rate.php on line 49
PHP Warning: Invalid argument supplied for foreach() in /home/nginx/domains/noodle.mx/public/wp-content/plugins/reduce-bounce-rate/reduce-bounce-rate.php on line 49
Plugin Author
Okoth1
(@okoth1)
Does the solution above solve the problem for you?
Yes, that code fixes the problem. I had thought it would have been implemented by now.
Plugin Author
Okoth1
(@okoth1)
Yea it should have been implemented. I forgot about it.
Thanks for reminding me. I’ll make the changes today.
-
This reply was modified 9 years, 5 months ago by
Okoth1.