MailChimp for WordPress - Version 2.2.2

Version Description

  • January 13, 2014 =

Fixes

  • Plugin wasn't connecting to MailChimp for users on MailChimp server us10 (API keys ending in -us10)
Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 MailChimp for WordPress
Version 2.2.2
Comparing to
See all releases

Code changes from version 2.2.1 to 2.2.2

assets/js/admin.js CHANGED
@@ -24,7 +24,8 @@
24
  function() {
25
  var hasListSelected = $listInputs.filter(':checked').length > 0;
26
  $(".mc4wp-notice.no-lists-selected").toggle( ! hasListSelected );
27
- $('#mc4wp-fw-fields, #mc4wp-fw-mailchimp-fields').toggle( hasListSelected );
 
28
  }
29
  );
30
 
@@ -75,11 +76,13 @@
75
  * Created by Danny van Kooten
76
  */
77
  (function() {
 
 
78
  // setup variables
79
  var $lists = $("#mc4wp-lists :input");
80
  var $mailchimpFields = $("#mc4wp-fw-mailchimp-fields");
81
- var $mailchimpMergeFields = $("#mc4wp-fw-mailchimp-fields .merge-fields");
82
- var $mailchimpGroupings = $("#mc4wp-fw-mailchimp-fields .groupings");
83
  var $wizardFields = $("#mc4wp-fw-fields");
84
  var $value = $("#mc4wp-fw-value");
85
  var $valueLabel = $("#mc4wp-fw-value-label");
@@ -341,10 +344,10 @@
341
  fieldName = data.tag;
342
 
343
  // set placeholder text
344
- $placeholder.val("Your " + data.name.toLowerCase());
345
 
346
  // set label text
347
- $label.val(data.name + ":");
348
 
349
  // set required attribute
350
  $required.attr('checked', data.req);
@@ -402,8 +405,10 @@
402
  // add options to select
403
  $multipleValues.find(":input").each(function() {
404
  if($(this).val().length > 0) {
405
- $("<option />").val($(this).data("value")).text($(this).val()).appendTo($input);
406
- }
 
 
407
  });
408
  break;
409
 
@@ -495,8 +500,8 @@
495
 
496
  // fallback, just append
497
  if(!result) {
498
- var $formContent = $("#mc4wpformmarkup");
499
- $("#mc4wpformmarkup").val($formContent.val() + "\n" + $codePreview.val());
500
  }
501
  }
502
 
24
  function() {
25
  var hasListSelected = $listInputs.filter(':checked').length > 0;
26
  $(".mc4wp-notice.no-lists-selected").toggle( ! hasListSelected );
27
+ $( document.getElementById( 'mc4wp-fw-fields')).toggle( hasListSelected );
28
+ $( document.getElementById( 'mc4wp-fw-mailchimp-fields' )).toggle( hasListSelected );
29
  }
30
  );
31
 
76
  * Created by Danny van Kooten
77
  */
