MailChimp for WordPress - Version 1.4

Version Description

New: default form themes, more unlocked fields in the "add field" tool and smarter auto-detection of name fields when integrating with Contact Form 7.

Download this release

Release Info

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

Code changes from version 1.3.1 to 1.4

assets/css/admin.css CHANGED
@@ -6,8 +6,9 @@
6
  #mc4wp-upgrade-box h3{ margin:0; }
7
 
8
  #mc4wp-fw h4{ margin-top:0; }
 
9
  #mc4wp-fw-fields { display:none; }
10
- #mc4wp-fw-preview { font-family: "Courier New", Courier, monospace; font-size:11px; }
11
  #mc4wp-lists{ margin:0; }
12
  #mc4wp-lists input{ margin-right:5px; }
13
 
@@ -34,6 +35,8 @@
34
  -webkit-border-radius: 3px; border-radius: 3px;
35
  -moz-border-radius: 3px; }
36
 
 
 
37
  table.mc4wp-help, table.mc4wp-help th, table.mc4wp-help td { border: 1px solid #ddd; border-collapse: collapse; font-size: 12px; }
38
  table.mc4wp-help th, table.mc4wp-help td { vertical-align: text-top; text-align: left; padding: 5px 10px; }
39
  table.mc4wp-help tr:hover { background-color: #ddd; }
6
  #mc4wp-upgrade-box h3{ margin:0; }
7
 
8
  #mc4wp-fw h4{ margin-top:0; }
9
+ #mc4wp-fw p{ margin-bottom: 1em; }
10
  #mc4wp-fw-fields { display:none; }
11
+ #mc4wp-fw-preview { font-family: "Courier New", Courier, monospace; min-height:200px; font-size:11px; background:white; z-index:99; }
12
  #mc4wp-lists{ margin:0; }
13
  #mc4wp-lists input{ margin-right:5px; }
14
 
35
  -webkit-border-radius: 3px; border-radius: 3px;
36
  -moz-border-radius: 3px; }
37
 
38
+ .mc4wp-title{ font-size: 1.25em; margin-bottom: 1em; }
39
+
40
  table.mc4wp-help, table.mc4wp-help th, table.mc4wp-help td { border: 1px solid #ddd; border-collapse: collapse; font-size: 12px; }
41
  table.mc4wp-help th, table.mc4wp-help td { vertical-align: text-top; text-align: left; padding: 5px 10px; }
42
  table.mc4wp-help tr:hover { background-color: #ddd; }
assets/css/css.php CHANGED
@@ -6,11 +6,26 @@ header("Cache-Control: public, max-age=" . $expires);
6
  header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
7
 
8
  if(isset($_GET['checkbox'])) {
9
- readfile('checkbox.css');
10
  }
11
 
 
12
  if(isset($_GET['form'])) {
13
- readfile('form.css');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
 
16
  exit;
6
  header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
7
 
8
  if(isset($_GET['checkbox'])) {
9
+ readfile(dirname(__FILE__) . '/checkbox.css');
10
  }
11
 
12
+ // load form reset
13
  if(isset($_GET['form'])) {
14
+ readfile(dirname(__FILE__) . '/form-reset.css');
15
+ }
16
+
17
+ // should we load a form theme?
18
+ if(isset($_GET['form-theme'])) {
19
+ $form_theme = $_GET['form-theme'];
20
+
21
+ // load theme base file
22
+ readfile(dirname(__FILE__) . '/form-theme-base.css');
23
+
24
+ // only load themes we actually have
25
+ if(in_array($form_theme, array('blue', 'green', 'dark', 'light', 'red'))) {
26
+ readfile(dirname(__FILE__) . '/form-theme-'. $form_theme .'.css');
27
+ }
28
+
29
  }
30
 
31
  exit;
assets/css/{form.css → form-reset.css} RENAMED
@@ -2,22 +2,26 @@
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:3px; text-align:left; }
 
6
  .mc4wp-form label > span, .mc4wp-form li > label{ font-weight: normal; }
 
7
 
8
  .mc4wp-form input[type="text"],
9
  .mc4wp-form input[type="email"],
10
  .mc4wp-form input[type="tel"],
11
- .mc4wp-form input[type="url"] { display:inline-block; width:100%; height:auto; box-sizing:border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }
 
 
 
12
 
13
- .mc4wp-form input[type="checkbox"] { margin:0 10px 0 0; padding:0; height:13px; width:13px;
14
  display:inline-block; -webkit-appearance: checkbox; border:0; }
15
- .mc4wp-form input[type="radio"] { margin:0 10px 0 0; padding:0; height:13px; width:13px;
16
- display:inline-block; -webkit-appearance: radio; border:0; }
17
- .mc4wp-form select, .mc4wp-form input[type="date"] { min-width:35%; }
18
- .mc4wp-form input[type="submit"], .mc4wp-form button{ display:inline-block; }
19
 
20
  .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;}
21
  .mc4wp-success { color: #468847; background-color: #dff0d8; border-color: #d6e9c6; }
22
  .mc4wp-notice { color: #3a87ad; background-color: #d9edf7; border-color: #bce8f1; }
23
- .mc4wp-error { color: #b94a48; background-color: #f2dede; border-color: #eed3d7;; }
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"],
12
  .mc4wp-form input[type="tel"],
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; }
26
  .mc4wp-notice { color: #3a87ad; background-color: #d9edf7; border-color: #bce8f1; }
27
+ .mc4wp-error { color: #b94a48; background-color: #f2dede; border-color: #eed3d7; }
assets/css/form-theme-base.css ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Form base theme */
3
+ .mc4wp-form { box-shadow: none !important; -webkit-box-shadow: none; -moz-box-shadow: none; }
4
+ .mc4wp-form p{ margin:0 0 15px; }
5
+ .mc4wp-form label{ font-size:1em; margin:5px 0; }
6
+
7
+ .mc4wp-form input[type="text"],
8
+ .mc4wp-form input[type="email"],
9
+ .mc4wp-form input[type="tel"],
10
+ .mc4wp-form input[type="url"],
11
+ .mc4wp-form input[type="date"],
12
+ .mc4wp-form textarea,
13
+ .mc4wp-form select {
14
+ width: 100%;
15
+ height: 34px;
16
+ margin:0;
17
+ padding: 6px 12px;
18
+ font-size: 14px;
19
+ line-height: 1.428571429;
20
+ color: #555555;
21
+ vertical-align: middle;
22
+ background-color: #ffffff;
23
+ border: 1px solid #cccccc;
24
+ border-radius: 2px;
25
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
26
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
27
+ -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
28
+ transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
29
+ background-image: none;
30
+ text-shadow: none;
31
+
32
+ }
33
+
34
+ .mc4wp-form input[type="text"]:focus,
35
+ .mc4wp-form input[type="email"]:focus,
36
+ .mc4wp-form input[type="tel"]:focus,
37
+ .mc4wp-form input[type="url"]:focus,
38
+ .mc4wp-form textarea:focus,
39
+ .mc4wp-form select:focus {
40
+ border-color: #66afe9;
41
+ outline: 0;
42
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
43
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
44
+ }
45
+
46
+ .mc4wp-form textarea{ height: auto; }
47
+
48
+ .mc4wp-form input[readonly], .mc4wp-form input[disabled] {
49
+ background-color: #eeeeee;
50
+ }
51
+
52
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
53
+ display: inline-block;
54
+ padding: 6px 12px;
55
+ margin:0;
56
+ font-size: 14px;
57
+ font-weight: normal;
58
+ line-height: 1.428571429;
59
+ text-align: center;
60
+ white-space: nowrap;
61
+ vertical-align: middle;
62
+ cursor: pointer;
63
+ border: 1px solid transparent;
64
+ border-radius: 2px;
65
+ -webkit-user-select: none;
66
+ -moz-user-select: none;
67
+ -ms-user-select: none;
68
+ -o-user-select: none;
69
+ user-select: none;
70
+ box-shadow:none;
71
+ background:none;
72
+ text-shadow:none;
73
+ filter: none;
74
+ }
75
+
76
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
77
+ outline: thin dotted #333;
78
+ outline: 5px auto -webkit-focus-ring-color;
79
+ outline-offset: -2px;
80
+ }
81
+
82
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
83
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
84
+ color: #333333;
85
+ text-decoration: none;
86
+ }
87
+
88
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active {
89
+ background-image: none;
90
+ outline: 0;
91
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
92
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
93
+ }
assets/css/form-theme-blue.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
2
+ color: #ffffff !important;
3
+ background-color: #428bca;
4
+ border-color: #357ebd;
5
+ }
6
+
7
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
8
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active,
9
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
10
+ color: #ffffff;
11
+ background-color: #3276b1;
12
+ border-color: #285e8e;
13
+ }
14
+
15
+ .mc4wp-form input[type="text"]:focus,
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;
22
+ }
assets/css/form-theme-dark.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
2
+ color: #ffffff !important;
3
+ background-color: #333333;
4
+ border-color: #2E2E2E;
5
+ }
6
+
7
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
8
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active,
9
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
10
+ color: #ffffff;
11
+ background-color: #2E2E2E;
12
+ border-color: #292929;
13
+ }
14
+
15
+ .mc4wp-form input[type="text"]:focus,
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;
22
+ }
assets/css/form-theme-green.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
2
+ color: #ffffff !important;
3
+ background-color: #5cb85c;
4
+ border-color: #4cae4c;
5
+ }
6
+
7
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
8
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active,
9
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
10
+ color: #ffffff;
11
+ background-color: #47a447;
12
+ border-color: #398439;
13
+ }
14
+
15
+ .mc4wp-form input[type="text"]:focus,
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;
22
+ }
assets/css/form-theme-light.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
2
+ color: #333333 !important;
3
+ background-color: #ffffff;
4
+ border-color: #E6E6E6;
5
+ }
6
+
7
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
8
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active,
9
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
10
+ color: #E6E6E6;
11
+ background-color: #ebebeb;
12
+ border-color: #CCCCCC;
13
+ }
assets/css/form-theme-red.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .mc4wp-form input[type="submit"], .mc4wp-form button {
2
+ color: #ffffff !important;
3
+ background-color: #d9534f;
4
+ border-color: #d43f3a;
5
+ }
6
+
7
+ .mc4wp-form input[type="submit"]:hover, .mc4wp-form button:hover,
8
+ .mc4wp-form input[type="submit"]:active, .mc4wp-form button:active,
9
+ .mc4wp-form input[type="submit"]:focus, .mc4wp-form button:focus {
10
+ color: #ffffff;
11
+ background-color: #d2322d;
12
+ border-color: #ac2925;
13
+ }
14
+
15
+ .mc4wp-form input[type="text"]:focus,
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;
22
+ }
assets/js/admin.js CHANGED
@@ -66,16 +66,8 @@
66
  var text = (f.name.length > 40) ? f.name.substring(0, 40) + '..' : f.name;
