Title: [Plugin: MailChimp List Subscribe Form] Minor WP_DEBUG error: &quot;Notice: Undefined variable: grou
Last modified: August 20, 2016

---

# [Plugin: MailChimp List Subscribe Form] Minor WP_DEBUG error: "Notice: Undefined variable: grou

 *  [Jer Clarke](https://wordpress.org/support/users/jeremyclarke/)
 * (@jeremyclarke)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-mailchimp-list-subscribe-form-minor-wp_debug-error-notice-undefined-variable-groups/)
 * Hey guys, this is not a big issue but I found an instance where the plugin shows
   an error if WP_DEBUG is enabled. Super easy to fix.
 *     ```
       Notice: Undefined variable: groups in /Users/ungratefulbiped/Sites/dev.gv/wp-content/plugins/mailchimp/mailchimp.php on line 1221
       ```
   
 * It’s caused by this code:
 *     ```
       foreach ($_POST['group'][$ig['id']] as $i => $value) {
       	$groups .= str_replace(',', '\,', $value).',';
       }
       ```
   
 * because you never initialize $groups and so the first .= makes PHP barf a little.
   All you have to do is add a line above with `$groups = '';` and the problem is
   solved.
 * Do you normally test with WP_DEBUG enabled? It’s really convenient for tracking
   issues and by making sure your plugin works with WP_DEBUG enabled you make your
   plugin more appealing to other WP developers who like to follow it as a standard.
 * [http://codex.wordpress.org/Debugging_in_WordPress](http://codex.wordpress.org/Debugging_in_WordPress)
 * Thanks
 * [http://wordpress.org/extend/plugins/mailchimp/](http://wordpress.org/extend/plugins/mailchimp/)

Viewing 1 replies (of 1 total)

 *  [mc_nate](https://wordpress.org/support/users/mc_nate/)
 * (@mc_nate)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-mailchimp-list-subscribe-form-minor-wp_debug-error-notice-undefined-variable-groups/#post-2431895)
 * Hey Jeremy!
 * Thanks for that detailed info! Although we will have to pass that along to the
   proper channels, we’ll make sure it gets in front of the right people. As far
   as WP_Debug goes, that’s something that we can definitely keep in mind for testing
   next time around. Thanks for the heads up on that!
 * In the meantime, if we can help with anything else, please don’t hesitate to 
   give us a shout.
 * Cheers

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: MailChimp List Subscribe Form] Minor WP_DEBUG error: "Notice:
Undefined variable: grou’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp/assets/icon.svg?rev=3156997)
 * [Mailchimp List Subscribe Form](https://wordpress.org/plugins/mailchimp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [mc_nate](https://wordpress.org/support/users/mc_nate/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-mailchimp-list-subscribe-form-minor-wp_debug-error-notice-undefined-variable-groups/#post-2431895)
 * Status: not resolved