WordPress.org

Ready to get started?Download WordPress

Forums

MailChimp List Subscribe Form
Minor WP_DEBUG error: "Notice: Undefined variable: grou (2 posts)

  1. Jeremy Clarke
    Member
    Posted 2 years ago #

    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

    Thanks

    http://wordpress.org/extend/plugins/mailchimp/

  2. mc_nate
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags