Easy Forms for MailChimp - Version 5.1.1

Version Description

  • November 5, 2014 =

  • Fix: repair 'Opt In' default list drop down on options page

  • Fix: repair errors being thrown when a commenter is added to a list

Download this release

Release Info

Developer eherman24
Plugin Icon 128x128 Easy Forms for MailChimp
Version 5.1.1
Comparing to
See all releases

Code changes from version 5.1.0.1 to 5.1.1

classes/class.yksemeBase.php CHANGED
@@ -163,6 +163,7 @@ public function yikes_mc_user_already_subscribed_error_message_filter( $errorMes
163
  // Create and store our initial plugin options
164
  public function getOptionValue()
165
  {
 
166
  $defaultVals = array(
167
  'version' => YKSEME_VERSION_CURRENT,
168
  'api-key' => '',
@@ -173,8 +174,8 @@ public function getOptionValue()
173
  'double-optin-message' => __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender'),
174
  'interest-group-label' => __('Select Your Area of Interest', 'yikes-inc-easy-mailchimp-extender'),
175
  'optIn-checkbox' => 'hide',
176
- 'optIn-default-list' => array(),
177
- 'yks-mailchimp-optin-checkbox-text' => 'SIGN ME UP!',
178
  'recaptcha-setting' => '0',
179
  'recaptcha-api-key' => '',
180
  'recaptcha-private-api-key' => '',
@@ -1671,6 +1672,7 @@ public function generateWelcomePage()
1671
  /***** FORM DATA
1672
  ****************************************************************************************************/
1673
  public function yks_resetPluginSettings() {
 
1674
  // reset the plugin settings back to defaults
1675
  $this->optionVal['api-key'] = '';
1676
  $this->optionVal['flavor'] = '1';
@@ -1680,8 +1682,8 @@ public function yks_resetPluginSettings() {
1680
  $this->optionVal['double-optin-message'] = __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender');
1681
  $this->optionVal['interest-group-label'] = '';
1682
  $this->optionVal['optIn-checkbox'] = 'hide';
1683
- $this->optionVal['yks-mailchimp-optIn-default-list'] = array();
1684
- $this->optionVal['yks-mailchimp-optin-checkbox-text'] = 'SIGN ME UP!';
1685
  $this->optionVal['recaptcha-setting'] = '0';
1686
  $this->optionVal['recaptcha-api-key'] = '';
1687
  $this->optionVal['recaptcha-private-api-key'] = '';
@@ -1741,7 +1743,6 @@ public function validateAPIkeySettings()
1741
  try {
1742
  $resp = $api->call('helper/ping', array('apikey' => $decryped_api_key));
1743
  echo $resp['msg'];
1744
- $this->getOptionsLists();
1745
  } catch( Exception $e ) {
1746
  $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1747
  echo $errorMessage;
@@ -4163,27 +4164,20 @@ function getTemplateFilePath($directory) {
4163
  */
4164
  private function runUpdateTasks_4_3()
4165
  {
4166
-
4167
  if ( !isset( $this->optionVal['recaptcha-setting'] ) ) {
4168
  $this->optionVal['recaptcha-setting'] = '0';
4169
  }
4170
-
4171
  if ( !isset( $this->optionVal['recaptcha-api-key'] ) ) {
4172
  $this->optionVal['recaptcha-api-key'] = '';
4173
  }
4174
-
4175
  if ( !isset( $this->optionVal['recaptcha-private-api-key'] ) ) {
4176
  $this->optionVal['recaptcha-private-api-key'] = '';
4177
  }
4178
-
4179
  if ( !isset( $this->optionVal['recaptcha-style'] ) ) {
4180
  $this->optionVal['recaptcha-style'] = 'default';
4181
  }
4182
-
4183
  $this->optionVal['version'] = '5.0.4';
4184
-
4185
  return true;
4186
-
4187
  }
4188
 
4189
 
@@ -4203,18 +4197,21 @@ private function runUpdateTasks_4_3()
4203
  }
4204
 
4205
  function add_after_comment_form($arg) {
4206
- $custom_text = trim($this->optionVal['yks-mailchimp-optin-checkbox-text']);
4207
- if ( $custom_text == '' ) {
4208
- $custom_text = __("Sign Me Up For MAILCHIMP-REPLACE-THIS-TEXT's Newsletter", "gettext");
4209
- } else {
4210
- $custom_text = $custom_text;
4211
- }
4212
 
4213
- $arg['comment_notes_after'] = '<label for="yikes_mailchimp_comment_subscribe">
4214
- <input type="checkbox" name="mailchimp_subscribe" id="yikes_mailchimp_comment_subscribe" checked="checked" />
4215
- '.$custom_text.'
4216
- </label>';
4217
- return $arg;
 
 
 
 
 
 
 
 
 
4218
  }
4219
 
4220
  // Replacing 'MAILCHIMP-REPLACE-THIS-TEXT' text with sitename
@@ -4272,7 +4269,8 @@ private function runUpdateTasks_4_3()
4272
  ),
4273
  'merge_vars' => array(
4274
  'FNAME' => $commenter_first_name,
4275
- 'LNAME' => $commenter_last_name
 
4276
  ),
4277
  'double_optin' => $optin, // double optin value (retreived from the settings page)
4278
  'send_welcome' => true
@@ -4312,7 +4310,10 @@ private function runUpdateTasks_4_3()
4312
  add_action('comment_approved_', array(&$this, 'ymc_subscription_add'), 60, 2);
4313
  add_action('comment_post', array(&$this, 'ymc_subscription_add'));
4314
  add_filter('gettext', array(&$this, 'yikes_mc_replace_this_text'));
4315
- add_filter('comment_form_defaults', array(&$this, 'add_after_comment_form'));
 
 
 
4316
  }
4317
  }
4318
 
@@ -5022,7 +5023,6 @@ private function runUpdateTasks_4_3()
5022
  ?><img style="display:block;margin:0 auto;margin-top:2em;margin-bottom:1em;" class="mailChimp_get_subscribers_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" ><?php
5023
  }
5024
 
5025
-
5026
  }
5027
  }