78
  (function() {
79
+ 'use strict';
80
+
81
  // setup variables
82
  var $lists = $("#mc4wp-lists :input");
83
  var $mailchimpFields = $("#mc4wp-fw-mailchimp-fields");
84
+ var $mailchimpMergeFields = $mailchimpFields.find('.merge-fields');
85
+ var $mailchimpGroupings = $mailchimpFields.find(".groupings");
86
  var $wizardFields = $("#mc4wp-fw-fields");
87
  var $value = $("#mc4wp-fw-value");
88
  var $valueLabel = $("#mc4wp-fw-value-label");
344
  fieldName = data.tag;
345
 
346
  // set placeholder text
347
+ $placeholder.val( "Your " + data.name.toLowerCase());
348
 
349
  // set label text
350
+ $label.val( data.name + ":" );
351
 
352
  // set required attribute
353
  $required.attr('checked', data.req);
405
  // add options to select
406
  $multipleValues.find(":input").each(function() {
407
  if($(this).val().length > 0) {
408
+ $("<option />")
409
+ .val($(this).data("value"))
410
+ .text($(this).val())
411
+ .appendTo($input); }
412
  });
413
  break;
414
 
500
 
501
  // fallback, just append
502
  if(!result) {
503
+ var $formContent = $( document.getElementById('mc4wpformmarkup') );
504
+ $formContent.val($formContent.val() + "\n" + $codePreview.val());
505
  }
506
  }
507
 
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){function b(){"boolean"==typeof this.checked&&(this.checked=!1),alert(mc4wp.strings.proOnlyNotice),event.stopPropagation()}var c=a("#mc4wp-admin");c.find(".pro-feature, .pro-feature label, .pro-feature :radio").click(b),c.find('input[name$="[show_at_woocommerce_checkout]"]').change(function(){c.find("tr#woocommerce-settings").toggle(a(this).prop("checked"))});var d=a("#mc4wp-lists").find(":input");d.change(function(){var b=d.filter(":checked").length>0;a(".mc4wp-notice.no-lists-selected").toggle(!b),a("#mc4wp-fw-fields, #mc4wp-fw-mailchimp-fields").toggle(b)}),a(document).delegate("#mc4wpformmarkup","keydown",function(b){var c=b.keyCode||b.which;if(9==c){b.preventDefault();var d=this.selectionStart,e=this.selectionEnd;a(this).val(a(this).val().substring(0,d)+" "+a(this).val().substring(e)),this.selectionStart=this.selectionEnd=d+1}}),function(){"undefined"!=typeof QTags&&(QTags.addButton("mc4wp_paragraph","<p>","<p>","</p>","paragraph","Paragraph tag",1),QTags.addButton("mc4wp_label","label","<label>","</label>","label","Label tag",2),QTags.addButton("mc4wp_response","form response","{response}","","response","Shows the form response"),QTags.addButton("mc4wp_subscriber_count","# of subscribers","{subscriber_count}","","subscribers","Shows number of subscribers of selected list(s)"),1==window.mc4wp.hasCaptchaPlugin&&QTags.addButton("mc4wp_captcha","CAPTCHA","{captcha}","","captcha","Display a CAPTCHA field"))}(),function(){function b(){p.find("option").not(".default").remove(),o.filter(":checked").each(function(){for(var b=a(this).val(),c=mc4wp.mailchimpLists[b],d=0,e=c.merge_vars.length;e>d;d++){var f=c.merge_vars[d];if(0==q.find("option[value='"+f.tag+"']").length){var g=f.name.length>25?f.name.substring(0,25)+"..":f.name;f.req&&(g+="*");var h=a("<option />").text(g).val(f.tag).data("list-field",f);d>3&&h.text(B.proOnly+" "+g).attr("disabled","disabled").data("field",null),q.append(h)}}for(var d=0,i=c.interest_groupings.length;i>d;d++){var j=c.interest_groupings[d];if(0==r.find("option[value='"+j.id+"']").length){var g=j.name.length>25?j.name.substring(0,25)+"..":j.name,h=a("<option />").text(g).val(j.id).data("list-grouping",j);d>=1&&h.text(B.proOnly+" "+g).attr("disabled","disabled").data("list-grouping",null),r.append(h)}}})}function c(){d();var b=a(this).find(":selected");switch(b.val()){case"submit":m="submit",u.text(B.buttonText),t.val(B.subscribe),s.find("p.row").filter(".value, .wrap-p").show();break;case"lists":m="lists",s.find(".wrap-p").show();break;default:var c=b.data("list-field");if(c)return h(c);var c=b.data("list-grouping");if(c)return f(c)}j()}function d(){s.find(".row :input").each(function(){a(this).is(":checkbox")?this.checked=!0:this.value=""}),s.find("p.row").hide(),v.find(":input").remove(),s.show(),m="text",n="",u.html(B.initialValue+" <small>"+B.optional+"</small>")}function e(b){for(var c=0,d=b.length;d>c;c++)a("<input />").attr("type","text").addClass("widefat").data("value",b[c].name).attr("placeholder",B.labelFor+' "'+b[c].name+'" '+B.orLeaveEmpty).attr("value",b[c].name).appendTo(v)}function f(a){switch(s.find("p.row").filter(".values, .label, .wrap-p").show(),w.val(a.name+":"),n="GROUPINGS["+a.id+"]",e(a.groups),a.form_field){case"radio":m="radio";break;case"hidden":s.find("p.row").filter(".values, .label, .wrap-p").hide(),s.find("p.row.value").show();for(var b=0,c=a.groups.length;c>b;b++)t.val(t.val()+a.groups[b].name+",");m="hidden";break;case"dropdown":m="select";break;default:m="checkbox",n+="[]"}j()}function g(){var b="";return o.each(function(){var c=a(this).val(),d=a(this).parent("label").text(),e="";a(this).is(":checked")&&(e+="checked "),b+="<label>\n",b+=' <input type="checkbox" name="_mc4wp_lists[]" value="'+c+'" '+e+" /> "+d+"\n",b+="</label>\n"}),b}function h(b){var c={"default":["label","value","placeholder","required","wrap-p"],select:["label","required","wrap-p","values"],radio:["label","required","wrap-p","values"],date:["label","required","wrap-p","value"]},d={text:"text",email:"email",phone:"tel",address:"text",number:"number",dropdown:"select",date:"date",birthday:"date",radio:"radio",checkbox:"checkbox"};if(m=void 0!=d[b.field_type]?d[b.field_type]:"text",void 0!=c[m])var e=c[m];else var e=c["default"];for(var f=0;f<e.length;f++)s.find("p.row."+e[f]).show();if(m=m,n=b.tag,x.val("Your "+b.name.toLowerCase()),w.val(b.name+":"),y.attr("checked",b.req),v.is(":visible")&&b.choices)for(var f=0;f<b.choices.length;f++)a("<input />").attr("type","text").addClass("widefat").data("value",b.choices[f]).attr("placeholder",B.labelFor+' "'+b.choices[f]+'" '+B.orLeaveEmpty).attr("value",b.choices[f]).appendTo(v);j()}function i(a){a=html_beautify(a),A.val(a)}function j(){var b,c=a("<div></div>");switch(m){case"lists":var d=g();return l()&&(d="<p>"+d+"</p>"),i(d);case"select":b=a("<select />"),v.find(":input").each(function(){a(this).val().length>0&&a("<option />").val(a(this).data("value")).text(a(this).val()).appendTo(b)});break;case"radio":case"checkbox":v.find(":input").each(function(){a(this).val().length>0&&(b=a("<input />").attr("type",m).attr("name",n).val(a(this).data("value")),y.is(":visible:checked")&&b.attr("required",!0),c.append(b),b.wrap("<label />"),a("<span />").text(a(this).val()+" ").insertAfter(b))});break;case"textarea":b=a("<textarea />");break;default:b=a("<input />").attr("type",m)}"radio"!=m&&"checkbox"!=m&&(n.length>0&&b.attr("name",n),t.is(":visible")&&t.val().length>0&&("textarea"==m?b.text(t.val()):b.attr("value",t.val())),x.is(":visible")&&x.val().length>0&&b.attr("placeholder",x.val()),y.is(":visible:checked")&&b.attr("required",!0),c.append(b)),w.is(":visible")&&w.val().length>0&&a("<label />").text(w.val()).prependTo(c),l()&&c.wrapInner(a("<p />"));var d=c.html();i(d)}function k(){var b=!1;if("undefined"!=typeof wpActiveEditor&&"undefined"!=typeof QTags&&QTags.insertContent&&(b=QTags.insertContent(A.val())),!b){var c=a("#mc4wpformmarkup");a("#mc4wpformmarkup").val(c.val()+"\n"+A.val())}}function l(){return z.is(":visible:checked")?!0:!1}var m,n,o=a("#mc4wp-lists :input"),p=a("#mc4wp-fw-mailchimp-fields"),q=a("#mc4wp-fw-mailchimp-fields .merge-fields"),r=a("#mc4wp-fw-mailchimp-fields .groupings"),s=a("#mc4wp-fw-fields"),t=a("#mc4wp-fw-value"),u=a("#mc4wp-fw-value-label"),v=a("#mc4wp-fw-values"),w=a("#mc4wp-fw-label"),x=a("#mc4wp-fw-placeholder"),y=a("#mc4wp-fw-required"),z=a("#mc4wp-fw-wrap-p"),A=a("#mc4wp-fw-preview"),B=mc4wp.strings.fieldWizard;o.change(b),p.change(c),s.change(j),a("#mc4wp-fw-add-to-form").click(k),b()}()}(jQuery);
1
+ !function(a){function b(){"boolean"==typeof this.checked&&(this.checked=!1),alert(mc4wp.strings.proOnlyNotice),event.stopPropagation()}var c=a("#mc4wp-admin");c.find(".pro-feature, .pro-feature label, .pro-feature :radio").click(b),c.find('input[name$="[show_at_woocommerce_checkout]"]').change(function(){c.find("tr#woocommerce-settings").toggle(a(this).prop("checked"))});var d=a("#mc4wp-lists").find(":input");d.change(function(){var b=d.filter(":checked").length>0;a(".mc4wp-notice.no-lists-selected").toggle(!b),a(document.getElementById("mc4wp-fw-fields")).toggle(b),a(document.getElementById("mc4wp-fw-mailchimp-fields")).toggle(b)}),a(document).delegate("#mc4wpformmarkup","keydown",function(b){var c=b.keyCode||b.which;if(9==c){b.preventDefault();var d=this.selectionStart,e=this.selectionEnd;a(this).val(a(this).val().substring(0,d)+" "+a(this).val().substring(e)),this.selectionStart=this.selectionEnd=d+1}}),function(){"undefined"!=typeof QTags&&(QTags.addButton("mc4wp_paragraph","<p>","<p>","</p>","paragraph","Paragraph tag",1),QTags.addButton("mc4wp_label","label","<label>","</label>","label","Label tag",2),QTags.addButton("mc4wp_response","form response","{response}","","response","Shows the form response"),QTags.addButton("mc4wp_subscriber_count","# of subscribers","{subscriber_count}","","subscribers","Shows number of subscribers of selected list(s)"),1==window.mc4wp.hasCaptchaPlugin&&QTags.addButton("mc4wp_captcha","CAPTCHA","{captcha}","","captcha","Display a CAPTCHA field"))}(),function(){"use strict";function b(){p.find("option").not(".default").remove(),o.filter(":checked").each(function(){for(var b=a(this).val(),c=mc4wp.mailchimpLists[b],d=0,e=c.merge_vars.length;e>d;d++){var f=c.merge_vars[d];if(0==q.find("option[value='"+f.tag+"']").length){var g=f.name.length>25?f.name.substring(0,25)+"..":f.name;f.req&&(g+="*");var h=a("<option />").text(g).val(f.tag).data("list-field",f);d>3&&h.text(B.proOnly+" "+g).attr("disabled","disabled").data("field",null),q.append(h)}}for(var d=0,i=c.interest_groupings.length;i>d;d++){var j=c.interest_groupings[d];if(0==r.find("option[value='"+j.id+"']").length){var g=j.name.length>25?j.name.substring(0,25)+"..":j.name,h=a("<option />").text(g).val(j.id).data("list-grouping",j);d>=1&&h.text(B.proOnly+" "+g).attr("disabled","disabled").data("list-grouping",null),r.append(h)}}})}function c(){d();var b=a(this).find(":selected");switch(b.val()){case"submit":m="submit",u.text(B.buttonText),t.val(B.subscribe),s.find("p.row").filter(".value, .wrap-p").show();break;case"lists":m="lists",s.find(".wrap-p").show();break;default:var c=b.data("list-field");if(c)return h(c);var c=b.data("list-grouping");if(c)return f(c)}j()}function d(){s.find(".row :input").each(function(){a(this).is(":checkbox")?this.checked=!0:this.value=""}),s.find("p.row").hide(),v.find(":input").remove(),s.show(),m="text",n="",u.html(B.initialValue+" <small>"+B.optional+"</small>")}function e(b){for(var c=0,d=b.length;d>c;c++)a("<input />").attr("type","text").addClass("widefat").data("value",b[c].name).attr("placeholder",B.labelFor+' "'+b[c].name+'" '+B.orLeaveEmpty).attr("value",b[c].name).appendTo(v)}function f(a){switch(s.find("p.row").filter(".values, .label, .wrap-p").show(),w.val(a.name+":"),n="GROUPINGS["+a.id+"]",e(a.groups),a.form_field){case"radio":m="radio";break;case"hidden":s.find("p.row").filter(".values, .label, .wrap-p").hide(),s.find("p.row.value").show();for(var b=0,c=a.groups.length;c>b;b++)t.val(t.val()+a.groups[b].name+",");m="hidden";break;case"dropdown":m="select";break;default:m="checkbox",n+="[]"}j()}function g(){var b="";return o.each(function(){var c=a(this).val(),d=a(this).parent("label").text(),e="";a(this).is(":checked")&&(e+="checked "),b+="<label>\n",b+=' <input type="checkbox" name="_mc4wp_lists[]" value="'+c+'" '+e+" /> "+d+"\n",b+="</label>\n"}),b}function h(b){var c={"default":["label","value","placeholder","required","wrap-p"],select:["label","required","wrap-p","values"],radio:["label","required","wrap-p","values"],date:["label","required","wrap-p","value"]},d={text:"text",email:"email",phone:"tel",address:"text",number:"number",dropdown:"select",date:"date",birthday:"date",radio:"radio",checkbox:"checkbox"};if(m=void 0!=d[b.field_type]?d[b.field_type]:"text",void 0!=c[m])var e=c[m];else var e=c["default"];for(var f=0;f<e.length;f++)s.find("p.row."+e[f]).show();if(m=m,n=b.tag,x.val("Your "+b.name.toLowerCase()),w.val(b.name+":"),y.attr("checked",b.req),v.is(":visible")&&b.choices)for(var f=0;f<b.choices.length;f++)a("<input />").attr("type","text").addClass("widefat").data("value",b.choices[f]).attr("placeholder",B.labelFor+' "'+b.choices[f]+'" '+B.orLeaveEmpty).attr("value",b.choices[f]).appendTo(v);j()}function i(a){a=html_beautify(a),A.val(a)}function j(){var b,c=a("<div></div>");switch(m){case"lists":var d=g();return l()&&(d="<p>"+d+"</p>"),i(d);case"select":b=a("<select />"),v.find(":input").each(function(){a(this).val().length>0&&a("<option />").val(a(this).data("value")).text(a(this).val()).appendTo(b)});break;case"radio":case"checkbox":v.find(":input").each(function(){a(this).val().length>0&&(b=a("<input />").attr("type",m).attr("name",n).val(a(this).data("value")),y.is(":visible:checked")&&b.attr("required",!0),c.append(b),b.wrap("<label />"),a("<span />").text(a(this).val()+" ").insertAfter(b))});break;case"textarea":b=a("<textarea />");break;default:b=a("<input />").attr("type",m)}"radio"!=m&&"checkbox"!=m&&(n.length>0&&b.attr("name",n),t.is(":visible")&&t.val().length>0&&("textarea"==m?b.text(t.val()):b.attr("value",t.val())),x.is(":visible")&&x.val().length>0&&b.attr("placeholder",x.val()),y.is(":visible:checked")&&b.attr("required",!0),c.append(b)),w.is(":visible")&&w.val().length>0&&a("<label />").text(w.val()).prependTo(c),l()&&c.wrapInner(a("<p />"));var d=c.html();i(d)}function k(){var b=!1;if("undefined"!=typeof wpActiveEditor&&"undefined"!=typeof QTags&&QTags.insertContent&&(b=QTags.insertContent(A.val())),!b){var c=a(document.getElementById("mc4wpformmarkup"));c.val(c.val()+"\n"+A.val())}}function l(){return z.is(":visible:checked")?!0:!1}var m,n,o=a("#mc4wp-lists :input"),p=a("#mc4wp-fw-mailchimp-fields"),q=p.find(".merge-fields"),r=p.find(".groupings"),s=a("#mc4wp-fw-fields"),t=a("#mc4wp-fw-value"),u=a("#mc4wp-fw-value-label"),v=a("#mc4wp-fw-values"),w=a("#mc4wp-fw-label"),x=a("#mc4wp-fw-placeholder"),y=a("#mc4wp-fw-required"),z=a("#mc4wp-fw-wrap-p"),A=a("#mc4wp-fw-preview"),B=mc4wp.strings.fieldWizard;o.change(b),p.change(c),s.change(j),a("#mc4wp-fw-add-to-form").click(k),b()}()}(jQuery);
includes/class-api.php CHANGED
@@ -41,9 +41,10 @@ class MC4WP_Lite_API {
41
  public function __construct( $api_key )
42
  {
43
  $this->api_key = $api_key;
 
44
 
45
- if( strpos( $api_key, '-' ) !== false ) {
46
- $this->api_url = 'https://' . substr( $api_key, -3 ) . '.api.mailchimp.com/2.0/';
47
  }
48
  }
49
 
41
  public function __construct( $api_key )
42
  {
43
  $this->api_key = $api_key;
44
+ $dash_position = strpos( $api_key, '-' );
45
 
46
+ if( $dash_position !== false ) {
47
+ $this->api_url = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/';
48
  }
49
  }
50
 
includes/integrations/class-cf7.php CHANGED
@@ -19,6 +19,9 @@ class MC4WP_CF7_Integration extends MC4WP_General_Integration {
19
  */
20
  public function __construct() {
21
 
 
 
 
22
  add_action( 'init', array( $this, 'init') );
23
 
24
  add_action( 'wpcf7_mail_sent', array( $this, 'subscribe_from_cf7' ) );
19
  */
20
  public function __construct() {
21
 
22
+ // make sure older checkbox names work for CF7 too
23
+ $this->upgrade();
24
+
25
  add_action( 'init', array( $this, 'init') );
26
 
27
  add_action( 'wpcf7_mail_sent', array( $this, 'subscribe_from_cf7' ) );
includes/integrations/class-general.php CHANGED
@@ -35,7 +35,7 @@ class MC4WP_General_Integration extends MC4WP_Integration {
35
  /**
36
  * Upgrade routine
37
  */
38
- private function upgrade() {
39
  // set new $_POST trigger value
40
  if( isset( $_POST['mc4wp-try-subscribe'] ) ) {
41
  $_POST[ $this->checkbox_name ] = 1;
35
  /**
36
  * Upgrade routine
37
  */
38
+ protected function upgrade() {
39
  // set new $_POST trigger value
40
  if( isset( $_POST['mc4wp-try-subscribe'] ) ) {
41
  $_POST[ $this->checkbox_name ] = 1;
includes/integrations/class-integration.php CHANGED
@@ -228,7 +228,7 @@ abstract class MC4WP_Integration {
228
  $lists = $this->get_lists();
229
 
230
  if( empty( $lists) ) {
231
- if( ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && current_user_can( 'manage_options' ) ) {
232
  wp_die(
233
  '<h3>' . __( 'MailChimp for WordPress - Error', 'mailchimp-for-wp' ) . '</h3>' .
234
  '<p>' . sprintf( __( 'Please select a list to subscribe to in the <a href="%s">checkbox settings</a>.', 'mailchimp-for-wp' ), admin_url( 'admin.php?page=mc4wp-lite-checkbox-settings' ) ) . '</p>' .
@@ -310,7 +310,7 @@ abstract class MC4WP_Integration {
310
  }
311
 
312
  // check if result succeeded, show debug message to administrators (only in NON-AJAX requests)
313
- if ( $result !== true && $api->has_error() && current_user_can( 'manage_options' ) && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && ( ! isset( $_POST['_wpcf7_is_ajax_call'] ) || $_POST['_wpcf7_is_ajax_call'] != 1 ) ) {
314
  wp_die( '<h3>' . __( 'MailChimp for WordPress - Error', 'mailchimp-for-wp' ) . '</h3>' .
315
  '<p>' . __( 'The MailChimp server returned the following error message as a response to our sign-up request:', 'mailchimp-for-wp' ) . '</p>' .
316
  '<pre>' . $api->get_error_message() . '</pre>' .
@@ -325,4 +325,18 @@ abstract class MC4WP_Integration {
325
 
326
  return $result;
327
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  }
228
  $lists = $this->get_lists();
229
 
230
  if( empty( $lists) ) {
231
+ if( $this->show_error_messages() ) {
232
  wp_die(
233
  '<h3>' . __( 'MailChimp for WordPress - Error', 'mailchimp-for-wp' ) . '</h3>' .
234
  '<p>' . sprintf( __( 'Please select a list to subscribe to in the <a href="%s">checkbox settings</a>.', 'mailchimp-for-wp' ), admin_url( 'admin.php?page=mc4wp-lite-checkbox-settings' ) ) . '</p>' .
310
  }
311
 
312
  // check if result succeeded, show debug message to administrators (only in NON-AJAX requests)
313
+ if ( $result !== true && $api->has_error() && $this->show_error_messages() ) {
314
  wp_die( '<h3>' . __( 'MailChimp for WordPress - Error', 'mailchimp-for-wp' ) . '</h3>' .
315
  '<p>' . __( 'The MailChimp server returned the following error message as a response to our sign-up request:', 'mailchimp-for-wp' ) . '</p>' .
316
  '<pre>' . $api->get_error_message() . '</pre>' .
325
 
326
  return $result;
327
  }
328
+
329
+ /**
330
+ * Should we show error messages?
331
+ * - Not for AJAX requests
332
+ * - Not for non-admins
333
+ * - Not for CF7 requests (which uses a different AJAX mechanism)
334
+ *
335
+ * @return bool
336
+ */
337
+ protected function show_error_messages() {
338
+ return ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
339
+ && ( ! isset( $_POST['_wpcf7_is_ajax_call'] ) || $_POST['_wpcf7_is_ajax_call'] != 1 )
340
+ && current_user_can( 'manage_options' );
341
+ }
342
  }
languages/mailchimp-for-wp-cs_CZ.po CHANGED
@@ -1,14 +1,14 @@
1
  # Copyright (C) 2014 Danny van Kooten
2
  # This file is distributed under the GPL v3.
3
  # Translators:
4
- # Jan Toman <toman.jan@gmail.com>, 2014
5
  msgid ""
6
  msgstr ""
7
  "Project-Id-Version: MailChimp for WordPress\n"
8
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
9
  "POT-Creation-Date: 2014-12-09 19:20:27+00:00\n"
10
- "PO-Revision-Date: 2014-12-09 19:21+0000\n"
11
- "Last-Translator: Danny van Kooten <dannyvankooten@gmail.com>\n"
12
  "Language-Team: Czech (Czech Republic) (http://www.transifex.com/projects/p/mailchimp-for-wordpress/language/cs_CZ/)\n"
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -55,7 +55,7 @@ msgstr "Formuláře"
55
 
56
  #: mailchimp-for-wordpress/includes/class-admin.php:299
57
  msgid "This option is only available in MailChimp for WordPress Pro."
58
- msgstr ""
59
 
60
  #: mailchimp-for-wordpress/includes/class-admin.php:313
61
  #: mailchimp-for-wordpress-pro/includes/admin/class-admin.php:671
@@ -721,7 +721,7 @@ msgstr ""
721
 
722
  #: mailchimp-for-wordpress/includes/views/form-settings.php:243
723
  msgid "Form Styling"
724
- msgstr ""
725
 
726
  #: mailchimp-for-wordpress/includes/views/form-settings.php:244
727
  msgid "Alter the visual appearance of the form by applying CSS rules to %s."
@@ -927,7 +927,7 @@ msgstr "Tento plugin není vyvíjen ve spolupráci s MailChimpem."
927
 
928
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:9
929
  msgid "Looking for support?"
930
- msgstr ""
931
 
932
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:10
933
  msgid ""
@@ -947,7 +947,7 @@ msgstr ""
947
 
948
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:17
949
  msgid "Upgrade to MailChimp for WordPress Pro"
950
- msgstr ""
951
 
952
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:18
953
  msgid "Leave a %s plugin review on WordPress.org"
@@ -959,7 +959,7 @@ msgstr ""
959
 
960
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:19
961
  msgid "Tweet about MailChimp for WordPress"
962
- msgstr ""
963
 
964
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:20
965
  msgid ""
@@ -973,7 +973,7 @@ msgstr ""
973
 
974
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:25
975
  msgid "About the developer"
976
- msgstr ""
977
 
978
  #: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:11
979
  msgid ""
@@ -1174,7 +1174,7 @@ msgstr "aktualizace pluginu budou stahovány"
1174
 
1175
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:28
1176
  msgid "EXPIRED"
1177
- msgstr ""
1178
 
1179
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:28
1180
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:30
@@ -1255,7 +1255,7 @@ msgstr "Seznam"
1255
 
1256
  #: mailchimp-for-wordpress-pro/includes/class-form-request.php:675
1257
  msgid "Other fields"
1258
- msgstr ""
1259
 
1260
  #: mailchimp-for-wordpress-pro/includes/class-form-request.php:692
1261
  msgid ""
@@ -1270,7 +1270,7 @@ msgstr ""
1270
 
1271
  #: mailchimp-for-wordpress-pro/includes/class-mailchimp.php:140
1272
  msgid "IP Address"
1273
- msgstr ""
1274
 
1275
  #: mailchimp-for-wordpress-pro/includes/class-widget.php:20
1276
  msgid "MailChimp for WP Form"
@@ -1366,7 +1366,7 @@ msgstr "Zdroj"
1366
 
1367
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:57
1368
  msgid "Data"
1369
- msgstr ""
1370
 
1371
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:58
1372
  msgid "Subscribed"
@@ -1383,7 +1383,7 @@ msgstr "Komentář"
1383
 
1384
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:209
1385
  msgid "deleted"
1386
- msgstr ""
1387
 
1388
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:219
1389
  msgid "Registration"
1
  # Copyright (C) 2014 Danny van Kooten
2
  # This file is distributed under the GPL v3.
3
  # Translators:
4
+ # Jan Toman <toman.jan@gmail.com>, 2014-2015
5
  msgid ""
6
  msgstr ""
7
  "Project-Id-Version: MailChimp for WordPress\n"
8
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
9
  "POT-Creation-Date: 2014-12-09 19:20:27+00:00\n"
10
+ "PO-Revision-Date: 2015-01-13 10:43+0000\n"
11
+ "Last-Translator: Jan Toman <toman.jan@gmail.com>\n"
12
  "Language-Team: Czech (Czech Republic) (http://www.transifex.com/projects/p/mailchimp-for-wordpress/language/cs_CZ/)\n"
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=UTF-8\n"
55
 
56
  #: mailchimp-for-wordpress/includes/class-admin.php:299
57
  msgid "This option is only available in MailChimp for WordPress Pro."
58
+ msgstr "Tato možnost je dostupná pouze v Pro verzi pluginu."
59
 
60
  #: mailchimp-for-wordpress/includes/class-admin.php:313
61
  #: mailchimp-for-wordpress-pro/includes/admin/class-admin.php:671
721
 
722
  #: mailchimp-for-wordpress/includes/views/form-settings.php:243
723
  msgid "Form Styling"
724
+ msgstr "Vzhled formuláře"
725
 
726
  #: mailchimp-for-wordpress/includes/views/form-settings.php:244
727
  msgid "Alter the visual appearance of the form by applying CSS rules to %s."
927
 
928
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:9
929
  msgid "Looking for support?"
930
+ msgstr "Potřebujete pomoc s nastavením?"
931
 
932
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:10
933
  msgid ""
947
 
948
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:17
949
  msgid "Upgrade to MailChimp for WordPress Pro"
950
+ msgstr "Upgrade na Pro verzi pluginu."
951
 
952
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:18
953
  msgid "Leave a %s plugin review on WordPress.org"
959
 
960
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:19
961
  msgid "Tweet about MailChimp for WordPress"
962
+ msgstr "Sdílej MailChimp pro WordPress na Twitteru"
963
 
964
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:20
965
  msgid ""
973
 
974
  #: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:25
975
  msgid "About the developer"
976
+ msgstr "O vývojáři"
977
 
978
  #: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:11
979
  msgid ""
1174
 
1175
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:28
1176
  msgid "EXPIRED"
1177
+ msgstr "VYPRŠENO"
1178
 
1179
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:28
1180
  #: mailchimp-for-wordpress-pro/includes/admin/license-manager/views/form.php:30
1255
 
1256
  #: mailchimp-for-wordpress-pro/includes/class-form-request.php:675
1257
  msgid "Other fields"
1258
+ msgstr "Ostatní políčka"
1259
 
1260
  #: mailchimp-for-wordpress-pro/includes/class-form-request.php:692
1261
  msgid ""
1270
 
1271
  #: mailchimp-for-wordpress-pro/includes/class-mailchimp.php:140
1272
  msgid "IP Address"
1273
+ msgstr "IP adresa"
1274
 
1275
  #: mailchimp-for-wordpress-pro/includes/class-widget.php:20
1276
  msgid "MailChimp for WP Form"
1366
 
1367
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:57
1368
  msgid "Data"
1369
+ msgstr "Data"
1370
 
1371
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:58
1372
  msgid "Subscribed"
1383
 
1384
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:209
1385
  msgid "deleted"
1386
+ msgstr "smazáno"
1387
 
1388
  #: mailchimp-for-wordpress-pro/includes/tables/class-log-table.php:219
1389
  msgid "Registration"
mailchimp-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailChimp for WordPress Lite
4
  Plugin URI: https://mc4wp.com/
5
  Description: Lite version of MailChimp for WordPress. Adds various sign-up methods to your website.
6
- Version: 2.2.1
7
  Author: Danny van Kooten
8
  Author URI: https://dannyvankooten.com
9
  Text Domain: mailchimp-for-wp
@@ -47,7 +47,7 @@ function mc4wp_load_plugin() {
47
  }
48
 
49
  // bootstrap the lite plugin
50
- define( 'MC4WP_LITE_VERSION', '2.2.1' );
51
  define( 'MC4WP_LITE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
52
  define( 'MC4WP_LITE_PLUGIN_URL', plugins_url( '/' , __FILE__ ) );
53
  define( 'MC4WP_LITE_PLUGIN_FILE', __FILE__ );
3
  Plugin Name: MailChimp for WordPress Lite
4
  Plugin URI: https://mc4wp.com/
5
  Description: Lite version of MailChimp for WordPress. Adds various sign-up methods to your website.
6
+ Version: 2.2.2
7
  Author: Danny van Kooten
8
  Author URI: https://dannyvankooten.com
9
  Text Domain: mailchimp-for-wp
47
  }
48
 
49
  // bootstrap the lite plugin
50
+ define( 'MC4WP_LITE_VERSION', '2.2.2' );
51
  define( 'MC4WP_LITE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
52
  define( 'MC4WP_LITE_PLUGIN_URL', plugins_url( '/' , __FILE__ ) );
53
  define( 'MC4WP_LITE_PLUGIN_FILE', __FILE__ );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://mc4wp.com/
4
  Tags: mailchimp,newsletter,optin,mailinglist,sign-up form,subscribe,form,shortcode,widget,checkbox,comment,buddypress,multisite,bbpress,woocommerce,easy digital downloads,contact form,contact form 7,events manager,comment form,registration form,captcha
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
- Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -264,6 +264,12 @@ It's easy to translate the plugin into your own language. Head over to the [tran
264
 
265
  == Changelog ==
266
 
 
 
 
 
 
 
267
  = 2.2.1 - January 12, 2014 =
268
 
269
  **Improvements**
@@ -671,5 +677,5 @@ It's easy to translate the plugin into your own language. Head over to the [tran
671
 
672
  == Upgrade Notice ==
673
 
674
- = 2.2.1 =
675
- Spam prevention improvements, updated translations & minor code improvements.
4
  Tags: mailchimp,newsletter,optin,mailinglist,sign-up form,subscribe,form,shortcode,widget,checkbox,comment,buddypress,multisite,bbpress,woocommerce,easy digital downloads,contact form,contact form 7,events manager,comment form,registration form,captcha
5
  Requires at least: 3.6
6
  Tested up to: 4.1
7
+ Stable tag: 2.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
264
 
265
  == Changelog ==
266
 
267
+ = 2.2.2 - January 13, 2014 =
268
+
269
+ **Fixes**
270
+
271
+ - Plugin wasn't connecting to MailChimp for users on MailChimp server `us10` (API keys ending in `-us10`)
272
+
273
  = 2.2.1 - January 12, 2014 =
274
 
275
  **Improvements**
677
 
678
  == Upgrade Notice ==
679
 
680
+ = 2.2.2 =
681
+ Fix for users on MailChimp server us10. Anti-spam improvements for checkbox integrations. Updated translations.