MailChimp for WordPress - Version 1.4.4

Version Description

  • November 27, 2013 =
  • Fixed: FNAME and LNAME not being guessed from NAME for form sign-ups.
  • Added: very small JavaScript fallback for placeholders in older browsers (<
Download this release

Release Info

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

Code changes from version 1.4.3 to 1.4.4

assets/css/admin.css CHANGED
@@ -1,5 +1,5 @@
1
  #mc4wp-content{ float:left; width:65%; margin-right:0; }
2
- #mc4wp-sidebar{ float:right; width:32%; margin:0; padding:9px 0 0; }
3
  #mc4wp-sidebar .mc4wp-box{ margin-bottom:20px; }
4
 
5
  #mc4wp-upgrade-box { background:#222; color:#ddd; padding:20px; }
@@ -40,4 +40,9 @@
40
 
41
  table.mc4wp-help, table.mc4wp-help th, table.mc4wp-help td { border: 1px solid #ddd; border-collapse: collapse; font-size: 12px; }
42
  table.mc4wp-help th, table.mc4wp-help td { vertical-align: text-top; text-align: left; padding: 5px 10px; }
43
- table.mc4wp-help tr:hover { background-color: #ddd; }
 
 
 
 
 
1
  #mc4wp-content{ float:left; width:65%; margin-right:0; }
2
+ #mc4wp-sidebar{ float:left; width:32%; margin-left:1%; border-left:1px solid #efefef; padding:0 0 0 1%; }
3
  #mc4wp-sidebar .mc4wp-box{ margin-bottom:20px; }
4
 
5
  #mc4wp-upgrade-box { background:#222; color:#ddd; padding:20px; }
40
 
41
  table.mc4wp-help, table.mc4wp-help th, table.mc4wp-help td { border: 1px solid #ddd; border-collapse: collapse; font-size: 12px; }
42
  table.mc4wp-help th, table.mc4wp-help td { vertical-align: text-top; text-align: left; padding: 5px 10px; }
43
+ table.mc4wp-help tr:hover { background-color: #ddd; }
44
+
45
+ @media(max-width: 1199px) {
46
+ #mc4wp-sidebar, #mc4wp-content{ float: none; width: 100%; }
47
+ #mc4wp-sidebar{ margin:25px 0 0; padding:25px 0 0; border:0; border-top:1px solid #efefef; }
48
+ }
assets/css/checkbox.css CHANGED
@@ -1,7 +1,22 @@
1
-
2
  /* MailChimp for WP - Default Checkbox Styles */
3
- #mc4wp-checkbox{ clear:both; display:block; }
4
- #mc4wp-checkbox input{ margin:0 5px 0 0; display:inline-block !important; width:13px; height:13px; }
5
- #mc4wp-checkbox label{ display:inline-block !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- #registerform #mc4wp-checkbox{ margin-bottom:10px; }
 
 
 
1
  /* MailChimp for WP - Default Checkbox Styles */
2
+ #mc4wp-checkbox{
3
+ clear:both;
4
+ display:block;
5
+ }
6
+
7
+ #mc4wp-checkbox input{
8
+ position:relative;
9
+ margin:0 6px 0 0;
10
+ padding:0;
11
+ vertical-align: middle;
12
+ display:inline-block !important;
13
+ -webkit-appearance: checkbox;
14
+ }
15
+
16
+ #mc4wp-checkbox label{
17
+ cursor:pointer;
18
+ }
19
 
20
+ #registerform #mc4wp-checkbox{
21
+ margin-bottom:10px;
22
+ }
assets/css/form-reset.css CHANGED
@@ -1,11 +1,32 @@
1
 
2
  /* MailChimp for WP - Default Form Styles */
3
- .mc4wp-form{ margin:1em 0; }
4
- .mc4wp-form p{ text-align:left; }
5
- .mc4wp-form label{ display:block; font-weight:bold; margin-bottom:5px; text-align:left; }
6
- .mc4wp-form ul, .mc4wp-form li { list-style:none; margin:0; padding:0; }
7
- .mc4wp-form label > span, .mc4wp-form li > label{ font-weight: normal; }
8
- .mc4wp-form p > label:nth-child(2) { margin-top: 10px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  .mc4wp-form input[type="text"],
11
  .mc4wp-form input[type="email"],
@@ -13,13 +34,41 @@
13
  .mc4wp-form input[type="url"],
14
  .mc4wp-form input[type="date"],
15
  .mc4wp-form textarea,
16
- .mc4wp-form select { cursor: auto; display:block; width:100%; height:auto; box-sizing:border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
- .mc4wp-form input[type="checkbox"] { position:relative; margin:0 10px 0 0; padding:0; height:13px; width:13px;
19
- display:inline-block; -webkit-appearance: checkbox; border:0; }
20
- .mc4wp-form input[type="radio"] { position:relative; margin:0 10px 0 0; padding:0; height:13px; width:13px;
21
- display:inline-block; -webkit-appearance: radio; border:0;}
22
- .mc4wp-form input[type="submit"], .mc4wp-form button { cursor: pointer; display:inline-block; }
 
23
 
24
  .mc4wp-alert{ margin:1em 0; padding: 10px 15px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5; border-radius: 2px; -moz-border-radius:2px; -webkit-border-radius:2px; display:block; position:relative;}
25
  .mc4wp-success { color: #468847; background-color: #dff0d8; border-color: #d6e9c6; }
1
 
2
  /* MailChimp for WP - Default Form Styles */
3
+ .mc4wp-form{
4
+ margin:1em 0;
5
+ }
6
+
7
+ .mc4wp-form label{
8
+ display:block;
9
+ font-weight:bold;
10
+ margin-bottom:5px;
11
+ }
12
+
13
+ .mc4wp-form ul,
14
+ .mc4wp-form li {
15
+ list-style:none;
16
+ margin:0;
17
+ padding:0;
18
+ }
19
+
20
+ .mc4wp-form label > span,
21
+ .mc4wp-form li > label {
22
+ font-weight: normal;
23
+ }
24
+
25
+ .mc4wp-form p > label:nth-child(2) {
26
+ margin-top: 10px;
27
+ }
28
+
29
+ .mc4wp-form input.placeholdersjs { color: #aaa !important; }
30
 
31
  .mc4wp-form input[type="text"],
32
  .mc4wp-form input[type="email"],
34
  .mc4wp-form input[type="url"],
35
  .mc4wp-form input[type="date"],
36
  .mc4wp-form textarea,
37
+ .mc4wp-form select {
38
+ cursor: auto;
39
+ display:block;
40
+ width:100%;
41
+ height:auto;
42
+ box-sizing:border-box;
43
+ -webkit-box-sizing: border-box;
44
+ -moz-box-sizing: border-box;
45
+ }
46
+
47
+ .mc4wp-form input[type="checkbox"],
48
+ .mc4wp-form input[type="radio"] {
49
+ position:relative;
50
+ margin:0 6px 0 0;
51
+ padding:0;
52
+ height:13px;
53
+ width:13px;
54
+ display:inline-block;
55
+ border:0;
56
+ }
57
+
58
+ .mc4wp-form input[type="checkbox"] {
59
+ -webkit-appearance: checkbox;
60
+ }
61
+
62
+ .mc4wp-form input[type="radio"] {
63
+ -webkit-appearance: radio;
64
+ }
65
 
66
+ .mc4wp-form input[type="submit"],
67
+ .mc4wp-form button,
68
+ .mc4wp-form input[type="button"] {
69
+ cursor: pointer;
70
+ display:inline-block;
71
+ }
72
 
73
  .mc4wp-alert{ margin:1em 0; padding: 10px 15px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5; border-radius: 2px; -moz-border-radius:2px; -webkit-border-radius:2px; display:block; position:relative;}
74
  .mc4wp-success { color: #468847; background-color: #dff0d8; border-color: #d6e9c6; }
assets/css/form-theme-blue.css CHANGED
@@ -16,6 +16,7 @@
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
 
19
  .mc4wp-form textarea:focus,
20
  .mc4wp-form select:focus {
21
  border-color: #428bca;
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
19
+ .mc4wp-form input[type="date"]:focus,
20
  .mc4wp-form textarea:focus,
21
  .mc4wp-form select:focus {
22
  border-color: #428bca;
assets/css/form-theme-dark.css CHANGED
@@ -16,6 +16,7 @@
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
 
19
  .mc4wp-form textarea:focus,
20
  .mc4wp-form select:focus {
21
  border-color: #333333;
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
19
+ .mc4wp-form input[type="date"]:focus,
20
  .mc4wp-form textarea:focus,
21
  .mc4wp-form select:focus {
22
  border-color: #333333;
assets/css/form-theme-green.css CHANGED
@@ -16,6 +16,7 @@
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
 
19
  .mc4wp-form textarea:focus,
20
  .mc4wp-form select:focus {
21
  border-color: #5cb85c;
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
19
+ .mc4wp-form input[type="date"]:focus,
20
  .mc4wp-form textarea:focus,
21
  .mc4wp-form select:focus {
22
  border-color: #5cb85c;
assets/css/form-theme-red.css CHANGED
@@ -16,6 +16,7 @@
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
 
19
  .mc4wp-form textarea:focus,
20
  .mc4wp-form select:focus {
21
  border-color: #d9534f;
16
  .mc4wp-form input[type="email"]:focus,
17
  .mc4wp-form input[type="tel"]:focus,
18
  .mc4wp-form input[type="url"]:focus,
19
+ .mc4wp-form input[type="date"]:focus,
20
  .mc4wp-form textarea:focus,
21
  .mc4wp-form select:focus {
22
  border-color: #d9534f;
assets/js/placeholders.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* Placeholders.js v3.0.1 */
2
+ (function(t){"use strict";function e(t,e,r){return t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):void 0}function r(t,e){var r,n;for(r=0,n=t.length;n>r;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move("character",e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){"use strict";function e(){}function r(){try{return document.activeElement}catch(t){}}function n(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(D);return(a||u)&&"true"===t.getAttribute(I)?(t.removeAttribute(I),t.value=t.value.replace(t.getAttribute(D),""),t.className=t.className.replace(V,""),n=t.getAttribute(F),n&&(t.setAttribute("maxLength",n),t.removeAttribute(F)),r=t.getAttribute(P),r&&(t.type=r),!0):!1}function a(t){var e,r,n=t.getAttribute(D);return""===t.value&&n?(t.setAttribute(I,"true"),t.value=n,t.className+=" "+R,r=t.getAttribute(F),r||(t.setAttribute(F,t.maxLength),t.removeAttribute("maxLength")),e=t.getAttribute(P),e?t.type="text":"password"===t.type&&M.changeType(t,"text")&&t.setAttribute(P,"password"),!0):!1}function u(t,e){var r,n,a,u,i;if(t&&t.getAttribute(D))e(t);else for(r=t?t.getElementsByTagName("input"):b,n=t?t.getElementsByTagName("textarea"):f,i=0,u=r.length+n.length;u>i;i++)a=r.length>i?r[i]:n[i-r.length],e(a)}function i(t){u(t,n)}function l(t){u(t,a)}function o(t){return function(){h&&t.value===t.getAttribute(D)&&"true"===t.getAttribute(I)?M.moveCaret(t,0):n(t)}}function c(t){return function(){a(t)}}function s(t){return function(e){return A=t.value,"true"===t.getAttribute(I)&&A===t.getAttribute(D)&&M.inArray(B,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function d(t){return function(){n(t,A),""===t.value&&(t.blur(),M.moveCaret(t,0))}}function g(t){return function(){t===r()&&t.value===t.getAttribute(D)&&"true"===t.getAttribute(I)&&M.moveCaret(t,0)}}function v(t){return function(){i(t)}}function p(t){t.form&&(T=t.form,T.getAttribute(U)||(M.addEventListener(T,"submit",v(T)),T.setAttribute(U,"true"))),M.addEventListener(t,"focus",o(t)),M.addEventListener(t,"blur",c(t)),h&&(M.addEventListener(t,"keydown",s(t)),M.addEventListener(t,"keyup",d(t)),M.addEventListener(t,"click",g(t))),t.setAttribute(j,"true"),t.setAttribute(D,x),(h||t!==r())&&a(t)}var b,f,h,m,A,y,E,x,L,T,N,S,w,C=["text","search","url","tel","email","password","number","textarea"],B=[27,33,34,35,36,37,38,39,40,8,46],k="#ccc",R="placeholdersjs",V=RegExp("(?:^|\\s)"+R+"(?!\\S)"),D="data-placeholder-value",I="data-placeholder-active",P="data-placeholder-type",U="data-placeholder-submit",j="data-placeholder-bound",q="data-placeholder-focus",z="data-placeholder-live",F="data-placeholder-maxlength",G=document.createElement("input"),H=document.getElementsByTagName("head")[0],J=document.documentElement,K=t.Placeholders,M=K.Utils;if(K.nativeSupport=void 0!==G.placeholder,!K.nativeSupport){for(b=document.getElementsByTagName("input"),f=document.getElementsByTagName("textarea"),h="false"===J.getAttribute(q),m="false"!==J.getAttribute(z),y=document.createElement("style"),y.type="text/css",E=document.createTextNode("."+R+" { color:"+k+"; }"),y.styleSheet?y.styleSheet.cssText=E.nodeValue:y.appendChild(E),H.insertBefore(y,H.firstChild),w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x&&(x=x.nodeValue,x&&M.inArray(C,N.type)&&p(N));L=setInterval(function(){for(w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x?(x=x.nodeValue,x&&M.inArray(C,N.type)&&(N.getAttribute(j)||p(N),(x!==N.getAttribute(D)||"password"===N.type&&!N.getAttribute(P))&&("password"===N.type&&!N.getAttribute(P)&&M.changeType(N,"text")&&N.setAttribute(P,"password"),N.value===N.getAttribute(D)&&(N.value=x),N.setAttribute(D,x)))):N.getAttribute(I)&&(n(N),N.removeAttribute(D));m||clearInterval(L)},100)}M.addEventListener(t,"beforeunload",function(){i()}),K.disable=K.nativeSupport?e:i,K.enable=K.nativeSupport?e:l}(this);
includes/MC4WP_Lite.php CHANGED
@@ -85,7 +85,6 @@ class MC4WP_Lite {
85
  'show_at_multisite_form' => 0,
86
  'show_at_buddypress_form' => 0,
87
  'show_at_bbpress_forms' => 0,
88
- 'show_at_other_forms' => 0,
89
  'lists' => array(),
90
  'double_optin' => 1
91
  ),
85
  'show_at_multisite_form' => 0,
86
  'show_at_buddypress_form' => 0,
87
  'show_at_bbpress_forms' => 0,
 
88
  'lists' => array(),
89
  'double_optin' => 1
90
  ),
includes/MC4WP_Lite_API.php CHANGED
@@ -71,7 +71,7 @@ class MC4WP_Lite_API {
71
 
72
  public function get_lists()
73
  {
74
- $result = $this->call('lists/list');
75
 
76
  if($result && isset($result->data)) {
77
  return $result->data;
71
 
72
  public function get_lists()
73
  {
74
+ $result = $this->call('lists/list', array('limit' => 100));
75
 
76
  if($result && isset($result->data)) {
77
  return $result->data;
includes/MC4WP_Lite_Admin.php CHANGED
@@ -48,7 +48,7 @@ class MC4WP_Lite_Admin
48
 
49
  public function add_settings_link($links)
50
  {
51
- $settings_link = '<a href="admin.php?page=mc4wp-lite">Settings</a>';
52
  $upgrade_link = '<a href="http://dannyvankooten.com/mailchimp-for-wordpress/">Upgrade to Pro</a>';
53
  array_unshift($links, $upgrade_link, $settings_link);
54
  return $links;
@@ -56,14 +56,9 @@ class MC4WP_Lite_Admin
56
 
57
  public function register_settings()
58
  {
59
- register_setting('mc4wp_lite_settings', 'mc4wp_lite', array($this, 'validate_options'));
60
- register_setting('mc4wp_lite_checkbox_settings', 'mc4wp_lite_checkbox', array($this, 'validate_options'));
61
- register_setting('mc4wp_lite_form_settings', 'mc4wp_lite_form', array($this, 'validate_options'));
62
- }
63
-
64
- public function validate_options($opts)
65
- {
66
- return $opts;
67
  }
68
 
69
  public function build_menu()
48
 
49
  public function add_settings_link($links)
50
  {
51
+ $settings_link = '<a href="admin.php?page=mc4wp-lite">'. __('Settings') . '</a>';
52
  $upgrade_link = '<a href="http://dannyvankooten.com/mailchimp-for-wordpress/">Upgrade to Pro</a>';
53
  array_unshift($links, $upgrade_link, $settings_link);
54
  return $links;
56
 
57
  public function register_settings()
58
  {
59
+ register_setting('mc4wp_lite_settings', 'mc4wp_lite');
60
+ register_setting('mc4wp_lite_checkbox_settings', 'mc4wp_lite_checkbox');
61
+ register_setting('mc4wp_lite_form_settings', 'mc4wp_lite_form');
 
 
 
 
 
62
  }
63
 
64
  public function build_menu()
includes/MC4WP_Lite_Checkbox.php CHANGED
@@ -57,9 +57,9 @@ class MC4WP_Lite_Checkbox
57
  }
58
 
59
  /* Other actions... catch-all */
60
- if($opts['show_at_other_forms']) {
61
  add_action('init', array($this, 'subscribe_from_whatever'));
62
- }
63
 
64
  }
65
 
@@ -84,8 +84,7 @@ class MC4WP_Lite_Checkbox
84
  $checked = $opts['precheck'] ? "checked" : '';
85
  $content = "\n<!-- Checkbox by MailChimp for WordPress plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
86
  $content .= '<p id="mc4wp-checkbox">';
87
- $content .= '<input type="checkbox" name="mc4wp-do-subscribe" id="mc4wp-checkbox-input" value="1" '. $checked . ' />';
88
- $content .= '<label for="mc4wp-checkbox-input">'. __($label) . '</label>';
89
  $content .= '</p>';
90
  $content .= "\n<!-- / MailChimp for WP Plugin -->\n";
91
  return $content;
@@ -359,14 +358,15 @@ class MC4WP_Lite_Checkbox
359
  return 'no_lists_selected';
360
  }
361
 
 
362
  // guess FNAME and LNAME
363
- if(isset($merge_vars['NAME']) && !isset($merge_vars['FNAME']) && !isset($merge_vars['LNAME'])) {
364
-
365
- $strpos = strpos($merge_vars['NAME'], ' ');
366
 
367
- if($strpos) {
368
- $merge_vars['FNAME'] = substr($merge_vars['NAME'], 0, $strpos);
369
- $merge_vars['LNAME'] = substr($merge_vars['NAME'], $strpos);
370
  } else {
371
  $merge_vars['FNAME'] = $merge_vars['NAME'];
372
  }
57
  }
58
 
59
  /* Other actions... catch-all */
60
+ if(isset($_POST['mc4wp-try-subscribe']) && $_POST['mc4wp-try-subscribe']) {
61
  add_action('init', array($this, 'subscribe_from_whatever'));
62
+ }
63
 
64
  }
65
 
84
  $checked = $opts['precheck'] ? "checked" : '';
85
  $content = "\n<!-- Checkbox by MailChimp for WordPress plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
86
  $content .= '<p id="mc4wp-checkbox">';
87
+ $content .= '<label><input type="checkbox" name="mc4wp-do-subscribe" value="1" '. $checked . ' /> ' . __($label) . '</label>';
 
88
  $content .= '</p>';
89
  $content .= "\n<!-- / MailChimp for WP Plugin -->\n";
90
  return $content;
358
  return 'no_lists_selected';
359
  }
360
 
361
+
362
  // guess FNAME and LNAME
363
+ if ( isset( $merge_vars['NAME'] ) && !isset( $merge_vars['FNAME'] ) && !isset( $merge_vars['LNAME'] ) ) {
364
+
365
+ $strpos = strpos( $merge_vars['NAME'], ' ' );
366
 
367
+ if ( $strpos ) {
368
+ $merge_vars['FNAME'] = trim( substr( $merge_vars['NAME'], 0, $strpos ) );
369
+ $merge_vars['LNAME'] = trim( substr( $merge_vars['NAME'], $strpos ) );
370
  } else {
371
  $merge_vars['FNAME'] = $merge_vars['NAME'];
372
  }
includes/MC4WP_Lite_Form.php CHANGED
@@ -26,7 +26,12 @@ class MC4WP_Lite_Form {
26
  add_action( 'wp_footer', array( $this, 'print_scroll_js' ), 99);
27
  }
28
 
 
 
29
 
 
 
 
30
  }
31
 
32
  public function get_options() {
@@ -60,7 +65,7 @@ class MC4WP_Lite_Form {
60
  if ( $this->success ) $css_classes .= 'mc4wp-form-success ';
61
 
62
  $content = "\n<!-- Form by MailChimp for WordPress plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
63
- $content .= '<form method="post" action="#mc4wp-form-'. $this->form_instance_number .'" id="mc4wp-form-'.$this->form_instance_number.'" class="mc4wp-form form'.$css_classes.'">';
64
 
65
  // maybe hide the form
66
  if ( !( $this->success && $opts['hide_after_success'] ) ) {
@@ -116,6 +121,12 @@ class MC4WP_Lite_Form {
116
  // increase form instance number in case there is more than one form on a page
117
  $this->form_instance_number++;
118
 
 
 
 
 
 
 
119
  return $content;
120
  }
121
 
@@ -220,12 +231,13 @@ class MC4WP_Lite_Form {
220
  // upercase $_POST variables
221
  foreach ( $_POST as $name => $value ) {
222
 
223
- // only uppercase variables which are not already uppercased, skip mc4wp internal vars
224
- if ( $name === strtoupper( $name ) || in_array( $name, array( 'mc4wp_form_instance', 'mc4wp_form_nonce', 'mc4wp_required_but_not_really', 'mc4wp_form_submit' ) ) ) continue;
225
- $uppercased_name = strtoupper( $name );
 
226
 
227
- // set new (uppercased) $_POST variable, unset old one.
228
- $_POST[$uppercased_name] = $value;
229
  unset( $_POST[$name] );
230
  }
231
 
@@ -238,9 +250,15 @@ class MC4WP_Lite_Form {
238
 
239
  foreach ( $old_groupings as $grouping ) {
240
 
241
- if ( !isset( $grouping['id'] ) && !isset( $grouping['name'] ) ) { continue; }
242
 
243
- $key = ( isset( $grouping['id'] ) ) ? $grouping['id'] : $grouping['name'];
 
 
 
 
 
 
244
 
245
  $new_groupings[$key] = $grouping['groups'];
246
 
@@ -267,23 +285,26 @@ class MC4WP_Lite_Form {
267
  // guess FNAME and LNAME
268
  if ( isset( $merge_vars['NAME'] ) && !isset( $merge_vars['FNAME'] ) && !isset( $merge_vars['LNAME'] ) ) {
269
 
270
- $strpos = strpos( $name, ' ' );
271
 
272
  if ( $strpos ) {
273
- $merge_vars['FNAME'] = substr( $name, 0, $strpos );
274
- $merge_vars['LNAME'] = substr( $name, $strpos );
275
  } else {
276
- $merge_vars['FNAME'] = $name;
277
  }
278
  }
279
 
280
- $merge_vars = apply_filters('mc4wp_merge_vars', $merge_vars);
 
 
281
  $email_type = apply_filters('mc4wp_email_type', 'html');
282
  $lists = apply_filters('mc4wp_lists', $lists, $merge_vars);
283
 
 
284
 
285
- foreach ( $lists as $list ) {
286
- $result = $api->subscribe( $list, $email, $merge_vars, $email_type, $opts['double_optin'] );
287
 
288
  if($result === true) {
289
  $from_url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
@@ -291,6 +312,8 @@ class MC4WP_Lite_Form {
291
  }
292
  }
293
 
 
 
294
  if ( $result === true ) {
295
  $this->success = true;
296
  } else {
26
  add_action( 'wp_footer', array( $this, 'print_scroll_js' ), 99);
27
  }
28
 
29
+ add_action( 'wp_enqueue_scripts', array($this, 'register_scripts' ) );
30
+ }
31
 
32
+ public function register_scripts()
33
+ {
34
+ wp_register_script( 'mc4wp-placeholders', plugins_url('mailchimp-for-wp/assets/js/placeholders.min.js'), array(), MC4WP_LITE_VERSION, true );
35
  }
36
 
37
  public function get_options() {
65
  if ( $this->success ) $css_classes .= 'mc4wp-form-success ';
66
 
67
  $content = "\n<!-- Form by MailChimp for WordPress plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/mailchimp-for-wordpress/ -->\n";
68
+ $content .= '<form method="post" action="'. mc4wp_get_current_url() .'#mc4wp-form-'. $this->form_instance_number .'" id="mc4wp-form-'.$this->form_instance_number.'" class="mc4wp-form form'.$css_classes.'">';
69
 
70
  // maybe hide the form
71
  if ( !( $this->success && $opts['hide_after_success'] ) ) {
121
  // increase form instance number in case there is more than one form on a page
122
  $this->form_instance_number++;
123
 
124
+ // make sure scripts are enqueued later
125
+ global $is_IE;
126
+ if(isset($is_IE) && $is_IE) {
127
+ wp_enqueue_script('mc4wp-placeholders');
128
+ }
129
+
130
  return $content;
131
  }
132
 
231
  // upercase $_POST variables
232
  foreach ( $_POST as $name => $value ) {
233
 
234
+ // skip mc4wp internal vars
235
+ if (in_array( $name, array( 'mc4wp_form_instance', 'mc4wp_form_nonce', 'mc4wp_required_but_not_really', 'mc4wp_form_submit' ) ) ) {
236
+ continue;
237
+ }
238
 
239
+ $ucname = strtoupper( $name );
240
+ $_POST[$ucname] = $value;
241
  unset( $_POST[$name] );
242
  }
243
 
250
 
251
  foreach ( $old_groupings as $grouping ) {
252
 
253
+ if(!isset($grouping['groups'])) { continue; }
254
 
255
+ if ( isset( $grouping['id'] ) ) {
256
+ $key = $grouping['id'];
257
+ } else if(isset( $grouping['name'] ) ) {
258
+ $key = $grouping['name'];
259
+ } else {
260
+ continue;
261
+ }
262
 
263
  $new_groupings[$key] = $grouping['groups'];
264
 
285
  // guess FNAME and LNAME
286
  if ( isset( $merge_vars['NAME'] ) && !isset( $merge_vars['FNAME'] ) && !isset( $merge_vars['LNAME'] ) ) {
287
 
288
+ $strpos = strpos( $merge_vars['NAME'], ' ' );
289
 
290
  if ( $strpos ) {
291
+ $merge_vars['FNAME'] = trim( substr( $merge_vars['NAME'], 0, $strpos ) );
292
+ $merge_vars['LNAME'] = trim( substr( $merge_vars['NAME'], $strpos ) );
293
  } else {
294
+ $merge_vars['FNAME'] = $merge_vars['NAME'];
295
  }
296
  }
297
 
298
+ do_action('mc4wp_before_subscribe', $email, $merge_vars, 0);
299
+
300
+ $result = false;
301
  $email_type = apply_filters('mc4wp_email_type', 'html');
302
  $lists = apply_filters('mc4wp_lists', $lists, $merge_vars);
303
 
304
+ foreach ( $lists as $list_id ) {
305
 
306
+ $list_merge_vars = apply_filters('mc4wp_merge_vars', $merge_vars, 0, $list_id);
307
+ $result = $api->subscribe( $list, $email, $list_merge_vars, $email_type, $opts['double_optin'] );
308
 
309
  if($result === true) {
310
  $from_url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';
312
  }
313
  }
314
 
315
+ do_action('mc4wp_after_subscribe', $email, $merge_vars, 0, $result);
316
+
317
  if ( $result === true ) {
318
  $this->success = true;
319
  } else {
includes/template-functions.php CHANGED
@@ -106,10 +106,11 @@ function mc4wp_get_subscriber_count( $list_ids ) {
106
  */
107
  function mc4wp_get_current_url() {
108
  global $wp;
109
- return add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
110
  }
111
 
112
 
 
113
  /**
114
  * Echoes a sign-up form.
115
  *
106
  */
107
  function mc4wp_get_current_url() {
108
  global $wp;
109
+ return trailingslashit( home_url( add_query_arg( array(), $wp->request ) ) );
110
  }
111
 
112
 
113
+
114
  /**
115
  * Echoes a sign-up form.
116
  *
includes/views/api-settings.php CHANGED
@@ -16,7 +16,7 @@
16
  <th scope="row"><label for="mailchimp_api_key">MailChimp API Key</label></th>
17
  <td>
18
  <input type="text" class="widefat" placeholder="Your MailChimp API key" id="mailchimp_api_key" name="mc4wp_lite[api_key]" value="<?php echo $opts['api_key']; ?>" />
19
- <small><a target="_blank" href="http://admin.mailchimp.com/account/api">Get your MailChimp API key here.</a></small>
20
  </td>
21
 
22
  </tr>
@@ -30,11 +30,12 @@
30
  <h3 class="mc4wp-title">MailChimp Cache</h3>
31
  <p>The table below shows your cached MailChimp lists configuration. If you made any changes in your MailChimp configuration that is not yet represented in the table below, please renew the cache manually by hitting the "renew cached data" button.</p>
32
 
33
- <h4>Lists</h4>
34
  <table class="wp-list-table widefat">
35
  <thead>
36
  <tr>
37
- <th scope="col">ID</th><th scope="col">Name</th><th>Merge fields & Interest groupings</th>
 
 
38
  </tr>
39
  </thead>
40
  <tbody>
@@ -42,9 +43,16 @@
42
  if($lists && is_array($lists)) { ?>
43
  <?php foreach($lists as $list) { ?>
44
  <tr valign="top">
45
- <td><?php echo $list->id; ?></td>
46
  <td><?php echo $list->name; ?></td>
47
- <td><em>Only available in the premium version. <a href="http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=cache-table-link">Upgrade now.</a></em></td>
 
 
 
 
 
 
 
 
48
  </tr>
49
  <?php } // endforeach ?>
50
  <?php } else { ?>
16
  <th scope="row"><label for="mailchimp_api_key">MailChimp API Key</label></th>
17
  <td>
18
  <input type="text" class="widefat" placeholder="Your MailChimp API key" id="mailchimp_api_key" name="mc4wp_lite[api_key]" value="<?php echo $opts['api_key']; ?>" />
19
+ <p class="help"><a target="_blank" href="http://admin.mailchimp.com/account/api">Click here to get your MailChimp API Key.</a></p>
20
  </td>
21
 
22
  </tr>
30
  <h3 class="mc4wp-title">MailChimp Cache</h3>
31
  <p>The table below shows your cached MailChimp lists configuration. If you made any changes in your MailChimp configuration that is not yet represented in the table below, please renew the cache manually by hitting the "renew cached data" button.</p>
32
 
 
33
  <table class="wp-list-table widefat">
34
  <thead>
35
  <tr>
36
+ <th scope="col">List Name</th>
37
+ <th scope="col">Merge fields</th>
38
+ <th scope="col">Interest groupings</th>
39
  </tr>
40
  </thead>
41
  <tbody>
43
  if($lists && is_array($lists)) { ?>
44
  <?php foreach($lists as $list) { ?>
45
  <tr valign="top">
 
46
  <td><?php echo $list->name; ?></td>
47
+ <td><?php
48
+ $first = true;
49
+ foreach($list->merge_vars as $merge_var) {
50
+ echo ($first) ? $merge_var->name : ', '. $merge_var->name;
51
+ $first = false;
52
+ }
53
+ ?>
54
+ </td>
55
+ <td><a href="http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=cache-table-link">Pro Only, Upgrade Now</a></td>
56
  </tr>
57
  <?php } // endforeach ?>
58
  <?php } else { ?>
includes/views/checkbox-settings.php CHANGED
@@ -7,7 +7,7 @@
7
  <?php settings_errors(); ?>
8
  <p>To use the MailChimp for WP sign-up checkboxes, select at least one list and one form to add the checkbox to.</p>
9
 
10
- <h3 class="mc4wp-title">List settings</h3>
11
  <form action="options.php" method="post">
12
  <?php settings_fields( 'mc4wp_lite_checkbox_settings' ); ?>
13
 
@@ -24,35 +24,35 @@
24
  { ?>
25
  <td>
26
  <?php foreach($lists as $list) {
27
- ?><input type="checkbox" id="mc4wp_checkbox_list_<?php echo $list->id; ?>_cb" name="mc4wp_lite_checkbox[lists][<?php echo $list->id; ?>]" value="<?php echo $list->id; ?>" <?php if(array_key_exists($list->id, $opts['lists'])) echo 'checked="checked"'; ?>> <label for="mc4wp_checkbox_list_<?php echo $list->id; ?>_cb"><?php echo $list->name; ?></label><br /><?php
28
  } ?>
29
  </td>
30
- <td class="desc" <?php if(empty($opts['lists'])) { ?>style="color:red;"<?php } ?>>Select at least one MailChimp list to which people who tick a checkbox should be subscribed.</td>
31
  <?php
32
  }
33
  ?>
34
  </tr>
 
 
 
 
 
35
  </table>
36
 
37
  <h3 class="mc4wp-title">Checkbox settings</h3>
38
  <table class="form-table">
39
- <tr valign="top">
40
- <th scope="row">Double opt-in?</th>
41
- <td class="nowrap"><input type="radio" id="mc4wp_checkbox_double_optin_1" name="mc4wp_lite_checkbox[double_optin]" value="1" <?php if($opts['double_optin'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_checkbox_double_optin_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_checkbox_double_optin_0" name="mc4wp_lite_checkbox[double_optin]" value="0" <?php if($opts['double_optin'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_checkbox_double_optin_0">No</label></td>
42
- <td class="desc">Tick "yes" if you want subscribers to have to confirm their email address (recommended)</td>
43
- </tr>
44
  <tr valign="top">
45
  <th scope="row">Add the checkbox to these forms</th>
46
  <td colspan="2">
47
  <?php foreach($this->get_checkbox_compatible_plugins() as $code => $name) {
48
 
49
  if($code[0] != '_') {
50
- ?><label><input name="mc4wp_lite_checkbox[show_at_<?php echo $code; ?>]" value="1" type="checkbox" <?php checked($opts['show_at_'.$code], 1); ?>> <?php echo $name; ?></label> &nbsp; <?php
51
  } else {
52
- ?><label class="pro-feature"><input type="checkbox" disabled> <?php echo $name; ?></label> &nbsp; <?php
53
  }
54
  } ?>
55
- <label><input name="mc4wp_lite_checkbox[show_at_other_forms]" value="1" type="checkbox" <?php if($opts['show_at_other_forms']) echo 'checked '; ?>> Other forms (manual)</label> &nbsp;
56
  </td>
57
  </tr>
58
  <tr valign="top">
@@ -64,13 +64,13 @@
64
  </tr>
65
  <tr valign="top">
66
  <th scope="row">Pre-check the checkbox?</th>
67
- <td class="nowrap"><input type="radio" id="mc4wp_checkbox_precheck_1" name="mc4wp_lite_checkbox[precheck]" value="1" <?php if($opts['precheck'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_checkbox_precheck_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_checkbox_precheck_0" name="mc4wp_lite_checkbox[precheck]" value="0" <?php if($opts['precheck'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_checkbox_precheck_0">No</label></td>
68
  <td class="desc"></td>
69
  </tr>
70
  <tr valign="top">
71
  <th scope="row">Load some default CSS?</th>
72
- <td class="nowrap"><input type="radio" id="mc4wp_checbox_css_1" name="mc4wp_lite_checkbox[css]" value="1" <?php if($opts['css'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_checbox_css_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_checbox_css_0" name="mc4wp_lite_checkbox[css]" value="0" <?php if($opts['css'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_checbox_css_0">No</label></td>
73
- <td class="desc">Tick "yes" if the checkbox appears in a weird place.</td>
74
  </tr>
75
 
76
 
7
  <?php settings_errors(); ?>
8
  <p>To use the MailChimp for WP sign-up checkboxes, select at least one list and one form to add the checkbox to.</p>
9
 
10
+ <h3 class="mc4wp-title">MailChimp settings</h3>
11
  <form action="options.php" method="post">
12
  <?php settings_fields( 'mc4wp_lite_checkbox_settings' ); ?>
13
 
24
  { ?>
25
  <td>
26
  <?php foreach($lists as $list) {
27
+ ?><label><input type="checkbox" name="mc4wp_lite_checkbox[lists][<?php echo $list->id; ?>]" value="<?php echo esc_attr($list->id); ?>" <?php if(array_key_exists($list->id, $opts['lists'])) echo 'checked="checked"'; ?>> <?php echo $list->name; ?></label><br /><?php
28
  } ?>
29
  </td>
30
+ <td class="desc">Select the list(s) to which people who tick the checkbox should be subscribed.</td>
31
  <?php
32
  }
33
  ?>
34
  </tr>
35
+ <tr valign="top">
36
+ <th scope="row">Double opt-in?</th>
37
+ <td class="nowrap"><label><input type="radio" name="mc4wp_lite_checkbox[double_optin]" value="1" <?php checked($opts['double_optin'], 1); ?> /> Yes</label> &nbsp; <label><input type="radio" id="mc4wp_checkbox_double_optin_0" name="mc4wp_lite_checkbox[double_optin]" value="0" <?php checked($opts['double_optin'], 0); ?> /> No</label></td>
38
+ <td class="desc">Select "yes" if you want subscribers to have to confirm their email address (recommended)</td>
39
+ </tr>
40
  </table>
41
 
42
  <h3 class="mc4wp-title">Checkbox settings</h3>
43
  <table class="form-table">
44
+
 
 
 
 
45
  <tr valign="top">
46
  <th scope="row">Add the checkbox to these forms</th>
47
  <td colspan="2">
48
  <?php foreach($this->get_checkbox_compatible_plugins() as $code => $name) {
49
 
50
  if($code[0] != '_') {
51
+ ?><label><input name="mc4wp_lite_checkbox[show_at_<?php echo $code; ?>]" value="1" type="checkbox" <?php checked($opts['show_at_'.$code], 1); ?>> <?php echo $name; ?></label><br /><?php
52
  } else {
53
+ ?><label class="pro-feature"><input type="checkbox" disabled> <?php echo $name; ?></label><br /><?php
54
  }
55
  } ?>
 
56
  </td>
57
  </tr>
58
  <tr valign="top">
64
  </tr>
65
  <tr valign="top">
66
  <th scope="row">Pre-check the checkbox?</th>
67
+ <td class="nowrap"><label><input type="radio" name="mc4wp_lite_checkbox[precheck]" value="1" <?php checked($opts['precheck'], 1); ?> /> Yes</label> &nbsp; <label><input type="radio" name="mc4wp_lite_checkbox[precheck]" value="0" <?php checked($opts['precheck'], 0); ?> /> No</label></td>
68
  <td class="desc"></td>
69
  </tr>
70
  <tr valign="top">
71
  <th scope="row">Load some default CSS?</th>
72
+ <td class="nowrap"><label><input type="radio" name="mc4wp_lite_checkbox[css]" value="1" <?php checked($opts['css'], 1); ?> /> Yes</label> &nbsp; <label><input type="radio" name="mc4wp_lite_checkbox[css]" value="0" <?php checked($opts['css'], 0); ?> /> No</label></td>
73
+ <td class="desc">Select "yes" if the checkbox appears in a weird place.</td>
74
  </tr>
75
 
76
 
includes/views/form-settings.php CHANGED
@@ -44,11 +44,11 @@
44
  <td>
45
  <ul id="mc4wp-lists">
46
  <?php foreach($lists as $list) { ?>
47
- <li><input type="checkbox" id="mc4wp_form_list_<?php echo $list->id; ?>_cb" name="mc4wp_lite_form[lists][<?php echo $list->id; ?>]" value="<?php echo $list->id; ?>" data-groupings="<?php echo esc_attr(json_encode($list->interest_groupings)); ?>" data-fields="<?php echo esc_attr(json_encode($list->merge_vars)); ?>" <?php if(array_key_exists($list->id, $opts['lists'])) echo 'checked="checked"'; ?>> <label for="mc4wp_form_list_<?php echo $list->id; ?>_cb"><?php echo $list->name; ?></label></li>
48
  <?php } ?>
49
  </ul>
50
  </td>
51
- <td class="desc" <?php if(empty($opts['lists'])) { ?>style="color:red;"<?php } ?>>Select at least one MailChimp list for this form.</td>
52
  <?php } ?>
53
 
54
  </tr>
@@ -63,10 +63,8 @@
63
  } else {
64
  ?><textarea class="widefat" cols="160" rows="20" id="mc4wpformmarkup" name="mc4wp_lite_form[markup]"><?php echo esc_textarea($opts['markup']); ?></textarea><?php
65
  } ?>
66
- <p><small>Use <input type="text" onfocus="this.select();" readonly="readonly" value="[mc4wp_form]" size="12" class="mc4wp-shortcode-example"> to render this form inside a widget, post or page. <u>Do not just copy the form mark-up as that will not work.</u> </small></p>
67
- <p class="submit">
68
- <input type="submit" class="button-primary" value="<?php _e('Save All Changes') ?>" id="mc4wp-submit-form-settings" />
69
- </p>
70
  </div>
71
 
72
  <div class="mc4wp-col mc4wp-col-1-3 mc4wp-last">
@@ -76,46 +74,46 @@
76
  </td>
77
  </tr>
78
 
79
- </table>
80
-
81
 
 
82
 
83
  <h3 class="mc4wp-title">MailChimp Settings</h3>
84
  <table class="form-table">
85
  <tr valign="top">
86
  <th scope="row">Double opt-in?</th>
87
  <td class="nowrap"><input type="radio" id="mc4wp_form_double_optin_1" name="mc4wp_lite_form[double_optin]" value="1" <?php if($opts['double_optin'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_double_optin_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_form_double_optin_0" name="mc4wp_lite_form[double_optin]" value="0" <?php if($opts['double_optin'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_double_optin_0">No</label></td>
88
- <td class="desc">Tick "yes" if you want subscribers to confirm their email address (recommended)</td>
89
  </tr>
90
  <tr class="pro-feature" valign="top">
91
  <th scope="row">Send Welcome Email?</th>
92
  <td class="nowrap">
93
  <input type="radio" readonly />
94
- <label>Yes</label> &nbsp;
95
  <input type="radio" checked readonly />
96
- <label>No</label> &nbsp;
97
  </td>
98
- <td class="desc">Tick "yes" if you want to send your lists Welcome Email if a subscribe succeeds. Only when double opt-in is disabled.</td>
99
  </tr>
100
  <tr class="pro-feature" valign="top">
101
  <th scope="row">Update existing subscribers?</th>
102
  <td class="nowrap">
103
  <input type="radio" readonly />
104
- <label>Yes</label> &nbsp;
105
  <input type="radio" checked readonly />
106
- <label>No</label> &nbsp;
107
  </td>
108
- <td class="desc">Tick "yes" if you want to update existing subscribers instead of showing the "already subscribed" message.</td>
109
  </tr>
110
  <tr class="pro-feature" valign="top">
111
  <th scope="row">Replace interest groups?</th>
112
  <td class="nowrap">
113
  <input type="radio" checked readonly />
114
- <label>Yes</label> &nbsp;
115
  <input type="radio" readonly />
116
- <label>No</label> &nbsp;
117
  </td>
118
- <td class="desc">Tick "yes" if you want to replace the interest groups with the groups provided instead of adding the provided groups to the member's interest groups. Only when updating a subscriber.</td>
119
  </tr>
120
  </table>
121
 
@@ -125,21 +123,21 @@
125
  <tr valign="top" class="pro-feature">
126
  <th scope="row">Enable AJAX?</th>
127
  <td class="nowrap">
128
- <input type="radio" readonly /> <label>Yes</label> &nbsp;
129
- <input type="radio" checked readonly /> <label>No</label>
130
  </td>
131
- <td class="desc">Tick "yes" if you want to use AJAX to submit forms, meaning the page doesn't need to reload so everything happens inline. <a href="http://dannyvankooten.com/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=lite-plugin&utm_medium=link&utm_campaign=settings-demo-link">(demo)</a></td>
132
  </tr>
133
  <tr valign="top">
134
  <th scope="row"><label for="mc4wp_form_hide_after_success">Hide form after a successful sign-up?</label></th>
135
  <td class="nowrap"><input type="radio" id="mc4wp_form_hide_after_success_1" name="mc4wp_lite_form[hide_after_success]" value="1" <?php if($opts['hide_after_success'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_hide_after_success_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_form_hide_after_success_0" name="mc4wp_lite_form[hide_after_success]" value="0" <?php if($opts['hide_after_success'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_hide_after_success_0">No</label></td>
136
- <td class="desc">Tick "yes" to hide the form fields after a successful sign-up.</td>
137
  </tr>
138
  <tr valign="top">
139
  <th scope="row"><label for="mc4wp_form_redirect">Redirect to this URL after a successful sign-up</label></th>
140
  <td colspan="2">
141
  <input type="text" class="widefat" name="mc4wp_lite_form[redirect]" id="mc4wp_form_redirect" placeholder="Example: <?php echo esc_attr(site_url('/thank-you/')); ?>"value="<?php echo $opts['redirect']; ?>" />
142
- <small>Leave empty or enter <strong>0</strong> (zero) for no redirection. Use complete URL's, including http://</small>
143
  </td>
144
  </tr>
145
  <tr valign="top">
@@ -160,11 +158,11 @@
160
  </tr>
161
  <tr>
162
  <th></th>
163
- <td colspan="2"><p><small>HTML tags like &lt;a&gt; and &lt;strong&gt; etc. are allowed in the message fields.</small></p></td>
164
  </tr>
165
  </table>
166
 
167
- <?php submit_button("Save All Changes"); ?>
168
  </form>
169
 
170
  <?php include 'parts/admin-footer.php'; ?>
44
  <td>
45
  <ul id="mc4wp-lists">
46
  <?php foreach($lists as $list) { ?>
47
+ <li><label><input type="checkbox" name="mc4wp_lite_form[lists][<?php echo esc_attr($list->id); ?>]" value="<?php echo esc_attr($list->id); ?>" data-groupings="<?php echo esc_attr(json_encode($list->interest_groupings)); ?>" data-fields="<?php echo esc_attr(json_encode($list->merge_vars)); ?>" <?php if(array_key_exists($list->id, $opts['lists'])) echo 'checked="checked"'; ?>> <?php echo $list->name; ?></label></li>
48
  <?php } ?>
49
  </ul>
50
  </td>
51
+ <td class="desc">Select the list(s) to which people who submit this form should be subscribed.</td>
52
  <?php } ?>
53
 
54
  </tr>
63
  } else {
64
  ?><textarea class="widefat" cols="160" rows="20" id="mc4wpformmarkup" name="mc4wp_lite_form[markup]"><?php echo esc_textarea($opts['markup']); ?></textarea><?php
65
  } ?>
66
+ <p class="help">Use the shortcode <input type="text" onfocus="this.select();" readonly="readonly" value="[mc4wp_form]" size="12" class="mc4wp-shortcode-example"> inside a post, page or text widget to display your sign-up form. <strong>Do not copy and paste the above form mark-up, that will not work.</strong></p>
67
+
 
 
68
  </div>
69
 
70
  <div class="mc4wp-col mc4wp-col-1-3 mc4wp-last">
74
  </td>
75
  </tr>
76
 
77
+ </table>
 
78
 
79
+ <?php submit_button(); ?>
80
 
81
  <h3 class="mc4wp-title">MailChimp Settings</h3>
82
  <table class="form-table">
83
  <tr valign="top">
84
  <th scope="row">Double opt-in?</th>
85
  <td class="nowrap"><input type="radio" id="mc4wp_form_double_optin_1" name="mc4wp_lite_form[double_optin]" value="1" <?php if($opts['double_optin'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_double_optin_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_form_double_optin_0" name="mc4wp_lite_form[double_optin]" value="0" <?php if($opts['double_optin'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_double_optin_0">No</label></td>
86
+ <td class="desc">Select "yes" if you want subscribers to confirm their email address (recommended)</td>
87
  </tr>
88
  <tr class="pro-feature" valign="top">
89
  <th scope="row">Send Welcome Email?</th>
90
  <td class="nowrap">
91
  <input type="radio" readonly />
92
+ <label><?php _e("Yes"); ?></label> &nbsp;
93
  <input type="radio" checked readonly />
94
+ <label><?php _e("No"); ?></label> &nbsp;
95
  </td>
96
+ <td class="desc">Select "yes" if you want to send your lists Welcome Email if a subscribe succeeds. Only when double opt-in is disabled.</td>
97
  </tr>
98
  <tr class="pro-feature" valign="top">
99
  <th scope="row">Update existing subscribers?</th>
100
  <td class="nowrap">
101
  <input type="radio" readonly />
102
+ <label><?php _e("Yes"); ?></label> &nbsp;
103
  <input type="radio" checked readonly />
104
+ <label><?php _e("No"); ?></label> &nbsp;
105
  </td>
106
+ <td class="desc">Select "yes" if you want to update existing subscribers instead of showing the "already subscribed" message.</td>
107
  </tr>
108
  <tr class="pro-feature" valign="top">
109
  <th scope="row">Replace interest groups?</th>
110
  <td class="nowrap">
111
  <input type="radio" checked readonly />
112
+ <label><?php _e("Yes"); ?></label> &nbsp;
113
  <input type="radio" readonly />
114
+ <label><?php _e("No"); ?></label> &nbsp;
115
  </td>
116
+ <td class="desc">Select "yes" if you want to replace the interest groups with the groups provided instead of adding the provided groups to the member's interest groups. Only when updating a subscriber.</td>
117
  </tr>
118
  </table>
119
 
123
  <tr valign="top" class="pro-feature">
124
  <th scope="row">Enable AJAX?</th>
125
  <td class="nowrap">
126
+ <input type="radio" readonly /> <label><?php _e("Yes"); ?></label> &nbsp;
127
+ <input type="radio" checked readonly /> <label><?php _e("No"); ?></label>
128
  </td>
129
+ <td class="desc">Select "yes" if you want to use AJAX to submit forms, meaning the page doesn't need to reload so everything happens inline. <a href="http://dannyvankooten.com/mailchimp-for-wordpress/demo/?utm_source=lite-plugin&utm_medium=link&utm_campaign=settings-demo-link">(demo)</a></td>
130
  </tr>
131
  <tr valign="top">
132
  <th scope="row"><label for="mc4wp_form_hide_after_success">Hide form after a successful sign-up?</label></th>
133
  <td class="nowrap"><input type="radio" id="mc4wp_form_hide_after_success_1" name="mc4wp_lite_form[hide_after_success]" value="1" <?php if($opts['hide_after_success'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_hide_after_success_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_form_hide_after_success_0" name="mc4wp_lite_form[hide_after_success]" value="0" <?php if($opts['hide_after_success'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_hide_after_success_0">No</label></td>
134
+ <td class="desc">Select "yes" to hide the form fields after a successful sign-up.</td>
135
  </tr>
136
  <tr valign="top">
137
  <th scope="row"><label for="mc4wp_form_redirect">Redirect to this URL after a successful sign-up</label></th>
138
  <td colspan="2">
139
  <input type="text" class="widefat" name="mc4wp_lite_form[redirect]" id="mc4wp_form_redirect" placeholder="Example: <?php echo esc_attr(site_url('/thank-you/')); ?>"value="<?php echo $opts['redirect']; ?>" />
140
+ <p class="help">Leave empty or enter <strong>0</strong> (zero) for no redirection. Use complete (absolute) URL's, including <code>http://</code></p>
141
  </td>
142
  </tr>
143
  <tr valign="top">
158
  </tr>
159
  <tr>
160
  <th></th>
161
+ <td colspan="2"><p class="help">HTML tags like <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code> are allowed in the message fields.</p></td>
162
  </tr>
163
  </table>
164
 
165
+ <?php submit_button(); ?>
166
  </form>
167
 
168
  <?php include 'parts/admin-footer.php'; ?>
includes/views/parts/admin-upgrade-to-pro.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="mc4wp-box" id="mc4wp-upgrade-box">
2
  <h3>MailChimp for WordPress Pro</h3>
3
 
4
- <p><em>This plugin comes with a premium version, you will love it.</em></p>
5
 
6
  <p>Pro features include better and multiple forms, advanced and easy form styling, more default themes, detailed statistics and priority support.</p>
7
 
1
  <div class="mc4wp-box" id="mc4wp-upgrade-box">
2
  <h3>MailChimp for WordPress Pro</h3>
3
 
4
+ <p><em>This plugin has an even better premium version, I am sure you will love it.</em></p>
5
 
6
  <p>Pro features include better and multiple forms, advanced and easy form styling, more default themes, detailed statistics and priority support.</p>
7
 
mailchimp-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailChimp for WordPress Lite
4
  Plugin URI: http://dannyvankooten.com/mailchimp-for-wordpress/
5
  Description: Lite version of MailChimp for WordPress. Add various sign-up methods to your website. Show sign-up forms in your posts, pages or widgets. Add sign-up checkboxes to various forms, like your comment or contact forms. Premium features include multiple and better forms, easier styling, detailed statistics and much more: <a href="http://dannyvankooten.com/mailchimp-for-wordpress/">Upgrade now</a>
6
- Version: 1.4.3
7
  Author: Danny van Kooten
8
  Author URI: http://dannyvanKooten.com
9
  License: GPL v3
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
 
28
  defined( 'ABSPATH' ) OR exit;
29
 
30
- define("MC4WP_LITE_VERSION", "1.4.3");
31
  define("MC4WP_LITE_PLUGIN_DIR", plugin_dir_path(__FILE__));
32
 
33
  if(!function_exists('is_plugin_active')) {
3
  Plugin Name: MailChimp for WordPress Lite
4
  Plugin URI: http://dannyvankooten.com/mailchimp-for-wordpress/
5
  Description: Lite version of MailChimp for WordPress. Add various sign-up methods to your website. Show sign-up forms in your posts, pages or widgets. Add sign-up checkboxes to various forms, like your comment or contact forms. Premium features include multiple and better forms, easier styling, detailed statistics and much more: <a href="http://dannyvankooten.com/mailchimp-for-wordpress/">Upgrade now</a>
6
+ Version: 1.4.4
7
  Author: Danny van Kooten
8
  Author URI: http://dannyvanKooten.com
9
  License: GPL v3
27
 
28
  defined( 'ABSPATH' ) OR exit;
29
 
30
+ define("MC4WP_LITE_VERSION", "1.4.4");
31
  define("MC4WP_LITE_PLUGIN_DIR", plugin_dir_path(__FILE__));
32
 
33
  if(!function_exists('is_plugin_active')) {
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Plugin Name ===
2
  Contributors: DvanKooten
3
  Donate link: http://dannyvankooten.com/donate/
4
- Tags: mailchimp, widget, form, checkbox, sign-up form, mandrill, buddypress, multisite, bbpress, contact form 7, newsletter, mailinglist
5
  Requires at least: 3.1
6
  Tested up to: 3.7.1
7
- Stable tag: 1.4.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -27,9 +27,9 @@ Add "sign up to our newsletter" checkboxes to your comment form, contact forms o
27
 
28
  * Easily create a highly customizable sign-up form
29
  * Show a sign-up form in your posts or pages using a simple shortcode `[mc4wp_form]`
30
- * Show a sign-up form in your sidebar or footer using the dedicated form widget.
31
  * Add a "sign-up to our newsletter" checkbox to your comment form or *any* other form you like.
32
- * Built-in integration with BuddyPress, WordPress MultiSite, bbPress and Contact Form 7 forms.
33
  * Configuring this plugin is easy, all you need is your MailChimp API key.
34
 
35
  **Premium features**
@@ -192,6 +192,16 @@ Your theme folder can be found by browsing to `/wp-content/themes/your-theme-nam
192
 
193
  == Changelog ==
194
 
 
 
 
 
 
 
 
 
 
 
195
  = 1.4.3 - November 19, 2013 =
196
  * Improved: added filter hook `mc4wp_lists` to customize lists before sending request to MailChimp.
197
  * Improved: added empty `index.php` files to directories to prevent directory listings
1
+ === MailChimp for WordPress ===
2
  Contributors: DvanKooten
3
  Donate link: http://dannyvankooten.com/donate/
4
+ Tags: mailchimp, widget, form, checkbox, sign-up form, mandrill, buddypress, multisite, bbpress, contact form 7, newsletter, mailinglist, cf7
5
  Requires at least: 3.1
6
  Tested up to: 3.7.1
7
+ Stable tag: 1.4.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
27
 
28
  * Easily create a highly customizable sign-up form
29
  * Show a sign-up form in your posts or pages using a simple shortcode `[mc4wp_form]`
30
+ * Show a sign-up form in your sidebar or footer using a simple to use form widget.
31
  * Add a "sign-up to our newsletter" checkbox to your comment form or *any* other form you like.
32
+ * Built-in integration with Contact Form 7, BuddyPress, WordPress MultiSite and bbPress.
33
  * Configuring this plugin is easy, all you need is your MailChimp API key.
34
 
35
  **Premium features**
192
 
193
  == Changelog ==
194
 
195
+ = 1.4.4 - November 27, 2013 =
196
+ * Fixed: FNAME and LNAME not being guessed from NAME for form sign-ups.
197
+ * Added: very small JavaScript fallback for placeholders in older browsers (<= IE9)
198
+ * Improved: removed limit from the lists retreived from MailChimp, for users with more than 25 lists.
199
+ * Improved: added current page URL to form action attribute for people using `<base>` url's.
200
+ * Improved: removed the sidebar from the admin pages on small screens
201
+ * Improved: various usability improvements
202
+ * Improved: minor improvements to default CSS styles
203
+ * Improved: added various action and filter hooks to the form sign-up process
204
+
205
  = 1.4.3 - November 19, 2013 =
206
  * Improved: added filter hook `mc4wp_lists` to customize lists before sending request to MailChimp.
207
  * Improved: added empty `index.php` files to directories to prevent directory listings