5028
  ?>
163
  // Create and store our initial plugin options
164
  public function getOptionValue()
165
  {
166
+ $blog_title = get_bloginfo( 'name' );
167
  $defaultVals = array(
168
  'version' => YKSEME_VERSION_CURRENT,
169
  'api-key' => '',
174
  'double-optin-message' => __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender'),
175
  'interest-group-label' => __('Select Your Area of Interest', 'yikes-inc-easy-mailchimp-extender'),
176
  'optIn-checkbox' => 'hide',
177
+ 'yks-mailchimp-optIn-default-list' => 'select_list',
178
+ 'yks-mailchimp-optin-checkbox-text' => 'Add me to the ' . $blog_title . ' mailing list',
179
  'recaptcha-setting' => '0',
180
  'recaptcha-api-key' => '',
181
  'recaptcha-private-api-key' => '',
1672
  /***** FORM DATA
1673
  ****************************************************************************************************/
1674
  public function yks_resetPluginSettings() {
1675
+ $blog_title = get_bloginfo( 'name' );
1676
  // reset the plugin settings back to defaults
1677
  $this->optionVal['api-key'] = '';
1678
  $this->optionVal['flavor'] = '1';
1682
  $this->optionVal['double-optin-message'] = __('Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender');
1683
  $this->optionVal['interest-group-label'] = '';
1684
  $this->optionVal['optIn-checkbox'] = 'hide';
1685
+ $this->optionVal['yks-mailchimp-optIn-default-list'] = 'select_list';
1686
+ $this->optionVal['yks-mailchimp-optin-checkbox-text'] = 'Add me to the ' . $blog_title . ' mailing list';
1687
  $this->optionVal['recaptcha-setting'] = '0';
1688
  $this->optionVal['recaptcha-api-key'] = '';
1689
  $this->optionVal['recaptcha-private-api-key'] = '';
1743
  try {
1744
  $resp = $api->call('helper/ping', array('apikey' => $decryped_api_key));
1745
  echo $resp['msg'];
 
1746
  } catch( Exception $e ) {
1747
  $errorMessage = str_replace('API call to helper/ping failed:', '', $e->getMessage());
1748
  echo $errorMessage;
4164
  */
4165
  private function runUpdateTasks_4_3()
4166
  {
 
4167
  if ( !isset( $this->optionVal['recaptcha-setting'] ) ) {
4168
  $this->optionVal['recaptcha-setting'] = '0';
4169
  }
 
4170
  if ( !isset( $this->optionVal['recaptcha-api-key'] ) ) {
4171
  $this->optionVal['recaptcha-api-key'] = '';
4172
  }
 
4173
  if ( !isset( $this->optionVal['recaptcha-private-api-key'] ) ) {
4174
  $this->optionVal['recaptcha-private-api-key'] = '';
4175
  }
 
4176
  if ( !isset( $this->optionVal['recaptcha-style'] ) ) {
4177
  $this->optionVal['recaptcha-style'] = 'default';
4178
  }
 
4179
  $this->optionVal['version'] = '5.0.4';
 
4180
  return true;
 
4181
  }
4182
 
4183
 
4197
  }
4198
 
4199
  function add_after_comment_form($arg) {
 
 
 
 
 
 
4200
 
4201
+ $custom_text = trim($this->optionVal['yks-mailchimp-optin-checkbox-text']);
4202
+ if ( $custom_text == '' ) {
4203
+ $custom_text = __("Sign Me Up For MAILCHIMP-REPLACE-THIS-TEXT's Newsletter", "gettext");
4204
+ } else {
4205
+ $custom_text = $custom_text;
4206
+ }
4207
+
4208
+ // set the default checked state here...
4209
+ $arg['comment_notes_after'] = '<label for="yikes_mailchimp_comment_subscribe">
4210
+ <input type="checkbox" name="mailchimp_subscribe" id="yikes_mailchimp_comment_subscribe" checked="checked" />
4211
+ '.$custom_text.'
4212
+ </label>';
4213
+ return $arg;
4214
+
4215
  }
4216
 
4217
  // Replacing 'MAILCHIMP-REPLACE-THIS-TEXT' text with sitename
4269
  ),
4270
  'merge_vars' => array(
4271
  'FNAME' => $commenter_first_name,
4272
+ 'LNAME' => $commenter_last_name,
4273
+ 'NAME' => $commenter_first_name
4274
  ),
4275
  'double_optin' => $optin, // double optin value (retreived from the settings page)
4276
  'send_welcome' => true
4310
  add_action('comment_approved_', array(&$this, 'ymc_subscription_add'), 60, 2);
4311
  add_action('comment_post', array(&$this, 'ymc_subscription_add'));
4312
  add_filter('gettext', array(&$this, 'yikes_mc_replace_this_text'));
4313
+ // only display the checkbox if the user is logged in, and the default list is set
4314
+ if( is_user_logged_in() && isset( $this->optionVal['yks-mailchimp-optIn-default-list'] ) && $this->optionVal['yks-mailchimp-optIn-default-list'] != 'select_value' ) {
4315
+ add_filter('comment_form_defaults', array(&$this, 'add_after_comment_form'));
4316
+ }
4317
  }
4318
  }