67
  if(f.req) { text += '*'; }
68
 
69
- var include = false;
70
- var triggers = [ 'name', 'email', 'website' ];
71
- for(var j = 0; j < triggers.length; j++) {
72
- if(f.tag.toLowerCase().indexOf(triggers[j]) !== -1) {
73
- include = true;
74
- break;
75
- }
76
- }
77
-
78
- if(include) {
79
  var $option = $("<option />").text(text).val(f.tag).data('field', f);
80
  } else {
81
  var $option = $("<option />").text("(PRO ONLY) " + text).val(f.tag).attr('disabled', 'disabled');
@@ -88,13 +80,23 @@
88
  // loop through interest groupings
89
  for(var i = 0, groupingsCount = groupings.length; i < groupingsCount; i++) {
90
  var grouping = groupings[i];
91
-
92
  // add field to select if no similar option exists yet
93
  if($mailchimpGroupings.find("option[value='"+ grouping.id +"']").length == 0) {
94
  var text = (grouping.name.length > 40) ? grouping.name.substring(0, 40) + '..' : grouping.name;
95
- var $option = $("<option />").text("(PRO ONLY) " + text).val(grouping.id).attr('disabled', 'disabled');
 
 
 
 
 
 
 
96
  $mailchimpGroupings.append($option);
97
  }
 
 
 
98
  }
99
 
100
 
@@ -110,24 +112,21 @@
110
  // setup values for submit field
111
  field['type'] = 'submit';
112
  $valueLabel.text("Button text");
113
- $value.val("Sign up");
114
  $wizardFields.find('p.row').filter('.value, .wrap-p').show();
115
  updateCodePreview();
116
  } else {
117
  var data = selected.data('field');
118
  if(data) { return setPresetsForField(data); }
 
 
 
119
  }
120
-
121
  return;
122
  }
123
 
124
  function resetFields() {
125
  $wizardFields.find('.row :input').each(function() {
126
- if($(this).is(":checkbox")) {
127
- this.checked = true;
128
- } else {
129
- this.value = '';
130
- }
131
  });
132
 
133
  $wizardFields.find('p.row').hide();
@@ -139,6 +138,44 @@
139
  $valueLabel.html("Initial value <small>(optional)</small>");
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  // show available fields and fill it with some values
143
  function setPresetsForField(data)
144
  {
@@ -152,7 +189,7 @@
152
  }
153
 
154
  var fieldTypesMap = {
155
- 'text': 'text', 'email': 'email', 'phone': 'tel', 'address': 'text', 'number': 'number', 'url': 'url',
156
  'dropdown': 'select', 'date': 'date', 'birthday': 'date', 'radio': 'radio', 'checkbox': 'checkbox'
157
  }
158
 
@@ -177,8 +214,13 @@
177
  field['name'] = data.tag;
178
  $placeholder.val("Your " + data.name.toLowerCase());
179
  $label.val(data.name + ":");
180
- if(data.req) { $required.attr('checked', true); }
181
-
 
 
 
 
 
182
  // update code preview
183
  updateCodePreview();
184
  }
@@ -190,8 +232,44 @@
190
  var $input;
191
 
192
  // build input / select / textarea element
193
- $input = $("<input />").attr('type', field['type']);
194
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  // set name attribute
196
  if(field.name.length > 0) {
197
  $input.attr('name', field.name);
@@ -219,12 +297,11 @@
219
  $code.append($input);
220
 
221
 
222
-
223
 
224
  // build label
225
  if($label.is(":visible") && $label.val().length > 0) {
226
- var labelTag = (field['type'] == 'radio' || field['type'] == 'checkbox') ? 'h5' : 'label';
227
- $("<"+ labelTag +" />").text($label.val()).prependTo($code);
228
  }
229
 
230
  // start indenting and tabbing of code
@@ -237,7 +314,21 @@
237
  codePreview = $code.html()
238
  .replace(/<p>/gi, "<p>\n\t")
239
  .replace(/<label><input /gi, "\n\t<label><input ")
240
- .replace(/<\/label><input/gi, "</label> \n\t<input");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
 
243
  // newline after every closed element
66
  var text = (f.name.length > 40) ? f.name.substring(0, 40) + '..' : f.name;
67
  if(f.req) { text += '*'; }
68
 
69
+ // only show first 4 fields
70
+ if((i <= 3)) {
 
 
 
 
 
 
 
 
71
  var $option = $("<option />").text(text).val(f.tag).data('field', f);
72
  } else {
73
  var $option = $("<option />").text("(PRO ONLY) " + text).val(f.tag).attr('disabled', 'disabled');
80
  // loop through interest groupings
81
  for(var i = 0, groupingsCount = groupings.length; i < groupingsCount; i++) {
82
  var grouping = groupings[i];
83
+
84
  // add field to select if no similar option exists yet
85
  if($mailchimpGroupings.find("option[value='"+ grouping.id +"']").length == 0) {
86
  var text = (grouping.name.length > 40) ? grouping.name.substring(0, 40) + '..' : grouping.name;
87
+
88
+ // only show 1 grouping
89
+ if(i < 1) {
90
+ var $option = $("<option />").text(text).val(grouping.id).data('grouping', grouping);
91
+ } else {
92
+ var $option = $("<option />").text("(PRO ONLY) " + text).val(grouping.id).attr('disabled', 'disabled');
93
+ }
94
+
95
  $mailchimpGroupings.append($option);
96
  }
97
+
98
+
99
+
100
  }
101
 
102
 
112
  // setup values for submit field
113
  field['type'] = 'submit';
114
  $valueLabel.text("Button text");
 
115
  $wizardFields.find('p.row').filter('.value, .wrap-p').show();
116
  updateCodePreview();
117
  } else {
118
  var data = selected.data('field');
119
  if(data) { return setPresetsForField(data); }
120
+
121
+ var data = selected.data('grouping');
122
+ if(data) { return setPresetsForGrouping(data); }
123
  }
 
124
  return;
125
  }
126
 
127
  function resetFields() {
128
  $wizardFields.find('.row :input').each(function() {
129
+ if($(this).is(":checkbox")) { this.checked = true; } else { this.value = ''; }
 
 
 
 
130
  });
131
 
132
  $wizardFields.find('p.row').hide();
138
  $valueLabel.html("Initial value <small>(optional)</small>");
139
  }
140
 
141
+ function addGroupInputs(groups)
142
+ {
143
+ // add a text input to $multipleValues for each group
144
+ for(var i = 0, groupsCount = groups.length; i < groupsCount; i++) {
145
+ $("<input />").attr('type', 'text').addClass('widefat').data('value', groups[i].name).attr('placeholder', 'Label for "' + groups[i].name + '" (or leave empty)').attr('value', groups[i].name).appendTo($multipleValues);
146
+ }
147
+ }
148
+
149
+ function setPresetsForGrouping(data)
150
+ {
151
+ $wizardFields.find('p.row').filter('.values, .label, .wrap-p').show();
152
+ $label.val(data.name + ":");
153
+ field['name'] = 'GROUPINGS['+ data.id + ']';
154
+ addGroupInputs(data.groups);
155
+
156
+ if(data.form_field == 'radio') {
157
+ field['type'] = 'radio';
158
+ } else if(data.form_field == 'dropdown') {
159
+ field['type'] = 'select';
160
+ } else if(data.form_field == 'hidden') {
161
+ $wizardFields.find('p.row').filter('.values, .label, .wrap-p').hide();
162
+ $wizardFields.find('p.row.value').show();
163
+ field['type'] = 'hidden';
164
+
165
+ for(var i = 0, groupsCount = data.groups.length; i < groupsCount; i++) {
166
+ $value.val($value.val() + data.groups[i].name + ',');
167
+ }
168
+
169
+ } else {
170
+ field['type'] = 'checkbox';
171
+ field['name'] = 'GROUPINGS['+ data.id + '][]';
172
+ }
173
+
174
+ // update code preview
175
+ updateCodePreview();
176
+ }
177
+
178
+
179
  // show available fields and fill it with some values
