Title: Plugin Error&#8230;
Last modified: August 31, 2016

---

# Plugin Error…

 *  Resolved [VannDigital](https://wordpress.org/support/users/vdn-staff/)
 * (@vdn-staff)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/)
 * I’m testing your plugin for right now. But I notice that anytime I run WP-CLI,
   I see this error…
 * `Warning: Invalid argument supplied for foreach() in /home/wp_urnhvf/vanndigital.
   com/wp-content/plugins/reduce-bounce-rate/reduce-bounce-rate.php on line 49`
 * It seems that the error is found on this line somewhere…
 * `foreach ($rbr_defaults as $optName => $optDefault) {`
 * Any help will be appreciated.
 * [https://wordpress.org/plugins/reduce-bounce-rate/](https://wordpress.org/plugins/reduce-bounce-rate/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984007)
 * 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.
 *  Thread Starter [VannDigital](https://wordpress.org/support/users/vdn-staff/)
 * (@vdn-staff)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984009)
 * Here’s the screencap…
 * [http://i817.photobucket.com/albums/zz94/youngraleigh/Work%20Photos/ReduceBounceRatePluginError20160125_zpsf4x5zedd.png~original](http://i817.photobucket.com/albums/zz94/youngraleigh/Work%20Photos/ReduceBounceRatePluginError20160125_zpsf4x5zedd.png~original)
 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984109)
 * 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.
 *  Thread Starter [VannDigital](https://wordpress.org/support/users/vdn-staff/)
 * (@vdn-staff)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984125)
 * So I just tried that code & came up with this…
 * [http://i817.photobucket.com/albums/zz94/youngraleigh/Work%20Photos/ReduceBounceRatePluginError20160125Part2_zpsklwjnids.png~original](http://i817.photobucket.com/albums/zz94/youngraleigh/Work%20Photos/ReduceBounceRatePluginError20160125Part2_zpsklwjnids.png~original)
 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984141)
 * 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](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984142)
 * Another question. Did the original plugin work or did you get errors using it?
 *  Thread Starter [VannDigital](https://wordpress.org/support/users/vdn-staff/)
 * (@vdn-staff)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984173)
 * I had to uninstall and reinstall the plugin to get it working again & the original
   plugin worked outside that error…
 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-6984177)
 * That’s good enough for me at the moment, because I don’t have time to look at
   it now.
 *  [Daniel J. Lewis](https://wordpress.org/support/users/djosephdesign/)
 * (@djosephdesign)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8674795)
 * 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](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8676517)
 * Does the solution above solve the problem for you?
 *  [Daniel J. Lewis](https://wordpress.org/support/users/djosephdesign/)
 * (@djosephdesign)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8679790)
 * Yes, that code fixes the problem. I had thought it would have been implemented
   by now.
    -  This reply was modified 9 years, 5 months ago by [Daniel J. Lewis](https://wordpress.org/support/users/djosephdesign/).
 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8680301)
 * 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](https://wordpress.org/support/users/okoth1/).
 *  Plugin Author [Okoth1](https://wordpress.org/support/users/okoth1/)
 * (@okoth1)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8680347)
 * Done

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Plugin Error…’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/reduce-bounce-rate_53adc5.svg)
 * [Reduce Bounce Rate](https://wordpress.org/plugins/reduce-bounce-rate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/reduce-bounce-rate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/reduce-bounce-rate/)
 * [Active Topics](https://wordpress.org/support/plugin/reduce-bounce-rate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reduce-bounce-rate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reduce-bounce-rate/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [Okoth1](https://wordpress.org/support/users/okoth1/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/plugin-error-65/#post-8680347)
 * Status: resolved