4319
 
5023
  ?><img style="display:block;margin:0 auto;margin-top:2em;margin-bottom:1em;" class="mailChimp_get_subscribers_preloader" src="<?php echo admin_url().'/images/wpspin_light.gif'; ?>" alt="preloader" ><?php
5024
  }
5025
 
 
5026
  }
5027
  }
5028
  ?>
pages/options.php CHANGED
@@ -168,12 +168,6 @@ jQuery(document).ready(function ($) {
168
  success: function(response) {
169
  // if our response contains 'Everything's Chimpy' - everything's good to go
170
  if(response.indexOf('Everything\'s Chimpy!') > -1) {
171
- var yikes_mc_ajax_response = response;
172
- jQuery('#ajax_list_replace').html(yikes_mc_ajax_response);
173
- var yikes_mc_ajax_html_content = jQuery('#ajax_list_replace').html();
174
- var replaced_text = yikes_mc_ajax_html_content.replace("Everything's Chimpy!", "");
175
- var new_replaced_text = replaced_text.replace("You must provide a MailChimp API key", "<select><option value='refreshThePage'>Save Settings and Refresh The Page</option></select>");
176
- jQuery('#ajax_list_replace').html(new_replaced_text);
177
  jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
178
  jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png'; ?>" alt=message > <?php _e('Valid API Key','yikes-inc-easy-mailchimp-extender'); ?>').css("color", "green").fadeIn();
179
  jQuery('#submit').removeAttr('disabled');
@@ -529,9 +523,9 @@ jQuery(document).ready(function() {
529
  <!-- get all lists from MailChimp -->
530
  <?php
531
  if ( $api_key_option == 'invalid_api_key' ) {
532
- echo '<div id="ajax_list_replace"><select><option>Please Enter a Valid API Key</option></select></div>';
533
  } else {
534
- echo '<div id="ajax_list_replace"><img class="mailChimp_api_key_preloader" src="'.admin_url("/images/wpspin_light.gif").'" alt="preloader" ></div>';
535
  }
536
  ?>
537
  </td>
@@ -540,7 +534,8 @@ jQuery(document).ready(function() {
540
  <td></td>
541
  <td class="yks-settings-description"> <!-- Description of optin checkbox default list-->
542
  <?php _e('This is the default list users will be subscribed to when submitting a comment.','yikes-inc-easy-mailchimp-extender'); ?><br />
543
- <em><?php _e('It is best to select a form where only the email , first name and/or last name are required or you may run into issues.','yikes-inc-easy-mailchimp-extender'); ?></em>
 
544
  </td>
545
  </tr>
546
  <tr>
168
  success: function(response) {
169
  // if our response contains 'Everything's Chimpy' - everything's good to go
170
  if(response.indexOf('Everything\'s Chimpy!') > -1) {
 
 
 
 
 
 
171
  jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
172
  jQuery('#yks-mailchimp-api-key').parents('td').find('.mailChimp_api_key_validation_message').first().html('<img src="<?php echo plugins_url().'/yikes-inc-easy-mailchimp-extender/images/yikes-mc-checkmark.png'; ?>" alt=message > <?php _e('Valid API Key','yikes-inc-easy-mailchimp-extender'); ?>').css("color", "green").fadeIn();
173
  jQuery('#submit').removeAttr('disabled');
523
  <!-- get all lists from MailChimp -->
524
  <?php
525
  if ( $api_key_option == 'invalid_api_key' ) {
526
+ echo '<div id="ajax_list_replace"><select disabled="disabled"><option>Please Enter a Valid API Key</option></select></div>';
527
  } else {
528
+ $this->getOptionsLists();
529
  }
530
  ?>
531
  </td>
534
  <td></td>
535
  <td class="yks-settings-description"> <!-- Description of optin checkbox default list-->
536
  <?php _e('This is the default list users will be subscribed to when submitting a comment.','yikes-inc-easy-mailchimp-extender'); ?><br />
537
+ <em><?php _e('Note : Its best to select a form where only the email , first name and/or last name are required or you may run into issues.','yikes-inc-easy-mailchimp-extender'); ?></em><br />
538
+ <em><strong><?php _e('Required Merge Variable Names : E-Mail : EMAIL , First Name : FNAME , Last Name : LNAME , Name : NAME','yikes-inc-easy-mailchimp-extender'); ?></strong></em>
539
  </td>
540
  </tr>
541
  <tr>
pages/welcome.php CHANGED
@@ -301,13 +301,13 @@ body.admin_page_yks-mailchimp-welcome {
301
  <div class="col-md-4">
302
  <h2>Custom Classes</h2>
303
  <p>We've now added the ability to attach custom class names to specific form inputs for greater style control.</p>
304
- <p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Custom_Class_Names.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
305
  </div>
306
 
307
  <div class="col-md-4">
308
  <h2>New Manage List Page Styles</h2>
309
  <p>All new styles for the manage list page, allowing you to collapse forms that you don't immediatly need.</p>
310
- <p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Manage_List_styles.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
311
  </div>
312
 
313
  <div class="col-md-4">
301
  <div class="col-md-4">
302
  <h2>Custom Classes</h2>
303
  <p>We've now added the ability to attach custom class names to specific form inputs for greater style control.</p>
304
+ <p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/custom_class_names.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
305
  </div>
306
 
307
  <div class="col-md-4">
308
  <h2>New Manage List Page Styles</h2>
309
  <p>All new styles for the manage list page, allowing you to collapse forms that you don't immediatly need.</p>
310
+ <p><img class="new_feature_image" src="<?php echo YKSEME_URL; ?>images/welcome_page/Manage_List_Styles.jpg" alt="New Form Customizer" title="New Form Customizer" ></p>
311
  </div>
312
 
313
  <div class="col-md-4">
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yikesinc.com
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, sign up, forms, sign up form
5
  Requires at least: 3.0
6
  Tested up to: 4.0
7
- Stable tag: 5.1.0.1
8
  License: GPLv2 or later
9
 
10
  Easy MailChimp Forms allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.
@@ -153,6 +153,9 @@ Finally, change the MailChimp template, author and description headers at the to
153
  **Step 4:**
154
  Once setup, you can assign the template to your form from the 'Manage List' page. Make sure to select the checkbox 'use custom form' and then in the drop down select your newly created template.
155
 
 
 
 
156
  == Developer Docs. ==
157
 
158
  **Text Domain**
@@ -572,6 +575,11 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
572
 
573
  == Changelog ==
574
 
 
 
 
 
 
575
  = 5.1.0.1 - November 4, 2014 =
576
 
577
  **Updates**
@@ -797,6 +805,10 @@ These functions should be used in conjunction with the `yikes_mc_get_form_data`
797
 
798
  == Upgrade Notice ==
799
 
 
 
 
 
800
  = 5.1.0.1 - November 4, 2014 =
801
 
802
  Removed the update profile info link, some users brought up security concerns.
4
  Tags: mailchimp, marketing, email, mailing lists, newsletter, sign up, forms, sign up form
5
  Requires at least: 3.0
6
  Tested up to: 4.0
7
+ Stable tag: 5.1.1
8
  License: GPLv2 or later
9
 
10
  Easy MailChimp Forms allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.
153
  **Step 4:**
154
  Once setup, you can assign the template to your form from the 'Manage List' page. Make sure to select the checkbox 'use custom form' and then in the drop down select your newly created template.
155
 
156
+ = I'm trying to set up the opt-in commenting checkbox. When users opt-in and leave a comment, an error is thrown and I can't figure out why. What could be wrong? =
157
+ For the optin commenter checkbox, you'll want to make sure that the form you have set to assign users to only has the email field set to required.
158
+
159
  == Developer Docs. ==
160
 
161
  **Text Domain**
575
 
576
  == Changelog ==
577
 
578
+ = 5.1.1 - November 5, 2014 =
579
+
580
+ * Fix: repair 'Opt In' default list drop down on options page
581
+ * Fix: repair errors being thrown when a commenter is added to a list
582
+
583
  = 5.1.0.1 - November 4, 2014 =
584
 
585
  **Updates**
805
 
806
  == Upgrade Notice ==
807
 
808
+ = 5.1.1 - November 5, 2014 =
809
+ Fix: repair 'Opt In' default list drop down on options page
810
+ Fix: repair errors being thrown when a commenter is added to a list
811
+
812
  = 5.1.0.1 - November 4, 2014 =
813
 
814
  Removed the update profile info link, some users brought up security concerns.
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Easy MailChimp Forms
5
  Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
6
  Description: Mailchimp integration in the form of a shortcode, php snippet or widget. Now track account status, campaign stats, view subscribers and so much more!
7
- Version: 5.1.0.1
8
  Author: YIKES Inc
9
  Author URI: http://yikesinc.com
10
  License: GPL2
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
 
31
  /** Configuration **/
32
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', false);
33
- if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '5.1.0.1');
34
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
35
  if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
36
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');
4
  Plugin Name: Easy MailChimp Forms
5
  Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
6
  Description: Mailchimp integration in the form of a shortcode, php snippet or widget. Now track account status, campaign stats, view subscribers and so much more!
7
+ Version: 5.1.1
8
  Author: YIKES Inc
9
  Author URI: http://yikesinc.com
10
  License: GPL2
30
 
31
  /** Configuration **/
32
  if(!defined('YKSEME_DEBUG')) define('YKSEME_DEBUG', false);
33
+ if(!defined('YKSEME_VERSION_CURRENT')) define('YKSEME_VERSION_CURRENT', '5.1.1');
34
  if(!defined('YKSEME_REQ_PHP')) define('YKSEME_REQ_PHP', '5.0');
35
  if(!defined('YKSEME_AUTHOR')) define('YKSEME_AUTHOR', 'YIKES Inc');
36
  if(!defined('YKSEME_SITE')) define('YKSEME_SITE', site_url().'/');