180
  function setPresetsForField(data)
181
  {
189
  }
190
 
191
  var fieldTypesMap = {
192
+ 'text': 'text', 'email': 'email', 'phone': 'tel', 'address': 'text', 'number': 'number',
193
  'dropdown': 'select', 'date': 'date', 'birthday': 'date', 'radio': 'radio', 'checkbox': 'checkbox'
194
  }
195
 
214
  field['name'] = data.tag;
215
  $placeholder.val("Your " + data.name.toLowerCase());
216
  $label.val(data.name + ":");
217
+ $required.attr('checked', data.req);
218
+ if($multipleValues.is(":visible") && data.choices) {
219
+ for(var i = 0, count = data.choices.length; i < count; i++) {
220
+ $("<input />").attr('type', 'text').addClass('widefat').data('value', data.choices[i]).attr('placeholder', 'Label for "' + data.choices[i] + '" (or leave empty)').attr('value', data.choices[i]).appendTo($multipleValues);
221
+ }
222
+ }
223
+
224
  // update code preview
225
  updateCodePreview();
226
  }
232
  var $input;
233
 
234
  // build input / select / textarea element
235
+ if(field['type'] == 'select') {
236
+ $input = $("<select />");
237
+
238
+ // add options to select
239
+ $multipleValues.find(":input").each(function() {
240
+ if($(this).val().length > 0) {
241
+ $el = $("<option />").val($(this).data("value")).text($(this).val());
242
+ $el.appendTo($input);
243
+ }
244
+ });
245
+
246
+ } else if(field['type'] == 'radio' || field['type'] == 'checkbox') {
247
+
248
+ // build multiple input values
249
+ $multipleValues.find(":input").each(function() {
250
+ if($(this).val().length > 0) {
251
+ $input = $("<input />").attr('type', field['type']).attr('name', field.name).val($(this).data('value'));
252
+
253
+ if($required.is(':visible:checked')) {
254
+ $input.attr('required', 'required');
255
+ }
256
+
257
+ $code.append($input);
258
+
259
+ $input.wrap("<label />");
260
+ $("<span />").text($(this).val() + ' ').insertAfter($input);
261
+ }
262
+ });
263
+
264
+ } else if(field['type'] == 'textarea') {
265
+ $input = $("<textarea />");
266
+ } else {
267
+ $input = $("<input />").attr('type', field['type']);
268
+ }
269
+
270
+ // only do this piece when we're not adding radio inputs
271
+ if(field['type'] != 'radio' && field['type'] != 'checkbox') {
272
+
273
  // set name attribute
274
  if(field.name.length > 0) {
275
  $input.attr('name', field.name);
297
  $code.append($input);
298
 
299
 
300
+ }
301
 
302
  // build label
303
  if($label.is(":visible") && $label.val().length > 0) {
304
+ $("<label />").text($label.val()).prependTo($code);
 
305
  }
306
 
307
  // start indenting and tabbing of code
314
  codePreview = $code.html()
315
  .replace(/<p>/gi, "<p>\n\t")
316
  .replace(/<label><input /gi, "\n\t<label><input ")
317
+ .replace(/<\/label><input/gi, "</label> \n\t<input")
318
+ .replace(/<select /gi, "\n\t<select ")
319
+ .replace(/<\/select>/gi, "\n\t</select>")
320
+ .replace(/<\/span><\/label>/gi, "</span>\n\t</label> \n")
321
+ .replace(/<option /gi, "\n\t\t<option ")
322
+ .replace(/<label><input type="radio"/g, "<label>\n\t\t<input type=\"radio\"")
323
+ .replace(/<label><input type="checkbox"/g, "<label>\n\t\t<input type=\"checkbox\"")
324
+ .replace(/<span>/gi, "\n\t\t<span>")
325
+ } else {
326
+ // indent code, single tab
327
+ codePreview = codePreview
328
+ .replace(/<option /gi, "\n\t<option ")
329
+ .replace(/<label><input type="radio"/g, "<label>\n\t<input type=\"radio\"")
330
+ .replace(/<label><input type="checkbox"/g, "<label>\n\t<input type=\"checkbox\"")
331
+ .replace(/<span>/gi, "\n\t<span>");
332
  }
333
 
334
  // newline after every closed element
includes/MC4WP_Lite.php CHANGED
@@ -90,7 +90,7 @@ class MC4WP_Lite {
90
  'double_optin' => 1
91
  ),
92
  'form' => array(
93
- 'css' => 1,
94
  'markup' => "<p>\n\t<label for=\"mc4wp_email\">Email address: </label>\n\t<input type=\"email\" id=\"mc4wp_email\" name=\"EMAIL\" required placeholder=\"Your email address\" />\n</p>\n\n<p>\n\t<input type=\"submit\" value=\"Sign up\" />\n</p>",
95
  'text_success' => 'Thank you, your sign-up request was successful! Please check your e-mail inbox.',
96
  'text_error' => 'Oops. Something went wrong. Please try again later.',
@@ -130,45 +130,74 @@ class MC4WP_Lite {
130
  private function backwards_compatibility() {
131
  $options = get_option( 'mc4wp_lite' );
132
 
133
- if ( !isset( $options['mailchimp_api_key'] ) ) { return; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
- // transfer old options to new option system
136
- $new_options = array(
137
- 'general' => array(),
138
- 'checkbox' => array(),
139
- 'form' => array()
140
- );
141
 
142
- $new_options['general']['api_key'] = $options['mailchimp_api_key'];
 
 
 
143
 
144
- foreach ( $options as $key => $value ) {
145
- $_pos = strpos( $key, '_' );
 
 
 
146
 
147
- $first_key = substr( $key, 0, $_pos );
148
- $second_key = substr( $key, $_pos + 1 );
149
 
150
- if ( isset( $new_options[$first_key] ) ) {
 
151
 
152
- // change option name
153
- if ( $second_key == 'show_at_bp_form' ) {
154
- $second_key = 'show_at_buddypress_form';
155
- }
156
 
157
- // change option name
158
- if ( $second_key == 'show_at_ms_form' ) {
159
- $second_key = 'show_at_multisite_form';
160
- }
161
 
162
- // set value into new option name
163
- $new_options[$first_key][$second_key] = $value;
164
- }
 
165
 
166
- }
 
 
 
167
 
168
- update_option( 'mc4wp_lite', $new_options['general'] );
169
- update_option( 'mc4wp_lite_checkbox', $new_options['checkbox'] );
170
- update_option( 'mc4wp_lite_form', $new_options['form'] );
 
 
171
 
 
 
 
 
172
  }
173
 
174
  public function register_widget()
90
  'double_optin' => 1
91
  ),
92
  'form' => array(
93
+ 'css' => 'default',
94
  'markup' => "<p>\n\t<label for=\"mc4wp_email\">Email address: </label>\n\t<input type=\"email\" id=\"mc4wp_email\" name=\"EMAIL\" required placeholder=\"Your email address\" />\n</p>\n\n<p>\n\t<input type=\"submit\" value=\"Sign up\" />\n</p>",
95
  'text_success' => 'Thank you, your sign-up request was successful! Please check your e-mail inbox.',
96
  'text_error' => 'Oops. Something went wrong. Please try again later.',
130
  private function backwards_compatibility() {
131
  $options = get_option( 'mc4wp_lite' );
132
 
133
+ // transfer widget to new id?
134
+ if(get_option('mc4wp_transfered_old_widgets', false) == false) {
135
+ $sidebars_widgets = get_option('sidebars_widgets');
136
+
137
+ if($sidebars_widgets && is_array($sidebars_widgets)) {
138
+ foreach($sidebars_widgets as $key => $widgets)
139
+ {
140
+ if(!is_array($widgets)) { continue; }
141
+ foreach($widgets as $subkey => $widget_name) {
142
+
143
+ if(substr($widget_name, 0, 17) == 'mc4wp_lite_widget') {
144
+
145
+ $new_widget_name = str_replace('mc4wp_lite_widget', 'mc4wp_widget', $widget_name);
146
+ // active widget found, just change name?
147
+ $sidebars_widgets[$key][$subkey] = $new_widget_name;
148
+ update_option('sidebars_widgets', $sidebars_widgets);
149
+ update_option('widget_mc4wp_widget', get_option('widget_mc4wp_lite_widget') );
150
+ break;
151
+ }
152
+ }
153
+ }
154
+ }
155
 
156
+ update_option('mc4wp_transfered_old_widgets', true);
157
+ }
158
+
 
 
 
159
 
160
+
161
+
162
+ // transfer old options to new options format
163
+ if (isset( $options['mailchimp_api_key'] )) {
164
 
165
+ $new_options = array(
166
+ 'general' => array(),
167
+ 'checkbox' => array(),
168
+ 'form' => array()
169
+ );
170
 
171
+ $new_options['general']['api_key'] = $options['mailchimp_api_key'];
 
172
 
173
+ foreach ( $options as $key => $value ) {
174
+ $_pos = strpos( $key, '_' );
175
 
176
+ $first_key = substr( $key, 0, $_pos );
177
+ $second_key = substr( $key, $_pos + 1 );
 
 
178
 
179
+ if ( isset( $new_options[$first_key] ) ) {
 
 
 
180
 
181
+ // change option name
182
+ if ( $second_key == 'show_at_bp_form' ) {
183
+ $second_key = 'show_at_buddypress_form';
184
+ }
185
 
186
+ // change option name
187
+ if ( $second_key == 'show_at_ms_form' ) {
188
+ $second_key = 'show_at_multisite_form';
189
+ }
190
 
191
+ // set value into new option name
192
+ $new_options[$first_key][$second_key] = $value;
193
+ }
194
+
195
+ }
196
 
197
+ update_option( 'mc4wp_lite', $new_options['general'] );
198
+ update_option( 'mc4wp_lite_checkbox', $new_options['checkbox'] );
199
+ update_option( 'mc4wp_lite_form', $new_options['form'] );
200
+ } // end transfer options
201
  }
202
 
203
  public function register_widget()
includes/MC4WP_Lite_Admin.php CHANGED
@@ -21,7 +21,7 @@ class MC4WP_Lite_Admin
21
  if(isset($_GET['page'])) {
22
 
23
  if($_GET['page'] == 'mc4wp-lite-upgrade' && !headers_sent()) {
24
- header("Location: http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=menu-upgrade-link");
25
  exit;
26
  }
27
 
@@ -49,7 +49,7 @@ class MC4WP_Lite_Admin
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/wordpress-plugins/mailchimp-for-wordpress/">Upgrade to Pro</a>';
53
  array_unshift($links, $upgrade_link, $settings_link);
54
  return $links;
55
  }
@@ -68,7 +68,7 @@ class MC4WP_Lite_Admin
68
 
69
  public function build_menu()
70
  {
71
- add_menu_page('MailChimp for WP Lite', 'MailChimp for WP Lite', 'manage_options', 'mc4wp-lite', array($this, 'show_api_settings'), plugins_url('mailchimp-for-wp/assets/img/menu-icon.png'));
72
  add_submenu_page('mc4wp-lite', 'API Settings - MailChimp for WP Lite', 'MailChimp Settings', 'manage_options', 'mc4wp-lite', array($this, 'show_api_settings'));
73
  add_submenu_page('mc4wp-lite', 'Checkbox Settings - MailChimp for WP Lite', 'Checkboxes', 'manage_options', 'mc4wp-lite-checkbox-settings', array($this, 'show_checkbox_settings'));
74
  add_submenu_page('mc4wp-lite', 'Form Settings - MailChimp for WP Lite', 'Forms', 'manage_options', 'mc4wp-lite-form-settings', array($this, 'show_form_settings'));
@@ -104,7 +104,7 @@ class MC4WP_Lite_Admin
104
 
105
  public function redirect_to_pro()
106
  {
107
- ?><script>window.location.replace('http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/'); </script><?php
108
  }
109
 
110
  public function show_api_settings()
@@ -239,13 +239,19 @@ class MC4WP_Lite_Admin
239
  */
240
  public function strip_unnecessary_merge_vars_properties($merge_var)
241
  {
242
- return (object) array(
243
  'name' => $merge_var->name,
244
  'field_type' => $merge_var->field_type,
245
  'req' => $merge_var->req,
246
  'tag' => $merge_var->tag
247
  );
248
 
 
 
 
 
 
 
249
  }
250
 
251
  }
21
  if(isset($_GET['page'])) {
22
 
23
  if($_GET['page'] == 'mc4wp-lite-upgrade' && !headers_sent()) {
24
+ header("Location: http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=menu-upgrade-link");
25
  exit;
26
  }
27
 
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;
55
  }
68
 
69
  public function build_menu()
70
  {
71
+ add_menu_page('MailChimp for WP Lite', 'MailChimp for WP', 'manage_options', 'mc4wp-lite', array($this, 'show_api_settings'), plugins_url('mailchimp-for-wp/assets/img/menu-icon.png'));
72
  add_submenu_page('mc4wp-lite', 'API Settings - MailChimp for WP Lite', 'MailChimp Settings', 'manage_options', 'mc4wp-lite', array($this, 'show_api_settings'));
73
  add_submenu_page('mc4wp-lite', 'Checkbox Settings - MailChimp for WP Lite', 'Checkboxes', 'manage_options', 'mc4wp-lite-checkbox-settings', array($this, 'show_checkbox_settings'));
74
  add_submenu_page('mc4wp-lite', 'Form Settings - MailChimp for WP Lite', 'Forms', 'manage_options', 'mc4wp-lite-form-settings', array($this, 'show_form_settings'));
104
 
105
  public function redirect_to_pro()
106
  {
107
+ ?><script>window.location.replace('http://dannyvankooten.com/mailchimp-for-wordpress/'); </script><?php
108
  }
109
 
110
  public function show_api_settings()
239
  */
240
  public function strip_unnecessary_merge_vars_properties($merge_var)
241
  {
242
+ $array = array(
243
  'name' => $merge_var->name,
244
  'field_type' => $merge_var->field_type,
245
  'req' => $merge_var->req,
246
  'tag' => $merge_var->tag
247
  );
248
 
249
+ if ( isset( $merge_var->choices ) ) {
250
+ $array["choices"] = $merge_var->choices;
251
+ }
252
+
253
+ return (object) $array;
254
+
255
  }
256
 
257
  }
includes/MC4WP_Lite_Checkbox.php CHANGED
@@ -82,7 +82,7 @@ class MC4WP_Lite_Checkbox
82
  $opts = $this->get_options();
83
  $label = isset($args['labels'][0]) ? $args['labels'][0] : $opts['label'];
84
  $checked = $opts['precheck'] ? "checked" : '';
85
- $content = "\n<!-- Checkbox by MailChimp for WP plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/wordpress-plugins/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>';
@@ -227,7 +227,9 @@ class MC4WP_Lite_Checkbox
227
 
228
  // start running..
229
  $email = null;
230
- $merge_vars = array();
 
 
231
 
232
  foreach($_POST as $key => $value) {
233
 
@@ -239,6 +241,33 @@ class MC4WP_Lite_Checkbox
239
 
240
  if($key == 'EMAIL') {
241
  $email = $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  } elseif(!isset($merge_vars[$key])) {
243
  // if value is array, convert to comma-delimited string
244
  if(is_array($value)) { $value = implode(',', $value); }
@@ -249,11 +278,26 @@ class MC4WP_Lite_Checkbox
249
  } elseif(!$email && is_email($value)) {
250
  // find first email field
251
  $email = $value;
252
- } elseif(!isset($merge_vars['NAME']) && in_array(strtolower($key), array('name', 'your-name', 'username', 'fullname', 'full-name'))) {
253
- // find name field
254
- $merge_vars['NAME'] = $value;
255
- }
256
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
 
258
  // if email has not been found by the smart field guessing, return false.. sorry
259
  if(!$email) {
@@ -328,7 +372,7 @@ class MC4WP_Lite_Checkbox
328
  }
329
  }
330
 
331
- $merge_vars = apply_filters('mc4wp_merge_vars', $merge_vars);
332
  $email_type = apply_filters('mc4wp_email_type', 'html');
333
 
334
  foreach($lists as $list) {
82
  $opts = $this->get_options();
83
  $label = isset($args['labels'][0]) ? $args['labels'][0] : $opts['label'];
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>';
227
 
228
  // start running..
229
  $email = null;
230
+ $merge_vars = array(
231
+ 'GROUPINGS' => array()
232
+ );
233
 
234
  foreach($_POST as $key => $value) {
235
 
241
 
242
  if($key == 'EMAIL') {
243
  $email = $value;
244
+ } elseif($key == 'GROUPINGS' && is_array($value)) {
245
+
246
+ $groupings = $value;
247
+
248
+ foreach($groupings as $grouping_id_or_name => $groups) {
249
+
250
+ $grouping = array();
251
+
252
+ // group ID or group name given?
253
+ if(is_numeric($grouping_id_or_name)) {
254
+ $grouping['id'] = $grouping_id_or_name;
255
+ } else {
256
+ $grouping['name'] = $grouping_id_or_name;
257
+ }
258
+
259
+ // comma separated list should become an array
260
+ if(!is_array($groups)) {
261
+ $grouping['groups'] = explode(',', $groups);
262
+ } else {
263
+ $grouping['groups'] = $groups;
264
+ }
265
+
266
+ // add grouping to array
267
+ $merge_vars['GROUPINGS'][] = $grouping;
268
+
269
+ } // end foreach
270
+
271
  } elseif(!isset($merge_vars[$key])) {
272
  // if value is array, convert to comma-delimited string
273
  if(is_array($value)) { $value = implode(',', $value); }
278
  } elseif(!$email && is_email($value)) {
279
  // find first email field
280
  $email = $value;
281
+
282
+ } else {
283
+ $simple_key = str_replace(array('-', '_'), '', strtolower($key));
284
+
285
+ if(!isset($merge_vars['NAME']) && in_array($simple_key, array('name', 'yourname', 'username', 'fullname'))) {
286
+ // find name field
287
+ $merge_vars['NAME'] = $value;
288
+ } elseif(!isset($merge_vars['FNAME']) && in_array($simple_key, array('firstname', 'fname', "givenname", "forename"))) {
289
+ // find first name field
290
+ $merge_vars['FNAME'] = $value;
291
+ } elseif(!isset($merge_vars['LNAME']) && in_array($simple_key, array('lastname', 'lname', 'surname', 'familyname'))) {
292
+ // find last name field
293
+ $merge_vars['LNAME'] = $value;
294
+ }
295
+ }
296
+ } // end foreach $_POST
297
+
298
+
299
+ // unset groupings if not used
300
+ if(empty($merge_vars['GROUPINGS'])) { unset($merge_vars['GROUPINGS']); }
301
 
302
  // if email has not been found by the smart field guessing, return false.. sorry
303
  if(!$email) {
372
  }
373
  }
374
 
375
+ $merge_vars = apply_filters('mc4wp_merge_vars', $merge_vars, '');
376
  $email_type = apply_filters('mc4wp_email_type', 'html');
377
 
378
  foreach($lists as $list) {
includes/MC4WP_Lite_Form.php CHANGED
@@ -9,8 +9,8 @@ class MC4WP_Lite_Form {
9
  public function __construct() {
10
  $opts = $this->get_options();
11
 
12
- if($opts['css'] == 1) {
13
- add_filter('mc4wp_stylesheets', array($this, 'add_stylesheet'));
14
  }
15
 
16
  add_shortcode( 'mc4wp_form', array( $this, 'output_form' ) );
@@ -34,8 +34,16 @@ class MC4WP_Lite_Form {
34
  return $options['form'];
35
  }
36
 
37
- public function add_stylesheet($stylesheets) {
 
 
38
  $stylesheets['form'] = 1;
 
 
 
 
 
 
39
  return $stylesheets;
40
  }
41
 
@@ -51,7 +59,7 @@ class MC4WP_Lite_Form {
51
  if ( $this->error ) $css_classes .= 'mc4wp-form-error ';
52
  if ( $this->success ) $css_classes .= 'mc4wp-form-success ';
53
 
54
- $content = "\n<!-- Form by MailChimp for WP plugin v". MC4WP_LITE_VERSION ." - http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/ -->\n";
55
  $content .= '<form method="post" action="#mc4wp-form-'. $this->form_instance_number .'" id="mc4wp-form-'.$this->form_instance_number.'" class="mc4wp-form form'.$css_classes.'">';
56
 
57
  // maybe hide the form
9
  public function __construct() {
10
  $opts = $this->get_options();
11
 
12
+ if($opts['css']) {
13
+ add_filter('mc4wp_stylesheets', array($this, 'add_stylesheets'));
14
  }
15
 
16
  add_shortcode( 'mc4wp_form', array( $this, 'output_form' ) );
34
  return $options['form'];
35
  }
36
 
37
+ public function add_stylesheets($stylesheets) {
38
+ $opts = $this->get_options();
39
+
40
  $stylesheets['form'] = 1;
41
+
42
+ // theme?
43
+ if($opts['css'] != 1 && $opts['css'] != 'default') {
44
+ $stylesheets['form-theme'] = $opts['css'];
45
+ }
46
+
47
  return $stylesheets;
48
  }
49
 
59
  if ( $this->error ) $css_classes .= 'mc4wp-form-error ';
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
includes/MC4WP_Lite_Widget.php CHANGED
@@ -10,7 +10,7 @@ class MC4WP_Lite_Widget extends WP_Widget {
10
  */
11
  function __construct() {
12
  parent::__construct(
13
- 'MC4WP_Lite_Widget', // Base ID
14
  __( 'MailChimp Sign-Up Form', 'mailchimp-for-wp' ), // Name
15
  array( 'description' => __( 'Displays your MailChimp sign-up form', 'mailchimp-for-wp' ), ) // Args
16
  );
10
  */
11
  function __construct() {
12
  parent::__construct(
13
+ 'MC4WP_Widget', // Base ID
14
  __( 'MailChimp Sign-Up Form', 'mailchimp-for-wp' ), // Name
15
  array( 'description' => __( 'Displays your MailChimp sign-up form', 'mailchimp-for-wp' ), ) // Args
16
  );
includes/views/api-settings.php CHANGED
@@ -1,6 +1,6 @@
1
  <div id="mc4wp-<?php echo $tab; ?>" class="wrap mc4wp-settings">
2
 
3
- <h2>MailChimp API Settings</h2>
4
 
5
  <div id="mc4wp-content">
6
 
@@ -9,7 +9,7 @@
9
  <form action="options.php" method="post">
10
  <?php settings_fields( 'mc4wp_lite_settings' ); ?>
11
 
12
- <h3>MailChimp API Settings <?php if($connected) { ?><span class="status positive">CONNECTED</span> <?php } else { ?><span class="status negative">NOT CONNECTED</span><?php } ?></h3>
13
  <table class="form-table">
14
 
15
  <tr valign="top">
@@ -27,7 +27,7 @@
27
  </form>
28
 
29
  <?php if($connected) { ?>
30
- <h3>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>
@@ -44,7 +44,7 @@
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/wordpress-plugins/mailchimp-for-wordpress/">Upgrade now.</a></em></td>
48
  </tr>
49
  <?php } // endforeach ?>
50
  <?php } else { ?>
1
  <div id="mc4wp-<?php echo $tab; ?>" class="wrap mc4wp-settings">
2
 
3
+ <h2>MailChimp Settings</h2>
4
 
5
  <div id="mc4wp-content">
6
 
9
  <form action="options.php" method="post">
10
  <?php settings_fields( 'mc4wp_lite_settings' ); ?>
11
 
12
+ <h3 class="mc4wp-title">MailChimp API Settings <?php if($connected) { ?><span class="status positive">CONNECTED</span> <?php } else { ?><span class="status negative">NOT CONNECTED</span><?php } ?></h3>
13
  <table class="form-table">
14
 
15
  <tr valign="top">
27
  </form>
28
 
29
  <?php if($connected) { ?>
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>
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 { ?>
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>List settings</h3>
11
  <form action="options.php" method="post">
12
  <?php settings_fields( 'mc4wp_lite_checkbox_settings' ); ?>
13
 
@@ -34,7 +34,7 @@
34
  </tr>
35
  </table>
36
 
37
- <h3>Checkbox settings</h3>
38
  <table class="form-table">
39
  <tr valign="top">
40
  <th scope="row">Double opt-in?</th>
@@ -52,7 +52,10 @@
52
  </tr>
53
  <tr valign="top">
54
  <th scope="row"><label for="mc4wp_checkbox_label">Checkbox label text</label></th>
55
- <td colspan="2"><input type="text" class="widefat" id="mc4wp_checkbox_label" name="mc4wp_lite_checkbox[label]" value="<?php echo esc_attr($opts['label']); ?>" required /></td>
 
 
 
56
  </tr>
57
  <tr valign="top">
58
  <th scope="row">Pre-check the checkbox?</th>
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
 
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>
52
  </tr>
53
  <tr valign="top">
54
  <th scope="row"><label for="mc4wp_checkbox_label">Checkbox label text</label></th>
55
+ <td colspan="2">
56
+ <input type="text" class="widefat" id="mc4wp_checkbox_label" name="mc4wp_lite_checkbox[label]" value="<?php echo esc_attr($opts['label']); ?>" required />
57
+ <p class="help">HTML tags like <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code> are allowed in the label text.</p>
58
+ </td>
59
  </tr>
60
  <tr valign="top">
61
  <th scope="row">Pre-check the checkbox?</th>
includes/views/form-settings.php CHANGED
@@ -11,9 +11,29 @@
11
  <form action="options.php" method="post">
12
  <?php settings_fields( 'mc4wp_lite_form_settings' ); ?>
13
 
14
- <h3>Required form settings</h3>
15
  <table class="form-table">
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <tr valign="top">
18
  <th scope="row">MailChimp list(s)</th>
19
  <?php // loop through lists
@@ -26,38 +46,40 @@
26
  <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>
27
  <?php } ?>
28
  </ul>
29
- </td>
30
- <td class="desc" <?php if(empty($opts['lists'])) { ?>style="color:red;"<?php } ?>>Select at least one MailChimp list for this form.</td>
31
- <?php
32
- } ?>
33
-
34
- </tr>
35
- <tr valign="top">
36
- <td colspan="3">
37
- <h4>Form mark-up</h4>
38
- <div class="mc4wp-wrapper">
39
- <div class="mc4wp-col mc4wp-col-2-3 mc4wp-first">
40
- <?php
41
- if(function_exists('wp_editor')) {
42
- wp_editor( esc_textarea($opts['markup']), 'mc4wpformmarkup', array('tinymce' => false, 'media_buttons' => false, 'textarea_name' => 'mc4wp_lite_form[markup]'));
43
- } else {
44
- ?><textarea class="widefat" cols="160" rows="20" id="mc4wpformmarkup" name="mc4wp_lite_form[markup]"><?php echo esc_textarea($opts['markup']); ?></textarea><?php
45
- } ?>
46
- <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>
47
- <p class="submit">
48
- <input type="submit" class="button-primary" value="<?php _e('Save All Changes') ?>" id="mc4wp-submit-form-settings" />
49
- </p>
50
- </div>
51
-
52
- <div class="mc4wp-col mc4wp-col-1-3 mc4wp-last">
53
- <?php include('parts/admin-field-wizard.php'); ?>
54
- </div>
55
- </div>
56
- </td>
57
- </tr>
58
  </table>
59
 
60
- <h3>MailChimp Settings</h3>
 
 
61
  <table class="form-table">
62
  <tr valign="top">
63
  <th scope="row">Double opt-in?</th>
@@ -96,7 +118,7 @@
96
  </tr>
97
  </table>
98
 
99
- <h3>Form Settings & Messages</h3>
100
 
101
  <table class="form-table mc4wp-form-messages">
102
  <tr valign="top" class="pro-feature">
@@ -105,12 +127,7 @@
105
  <input type="radio" readonly /> <label>Yes</label> &nbsp;
106
  <input type="radio" checked readonly /> <label>No</label>
107
  </td>
108
- <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/wordpress-plugins/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=lite-plugin&utm_medium=link&utm_campaign=settings-demo-link">(demo)</a></td>
109
- </tr>
110
- <tr valign="top">
111
- <th scope="row">Load some default CSS?</th>
112
- <td class="nowrap"><input type="radio" id="mc4wp_form_css_1" name="mc4wp_lite_form[css]" value="1" <?php if($opts['css'] == 1) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_css_1">Yes</label> &nbsp; <input type="radio" id="mc4wp_form_css_0" name="mc4wp_lite_form[css]" value="0" <?php if($opts['css'] == 0) echo 'checked="checked"'; ?> /> <label for="mc4wp_form_css_0">No</label></td>
113
- <td class="desc">Tick "yes" to load some basic form styles.</td>
114
  </tr>
115
  <tr valign="top">
116
  <th scope="row"><label for="mc4wp_form_hide_after_success">Hide form after a successful sign-up?</label></th>
@@ -159,8 +176,8 @@
159
  <p>At a minimum, your form should include just an <strong>EMAIL</strong> field and a submit button.</p>
160
  <p>Add more fields to your form if your list requires more fields. Field names should match your MailChimp list field tags. Use the "Add a new field" tool to have the correct HTML generated for you.</p>
161
 
162
- <p><strong>Styling</strong><br />
163
- Alter the visual appearance of the form by applying CSS rules to <b>.mc4wp-form</b> and its child elements.</p>
164
  <p>You should add the CSS rules to your theme stylesheet using the <a href="<?php echo admin_url('theme-editor.php?file=style.css'); ?>">Theme Editor</a> or by editing <em><?php echo get_stylesheet_directory(); ?>/style.css</em> over FTP.</p>
165
 
166
  <p>The <a href="http://wordpress.org/plugins/mailchimp-for-wp/faq/" target="_blank">FAQ</a> lists the various CSS selectors you can use to target the different elements.</p>
11
  <form action="options.php" method="post">
12
  <?php settings_fields( 'mc4wp_lite_form_settings' ); ?>
13
 
14
+ <h3 class="mc4wp-title">Required form settings</h3>
15
  <table class="form-table">
16
 
17
+ <tr valign="top">
18
+ <th scope="row"><label for="mc4wp_load_stylesheet_select">Load styles or theme?</label></th>
19
+ <td class="nowrap">
20
+ <select name="mc4wp_lite_form[css]" id="mc4wp_load_stylesheet_select">
21
+ <option value="0" <?php selected($opts['css'], 0); ?>>No</option>
22
+ <option value="default" <?php selected($opts['css'], 'default'); ?><?php selected($opts['css'], 1); ?>>Yes, load basic formatting styles</option>
23
+ <optgroup label="Load a default form theme">
24
+ <option value="light" <?php selected($opts['css'], 'light'); ?>>Light theme</option>
25
+ <option value="red" <?php selected($opts['css'], 'red'); ?>>Red theme</option>
26
+ <option value="green" <?php selected($opts['css'], 'green'); ?>>Green theme</option>
27
+ <option value="blue" <?php selected($opts['css'], 'blue'); ?>>Blue theme</option>
28
+ <option value="dark" <?php selected($opts['css'], 'dark'); ?>>Dark theme</option>
29
+ <option disabled>(PRO ONLY) Custom color theme</option>
30
+ </optgroup>
31
+ </select>
32
+ </td>
33
+ <td class="desc">
34
+ If you want to load some default styles, select "basic formatting styles" or one of the default themes.
35
+ </td>
36
+ </tr>
37
  <tr valign="top">
38
  <th scope="row">MailChimp list(s)</th>
39
  <?php // loop through lists
46
  <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>
47
  <?php } ?>
48
  </ul>
49
+ </td>
50
+ <td class="desc" <?php if(empty($opts['lists'])) { ?>style="color:red;"<?php } ?>>Select at least one MailChimp list for this form.</td>
51
+ <?php } ?>
52
+
53
+ </tr>
54
+ <tr valign="top">
55
+ <td colspan="3">
56
+ <h4>Form mark-up</h4>
57
+ <div class="mc4wp-wrapper">
58
+ <div class="mc4wp-col mc4wp-col-2-3 mc4wp-first">
59
+ <?php
60
+ if(function_exists('wp_editor')) {
61
+ wp_editor( esc_textarea($opts['markup']), 'mc4wpformmarkup', array('tinymce' => false, 'media_buttons' => false, 'textarea_name' => 'mc4wp_lite_form[markup]'));
62
+ } else {
63
+ ?><textarea class="widefat" cols="160" rows="20" id="mc4wpformmarkup" name="mc4wp_lite_form[markup]"><?php echo esc_textarea($opts['markup']); ?></textarea><?php
64
+ } ?>
65
+ <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>
66
+ <p class="submit">
67
+ <input type="submit" class="button-primary" value="<?php _e('Save All Changes') ?>" id="mc4wp-submit-form-settings" />
68
+ </p>
69
+ </div>
70
+
71
+ <div class="mc4wp-col mc4wp-col-1-3 mc4wp-last">
72
+ <?php include('parts/admin-field-wizard.php'); ?>
73
+ </div>
74
+ </div>
75
+ </td>
76
+ </tr>
77
+
78
  </table>
79
 
80
+
81
+
82
+ <h3 class="mc4wp-title">MailChimp Settings</h3>
83
  <table class="form-table">
84
  <tr valign="top">
85
  <th scope="row">Double opt-in?</th>
118
  </tr>
119
  </table>
120
 
121
+ <h3 class="mc4wp-title">Form Settings & Messages</h3>
122
 
123
  <table class="form-table mc4wp-form-messages">
124
  <tr valign="top" class="pro-feature">
127
  <input type="radio" readonly /> <label>Yes</label> &nbsp;
128
  <input type="radio" checked readonly /> <label>No</label>
129
  </td>
130
+ <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>
 
 
 
 
 
131
  </tr>
132
  <tr valign="top">
133
  <th scope="row"><label for="mc4wp_form_hide_after_success">Hide form after a successful sign-up?</label></th>
176
  <p>At a minimum, your form should include just an <strong>EMAIL</strong> field and a submit button.</p>
177
  <p>Add more fields to your form if your list requires more fields. Field names should match your MailChimp list field tags. Use the "Add a new field" tool to have the correct HTML generated for you.</p>
178
 
179
+ <h3>Form Styling</h3>
180
+ <p>Alter the visual appearance of the form by applying CSS rules to <b>.mc4wp-form</b> and its child elements.</p>
181
  <p>You should add the CSS rules to your theme stylesheet using the <a href="<?php echo admin_url('theme-editor.php?file=style.css'); ?>">Theme Editor</a> or by editing <em><?php echo get_stylesheet_directory(); ?>/style.css</em> over FTP.</p>
182
 
183
  <p>The <a href="http://wordpress.org/plugins/mailchimp-for-wp/faq/" target="_blank">FAQ</a> lists the various CSS selectors you can use to target the different elements.</p>
includes/views/parts/admin-field-wizard.php CHANGED
@@ -1,7 +1,7 @@
1
  <div id="mc4wp-fw" class="mc4wp-well">
2
 
3
  <h4>Add a new field</h4>
4
- <p>Use the tool below to help you add fields to your form mark-up.</p>
5
  <p>
6
  <select class="widefat" id="mc4wp-fw-mailchimp-fields">
7
  <option class="default" value="" disabled selected>Select MailChimp field..</option>
@@ -21,7 +21,7 @@
21
  </p>
22
 
23
  <p class="row placeholder">
24
- <label for="mc4wp-fw-placeholder">Placeholder <small>(optional, HTML5)</small></label>
25
  <input class="widefat" type="text" id="mc4wp-fw-placeholder" />
26
  </p>
27
 
@@ -30,6 +30,10 @@
30
  <input class="widefat" type="text" id="mc4wp-fw-value" />
31
  </p>
32
 
 
 
 
 
33
  <p class="row wrap-p">
34
  <input type="checkbox" id="mc4wp-fw-wrap-p" value="1" checked />
35
  <label for="mc4wp-fw-wrap-p">Wrap in paragraph (<code>&lt;p&gt;</code>) tags?</label>
@@ -41,11 +45,12 @@
41
  </p>
42
 
43
  <p>
44
- <textarea class="widefat" id="mc4wp-fw-preview" rows="5"></textarea>
45
  </p>
46
 
47
  <p>
48
- <input class="button button-large" type="button" id="mc4wp-fw-add-to-form" value="&laquo; add to form" />
 
49
  </p>
50
 
51
  </div>
1
  <div id="mc4wp-fw" class="mc4wp-well">
2
 
3
  <h4>Add a new field</h4>
4
+ <p>Use the tool below to generate the HTML for your form fields.</p>
5
  <p>
6
  <select class="widefat" id="mc4wp-fw-mailchimp-fields">
7
  <option class="default" value="" disabled selected>Select MailChimp field..</option>
21
  </p>
22
 
23
  <p class="row placeholder">
24
+ <label for="mc4wp-fw-placeholder">Placeholder <small>(optional)</small></label>
25
  <input class="widefat" type="text" id="mc4wp-fw-placeholder" />
26
  </p>
27
 
30
  <input class="widefat" type="text" id="mc4wp-fw-value" />
31
  </p>
32
 
33
+ <p class="row values" id="mc4wp-fw-values">
34
+ <label for="mc4wp-fw-values">Value labels <small>(leave empty to hide)</small></label>
35
+ </p>
36
+
37
  <p class="row wrap-p">
38
  <input type="checkbox" id="mc4wp-fw-wrap-p" value="1" checked />
39
  <label for="mc4wp-fw-wrap-p">Wrap in paragraph (<code>&lt;p&gt;</code>) tags?</label>
45
  </p>
46
 
47
  <p>
48
+ <input class="button button-large" type="button" id="mc4wp-fw-add-to-form" value="&laquo; add to form" />
49
  </p>
50
 
51
  <p>
52
+ <label for="mc4wp-fw-preview">Generated HTML</label>
53
+ <textarea class="widefat" id="mc4wp-fw-preview" rows="5"></textarea>
54
  </p>
55
 
56
  </div>
includes/views/parts/admin-footer.php CHANGED
@@ -1,3 +1,3 @@
1
  <br style="clear:both;" />
2
  <p class="copyright-notice">This plugin is not developed by or affiliated with MailChimp in any way.</p>
3
- <p class="copyright-notice">Enjoying this plugin? <a href="http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=footer-link">Upgrade to MailChimp for WordPress Pro now</a>, you will love it.</p>
1
  <br style="clear:both;" />
2
  <p class="copyright-notice">This plugin is not developed by or affiliated with MailChimp in any way.</p>
3
+ <p class="copyright-notice">Enjoying this plugin? <a href="http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=footer-link">Upgrade to MailChimp for WordPress Pro now</a> for an even better plugin, you will love it.</p>
includes/views/parts/admin-need-support.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="mc4wp-box">
2
  <h3>Looking for support?</h3>
3
  <p>Please use the <a href="http://wordpress.org/support/plugin/mailchimp-for-wp">support forums</a> on WordPress.org. Please do not email me directly as this is reserved for premium users only.</p>
4
- <p>If you need priority support, please <a href="http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=support-link">upgrade to the premium version</a>.</p>
5
  </div>
6
 
7
  <div class="mc4wp-box">
@@ -9,9 +9,10 @@
9
  <p>
10
  </p>
11
  <ul class="ul-square">
12
- <li><a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/mailchimp-for-wp?rate=5#postform">Give a &#9733;&#9733;&#9733;&#9733;&#9733; review on WordPress.org</a></li>
13
  <li><a target="_blank" href="http://twitter.com/?status=Showing%20my%20appreciation%20to%20%40DannyvanKooten%20for%20his%20WordPress%20plugin%3A%20MailChimp%20for%20WP%20%20-%20check%20it%20out!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Fmailchimp-for-wp%2F">Tweet about MailChimp for WP</a></li>
14
- <li>Review the plugin on your blog and link to <a href="http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/">the plugin page</a>.</li>
15
  <li><a target="_blank" href="http://wordpress.org/plugins/mailchimp-for-wp/">Vote "works" on the WordPress.org plugin page</a></li>
16
  </ul>
 
17
  </div>
1
  <div class="mc4wp-box">
2
  <h3>Looking for support?</h3>
3
  <p>Please use the <a href="http://wordpress.org/support/plugin/mailchimp-for-wp">support forums</a> on WordPress.org. Please do not email me directly as this is reserved for premium users only.</p>
4
+ <p>If you need priority support, please <a href="http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=support-link">upgrade to the premium version</a>.</p>
5
  </div>
6
 
7
  <div class="mc4wp-box">
9
  <p>
10
  </p>
11
  <ul class="ul-square">
12
+ <li><a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/mailchimp-for-wp?rate=5#postform">Leave a review on WordPress.org</a></li>
13
  <li><a target="_blank" href="http://twitter.com/?status=Showing%20my%20appreciation%20to%20%40DannyvanKooten%20for%20his%20WordPress%20plugin%3A%20MailChimp%20for%20WP%20%20-%20check%20it%20out!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Fmailchimp-for-wp%2F">Tweet about MailChimp for WP</a></li>
14
+ <li>Review the plugin on your blog and link to <a href="http://dannyvankooten.com/mailchimp-for-wordpress/">the plugin page</a></li>
15
  <li><a target="_blank" href="http://wordpress.org/plugins/mailchimp-for-wp/">Vote "works" on the WordPress.org plugin page</a></li>
16
  </ul>
17
+ <p>Thank you for supporting MailChimp for WordPress, much appreciated!</p>
18
  </div>
includes/views/parts/admin-upgrade-to-pro.php CHANGED
@@ -3,7 +3,7 @@
3
 
4
  <p><em>This plugin comes with a premium version, you will love it.</em></p>
5
 
6
- <p>Better forms, easier styling and statistics. Just a few of the many benefits of upgrading.</p>
7
 
8
- <p><a href="http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=upgrade-box">More information about MailChimp for WP Pro &raquo;</a></p>
9
  </div>
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
 
8
+ <p><a href="http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=lite-plugin&utm_medium=link&utm_campaign=upgrade-box">More information about MailChimp for WP Pro &raquo;</a></p>
9
  </div>
mailchimp-for-wp.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: MailChimp for WordPress
4
- Plugin URI: http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/
5
- Description: Lite version of MailChimp for WordPress. Add various sign-up methods to your WordPress website. Show a sign-up form in your posts, pages or text widgets. Add a sign-up checkbox to various forms, like your comment form. <a href="http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/">Premium features include (multiple) AJAX powered forms, a form designer, an unlocked field wizard and much more.</a>
6
- Version: 1.3.1
7
  Author: Danny van Kooten
8
  Author URI: http://dannyvanKooten.com
9
  License: GPL v3
@@ -25,7 +25,7 @@ You should have received a copy of the GNU General Public License
25
  along with this program. If not, see <http://www.gnu.org/licenses/>.
26
  */
27
 
28
- define("MC4WP_LITE_VERSION", "1.3.1");
29
  define("MC4WP_LITE_PLUGIN_DIR", plugin_dir_path(__FILE__));
30
 
31
  if(!function_exists('is_plugin_active')) {
1
  <?php
2
  /*
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
7
  Author: Danny van Kooten
8
  Author URI: http://dannyvanKooten.com
9
  License: GPL v3
25
  along with this program. If not, see <http://www.gnu.org/licenses/>.
26
  */
27
 
28
+ define("MC4WP_LITE_VERSION", "1.4");
29
  define("MC4WP_LITE_PLUGIN_DIR", plugin_dir_path(__FILE__));
30
 
31
  if(!function_exists('is_plugin_active')) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -16,12 +16,12 @@ The best MailChimp plugin to get more email subscribers. Easily add sign-up form
16
 
17
  Looking to get more email subscribers for your MailChimp lists? This plugin will be a BIG help by adding sign-up forms and sign-up checkboxes to your WordPress website.
18
 
19
- Easily build sign-up forms and display them in your posts, pages and widget areas.
20
 
21
  Add "sign up to our newsletter" checkboxes to your comment form, contact forms or any form you like, making subscribing to your list(s) effortless for your visitors.
22
 
23
  > MailChimp for WP comes with a premium version which gives you better forms, easier styling and detailed statistics.
24
- > *[Upgrade now >>](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=first-link)*
25
 
26
  **Plugin Features**
27
 
@@ -36,7 +36,7 @@ Add "sign up to our newsletter" checkboxes to your comment form, contact forms o
36
 
37
  The premium version comes with better and unlimited forms, easier form styling, an unlocked field wizard, detailed statistics and priority support.
38
 
39
- [More information](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link) | [Screenshots](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/screenshots/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link) | [Demo](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link) | [Upgrade now >>](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link)
40
 
41
  = Sign-Up Forms =
42
  This plugin comes with an easy but flexible way to build sign-up forms for your MailChimp lists.
@@ -76,7 +76,7 @@ Check out more [WordPress plugins](http://dannyvankooten.com/wordpress-plugins/?
76
  1. Show the form in your widget areas by using the widget.
77
 
78
  = Upgrade to Pro =
79
- If you like the plugin, upgrade to [MailChimp for WordPress Pro](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=installation-instructions-link) for an even better plugin.
80
 
81
  == Frequently Asked Questions ==
82
 
@@ -89,7 +89,7 @@ Yes, there is and you will love it. Some Pro features are:
89
  1. Easily add *all* your MailChimp list fields to your forms using the add-field tool.
90
  1. Priority support
91
 
92
- [More information](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) | [Screenshots](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/screenshots/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) | [Demo](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link)
93
 
94
  = How to display a form in posts or pages? =
95
  Use the `[mc4wp_form]` shortcode.
@@ -120,7 +120,7 @@ You can use CSS rules to style the sign-up form, use the following CSS selectors
120
 
121
  Add your custom CSS rules to the end of your theme stylesheet, **/wp-content/themes/your-theme-name/style.css**. Do not add them to the plugin stylesheet as they will be automatically overwritten on the next plugin update.
122
 
123
- [PS: With the Pro version, you can design beautiful forms without touching any code >>](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/)
124
 
125
  = Where can I find my MailChimp API key? =
126
  [Here](http://kb.mailchimp.com/article/where-can-i-find-my-api-key)
@@ -169,6 +169,9 @@ Or, if you want to use a hidden field...
169
  = I don't see new subscribers but they are still added to my list =
170
  When you have double opt-in disabled, new subscribers will be seen as *imports* by MailChimp. They will not show up in your daily digest emails or statistics. My recommendation is to leave double opt-in enabled.
171
 
 
 
 
172
  = Why does the checkbox not show up at my comment form? =
173
  Your theme probably does not support the necessary comment hook this plugin uses to add the checkbox to your comment form. You can manually place the checkbox by placing the following code snippet inside the form tags of your theme's comment form.
174
 
@@ -181,14 +184,21 @@ Your theme folder can be found by browsing to `/wp-content/themes/your-theme-nam
181
  1. **Premium only:** Design beautiful sign-up forms using the form CSS designer.
182
  2. Add a sign-up checkbox to various places on your website.
183
  3. An example sign-up checkbox.
184
- 4. An example sign-up form in my footer on dannyvankooten.com. More [MailChimp sign-up form examples](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=screenshots-link) are available on my website.
185
  5. **Premium only:** Create multiple AJAX powered sign-up forms.
186
  6. **Premium only:** Use the field wizard to easily add advanced fields to your form mark-up. You don't have to write any HTML, if you want.
187
- 7. **Premium only:** Gain valuable insights which method your visitors used to subscribe for any given time period using beautiful line charts. [Upgrade to the premium version now.](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=screenshots-link)
188
 
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
192
  = 1.3.1 - October 20, 2013 =
193
  * Fixed: bug when calling MailChimp API for PHP 5.2
194
  * Improved: better default form CSS
@@ -283,7 +293,7 @@ Your theme folder can be found by browsing to `/wp-content/themes/your-theme-nam
283
 
284
  = 0.8.3 =
285
  * Added: Guess first and last name when only using full name field.
286
- * Added: Links to [MailChimp for WordPress Pro](http://dannyvankooten.com/wordpress-plugins/mailchimp-for-wordpress/)
287
  * Fixed: Bug where options could not be saved after adding specific HTML tags to the form mark-up.
288
 
289
  = 0.8.2 =
@@ -371,8 +381,12 @@ Your theme folder can be found by browsing to `/wp-content/themes/your-theme-nam
371
 
372
  == Upgrade Notice ==
373
 
 
 
 
374
  = 1.2.5 =
375
  Fixed CSS issue where the form caused a hue gap in the sidebar for some themes.
376
 
377
  = 1.1.1 =
378
- Bugfix for BuddyPress sites
 
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
7
+ Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
16
 
17
  Looking to get more email subscribers for your MailChimp lists? This plugin will be a BIG help by adding sign-up forms and sign-up checkboxes to your WordPress website.
18
 
19
+ Easily build beautiful sign-up forms and display them in your posts, pages and widget areas.
20
 
21
  Add "sign up to our newsletter" checkboxes to your comment form, contact forms or any form you like, making subscribing to your list(s) effortless for your visitors.
22
 
23
  > MailChimp for WP comes with a premium version which gives you better forms, easier styling and detailed statistics.
24
+ > *[Upgrade now >>](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=first-link)*
25
 
26
  **Plugin Features**
27
 
36
 
37
  The premium version comes with better and unlimited forms, easier form styling, an unlocked field wizard, detailed statistics and priority support.
38
 
39
+ [More information](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link) | [Demo](http://dannyvankooten.com/mailchimp-for-wordpress/demo/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link) | [Upgrade now >>](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-link)
40
 
41
  = Sign-Up Forms =
42
  This plugin comes with an easy but flexible way to build sign-up forms for your MailChimp lists.
76
  1. Show the form in your widget areas by using the widget.
77
 
78
  = Upgrade to Pro =
79
+ If you like the plugin, upgrade to [MailChimp for WordPress Pro](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=installation-instructions-link) for an even better plugin.
80
 
81
  == Frequently Asked Questions ==
82
 
89
  1. Easily add *all* your MailChimp list fields to your forms using the add-field tool.
90
  1. Priority support
91
 
92
+ [More information](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link) | [Demo](http://dannyvankooten.com/mailchimp-for-wordpress/demo/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-link)
93
 
94
  = How to display a form in posts or pages? =
95
  Use the `[mc4wp_form]` shortcode.
120
 
121
  Add your custom CSS rules to the end of your theme stylesheet, **/wp-content/themes/your-theme-name/style.css**. Do not add them to the plugin stylesheet as they will be automatically overwritten on the next plugin update.
122
 
123
+ [PS: With the Pro version, you can design beautiful forms without touching any code >>](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-css-link)
124
 
125
  = Where can I find my MailChimp API key? =
126
  [Here](http://kb.mailchimp.com/article/where-can-i-find-my-api-key)
169
  = I don't see new subscribers but they are still added to my list =
170
  When you have double opt-in disabled, new subscribers will be seen as *imports* by MailChimp. They will not show up in your daily digest emails or statistics. My recommendation is to leave double opt-in enabled.
171
 
172
+ = Can I add more (hidden) fields to the sign-up checkbox? =
173
+ Not at the moment, but you can add more data using a filter. Here is a code snippet to [add grouping information to comment form sign-ups](https://gist.github.com/dannyvankooten/7120559).
174
+
175
  = Why does the checkbox not show up at my comment form? =
176
  Your theme probably does not support the necessary comment hook this plugin uses to add the checkbox to your comment form. You can manually place the checkbox by placing the following code snippet inside the form tags of your theme's comment form.
177
 
184
  1. **Premium only:** Design beautiful sign-up forms using the form CSS designer.
185
  2. Add a sign-up checkbox to various places on your website.
186
  3. An example sign-up checkbox.
187
+ 4. An example sign-up form in my footer on dannyvankooten.com. More [MailChimp sign-up form examples](http://dannyvankooten.com/mailchimp-for-wordpress/demo-sign-up-forms/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=screenshots-link) are available on my website.
188
  5. **Premium only:** Create multiple AJAX powered sign-up forms.
189
  6. **Premium only:** Use the field wizard to easily add advanced fields to your form mark-up. You don't have to write any HTML, if you want.
190
+ 7. **Premium only:** Gain valuable insights which method your visitors used to subscribe for any given time period using beautiful line charts. [Upgrade to the premium version now.](http://dannyvankooten.com/mailchimp-for-wordpress/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=screenshots-link)
191
 
192
 
193
  == Changelog ==
194
 
195
+ = 1.4 - October 28, 2013 =
196
+ * Added: default form CSS themes, choose between light, red, green, blue or dark form styling.
197
+ * Added: filter to add more variables to Checkbox Sign-Ups.
198
+ * Improved: more fields unlocked in "add field" tool when editing forms.
199
+ * Improved: smarter auto-detection of name fields when integrating with third-party forms like Contact Form 7
200
+ * Changed: links point to new [MailChimp for WordPress](http://dannyvankooten.com/mailchimp-for-wordpress/) page now.
201
+
202
  = 1.3.1 - October 20, 2013 =
203
  * Fixed: bug when calling MailChimp API for PHP 5.2
204
  * Improved: better default form CSS
293
 
294
  = 0.8.3 =
295
  * Added: Guess first and last name when only using full name field.
296
+ * Added: Links to [MailChimp for WordPress Pro](http://dannyvankooten.com/mailchimp-for-wordpress/)
297
  * Fixed: Bug where options could not be saved after adding specific HTML tags to the form mark-up.
298
 
299
  = 0.8.2 =
381
 
382
  == Upgrade Notice ==
383
 
384
+ = 1.4 =
385
+ New: default form themes, more unlocked fields in the "add field" tool and smarter auto-detection of name fields when integrating with Contact Form 7.
386
+
387
  = 1.2.5 =
388
  Fixed CSS issue where the form caused a hue gap in the sidebar for some themes.
389
 
390
  = 1.1.1 =
391
+ Bugfix for BuddyPress sites
392
+