MailChimp List Subscribe Form - Version 1.5.3

Version Description

  • Fix PHP7 compatibility issue
  • Cut down on size of API requests for users with large lists.
  • Fix CSS issue on removing MailChimp style.
Download this release

Release Info

Developer MailChimp
Plugin Icon wp plugin MailChimp List Subscribe Form
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.3

README.md CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: crowdfavorite
3
  Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
4
  Requires at least: 2.8
5
- Tested up to: 4.5
6
  Stable tag: 1.5
7
 
8
  == Description ==
2
  Contributors: crowdfavorite
3
  Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
4
  Requires at least: 2.8
5
+ Tested up to: 4.0
6
  Stable tag: 1.5
7
 
8
  == Description ==
bin/install-wp-tests.sh ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ if [ $# -lt 3 ]; then
4
+ echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
5
+ exit 1
6
+ fi
7
+
8
+ DB_NAME=$1
9
+ DB_USER=$2
10
+ DB_PASS=$3
11
+ DB_HOST=${4-localhost}
12
+ WP_VERSION=${5-latest}
13
+
14
+ WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
15
+ WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/}
16
+
17
+ download() {
18
+ if [ `which curl` ]; then
19
+ curl -s "$1" > "$2";
20
+ elif [ `which wget` ]; then
21
+ wget -nv -O "$2" "$1"
22
+ fi
23
+ }
24
+
25
+ if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
26
+ WP_TESTS_TAG="tags/$WP_VERSION"
27
+ elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
28
+ WP_TESTS_TAG="trunk"
29
+ else
30
+ # http serves a single offer, whereas https serves multiple. we only want one
31
+ download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
32
+ grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
33
+ LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
34
+ if [[ -z "$LATEST_VERSION" ]]; then
35
+ echo "Latest WordPress version could not be found"
36
+ exit 1
37
+ fi
38
+ WP_TESTS_TAG="tags/$LATEST_VERSION"
39
+ fi
40
+
41
+ set -ex
42
+
43
+ install_wp() {
44
+
45
+ if [ -d $WP_CORE_DIR ]; then
46
+ return;
47
+ fi
48
+
49
+ mkdir -p $WP_CORE_DIR
50
+
51
+ if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
52
+ mkdir -p /tmp/wordpress-nightly
53
+ download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip
54
+ unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/
55
+ mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR
56
+ else
57
+ if [ $WP_VERSION == 'latest' ]; then
58
+ local ARCHIVE_NAME='latest'
59
+ else
60
+ local ARCHIVE_NAME="wordpress-$WP_VERSION"
61
+ fi
62
+ download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
63
+ tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
64
+ fi
65
+
66
+ download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
67
+ }
68
+
69
+ install_test_suite() {
70
+ # portable in-place argument for both GNU sed and Mac OSX sed
71
+ if [[ $(uname -s) == 'Darwin' ]]; then
72
+ local ioption='-i .bak'
73
+ else
74
+ local ioption='-i'
75
+ fi
76
+
77
+ # set up testing suite if it doesn't yet exist
78
+ if [ ! -d $WP_TESTS_DIR ]; then
79
+ # set up testing suite
80
+ mkdir -p $WP_TESTS_DIR
81
+ svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
82
+ fi
83
+
84
+ if [ ! -f wp-tests-config.php ]; then
85
+ download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
86
+ sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php
87
+ sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
88
+ sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
89
+ sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
90
+ sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
91
+ fi
92
+
93
+ }
94
+
95
+ install_db() {
96
+ # parse DB_HOST for port or socket references
97
+ local PARTS=(${DB_HOST//\:/ })
98
+ local DB_HOSTNAME=${PARTS[0]};
99
+ local DB_SOCK_OR_PORT=${PARTS[1]};
100
+ local EXTRA=""
101
+
102
+ if ! [ -z $DB_HOSTNAME ] ; then
103
+ if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
104
+ EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
105
+ elif ! [ -z $DB_SOCK_OR_PORT ] ; then
106
+ EXTRA=" --socket=$DB_SOCK_OR_PORT"
107
+ elif ! [ -z $DB_HOSTNAME ] ; then
108
+ EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
109
+ fi
110
+ fi
111
+
112
+ # create database
113
+ mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
114
+ }
115
+
116
+ install_wp
117
+ install_test_suite
118
+ install_db
lib/mailchimp/mailchimp.php CHANGED
@@ -18,11 +18,21 @@ class MailChimp_API {
18
  return;
19
  }
20
 
21
- public function get($endpoint, $count=10) {
22
  $url = $this->api_url . $endpoint;
23
 
24
  if($count) {
25
- $url .= '?count=' . $count;
 
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
  $args = array(
@@ -68,7 +78,19 @@ class MailChimp_API {
68
  }
69
 
70
  $body = json_decode($request['body'], true);
71
- return new WP_Error('mc-subscribe-error-api', $body['detail']);
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
  }
74
  }
18
  return;
19
  }
20
 
21
+ public function get($endpoint, $count=10, $fields) {
22
  $url = $this->api_url . $endpoint;
23
 
24
  if($count) {
25
+ $query_params = 'count=' . $count . '&';
26
+ }
27
+
28
+ if(!empty($fields)) {
29
+ foreach($fields as $field => $value) {
30
+ $query_params .= $field . '=' . $value . '&';
31
+ }
32
+ }
33
+
34
+ if($query_params){
35
+ $url .= "?{$query_params}";
36
  }
37
 
38
  $args = array(
78
  }
79
 
80
  $body = json_decode($request['body'], true);
81
+ $merges = get_option('mc_merge_vars');
82
+ foreach ($merges as $merge) {
83
+ if (empty($body['errors'])) {
84
+ //Email address doesn't come back from the API, so if something's wrong, it's that.
85
+ $field_name = 'Email Address';
86
+ $body['errors'][0]['message'] = 'Please fill out a valid email address.';
87
+ }
88
+ elseif ($merge['tag'] == $body['errors'][0]['field']) {
89
+ $field_name = $merge['name'];
90
+ }
91
+ }
92
+ $message = sprintf($field_name . ": " . $body['errors'][0]['message']);
93
+ return new WP_Error('mc-subscribe-error-api', $message);
94
  }
95
  }
96
  }
lib/sopresto/sopresto.php DELETED
@@ -1,355 +0,0 @@
1
- <?php
2
-
3
- class Sopresto_MailChimp {
4
- const DEFAULT_VERSION = '2.0';
5
- var $errorMessage = '';
6
- var $errorCode = 0;
7
-
8
- var $apiUrl;
9
- var $version;
10
- var $public;
11
- var $secret;
12
- var $timeout = 300;
13
- var $chunkSize = 8192;
14
- var $secure = false;
15
-
16
- function __construct($public, $secret, $version = self::DEFAULT_VERSION) {
17
- $this->public = $public;
18
- $this->secret = $secret;
19
- $this->apiUrl = parse_url('https://sopresto.socialize-this.com/mailchimp/');
20
- $this->setVersion($version);
21
- }
22
-
23
- function getApiUrl($uri = '') {
24
- return $this->apiUrl['scheme'].'://'.$this->apiUrl['host'].$this->apiUrl['path'] . '/' . $uri;
25
- }
26
-
27
- function setVersion($version = self::DEFAULT_VERSION) {
28
- if ( !in_array($version, array('1.3', '2.0') ) ) $version = self::DEFAULT_VERSION;
29
- $this->version = $version;
30
- }
31
-
32
- function __call($method, $params) {
33
- if ( $this->version == '2.0' ) {
34
- list($module, $method) = explode('_', $method, 2);
35
- $method = str_replace('_','-',$method);
36
-
37
- $method = "$module/$method";
38
- }
39
-
40
- $this->errorMessage = '';
41
- $this->errorCode = 0;
42
-
43
- $public = $this->public;
44
- $secret = $this->secret;
45
-
46
- //some distribs change this to &amp; by default
47
- $sep_changed = false;
48
- if (ini_get("arg_separator.output") != "&"){
49
- $sep_changed = true;
50
- $orig_sep = ini_get("arg_separator.output");
51
- ini_set("arg_separator.output", "&");
52
- }
53
-
54
- //mutate params
55
- $mutate = array();
56
- foreach($params as $k=>$v){
57
- $mutate[$this->function_map[$this->version][$method][$k]] = $v;
58
- }
59
- if ( $this->version != self::DEFAULT_VERSION) $method = $this->version . "/$method";
60
-
61
- $post_vars = array();
62
- $post_vars['api'] = $method;
63
- $post_vars['public_key'] = $public;
64
- $post_vars['hash'] = sha1($public.$secret);
65
- $post_vars['params'] = $mutate;
66
- //return $post_vars;
67
- $post_vars = http_build_query($post_vars);
68
-
69
- if ($sep_changed) ini_set("arg_separator.output", $orig_sep);
70
-
71
-
72
- $payload = "POST " . $this->apiUrl["path"] . " HTTP/1.0\r\n";
73
- $payload .= "Host: " . $this->apiUrl["host"] . "\r\n";
74
- $payload .= "User-Agent: Sopresto_MailChimp/1.0\r\n";
75
- $payload .= "Content-type: application/x-www-form-urlencoded\r\n";
76
- $payload .= "Content-length: " . strlen($post_vars) . "\r\n";
77
- $payload .= "Connection: close \r\n\r\n";
78
- $payload .= $post_vars;
79
-
80
- ob_start();
81
- if ($this->secure){
82
- $sock = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
83
- } else {
84
- $sock = fsockopen($this->apiUrl["host"], 80, $errno, $errstr, 30);
85
- }
86
- if(!$sock) {
87
- $this->errorMessage = "Could not connect (ERR $errno: $errstr)";
88
- $this->errorCode = "-99";
89
- ob_end_clean();
90
- return false;
91
- }
92
-
93
- $response = "";
94
- fwrite($sock, $payload);
95
- stream_set_timeout($sock, $this->timeout);
96
- $info = stream_get_meta_data($sock);
97
- while ((!feof($sock)) && (!$info["timed_out"])) {
98
- $response .= fread($sock, $this->chunkSize);
99
- $info = stream_get_meta_data($sock);
100
- }
101
- fclose($sock);
102
- ob_end_clean();
103
-
104
- if ($info["timed_out"]) {
105
- $this->errorMessage = "Could not read response (timed out)";
106
- $this->errorCode = -98;
107
- return false;
108
- }
109
-
110
- list($headers, $response) = explode("\r\n\r\n", $response, 2);
111
- $headers = explode("\r\n", $headers);
112
-
113
- if(ini_get("magic_quotes_runtime")) $response = stripslashes($response);
114
-
115
- $serial = json_decode($response,true);
116
- if($response && $serial === false) {
117
- $response = array("error" => "Bad Response. Got This: " . $response, "code" => "-99");
118
- } else {
119
- $response = $serial;
120
- }
121
-
122
- if ( $this->version == '2.0' ) {
123
- if ( is_array($response) && isset($response['response']['errors'][0]['code']) && $response['response']['errors'][0]['code'] ) {
124
- $this->errorMessage = $response['response']['errors'][0]['error'];
125
- $this->errorCode = $response['response']['errors'][0]['code'];
126
- return false;
127
- }
128
- } else {
129
- if (is_array($response) && isset($response["result"]) && $response["result"] == 'error') {
130
- list($code, $message) = explode('||',$response['response'],2);
131
- $this->errorMessage = $message;
132
- $this->errorCode = $code;
133
- return false;
134
- }
135
- }
136
- return $response['response'];
137
- }
138
-
139
- protected $function_map = array(
140
- '2.0' => array(
141
- 'campaigns/content'=>array('cid', 'options'),
142
- 'campaigns/create'=>array('type', 'options', 'content', 'segment_opts', 'type_opts'),
143
- 'campaigns/delete'=>array('cid'),
144
- 'campaigns/list'=>array('filters', 'start', 'limit', 'sort_field', 'sort_dir'),
145
- 'campaigns/pause'=>array('cid'),
146
- 'campaigns/ready'=>array('cid'),
147
- 'campaigns/replicate'=>array('cid'),
148
- 'campaigns/resume'=>array('cid'),
149
- 'campaigns/schedule-batch'=>array('cid', 'schedule_time', 'num_batches', 'stagger_mins'),
150
- 'campaigns/schedule'=>array('cid', 'schedule_time', 'schedule_time_b'),
151
- 'campaigns/segment-test'=>array('list_id', 'options'),
152
- 'campaigns/send'=>array('cid'),
153
- 'campaigns/send-test'=>array('cid', 'test_emails', 'send_type'),
154
- 'campaigns/template-content'=>array('cid'),
155
- 'campaigns/unschedule'=>array('cid'),
156
- 'campaigns/update'=>array('cid', 'name', 'value'),
157
- 'ecomm/order-add'=>array('order'),
158
- 'ecomm/order-del'=>array('store_id', 'order_id'),
159
- 'ecomm/orders'=>array('cid', 'start', 'limit', 'since'),
160
- 'folders/add'=>array('name', 'type'),
161
- 'folders/del'=>array('fid', 'type'),
162
- 'folders/list'=>array('type'),
163
- 'folders/update'=>array('fid', 'name', 'type'),
164
- 'gallery/list'=>array('opts'),
165
- 'lists/abuse-reports'=>array('id', 'start', 'limit', 'since'),
166
- 'lists/activity'=>array('id'),
167
- 'lists/batch-subscribe'=>array('id', 'batch', 'double_optin', 'update_existing', 'replace_interests'),
168
- 'lists/batch-unsubscribe'=>array('id', 'batch', 'delete_member', 'send_goodbye', 'send_notify'),
169
- 'lists/clients'=>array('id'),
170
- 'lists/growth-history'=>array('id'),
171
- 'lists/interest-group-add'=>array('id', 'group_name', 'grouping_id'),
172
- 'lists/interest-group-del'=>array('id', 'group_name', 'grouping_id'),
173
- 'lists/interest-group-update'=>array('id', 'old_name', 'new_name', 'grouping_id'),
174
- 'lists/interest-grouping-add'=>array('id', 'name', 'type', 'groups'),
175
- 'lists/interest-grouping-del'=>array('grouping_id'),
176
- 'lists/interest-grouping-update'=>array('grouping_id', 'name', 'value'),
177
- 'lists/interest-groupings'=>array('id', 'counts'),
178
- 'lists/list'=>array('filters', 'start', 'limit', 'sort_field', 'sort_dir'),
179
- 'lists/locations'=>array('id'),
180
- 'lists/member-activity'=>array('id', 'emails'),
181
- 'lists/member-info'=>array('id', 'emails'),
182
- 'lists/members'=>array('id', 'status', 'opts'),
183
- 'lists/merge-var-add'=>array('id', 'tag', 'name', 'options'),
184
- 'lists/merge-var-del'=>array('id', 'tag'),
185
- 'lists/merge-var-reset'=>array('id', 'tag'),
186
- 'lists/merge-var-set'=>array('id', 'tag', 'value'),
187
- 'lists/merge-var-update'=>array('id', 'tag', 'options'),
188
- 'lists/merge-vars'=>array('id'),
189
- 'lists/static-segment-add'=>array('id', 'name'),
190
- 'lists/static-segment-del'=>array('id', 'seg_id'),
191
- 'lists/static-segment-members-add'=>array('id', 'seg_id', 'batch'),
192
- 'lists/static-segment-members-del'=>array('id', 'seg_id', 'batch'),
193
- 'lists/static-segment-reset'=>array('id', 'seg_id'),
194
- 'lists/static-segments'=>array('id'),
195
- 'lists/subscribe'=>array('id', 'email', 'merge_vars', 'email_type', 'double_optin', 'update_existing', 'replace_interests', 'send_welcome'),
196
- 'lists/unsubscribe'=>array('id', 'email', 'delete_member', 'send_goodbye', 'send_notify'),
197
- 'lists/update-member'=>array('id', 'email', 'merge_vars', 'email_type', 'replace_interests'),
198
- 'lists/webhook-add'=>array('id', 'url', 'actions', 'sources'),
199
- 'lists/webhook-del'=>array('id', 'url'),
200
- 'lists/webhooks'=>array('id'),
201
- 'helper/account-details'=>array('exclude'),
202
- 'helper/campaigns-for-email'=>array('email', 'options'),
203
- 'helper/chimp-chatter'=>array(),
204
- 'helper/generate-text'=>array('type', 'content'),
205
- 'helper/inline-css'=>array('html', 'strip_css'),
206
- 'helper/lists-for-email'=>array('email'),
207
- 'helper/ping'=>array(),
208
- 'helper/search-campaigns'=>array('query', 'offset', 'snip_start', 'snip_end'),
209
- 'helper/search-members'=>array('query', 'id', 'offset'),
210
- 'helper/verified-domains'=>array(),
211
- 'reports/abuse'=>array('cid', 'opts'),
212
- 'reports/advice'=>array('cid'),
213
- 'reports/bounce-message'=>array('cid', 'email'),
214
- 'reports/bounce-messages'=>array('cid', 'opts'),
215
- 'reports/click-detail'=>array('cid', 'tid', 'opts'),
216
- 'reports/clicks'=>array('cid'),
217
- 'reports/domain-performance'=>array('cid'),
218
- 'reports/ecomm-orders'=>array('cid', 'opts'),
219
- 'reports/eepurl'=>array('cid'),
220
- 'reports/geo-opens'=>array('cid'),
221
- 'reports/google-analytics'=>array('cid'),
222
- 'reports/member-activity'=>array('cid', 'emails'),
223
- 'reports/not-opened'=>array('cid', 'opts'),
224
- 'reports/opened'=>array('cid', 'opts'),
225
- 'reports/sent-to'=>array('cid', 'opts'),
226
- 'reports/share'=>array('cid', 'opts'),
227
- 'reports/summary'=>array('cid'),
228
- 'reports/unsubscribes'=>array('cid', 'opts'),
229
- 'templates/add'=>array('name', 'html', 'folder_id'),
230
- 'templates/del'=>array('template_id'),
231
- 'templates/info'=>array('template_id', 'type'),
232
- 'templates/list'=>array('types', 'filters'),
233
- 'templates/undel'=>array('template_id'),
234
- 'templates/update'=>array('template_id', 'values'),
235
- 'users/invite'=>array('email', 'role', 'msg'),
236
- 'users/invite-resend'=>array('email'),
237
- 'users/invite-revoke'=>array('email'),
238
- 'users/invites'=>array(),
239
- 'users/login-revoke'=>array('username'),
240
- 'users/logins'=>array(),
241
- 'vip/activity'=>array(),
242
- 'vip/add'=>array('id', 'emails'),
243
- 'vip/del'=>array('id', 'emails'),
244
- 'vip/members'=>array()
245
- ),
246
- '1.3' => array(
247
- 'campaignUnschedule'=>array("cid"),
248
- 'campaignSchedule'=>array("cid","schedule_time","schedule_time_b"),
249
- 'campaignScheduleBatch'=>array("cid","schedule_time","num_batches","stagger_mins"),
250
- 'campaignResume'=>array("cid"),
251
- 'campaignPause'=>array("cid"),
252
- 'campaignSendNow'=>array("cid"),
253
- 'campaignSendTest'=>array("cid","test_emails","send_type"),
254
- 'campaignSegmentTest'=>array("list_id","options"),
255
- 'campaignCreate'=>array("type","options","content","segment_opts","type_opts"),
256
- 'campaignUpdate'=>array("cid","name","value"),
257
- 'campaignReplicate'=>array("cid"),
258
- 'campaignDelete'=>array("cid"),
259
- 'campaigns'=>array("filters","start","limit","sort_field","sort_dir"),
260
- 'campaignStats'=>array("cid"),
261
- 'campaignClickStats'=>array("cid"),
262
- 'campaignEmailDomainPerformance'=>array("cid"),
263
- 'campaignMembers'=>array("cid","status","start","limit"),
264
- 'campaignHardBounces'=>array("cid","start","limit"),
265
- 'campaignSoftBounces'=>array("cid","start","limit"),
266
- 'campaignUnsubscribes'=>array("cid","start","limit"),
267
- 'campaignAbuseReports'=>array("cid","since","start","limit"),
268
- 'campaignAdvice'=>array("cid"),
269
- 'campaignAnalytics'=>array("cid"),
270
- 'campaignGeoOpens'=>array("cid"),
271
- 'campaignGeoOpensForCountry'=>array("cid","code"),
272
- 'campaignEepUrlStats'=>array("cid"),
273
- 'campaignBounceMessage'=>array("cid","email"),
274
- 'campaignBounceMessages'=>array("cid","start","limit","since"),
275
- 'campaignEcommOrders'=>array("cid","start","limit","since"),
276
- 'campaignShareReport'=>array("cid","opts"),
277
- 'campaignContent'=>array("cid","for_archive"),
278
- 'campaignTemplateContent'=>array("cid"),
279
- 'campaignOpenedAIM'=>array("cid","start","limit"),
280
- 'campaignNotOpenedAIM'=>array("cid","start","limit"),
281
- 'campaignClickDetailAIM'=>array("cid","url","start","limit"),
282
- 'campaignEmailStatsAIM'=>array("cid","email_address"),
283
- 'campaignEmailStatsAIMAll'=>array("cid","start","limit"),
284
- 'campaignEcommOrderAdd'=>array("order"),
285
- 'lists'=>array("filters","start","limit","sort_field","sort_dir"),
286
- 'listMergeVars'=>array("id"),
287
- 'listMergeVarAdd'=>array("id","tag","name","options"),
288
- 'listMergeVarUpdate'=>array("id","tag","options"),
289
- 'listMergeVarDel'=>array("id","tag"),
290
- 'listMergeVarReset'=>array("id","tag"),
291
- 'listInterestGroupings'=>array("id"),
292
- 'listInterestGroupAdd'=>array("id","group_name","grouping_id"),
293
- 'listInterestGroupDel'=>array("id","group_name","grouping_id"),
294
- 'listInterestGroupUpdate'=>array("id","old_name","new_name","grouping_id"),
295
- 'listInterestGroupingAdd'=>array("id","name","type","groups"),
296
- 'listInterestGroupingUpdate'=>array("grouping_id","name","value"),
297
- 'listInterestGroupingDel'=>array("grouping_id"),
298
- 'listWebhooks'=>array("id"),
299
- 'listWebhookAdd'=>array("id","url","actions","sources"),
300
- 'listWebhookDel'=>array("id","url"),
301
- 'listStaticSegments'=>array("id"),
302
- 'listStaticSegmentAdd'=>array("id","name"),
303
- 'listStaticSegmentReset'=>array("id","seg_id"),
304
- 'listStaticSegmentDel'=>array("id","seg_id"),
305
- 'listStaticSegmentMembersAdd'=>array("id","seg_id","batch"),
306
- 'listStaticSegmentMembersDel'=>array("id","seg_id","batch"),
307
- 'listSubscribe'=>array("id","email_address","merge_vars","email_type","double_optin","update_existing","replace_interests","send_welcome"),
308
- 'listUnsubscribe'=>array("id","email_address","delete_member","send_goodbye","send_notify"),
309
- 'listUpdateMember'=>array("id","email_address","merge_vars","email_type","replace_interests"),
310
- 'listBatchSubscribe'=>array("id","batch","double_optin","update_existing","replace_interests"),
311
- 'listBatchUnsubscribe'=>array("id","emails","delete_member","send_goodbye","send_notify"),
312
- 'listMembers'=>array("id","status","since","start","limit","sort_dir"),
313
- 'listMemberInfo'=>array("id","email_address"),
314
- 'listMemberActivity'=>array("id","email_address"),
315
- 'listAbuseReports'=>array("id","start","limit","since"),
316
- 'listGrowthHistory'=>array("id"),
317
- 'listActivity'=>array("id"),
318
- 'listLocations'=>array("id"),
319
- 'listClients'=>array("id"),
320
- 'templates'=>array("types","category","inactives"),
321
- 'templateInfo'=>array("tid","type"),
322
- 'templateAdd'=>array("name","html"),
323
- 'templateUpdate'=>array("id","values"),
324
- 'templateDel'=>array("id"),
325
- 'templateUndel'=>array("id"),
326
- 'getAccountDetails'=>array("exclude"),
327
- 'getVerifiedDomains'=>array(),
328
- 'generateText'=>array("type","content"),
329
- 'inlineCss'=>array("html","strip_css"),
330
- 'folders'=>array("type"),
331
- 'folderAdd'=>array("name","type"),
332
- 'folderUpdate'=>array("fid","name","type"),
333
- 'folderDel'=>array("fid","type"),
334
- 'ecommOrders'=>array("start","limit","since"),
335
- 'ecommOrderAdd'=>array("order"),
336
- 'ecommOrderDel'=>array("store_id","order_id"),
337
- 'listsForEmail'=>array("email_address"),
338
- 'campaignsForEmail'=>array("email_address","options"),
339
- 'chimpChatter'=>array(),
340
- 'searchMembers'=>array("query","id","offset"),
341
- 'searchCampaigns'=>array("query","offset","snip_start","snip_end"),
342
- 'apikeys'=>array("username","password","expired"),
343
- 'apikeyAdd'=>array("username","password"),
344
- 'apikeyExpire'=>array("username","password"),
345
- 'ping'=>array(),
346
- 'deviceRegister'=>array("mobile_key","details"),
347
- 'deviceUnregister'=>array("mobile_key","device_id"),
348
- 'gmonkeyAdd'=>array("id","email_address"),
349
- 'gmonkeyDel'=>array("id","email_address"),
350
- 'gmonkeyMembers'=>array(),
351
- 'gmonkeyActivity'=>array()
352
- )
353
- );
354
- }
355
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/sopresto/test.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- require('sopresto.php');
3
- $public = 'XXX';
4
- $secret = 'YYY';
5
- $version = '1.3'; // or '2.0'
6
-
7
- $sopresto = new Sopresto_MailChimp($public, $secret, $version);
8
-
9
- if ( $version == '2.0' ) {
10
- // First underscore will be changed for a slash.
11
- // Remaning underscores will be changed by a dash
12
- // Ie.- to call 'helper/search-members' you should use $sopresto->helper_search_members()
13
-
14
- $response = $sopresto->campaigns_list(array(), 0, 2);
15
- } else {
16
- $response = $sopresto->campaigns(array(), 0, 2);
17
- }
18
-
19
- print_r($response);
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mailchimp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailChimp
4
  Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
5
  Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
6
- Version: 1.5.1
7
  Author: MailChimp
8
  Author URI: https://mailchimp.com/
9
  */
@@ -25,7 +25,7 @@ Author URI: https://mailchimp.com/
25
  */
26
 
27
  // Version constant for easy CSS refreshes
28
- define('MCSF_VER', '1.5.1');
29
 
30
  // What's our permission (capability) threshold
31
  define('MCSF_CAP_THRESHOLD', 'manage_options');
@@ -62,9 +62,14 @@ function mailchimpSF_plugin_init() {
62
  // Check for mc_api_key or sopresto key and continue if neither
63
  mailchimpSF_migrate_sopresto();
64
 
 
 
 
 
65
  // Bring in our appropriate JS and CSS resources
66
  mailchimpSF_load_resources();
67
  }
 
68
  add_action( 'init', 'mailchimpSF_plugin_init' );
69
 
70
 
@@ -104,12 +109,13 @@ function mailchimpSF_load_resources() {
104
 
105
  if (get_option('mc_use_datepicker') == 'on' && !is_admin()) {
106
  // Datepicker theme
107
- wp_enqueue_style('flick', MCSF_URL.'/css/flick/flick.css');
 
108
  // Datepicker JS
109
  wp_enqueue_script('datepicker', MCSF_URL.'/js/datepicker.js', array('jquery','jquery-ui-core'));
110
  }
111
 
112
- if(get_option('mc_nuke_all_styles') !== true) {
113
  wp_enqueue_style('mailchimpSF_main_css', home_url('?mcsf_action=main_css&ver='.MCSF_VER, 'relative'));
114
  wp_enqueue_style('mailchimpSF_ie_css', MCSF_URL.'css/ie.css');
115
  global $wp_styles;
@@ -125,7 +131,6 @@ function mailchimpSF_load_resources() {
125
  */
126
  function mc_admin_page_load_resources() {
127
  wp_enqueue_style('mailchimpSF_admin_css', MCSF_URL.'css/admin.css');
128
- wp_enqueue_script('mailchimpSF_admin_js', MCSF_URL.'js/admin.js');
129
  }
130
  add_action('load-settings_page_mailchimpSF_options', 'mc_admin_page_load_resources');
131
 
@@ -230,7 +235,6 @@ function mailchimpSF_request_handler() {
230
  case 'html':
231
  /* Allow to fall through. The widget will pick up the
232
  * global message left over from the signup_submit function */
233
- break;
234
  case 'js':
235
  if (!headers_sent()){ //just in case...
236
  header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', true, 200);
@@ -295,6 +299,13 @@ function mailchimpSF_migrate_sopresto() {
295
  return;
296
  }
297
 
 
 
 
 
 
 
 
298
  function mailchimpSF_auth_nonce_key($salt = null) {
299
  if (is_null($salt)) {
300
  $salt = mailchimpSF_auth_nonce_salt();
@@ -475,6 +486,17 @@ function mailchimpSF_save_general_form_settings() {
475
  mailchimpSF_global_msg($msg);
476
  }
477
 
 
 
 
 
 
 
 
 
 
 
 
478
  if (isset($_POST['mc_use_unsub_link'])){
479
  update_option('mc_use_unsub_link', 'on');
480
  $msg = '<p class="success_msg">'.__('Unsubscribe link turned On!', 'mailchimp_i18n').'</p>';
@@ -558,7 +580,7 @@ function mailchimpSF_change_list_if_necessary() {
558
  if (!$api) { return; }
559
 
560
  //we *could* support paging, but few users have that many lists (and shouldn't)
561
- $lists = $api->get('lists',100);
562
  $lists = $lists['lists'];
563
 
564
  if (is_array($lists) && !empty($lists) && isset($_POST['mc_list_id'])) {
@@ -614,6 +636,12 @@ function mailchimpSF_change_list_if_necessary() {
614
  function mailchimpSF_get_merge_vars($list_id, $new_list) {
615
  $api = mailchimpSF_get_api();
616
  $mv = $api->get('lists/' . $list_id . '/merge-fields', 80);
 
 
 
 
 
 
617
  $mv['merge_fields'] = mailchimpSF_add_email_field($mv['merge_fields']);
618
  update_option('mc_merge_vars', $mv['merge_fields']);
619
  foreach($mv['merge_fields'] as $var){
@@ -645,6 +673,11 @@ function mailchimpSF_get_interest_categories($list_id, $new_list) {
645
  $api = mailchimpSF_get_api();
646
  $igs = $api->get('lists/' . $list_id . '/interest-categories', 60);
647
 
 
 
 
 
 
648
  if (is_array($igs)) {
649
  $key = 0;
650
  foreach($igs['categories'] as $ig) {
@@ -741,6 +774,16 @@ function mailchimpSF_signup_submit() {
741
 
742
  $url = 'lists/'. $listId . '/members/' . md5(strtolower($email));
743
  $status = mailchimpSF_check_status($url);
 
 
 
 
 
 
 
 
 
 
744
  $body = mailchimpSF_subscribe_body($merge, $igs, $email_type, $email, $status, get_option('mc_double_optin'));
745
  $retval = $api->post($url, $body, 'PUT');
746
 
@@ -770,7 +813,8 @@ function mailchimpSF_signup_submit() {
770
  API 3.0-friendly.
771
  */
772
 
773
- function mailchimpSF_subscribe_body($merge, $igs, $email_type, $email, $status, $double_optin) {
 
774
  $body = new stdClass();
775
  $body->email_address = $email;
776
  $body->email_type = $email_type;
@@ -779,16 +823,15 @@ function mailchimpSF_subscribe_body($merge, $igs, $email_type, $email, $status,
779
  $body->interests = $igs;
780
  }
781
 
782
- // single opt-in that covers new subscribers
783
- if (!$status && $double_optin == false) {
784
- $body->status = 'subscribed';
785
- }
786
- // anyone else
787
- else {
788
- $body->status = 'pending';
 
789
  }
790
-
791
-
792
  return $body;
793
  }
794
 
@@ -807,9 +850,10 @@ function mailchimpSF_merge_submit($mv) {
807
  $merge = new stdClass();
808
  foreach($mv as $var) {
809
  // We also want to create an array where the keys are the tags for easier validation later
810
- $mv_tag_keys[$var['tag']] = $var;
 
811
 
812
- $opt = 'mc_mv_'.$var['tag'];
813
 
814
  $opt_val = isset($_POST[$opt]) ? stripslashes_deep($_POST[$opt]) : '';
815
 
@@ -828,7 +872,7 @@ function mailchimpSF_merge_submit($mv) {
828
  }
829
 
830
  if($validate) {
831
- $merge->$var['tag'] = $validate;
832
  }
833
  continue;
834
 
@@ -848,8 +892,8 @@ function mailchimpSF_merge_submit($mv) {
848
  return $error;
849
  }
850
  else {
851
- if ($var['tag'] != 'EMAIL') {
852
- $merge->$var['tag'] = $opt_val;
853
  }
854
  }
855
  }
@@ -861,7 +905,7 @@ function mailchimpSF_merge_validate_phone($opt_val, $var) {
861
  $opt_val = array_filter($opt_val);
862
  // If they weren't all empty
863
  if (!$opt_val) {
864
- return false;
865
  }
866
 
867
  $opt_val = implode('-', $opt_val);
@@ -890,23 +934,25 @@ function mailchimpSF_merge_validate_address($opt_val, $var) {
890
  if (empty($opt_val['addr1']) || empty($opt_val['city'])) {
891
  return false;
892
  }
893
- $merge = new stdClass();
894
- $merge->addr1 = $opt_val['addr1'];
895
- $merge->addr2 = $opt_val['addr2'];
896
- $merge->city = $opt_val['city'];
897
- $merge->state = $opt_val['state'];
898
- $merge->zip = $opt_val['zip'];
899
- $merge->country = $opt_val['country'];
900
- return $merge;
901
  }
 
 
 
 
 
 
 
 
 
 
902
  }
903
 
904
- function mailchimpSF_merge_remove_empty($merge) {
 
905
  foreach ($merge as $k => $v) {
906
  if (is_object($v) && empty($v)) {
907
  unset($merge->$k);
908
- }
909
- else if (!is_object($v) && trim($v) === '') {
910
  unset($merge->$k);
911
  }
912
  }
@@ -919,28 +965,31 @@ function mailchimpSF_merge_remove_empty($merge) {
919
  return $merge;
920
  }
921
 
922
-
923
  function mailchimpSF_groups_submit($igs) {
 
 
924
  if(empty($igs)) {
925
  return new StdClass();
926
  }
927
-
928
- $groups = new stdClass();
 
929
 
930
  foreach ($igs as $ig) {
931
- if (get_option('mc_show_interest_groups_'.$ig['id']) == 'on' && $ig['type'] !== 'hidden') {
 
932
  switch ($ig['type']) {
933
  case 'dropdown':
934
  case 'radio':
935
  // there can only be one value submitted for radio/dropdowns, so use that at the group id.
936
- if (isset($_POST['group'][$ig['id']])){
937
- $value = $_POST['group'][$ig['id']];
938
  $groups->$value = true;
939
  }
940
  break;
941
  case 'checkboxes':
942
- if (isset($_POST['group'][$ig['id']])) {
943
- foreach ($_POST['group'][$ig['id']] as $id => $value) {
944
  $groups->$id = true;
945
  }
946
  }
@@ -954,6 +1003,21 @@ function mailchimpSF_groups_submit($igs) {
954
  return $groups;
955
  }
956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  function mailchimpSF_verify_key($api) {
958
  $user = $api->get('');
959
  if (is_wp_error($user)) {
3
  Plugin Name: MailChimp
4
  Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
5
  Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
6
+ Version: 1.5.3
7
  Author: MailChimp
8
  Author URI: https://mailchimp.com/
9
  */
25
  */
26
 
27
  // Version constant for easy CSS refreshes
28
+ define('MCSF_VER', '1.5.3');
29
 
30
  // What's our permission (capability) threshold
31
  define('MCSF_CAP_THRESHOLD', 'manage_options');
62
  // Check for mc_api_key or sopresto key and continue if neither
63
  mailchimpSF_migrate_sopresto();
64
 
65
+ if (get_option('mc_list_id') && get_option('mc_merge_field_migrate') != true && mailchimpSF_get_api() !== false) {
66
+ mailchimpSF_update_merge_fields(get_option('mc_list_id'));
67
+ }
68
+
69
  // Bring in our appropriate JS and CSS resources
70
  mailchimpSF_load_resources();
71
  }
72
+
73
  add_action( 'init', 'mailchimpSF_plugin_init' );
74
 
75
 
109
 
110
  if (get_option('mc_use_datepicker') == 'on' && !is_admin()) {
111
  // Datepicker theme
112
+ wp_enqueue_style('flick', MCSF_URL.'/css/flick/flick.css'
113
+ );
114
  // Datepicker JS
115
  wp_enqueue_script('datepicker', MCSF_URL.'/js/datepicker.js', array('jquery','jquery-ui-core'));
116
  }
117
 
118
+ if(get_option('mc_nuke_all_styles') != true) {
119
  wp_enqueue_style('mailchimpSF_main_css', home_url('?mcsf_action=main_css&ver='.MCSF_VER, 'relative'));
120
  wp_enqueue_style('mailchimpSF_ie_css', MCSF_URL.'css/ie.css');
121
  global $wp_styles;
131
  */
132
  function mc_admin_page_load_resources() {
133
  wp_enqueue_style('mailchimpSF_admin_css', MCSF_URL.'css/admin.css');
 
134
  }
135
  add_action('load-settings_page_mailchimpSF_options', 'mc_admin_page_load_resources');
136
 
235
  case 'html':
236
  /* Allow to fall through. The widget will pick up the
237
  * global message left over from the signup_submit function */
 
238
  case 'js':
239
  if (!headers_sent()){ //just in case...
240
  header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', true, 200);
299
  return;
300
  }
301
 
302
+ function mailchimpSF_update_merge_fields($list_id)
303
+ {
304
+ mailchimpSF_get_merge_vars(get_option('mc_list_id'), true);
305
+ mailchimpSF_get_interest_categories(get_option('mc_list_id'), true);
306
+ update_option('mc_merge_field_migrate', true);
307
+ }
308
+
309
  function mailchimpSF_auth_nonce_key($salt = null) {
310
  if (is_null($salt)) {
311
  $salt = mailchimpSF_auth_nonce_salt();
486
  mailchimpSF_global_msg($msg);
487
  }
488
 
489
+ /* Update existing */
490
+ if (isset($_POST['mc_update_existing'])) {
491
+ update_option('mc_update_existing', true);
492
+ $msg = '<p class="success_msg">' . __('Update existing subscribers turned On!') . '</p>';
493
+ mailchimpSF_global_msg($msg);
494
+ } elseif (get_option('mc_update_existing') ==! false) {
495
+ update_option('mc_update_existing', false);
496
+ $msg = '<p class="success_msg">' . __('Update existing subscribers turned Off!') . '</p>';
497
+ mailchimpSF_global_msg($msg);
498
+ }
499
+
500
  if (isset($_POST['mc_use_unsub_link'])){
501
  update_option('mc_use_unsub_link', 'on');
502
  $msg = '<p class="success_msg">'.__('Unsubscribe link turned On!', 'mailchimp_i18n').'</p>';
580
  if (!$api) { return; }
581
 
582
  //we *could* support paging, but few users have that many lists (and shouldn't)
583
+ $lists = $api->get('lists',100, array('fields' => 'lists.id,lists.name,lists.email_type_option'));
584
  $lists = $lists['lists'];
585
 
586
  if (is_array($lists) && !empty($lists) && isset($_POST['mc_list_id'])) {
636
  function mailchimpSF_get_merge_vars($list_id, $new_list) {
637
  $api = mailchimpSF_get_api();
638
  $mv = $api->get('lists/' . $list_id . '/merge-fields', 80);
639
+
640
+ //if we get an error back from the api, exit this process.
641
+ if(is_wp_error($mv)) {
642
+ return;
643
+ }
644
+
645
  $mv['merge_fields'] = mailchimpSF_add_email_field($mv['merge_fields']);
646
  update_option('mc_merge_vars', $mv['merge_fields']);
647
  foreach($mv['merge_fields'] as $var){
673
  $api = mailchimpSF_get_api();
674
  $igs = $api->get('lists/' . $list_id . '/interest-categories', 60);
675
 
676
+ //if we get an error back from the api, exis
677
+ if(is_wp_error($igs)) {
678
+ return;
679
+ }
680
+
681
  if (is_array($igs)) {
682
  $key = 0;
683
  foreach($igs['categories'] as $ig) {
774
 
775
  $url = 'lists/'. $listId . '/members/' . md5(strtolower($email));
776
  $status = mailchimpSF_check_status($url);
777
+
778
+
779
+ // If update existing is turned off and the subscriber exists, error out.
780
+ if (get_option('mc_update_existing') == false && $status === 'subscribed') {
781
+ $msg = 'This email address is already subscribed to the list.';
782
+ $error = new WP_Error('mailchimp-update-existing', $msg);
783
+ mailchimpSF_global_msg('<strong class="mc_error_msg">' . $msg . '</strong>');
784
+ return false;
785
+ }
786
+
787
  $body = mailchimpSF_subscribe_body($merge, $igs, $email_type, $email, $status, get_option('mc_double_optin'));
788
  $retval = $api->post($url, $body, 'PUT');
789
 
813
  API 3.0-friendly.
814
  */
815
 
816
+ function mailchimpSF_subscribe_body($merge, $igs, $email_type, $email, $status, $double_optin)
817
+ {
818
  $body = new stdClass();
819
  $body->email_address = $email;
820
  $body->email_type = $email_type;
823
  $body->interests = $igs;
824
  }
825
 
826
+ if($status !== 'subscribed') {
827
+ // single opt-in that covers new subscribers
828
+ if (!$status && $double_optin == false) {
829
+ $body->status = 'subscribed';
830
+ } else {
831
+ // anyone else
832
+ $body->status = 'pending';
833
+ }
834
  }
 
 
835
  return $body;
836
  }
837
 
850
  $merge = new stdClass();
851
  foreach($mv as $var) {
852
  // We also want to create an array where the keys are the tags for easier validation later
853
+ $tag = $var['tag'];
854
+ $mv_tag_keys[$tag] = $var;
855
 
856
+ $opt = 'mc_mv_' . $tag;
857
 
858
  $opt_val = isset($_POST[$opt]) ? stripslashes_deep($_POST[$opt]) : '';
859
 
872
  }
873
 
874
  if($validate) {
875
+ $merge->$tag = $validate;
876
  }
877
  continue;
878
 
892
  return $error;
893
  }
894
  else {
895
+ if ($tag != 'EMAIL') {
896
+ $merge->$tag = $opt_val;
897
  }
898
  }
899
  }
905
  $opt_val = array_filter($opt_val);
906
  // If they weren't all empty
907
  if (!$opt_val) {
908
+ return;
909
  }
910
 
911
  $opt_val = implode('-', $opt_val);
934
  if (empty($opt_val['addr1']) || empty($opt_val['city'])) {
935
  return false;
936
  }
 
 
 
 
 
 
 
 
937
  }
938
+
939
+ $merge = new stdClass();
940
+ $merge->addr1 = $opt_val['addr1'];
941
+ $merge->addr2 = $opt_val['addr2'];
942
+ $merge->city = $opt_val['city'];
943
+ $merge->state = $opt_val['state'];
944
+ $merge->zip = $opt_val['zip'];
945
+ $merge->country = $opt_val['country'];
946
+ return $merge;
947
+
948
  }
949
 
950
+ function mailchimpSF_merge_remove_empty($merge)
951
+ {
952
  foreach ($merge as $k => $v) {
953
  if (is_object($v) && empty($v)) {
954
  unset($merge->$k);
955
+ } elseif ((is_string($v) && trim($v) === '') || is_null($v)) {
 
956
  unset($merge->$k);
957
  }
958
  }
965
  return $merge;
966
  }
967
 
 
968
  function mailchimpSF_groups_submit($igs) {
969
+ $groups = mailchimpSF_set_all_groups_to_false();
970
+
971
  if(empty($igs)) {
972
  return new StdClass();
973
  }
974
+
975
+ //get groups and ids
976
+ //set all to false
977
 
978
  foreach ($igs as $ig) {
979
+ $ig_id = $ig['id'];
980
+ if (get_option('mc_show_interest_groups_'.$ig_id) == 'on' && $ig['type'] !== 'hidden') {
981
  switch ($ig['type']) {
982
  case 'dropdown':
983
  case 'radio':
984
  // there can only be one value submitted for radio/dropdowns, so use that at the group id.
985
+ if (isset($_POST['group'][$ig_id]) && !empty($_POST['group'][$ig_id])) {
986
+ $value = $_POST['group'][$ig_id];
987
  $groups->$value = true;
988
  }
989
  break;
990
  case 'checkboxes':
991
+ if (isset($_POST['group'][$ig_id])) {
992
+ foreach ($_POST['group'][$ig_id] as $id => $value) {
993
  $groups->$id = true;
994
  }
995
  }
1003
  return $groups;
1004
  }
1005
 
1006
+ function mailchimpSF_set_all_groups_to_false() {
1007
+ $toreturn = new StdClass();
1008
+
1009
+ foreach (get_option('mc_interest_groups') as $grouping) {
1010
+ if($grouping['type'] !== 'hidden') {
1011
+ foreach ($grouping['groups'] as $group) {
1012
+ $id = $group['id'];
1013
+ $toreturn->$id = false;
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ return $toreturn;
1019
+ }
1020
+
1021
  function mailchimpSF_verify_key($api) {
1022
  $user = $api->get('');
1023
  if (is_wp_error($user)) {
mailchimp_widget.php CHANGED
@@ -381,7 +381,7 @@ function mailchimp_form_field($var, $num_fields) {
381
  break;
382
  case 'birthday':
383
  $html .= '
384
- <input type="text" size="18" placeholder="'.esc_attr($var['default_value']).'" data-format="'.esc_attr($var['dateformat']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="birthdate-pick mc_input"/>';
385
  break;
386
  case 'birthday-old':
387
  $days = range(1, 31);
@@ -472,7 +472,7 @@ function mailchimp_form_field($var, $num_fields) {
472
 
473
  class mailchimpSF_Widget extends WP_Widget {
474
 
475
- function mailchimpSF_Widget() {
476
  $widget_ops = array(
477
  'description' => __('Displays a MailChimp Subscribe box', 'mailchimp_i18n')
478
  );
381
  break;
382
  case 'birthday':
383
  $html .= '
384
+ <input type="text" size="18" placeholder="'.esc_attr($var['default_value']).'" data-format="'.esc_attr($var['options']['date_format']).'" name="'.esc_attr($opt).'" id="'.esc_attr($opt).'" class="birthdate-pick mc_input"/>';
385
  break;
386
  case 'birthday-old':
387
  $days = range(1, 31);
472
 
473
  class mailchimpSF_Widget extends WP_Widget {
474
 
475
+ function __construct() {
476
  $widget_ops = array(
477
  'description' => __('Displays a MailChimp Subscribe box', 'mailchimp_i18n')
478
  );
phpunit.xml.dist ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit
2
+ bootstrap="tests/bootstrap.php"
3
+ backupGlobals="false"
4
+ colors="true"
5
+ convertErrorsToExceptions="true"
6
+ convertNoticesToExceptions="true"
7
+ convertWarningsToExceptions="true"
8
+ >
9
+ <testsuites>
10
+ <testsuite>
11
+ <directory prefix="test-" suffix=".php">./tests/</directory>
12
+ </testsuite>
13
+ </testsuites>
14
+ </phpunit>
po/mailchimp.pot CHANGED
@@ -1,382 +1,1288 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR MailChimp API Support Team
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: MailChimp 1.1.5\n"
10
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/mailchimp\n"
11
- "POT-Creation-Date: 2009-07-15 14:23-0400\n"
12
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
- "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- #: mailchimp_includes.php:27 mailchimp_includes.php:62
20
- msgid "You must fill in %s."
21
  msgstr ""
22
 
23
- #: mailchimp_includes.php:59
24
- msgid "That email address is already subscribed to the list"
25
  msgstr ""
26
 
27
- #: mailchimp_includes.php:66
28
- #, php-format
29
- msgid "%s has invalid content"
30
  msgstr ""
31
 
32
- #: mailchimp_includes.php:68
33
- msgid "An invalid Interest Group was selected"
34
  msgstr ""
35
 
36
- #: mailchimp_includes.php:69
37
- msgid "That email address is invalid"
38
  msgstr ""
39
 
40
- #: mailchimp_includes.php:75
41
- msgid "Success, you've been signed up! Please look for our confirmation email!"
42
  msgstr ""
43
 
44
- #: mailchimp_includes.php:131
45
- msgid "required field"
46
  msgstr ""
47
 
48
- #: mailchimp_includes.php:168
49
- msgid "unsubscribe from list"
50
  msgstr ""
51
 
52
- #: mailchimp_includes.php:171
53
- msgid "powered by"
54
  msgstr ""
55
 
56
- #: mailchimp.php:135
57
- msgid "MailChimp Setup"
58
  msgstr ""
59
 
60
- #: mailchimp.php:150
61
- msgid ""
62
- "While upgrading the plugin setup, we were unable to login to your account. "
63
- "You will need to login again and setup your list."
64
  msgstr ""
65
 
66
- #: mailchimp.php:156
67
- msgid "MailChimp List Setup"
68
  msgstr ""
69
 
70
- #: mailchimp.php:166
71
- msgid ""
72
- "Success! We were able to verify your username & password! Let's continue, "
73
- "shall we?"
74
  msgstr ""
75
 
76
- #: mailchimp.php:178
77
- msgid ""
78
- "Uh-oh, we were unable to login and verify your username & password. Please "
79
- "check them and try again!"
80
  msgstr ""
81
 
82
- #: mailchimp.php:179
83
- msgid "The server said:"
84
  msgstr ""
85
 
86
- #: mailchimp.php:222
87
- msgid "Sign up for"
88
  msgstr ""
89
 
90
- #: mailchimp.php:223
91
- msgid "Subscribe"
92
  msgstr ""
93
 
94
- #: mailchimp.php:253
95
- #, php-format
96
- msgid ""
97
- "Success! Loaded and saved the info for %d Merge Variables and %d Interest "
98
- "Groups from your list"
99
  msgstr ""
100
 
101
- #: mailchimp.php:256
102
- msgid ""
103
- "Now you should either Turn On the MailChimp Widget or change your options "
104
- "below, then turn it on."
105
  msgstr ""
106
 
107
- #: mailchimp.php:284
108
- msgid "Successfully Reset your List selection... Now you get to pick again!"
109
  msgstr ""
110
 
111
- #: mailchimp.php:290
112
- msgid "Monkey Rewards turned On!"
113
  msgstr ""
114
 
115
- #: mailchimp.php:294
116
- msgid "Monkey Rewards turned Off!"
117
  msgstr ""
118
 
119
- #: mailchimp.php:299
120
- msgid "Fancy Javascript submission turned On!"
121
  msgstr ""
122
 
123
- #: mailchimp.php:303
124
- msgid "Fancy Javascript submission turned Off!"
125
  msgstr ""
126
 
127
- #: mailchimp.php:309
128
- msgid "Unsubscribe link turned On!"
129
  msgstr ""
130
 
131
- #: mailchimp.php:313
132
- msgid "Unsubscribe link turned Off!"
133
  msgstr ""
134
 
135
- #: mailchimp.php:359
136
- msgid "Successfully Updated your List Subscribe Form Settings!"
137
  msgstr ""
138
 
139
- #: mailchimp.php:372
140
- msgid "Login Info"
141
  msgstr ""
142
 
143
- #: mailchimp.php:373
144
- msgid ""
145
- "To start using the MailChimp plugin, we first need to login and get your API "
146
- "Key. Please enter your MailChimp username and password below."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  msgstr ""
148
 
149
- #: mailchimp.php:375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  msgid ""
151
- "Don't have a MailChimp account? <a href='http://www.mailchimp.com/tryit."
152
- "phtml' target='_blank'>Try one for Free</a>!"
 
 
153
  msgstr ""
154
 
155
- #: mailchimp.php:379
156
- msgid "Username"
157
  msgstr ""
158
 
159
- #: mailchimp.php:383
160
- msgid "Password"
161
  msgstr ""
162
 
163
- #: mailchimp.php:389
164
- msgid "Save & Check"
165
  msgstr ""
166
 
167
- #: mailchimp.php:394
168
  msgid "Notes"
169
  msgstr ""
170
 
171
- #: mailchimp.php:395
172
  msgid "Changing your settings at MailChimp.com may cause this to stop working."
173
  msgstr ""
174
 
175
- #: mailchimp.php:396
176
  msgid ""
177
  "If you change your login to a different account, the info you have setup "
178
  "below will be erased."
179
  msgstr ""
180
 
181
- #: mailchimp.php:397
182
  msgid ""
183
  "If any of that happens, no biggie - just reconfigure your login and the "
184
  "items below..."
185
  msgstr ""
186
 
187
- #: mailchimp.php:403
188
  msgid "Logged in as"
189
  msgstr ""
190
 
191
- #: mailchimp.php:407
192
  msgid "Logout"
193
  msgstr ""
194
 
195
- #: mailchimp.php:421
196
  msgid "Your Lists"
197
  msgstr ""
198
 
199
- #: mailchimp.php:423
200
- msgid "Please select the List you wish to create a Signup Form for."
201
  msgstr ""
202
 
203
- #: mailchimp.php:432
204
- #, php-format
 
 
 
 
 
 
 
 
 
205
  msgid ""
206
  "Uh-oh, you don't have any lists defined! Please visit %s, login, and setup a "
207
  "list before using this tool!"
208
  msgstr ""
209
 
210
- #: mailchimp.php:437
211
  msgid "Select A List"
212
  msgstr ""
213
 
214
- #: mailchimp.php:450
215
  msgid "Update List"
216
  msgstr ""
217
 
218
- #: mailchimp.php:453
219
- msgid "Note:"
 
 
 
 
 
 
 
 
 
 
 
 
220
  msgstr ""
221
 
222
- #: mailchimp.php:453
223
  msgid ""
224
- "Updating your list will not cause settings below to be lost. Changing to a "
225
- "new list will."
226
  msgstr ""
227
 
228
- #: mailchimp.php:471
229
- msgid "Reset List Options and Select again"
230
  msgstr ""
231
 
232
- #: mailchimp.php:474
233
- msgid "Subscribe Form Widget Settings for this List"
234
  msgstr ""
235
 
236
- #: mailchimp.php:475
237
- msgid "Selected MailChimp List"
238
  msgstr ""
239
 
240
- #: mailchimp.php:496 mailchimp.php:569 mailchimp.php:630
 
241
  msgid "Update Subscribe Form Settings"
242
  msgstr ""
243
 
244
- #: mailchimp.php:499
245
- msgid "Monkey Rewards"
246
  msgstr ""
247
 
248
- #: mailchimp.php:501
249
  msgid ""
250
- "turning this on will place a \"powered by MailChimp\" link in your form that "
251
- "will earn you credits with us. It is optional and can be turned on or off at "
252
- "any time."
253
  msgstr ""
254
 
255
- #: mailchimp.php:505
256
- msgid "Use Javascript Support?"
257
  msgstr ""
258
 
259
- #: mailchimp.php:507
260
- msgid ""
261
- "turning this on will use fancy javascript submission and should degrade "
262
- "gracefully for users not using javascript. It is optional and can be turned "
263
- "on or off at any time."
264
  msgstr ""
265
 
266
- #: mailchimp.php:511
267
- msgid "Include Unsubscribe link?"
 
 
 
 
268
  msgstr ""
269
 
270
- #: mailchimp.php:513
271
- msgid "turning this on will add a link to your host unsubscribe form"
272
  msgstr ""
273
 
274
- #: mailchimp.php:517
275
- msgid "Header content"
276
  msgstr ""
277
 
278
- #: mailchimp.php:520
279
- msgid ""
280
- "You can fill this with your own Text, HTML markup (including image links), "
281
- "or Nothing!"
 
 
282
  msgstr ""
283
 
284
- #: mailchimp.php:525
285
- msgid "Submit Button text"
286
  msgstr ""
287
 
288
- #: mailchimp.php:532
289
- msgid "Custom Styling"
 
 
 
 
290
  msgstr ""
291
 
292
- #: mailchimp.php:536
293
- msgid "Turned On?"
294
  msgstr ""
295
 
296
- #: mailchimp.php:537
297
  msgid ""
298
- "Header Settings (only applies if there are no HTML tags in the Header "
299
- "Content area above)"
 
300
  msgstr ""
301
 
302
- #: mailchimp.php:538 mailchimp.php:552
303
- msgid "Border Width"
304
  msgstr ""
305
 
306
- #: mailchimp.php:539 mailchimp.php:553
307
- msgid "Set to 0 for no border, do not enter <strong>px</strong>!"
308
  msgstr ""
309
 
310
- #: mailchimp.php:541 mailchimp.php:555
311
- msgid "Border Color"
 
 
 
 
 
 
312
  msgstr ""
313
 
314
- #: mailchimp.php:542 mailchimp.php:545 mailchimp.php:548 mailchimp.php:556
315
- #: mailchimp.php:559 mailchimp.php:562
316
- msgid "do not enter initial <strong>#</strong>"
317
  msgstr ""
318
 
319
- #: mailchimp.php:551
320
- msgid "Form Settings"
321
  msgstr ""
322
 
323
- #: mailchimp.php:571
324
- msgid "Merge Variables Included"
325
  msgstr ""
326
 
327
- #: mailchimp.php:574
328
- msgid "No Merge Variables found."
329
  msgstr ""
330
 
331
- #: mailchimp.php:580 mailchimp.php:614
332
  msgid "Name"
333
  msgstr ""
334
 
335
- #: mailchimp.php:581
336
  msgid "Tag"
337
  msgstr ""
338
 
339
- #: mailchimp.php:582
340
  msgid "Required?"
341
  msgstr ""
342
 
343
- #: mailchimp.php:583
344
  msgid "Include?"
345
  msgstr ""
346
 
347
- #: mailchimp.php:603
348
- msgid "Interest Groups"
349
  msgstr ""
350
 
351
- #: mailchimp.php:605
352
  msgid "No Interest Groups Setup for this List"
353
  msgstr ""
354
 
355
- #: mailchimp.php:610
356
  msgid "Show?"
357
  msgstr ""
358
 
359
- #: mailchimp.php:617
360
  msgid "Input Type"
361
  msgstr ""
362
 
363
- #: mailchimp.php:620
364
  msgid "Options"
365
  msgstr ""
366
 
367
- #: wp-content/plugins/mailchimp/mailchimp_widget.php:140
368
- msgid "Preferred Format"
 
 
 
369
  msgstr ""
370
 
371
- #: wp-content/plugins/mailchimp/mailchimp_widget.php:143
372
- msgid "HTML"
373
  msgstr ""
374
 
375
- #: wp-content/plugins/mailchimp/mailchimp_widget.php:144
376
- msgid "Text"
 
 
377
  msgstr ""
378
 
379
- #: wp-content/plugins/mailchimp/mailchimp_widget.php:145
380
- msgid "Mobile"
381
  msgstr ""
382
-
1
+ # Copyright (C) 2016 MailChimp
2
+ # This file is distributed under the same license as the MailChimp package.
 
 
 
 
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MailChimp 1.5.1\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mailchimp\n"
7
+ "POT-Creation-Date: 2016-08-12 14:29:14+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: mailchimp.php:79
16
+ msgid "Settings"
17
+ msgstr ""
18
+
19
+ #: mailchimp.php:176
20
+ msgid "MailChimp Setup"
21
+ msgstr ""
22
+
23
+ #: mailchimp.php:399
24
+ msgid "Sign up for"
25
+ msgstr ""
26
+
27
+ #: mailchimp.php:400
28
+ msgid "Subscribe"
29
+ msgstr ""
30
+
31
+ #: mailchimp.php:428
32
+ msgid "Monkey Rewards turned On!"
33
+ msgstr ""
34
+
35
+ #: mailchimp.php:432
36
+ msgid "Monkey Rewards turned Off!"
37
+ msgstr ""
38
+
39
+ #: mailchimp.php:437
40
+ msgid "Fancy Javascript submission turned On!"
41
+ msgstr ""
42
+
43
+ #: mailchimp.php:441
44
+ msgid "Fancy Javascript submission turned Off!"
45
+ msgstr ""
46
+
47
+ #: mailchimp.php:447
48
+ msgid "Datepicker turned On!"
49
+ msgstr ""
50
+
51
+ #: mailchimp.php:451
52
+ msgid "Datepicker turned Off!"
53
+ msgstr ""
54
+
55
+ #: mailchimp.php:459
56
+ msgid "Double opt-in turned On!"
57
+ msgstr ""
58
+
59
+ #: mailchimp.php:463
60
+ msgid "Double opt-in turned Off!"
61
+ msgstr ""
62
+
63
+ #: mailchimp.php:470
64
+ msgid "MailChimp CSS turned Off!"
65
+ msgstr ""
66
+
67
+ #: mailchimp.php:474
68
+ msgid "MailChimp CSS turned On!"
69
+ msgstr ""
70
+
71
+ #: mailchimp.php:480
72
+ msgid "Unsubscribe link turned On!"
73
+ msgstr ""
74
+
75
+ #: mailchimp.php:486
76
+ msgid "Unsubscribe link turned Off!"
77
+ msgstr ""
78
+
79
+ #: mailchimp.php:546
80
+ msgid "Successfully Updated your List Subscribe Form Settings!"
81
+ msgstr ""
82
+
83
+ #: mailchimp.php:599
84
+ msgid "and %s Sets of Interest Groups"
85
+ msgstr ""
86
+
87
+ #: mailchimp.php:604
88
+ msgid "<b>Success!</b> Loaded and saved the info for %d Merge Variables"
89
+ msgstr ""
90
+
91
+ #: mailchimp.php:607
92
+ msgid "from your list"
93
+ msgstr ""
94
+
95
+ #: mailchimp.php:608
96
+ msgid ""
97
+ "Now you should either Turn On the MailChimp Widget or change your options "
98
+ "below, then turn it on."
99
+ msgstr ""
100
+
101
+ #: mailchimp.php:633
102
+ msgid "Email Address"
103
+ msgstr ""
104
+
105
+ #: mailchimp.php:755
106
+ msgid "Success, you've been signed up."
107
+ msgstr ""
108
+
109
+ #: mailchimp.php:758
110
+ msgid "Success, you've been signed up! Please look for our confirmation email."
111
+ msgstr ""
112
+
113
+ #: mailchimp.php:846 mailchimp.php:885
114
+ msgid "You must fill in %s."
115
+ msgstr ""
116
+
117
+ #: mailchimp.php:874
118
+ msgid "%s must consist of only numbers"
119
+ msgstr ""
120
+
121
+ #: mailchimp.php:971
122
+ msgid "API Key must belong to \"Owner\", \"Admin\", or \"Manager.\""
123
+ msgstr ""
124
+
125
+ #: mailchimp_widget.php:16
126
+ msgid ""
127
+ "Sorry, there was a problem loading your MailChimp details. Please navigate "
128
+ "to <strong>Settings</strong> and click <strong>MailChimp Setup</strong> to "
129
+ "try again."
130
+ msgstr ""
131
+
132
+ #: mailchimp_widget.php:176
133
+ msgid "required field"
134
+ msgstr ""
135
+
136
+ #: mailchimp_widget.php:216
137
+ msgid "Preferred Format"
138
+ msgstr ""
139
+
140
+ #: mailchimp_widget.php:219
141
+ msgid "HTML"
142
+ msgstr ""
143
+
144
+ #: mailchimp_widget.php:220
145
+ msgid "Text"
146
+ msgstr ""
147
+
148
+ #: mailchimp_widget.php:244
149
+ msgid "unsubscribe from list"
150
+ msgstr ""
151
+
152
+ #: mailchimp_widget.php:252
153
+ msgid "powered by"
154
+ msgstr ""
155
+
156
+ #: mailchimp_widget.php:388
157
+ msgid "January"
158
+ msgstr ""
159
+
160
+ #: mailchimp_widget.php:388
161
+ msgid "February"
162
+ msgstr ""
163
+
164
+ #: mailchimp_widget.php:388
165
+ msgid "March"
166
+ msgstr ""
167
+
168
+ #: mailchimp_widget.php:388
169
+ msgid "April"
170
+ msgstr ""
171
+
172
+ #: mailchimp_widget.php:388
173
+ msgid "May"
174
+ msgstr ""
175
+
176
+ #: mailchimp_widget.php:388
177
+ msgid "June"
178
+ msgstr ""
179
+
180
+ #: mailchimp_widget.php:388
181
+ msgid "July"
182
+ msgstr ""
183
+
184
+ #: mailchimp_widget.php:388
185
+ msgid "August"
186
+ msgstr ""
187
+
188
+ #: mailchimp_widget.php:388
189
+ msgid "September"
190
+ msgstr ""
191
+
192
+ #: mailchimp_widget.php:388
193
+ msgid "October"
194
+ msgstr ""
195
+
196
+ #: mailchimp_widget.php:388
197
+ msgid "November"
198
+ msgstr ""
199
+
200
+ #: mailchimp_widget.php:388
201
+ msgid "December"
202
+ msgstr ""
203
+
204
+ #: mailchimp_widget.php:412
205
+ msgid "Street Address"
206
+ msgstr ""
207
+
208
+ #: mailchimp_widget.php:414
209
+ msgid "Address Line 2"
210
+ msgstr ""
211
+
212
+ #: mailchimp_widget.php:416
213
+ msgid "City"
214
+ msgstr ""
215
+
216
+ #: mailchimp_widget.php:418
217
+ msgid "State"
218
+ msgstr ""
219
+
220
+ #: mailchimp_widget.php:420
221
+ msgid "Zip / Postal"
222
+ msgstr ""
223
+
224
+ #: mailchimp_widget.php:422
225
+ msgid "Country"
226
+ msgstr ""
227
+
228
+ #: mailchimp_widget.php:477
229
+ msgid "Displays a MailChimp Subscribe box"
230
+ msgstr ""
231
+
232
+ #: mailchimp_widget.php:479
233
+ msgid "MailChimp Widget"
234
+ msgstr ""
235
+
236
+ #: mailchimp_widget.php:494
237
+ msgid "USA"
238
+ msgstr ""
239
+
240
+ #: mailchimp_widget.php:495
241
+ msgid "Aaland Islands"
242
+ msgstr ""
243
+
244
+ #: mailchimp_widget.php:496
245
+ msgid "Afghanistan"
246
+ msgstr ""
247
+
248
+ #: mailchimp_widget.php:497
249
+ msgid "Albania"
250
+ msgstr ""
251
+
252
+ #: mailchimp_widget.php:498
253
+ msgid "Algeria"
254
+ msgstr ""
255
+
256
+ #: mailchimp_widget.php:499
257
+ msgid "American Samoa"
258
+ msgstr ""
259
+
260
+ #: mailchimp_widget.php:500
261
+ msgid "Andorra"
262
+ msgstr ""
263
+
264
+ #: mailchimp_widget.php:501
265
+ msgid "Angola"
266
+ msgstr ""
267
+
268
+ #: mailchimp_widget.php:502
269
+ msgid "Anguilla"
270
+ msgstr ""
271
+
272
+ #: mailchimp_widget.php:503
273
+ msgid "Antigua And Barbuda"
274
+ msgstr ""
275
+
276
+ #: mailchimp_widget.php:504
277
+ msgid "Argentina"
278
+ msgstr ""
279
+
280
+ #: mailchimp_widget.php:505
281
+ msgid "Armenia"
282
+ msgstr ""
283
+
284
+ #: mailchimp_widget.php:506
285
+ msgid "Aruba"
286
+ msgstr ""
287
+
288
+ #: mailchimp_widget.php:507
289
+ msgid "Australia"
290
+ msgstr ""
291
+
292
+ #: mailchimp_widget.php:508
293
+ msgid "Austria"
294
+ msgstr ""
295
+
296
+ #: mailchimp_widget.php:509
297
+ msgid "Azerbaijan"
298
+ msgstr ""
299
+
300
+ #: mailchimp_widget.php:510
301
+ msgid "Bahamas"
302
+ msgstr ""
303
+
304
+ #: mailchimp_widget.php:511
305
+ msgid "Bahrain"
306
+ msgstr ""
307
+
308
+ #: mailchimp_widget.php:512
309
+ msgid "Bangladesh"
310
+ msgstr ""
311
+
312
+ #: mailchimp_widget.php:513
313
+ msgid "Barbados"
314
+ msgstr ""
315
+
316
+ #: mailchimp_widget.php:514
317
+ msgid "Belarus"
318
+ msgstr ""
319
+
320
+ #: mailchimp_widget.php:515
321
+ msgid "Belgium"
322
+ msgstr ""
323
+
324
+ #: mailchimp_widget.php:516
325
+ msgid "Belize"
326
+ msgstr ""
327
+
328
+ #: mailchimp_widget.php:517
329
+ msgid "Benin"
330
+ msgstr ""
331
+
332
+ #: mailchimp_widget.php:518
333
+ msgid "Bermuda"
334
+ msgstr ""
335
+
336
+ #: mailchimp_widget.php:519
337
+ msgid "Bhutan"
338
+ msgstr ""
339
+
340
+ #: mailchimp_widget.php:520
341
+ msgid "Bolivia"
342
+ msgstr ""
343
+
344
+ #: mailchimp_widget.php:521
345
+ msgid "Bosnia and Herzegovina"
346
+ msgstr ""
347
+
348
+ #: mailchimp_widget.php:522
349
+ msgid "Botswana"
350
+ msgstr ""
351
+
352
+ #: mailchimp_widget.php:523
353
+ msgid "Brazil"
354
+ msgstr ""
355
+
356
+ #: mailchimp_widget.php:524
357
+ msgid "Brunei Darussalam"
358
+ msgstr ""
359
+
360
+ #: mailchimp_widget.php:525
361
+ msgid "Bulgaria"
362
+ msgstr ""
363
+
364
+ #: mailchimp_widget.php:526
365
+ msgid "Burkina Faso"
366
+ msgstr ""
367
+
368
+ #: mailchimp_widget.php:527
369
+ msgid "Burundi"
370
+ msgstr ""
371
+
372
+ #: mailchimp_widget.php:528
373
+ msgid "Cambodia"
374
+ msgstr ""
375
+
376
+ #: mailchimp_widget.php:529
377
+ msgid "Cameroon"
378
+ msgstr ""
379
+
380
+ #: mailchimp_widget.php:530
381
+ msgid "Canada"
382
+ msgstr ""
383
+
384
+ #: mailchimp_widget.php:531
385
+ msgid "Cape Verde"
386
+ msgstr ""
387
+
388
+ #: mailchimp_widget.php:532
389
+ msgid "Cayman Islands"
390
+ msgstr ""
391
+
392
+ #: mailchimp_widget.php:533
393
+ msgid "Central African Republic"
394
+ msgstr ""
395
+
396
+ #: mailchimp_widget.php:534
397
+ msgid "Chad"
398
+ msgstr ""
399
+
400
+ #: mailchimp_widget.php:535
401
+ msgid "Chile"
402
+ msgstr ""
403
+
404
+ #: mailchimp_widget.php:536
405
+ msgid "China"
406
+ msgstr ""
407
+
408
+ #: mailchimp_widget.php:537
409
+ msgid "Colombia"
410
+ msgstr ""
411
+
412
+ #: mailchimp_widget.php:538
413
+ msgid "Congo"
414
+ msgstr ""
415
+
416
+ #: mailchimp_widget.php:539
417
+ msgid "Cook Islands"
418
+ msgstr ""
419
+
420
+ #: mailchimp_widget.php:540
421
+ msgid "Costa Rica"
422
+ msgstr ""
423
+
424
+ #: mailchimp_widget.php:541
425
+ msgid "Cote D'Ivoire"
426
+ msgstr ""
427
+
428
+ #: mailchimp_widget.php:542
429
+ msgid "Croatia"
430
+ msgstr ""
431
+
432
+ #: mailchimp_widget.php:543
433
+ msgid "Cuba"
434
+ msgstr ""
435
+
436
+ #: mailchimp_widget.php:544
437
+ msgid "Cyprus"
438
+ msgstr ""
439
+
440
+ #: mailchimp_widget.php:545
441
+ msgid "Czech Republic"
442
+ msgstr ""
443
+
444
+ #: mailchimp_widget.php:546
445
+ msgid "Denmark"
446
+ msgstr ""
447
+
448
+ #: mailchimp_widget.php:547
449
+ msgid "Djibouti"
450
+ msgstr ""
451
+
452
+ #: mailchimp_widget.php:548
453
+ msgid "Dominica"
454
+ msgstr ""
455
+
456
+ #: mailchimp_widget.php:549
457
+ msgid "Dominican Republic"
458
+ msgstr ""
459
+
460
+ #: mailchimp_widget.php:550
461
+ msgid "East Timor"
462
+ msgstr ""
463
+
464
+ #: mailchimp_widget.php:551
465
+ msgid "Ecuador"
466
+ msgstr ""
467
+
468
+ #: mailchimp_widget.php:552
469
+ msgid "Egypt"
470
+ msgstr ""
471
+
472
+ #: mailchimp_widget.php:553
473
+ msgid "El Salvador"
474
+ msgstr ""
475
+
476
+ #: mailchimp_widget.php:554
477
+ msgid "Equatorial Guinea"
478
+ msgstr ""
479
+
480
+ #: mailchimp_widget.php:555
481
+ msgid "Eritrea"
482
+ msgstr ""
483
+
484
+ #: mailchimp_widget.php:556
485
+ msgid "Estonia"
486
+ msgstr ""
487
+
488
+ #: mailchimp_widget.php:557
489
+ msgid "Ethiopia"
490
+ msgstr ""
491
+
492
+ #: mailchimp_widget.php:558
493
+ msgid "Faroe Islands"
494
+ msgstr ""
495
+
496
+ #: mailchimp_widget.php:559
497
+ msgid "Fiji"
498
+ msgstr ""
499
+
500
+ #: mailchimp_widget.php:560
501
+ msgid "Finland"
502
+ msgstr ""
503
+
504
+ #: mailchimp_widget.php:561
505
+ msgid "France"
506
+ msgstr ""
507
+
508
+ #: mailchimp_widget.php:562
509
+ msgid "French Polynesia"
510
+ msgstr ""
511
+
512
+ #: mailchimp_widget.php:563
513
+ msgid "Germany"
514
+ msgstr ""
515
+
516
+ #: mailchimp_widget.php:564
517
+ msgid "Ghana"
518
+ msgstr ""
519
 
520
+ #: mailchimp_widget.php:565
521
+ msgid "Gibraltar"
522
  msgstr ""
523
 
524
+ #: mailchimp_widget.php:566
525
+ msgid "Greece"
526
  msgstr ""
527
 
528
+ #: mailchimp_widget.php:567
529
+ msgid "Greenland"
 
530
  msgstr ""
531
 
532
+ #: mailchimp_widget.php:568
533
+ msgid "Grenada"
534
  msgstr ""
535
 
536
+ #: mailchimp_widget.php:569
537
+ msgid "Guam"
538
  msgstr ""
539
 
540
+ #: mailchimp_widget.php:570
541
+ msgid "Guatemala"
542
  msgstr ""
543
 
544
+ #: mailchimp_widget.php:571
545
+ msgid "Guernsey"
546
  msgstr ""
547
 
548
+ #: mailchimp_widget.php:572
549
+ msgid "Guyana"
550
  msgstr ""
551
 
552
+ #: mailchimp_widget.php:573
553
+ msgid "Haiti"
554
  msgstr ""
555
 
556
+ #: mailchimp_widget.php:574
557
+ msgid "Honduras"
558
  msgstr ""
559
 
560
+ #: mailchimp_widget.php:575
561
+ msgid "Hong Kong"
 
 
562
  msgstr ""
563
 
564
+ #: mailchimp_widget.php:576
565
+ msgid "Hungary"
566
  msgstr ""
567
 
568
+ #: mailchimp_widget.php:577
569
+ msgid "Iceland"
 
 
570
  msgstr ""
571
 
572
+ #: mailchimp_widget.php:578
573
+ msgid "India"
 
 
574
  msgstr ""
575
 
576
+ #: mailchimp_widget.php:579
577
+ msgid "Indonesia"
578
  msgstr ""
579
 
580
+ #: mailchimp_widget.php:580
581
+ msgid "Iran"
582
  msgstr ""
583
 
584
+ #: mailchimp_widget.php:581
585
+ msgid "Iraq"
586
  msgstr ""
587
 
588
+ #: mailchimp_widget.php:582
589
+ msgid "Ireland"
 
 
 
590
  msgstr ""
591
 
592
+ #: mailchimp_widget.php:583
593
+ msgid "Israel"
 
 
594
  msgstr ""
595
 
596
+ #: mailchimp_widget.php:584
597
+ msgid "Italy"
598
  msgstr ""
599
 
600
+ #: mailchimp_widget.php:585
601
+ msgid "Jamaica"
602
  msgstr ""
603
 
604
+ #: mailchimp_widget.php:586
605
+ msgid "Japan"
606
  msgstr ""
607
 
608
+ #: mailchimp_widget.php:587
609
+ msgid "Jersey (Channel Islands)"
610
  msgstr ""
611
 
612
+ #: mailchimp_widget.php:588
613
+ msgid "Jordan"
614
  msgstr ""
615
 
616
+ #: mailchimp_widget.php:589
617
+ msgid "Kazakhstan"
618
  msgstr ""
619
 
620
+ #: mailchimp_widget.php:590
621
+ msgid "Kenya"
622
  msgstr ""
623
 
624
+ #: mailchimp_widget.php:591
625
+ msgid "Kuwait"
626
  msgstr ""
627
 
628
+ #: mailchimp_widget.php:592
629
+ msgid "Kyrgyzstan"
630
  msgstr ""
631
 
632
+ #: mailchimp_widget.php:593
633
+ msgid "Lao People's Democratic Republic"
634
+ msgstr ""
635
+
636
+ #: mailchimp_widget.php:594
637
+ msgid "Latvia"
638
+ msgstr ""
639
+
640
+ #: mailchimp_widget.php:595
641
+ msgid "Lebanon"
642
+ msgstr ""
643
+
644
+ #: mailchimp_widget.php:596
645
+ msgid "Libya"
646
+ msgstr ""
647
+
648
+ #: mailchimp_widget.php:597
649
+ msgid "Liechtenstein"
650
+ msgstr ""
651
+
652
+ #: mailchimp_widget.php:598
653
+ msgid "Lithuania"
654
+ msgstr ""
655
+
656
+ #: mailchimp_widget.php:599
657
+ msgid "Luxembourg"
658
+ msgstr ""
659
+
660
+ #: mailchimp_widget.php:600
661
+ msgid "Macau"
662
+ msgstr ""
663
+
664
+ #: mailchimp_widget.php:601
665
+ msgid "Macedonia"
666
+ msgstr ""
667
+
668
+ #: mailchimp_widget.php:602
669
+ msgid "Madagascar"
670
+ msgstr ""
671
+
672
+ #: mailchimp_widget.php:603
673
+ msgid "Malawi"
674
+ msgstr ""
675
+
676
+ #: mailchimp_widget.php:604
677
+ msgid "Malaysia"
678
+ msgstr ""
679
+
680
+ #: mailchimp_widget.php:605
681
+ msgid "Maldives"
682
+ msgstr ""
683
+
684
+ #: mailchimp_widget.php:606
685
+ msgid "Mali"
686
+ msgstr ""
687
+
688
+ #: mailchimp_widget.php:607
689
+ msgid "Malta"
690
+ msgstr ""
691
+
692
+ #: mailchimp_widget.php:608
693
+ msgid "Mauritius"
694
+ msgstr ""
695
+
696
+ #: mailchimp_widget.php:609
697
+ msgid "Mexico"
698
+ msgstr ""
699
+
700
+ #: mailchimp_widget.php:610
701
+ msgid "Moldova, Republic of"
702
+ msgstr ""
703
+
704
+ #: mailchimp_widget.php:611
705
+ msgid "Monaco"
706
+ msgstr ""
707
+
708
+ #: mailchimp_widget.php:612
709
+ msgid "Mongolia"
710
+ msgstr ""
711
+
712
+ #: mailchimp_widget.php:613
713
+ msgid "Montenegro"
714
+ msgstr ""
715
+
716
+ #: mailchimp_widget.php:614
717
+ msgid "Morocco"
718
+ msgstr ""
719
+
720
+ #: mailchimp_widget.php:615
721
+ msgid "Mozambique"
722
+ msgstr ""
723
+
724
+ #: mailchimp_widget.php:616
725
+ msgid "Myanmar"
726
+ msgstr ""
727
+
728
+ #: mailchimp_widget.php:617
729
+ msgid "Namibia"
730
+ msgstr ""
731
+
732
+ #: mailchimp_widget.php:618
733
+ msgid "Nepal"
734
+ msgstr ""
735
+
736
+ #: mailchimp_widget.php:619
737
+ msgid "Netherlands"
738
+ msgstr ""
739
+
740
+ #: mailchimp_widget.php:620
741
+ msgid "Netherlands Antilles"
742
+ msgstr ""
743
+
744
+ #: mailchimp_widget.php:621
745
+ msgid "New Caledonia"
746
+ msgstr ""
747
+
748
+ #: mailchimp_widget.php:622
749
+ msgid "New Zealand"
750
+ msgstr ""
751
+
752
+ #: mailchimp_widget.php:623
753
+ msgid "Nicaragua"
754
+ msgstr ""
755
+
756
+ #: mailchimp_widget.php:624
757
+ msgid "Niger"
758
+ msgstr ""
759
+
760
+ #: mailchimp_widget.php:625
761
+ msgid "Nigeria"
762
+ msgstr ""
763
+
764
+ #: mailchimp_widget.php:626
765
+ msgid "North Korea"
766
+ msgstr ""
767
+
768
+ #: mailchimp_widget.php:627
769
+ msgid "Norway"
770
+ msgstr ""
771
+
772
+ #: mailchimp_widget.php:628
773
+ msgid "Oman"
774
+ msgstr ""
775
+
776
+ #: mailchimp_widget.php:629
777
+ msgid "Pakistan"
778
+ msgstr ""
779
+
780
+ #: mailchimp_widget.php:630
781
+ msgid "Palau"
782
+ msgstr ""
783
+
784
+ #: mailchimp_widget.php:631
785
+ msgid "Palestine"
786
+ msgstr ""
787
+
788
+ #: mailchimp_widget.php:632
789
+ msgid "Panama"
790
+ msgstr ""
791
+
792
+ #: mailchimp_widget.php:633
793
+ msgid "Papua New Guinea"
794
+ msgstr ""
795
+
796
+ #: mailchimp_widget.php:634
797
+ msgid "Paraguay"
798
+ msgstr ""
799
+
800
+ #: mailchimp_widget.php:635
801
+ msgid "Peru"
802
+ msgstr ""
803
+
804
+ #: mailchimp_widget.php:636
805
+ msgid "Philippines"
806
+ msgstr ""
807
+
808
+ #: mailchimp_widget.php:637
809
+ msgid "Poland"
810
+ msgstr ""
811
+
812
+ #: mailchimp_widget.php:638
813
+ msgid "Portugal"
814
+ msgstr ""
815
+
816
+ #: mailchimp_widget.php:639
817
+ msgid "Qatar"
818
+ msgstr ""
819
+
820
+ #: mailchimp_widget.php:640
821
+ msgid "Republic of Georgia"
822
+ msgstr ""
823
+
824
+ #: mailchimp_widget.php:641
825
+ msgid "Romania"
826
+ msgstr ""
827
+
828
+ #: mailchimp_widget.php:642
829
+ msgid "Russia"
830
+ msgstr ""
831
+
832
+ #: mailchimp_widget.php:643
833
+ msgid "Rwanda"
834
+ msgstr ""
835
+
836
+ #: mailchimp_widget.php:644
837
+ msgid "Saint Kitts and Nevis"
838
+ msgstr ""
839
+
840
+ #: mailchimp_widget.php:645
841
+ msgid "Saint Lucia"
842
  msgstr ""
843
 
844
+ #: mailchimp_widget.php:646
845
+ msgid "Samoa (Independent)"
846
+ msgstr ""
847
+
848
+ #: mailchimp_widget.php:647
849
+ msgid "San Marino"
850
+ msgstr ""
851
+
852
+ #: mailchimp_widget.php:648
853
+ msgid "Saudi Arabia"
854
+ msgstr ""
855
+
856
+ #: mailchimp_widget.php:649
857
+ msgid "Senegal"
858
+ msgstr ""
859
+
860
+ #: mailchimp_widget.php:650
861
+ msgid "Serbia"
862
+ msgstr ""
863
+
864
+ #: mailchimp_widget.php:651
865
+ msgid "Seychelles"
866
+ msgstr ""
867
+
868
+ #: mailchimp_widget.php:652
869
+ msgid "Singapore"
870
+ msgstr ""
871
+
872
+ #: mailchimp_widget.php:653
873
+ msgid "Slovakia"
874
+ msgstr ""
875
+
876
+ #: mailchimp_widget.php:654
877
+ msgid "Slovenia"
878
+ msgstr ""
879
+
880
+ #: mailchimp_widget.php:655
881
+ msgid "Solomon Islands"
882
+ msgstr ""
883
+
884
+ #: mailchimp_widget.php:656
885
+ msgid "South Africa"
886
+ msgstr ""
887
+
888
+ #: mailchimp_widget.php:657
889
+ msgid "South Korea"
890
+ msgstr ""
891
+
892
+ #: mailchimp_widget.php:658
893
+ msgid "Spain"
894
+ msgstr ""
895
+
896
+ #: mailchimp_widget.php:659
897
+ msgid "Sri Lanka"
898
+ msgstr ""
899
+
900
+ #: mailchimp_widget.php:660
901
+ msgid "Sudan"
902
+ msgstr ""
903
+
904
+ #: mailchimp_widget.php:661
905
+ msgid "Suriname"
906
+ msgstr ""
907
+
908
+ #: mailchimp_widget.php:662
909
+ msgid "Swaziland"
910
+ msgstr ""
911
+
912
+ #: mailchimp_widget.php:663
913
+ msgid "Sweden"
914
+ msgstr ""
915
+
916
+ #: mailchimp_widget.php:664
917
+ msgid "Switzerland"
918
+ msgstr ""
919
+
920
+ #: mailchimp_widget.php:665
921
+ msgid "Taiwan"
922
+ msgstr ""
923
+
924
+ #: mailchimp_widget.php:666
925
+ msgid "Tanzania"
926
+ msgstr ""
927
+
928
+ #: mailchimp_widget.php:667
929
+ msgid "Thailand"
930
+ msgstr ""
931
+
932
+ #: mailchimp_widget.php:668
933
+ msgid "Togo"
934
+ msgstr ""
935
+
936
+ #: mailchimp_widget.php:669
937
+ msgid "Tonga"
938
+ msgstr ""
939
+
940
+ #: mailchimp_widget.php:670
941
+ msgid "Trinidad and Tobago"
942
+ msgstr ""
943
+
944
+ #: mailchimp_widget.php:671
945
+ msgid "Tunisia"
946
+ msgstr ""
947
+
948
+ #: mailchimp_widget.php:672
949
+ msgid "Turkey"
950
+ msgstr ""
951
+
952
+ #: mailchimp_widget.php:673
953
+ msgid "Turks &amp; Caicos Islands"
954
+ msgstr ""
955
+
956
+ #: mailchimp_widget.php:674
957
+ msgid "Uganda"
958
+ msgstr ""
959
+
960
+ #: mailchimp_widget.php:675
961
+ msgid "Ukraine"
962
+ msgstr ""
963
+
964
+ #: mailchimp_widget.php:676
965
+ msgid "United Arab Emirates"
966
+ msgstr ""
967
+
968
+ #: mailchimp_widget.php:677
969
+ msgid "United Kingdom"
970
+ msgstr ""
971
+
972
+ #: mailchimp_widget.php:678
973
+ msgid "Uruguay"
974
+ msgstr ""
975
+
976
+ #: mailchimp_widget.php:679
977
+ msgid "Vanuatu"
978
+ msgstr ""
979
+
980
+ #: mailchimp_widget.php:680
981
+ msgid "Vatican City State (Holy See)"
982
+ msgstr ""
983
+
984
+ #: mailchimp_widget.php:681
985
+ msgid "Venezuela"
986
+ msgstr ""
987
+
988
+ #: mailchimp_widget.php:682
989
+ msgid "Vietnam"
990
+ msgstr ""
991
+
992
+ #: mailchimp_widget.php:683
993
+ msgid "Virgin Islands (British)"
994
+ msgstr ""
995
+
996
+ #: mailchimp_widget.php:684
997
+ msgid "Virgin Islands (U.S.)"
998
+ msgstr ""
999
+
1000
+ #: mailchimp_widget.php:685
1001
+ msgid "Zambia"
1002
+ msgstr ""
1003
+
1004
+ #: mailchimp_widget.php:686
1005
+ msgid "Zimbabwe"
1006
+ msgstr ""
1007
+
1008
+ #: views/setup_page.php:4
1009
+ msgid "MailChimp List Setup"
1010
+ msgstr ""
1011
+
1012
+ #: views/setup_page.php:26
1013
+ msgid "Log In"
1014
+ msgstr ""
1015
+
1016
+ #: views/setup_page.php:27
1017
  msgid ""
1018
+ "To get started, we’ll need to access your MailChimp account with an <a href="
1019
+ "\"http://kb.mailchimp.com/integrations/api-integrations/about-api-keys\">API "
1020
+ "Key</a>. Paste your MailChimp API key, and click <strong>Connect</strong> to "
1021
+ "continue.\n"
1022
  msgstr ""
1023
 
1024
+ #: views/setup_page.php:33
1025
+ msgid "Don't have a MailChimp account?"
1026
  msgstr ""
1027
 
1028
+ #: views/setup_page.php:34
1029
+ msgid "Try one for Free!"
1030
  msgstr ""
1031
 
1032
+ #: views/setup_page.php:43
1033
+ msgid "Connect to MailChimp"
1034
  msgstr ""
1035
 
1036
+ #: views/setup_page.php:62
1037
  msgid "Notes"
1038
  msgstr ""
1039
 
1040
+ #: views/setup_page.php:64
1041
  msgid "Changing your settings at MailChimp.com may cause this to stop working."
1042
  msgstr ""
1043
 
1044
+ #: views/setup_page.php:65
1045
  msgid ""
1046
  "If you change your login to a different account, the info you have setup "
1047
  "below will be erased."
1048
  msgstr ""
1049
 
1050
+ #: views/setup_page.php:66
1051
  msgid ""
1052
  "If any of that happens, no biggie - just reconfigure your login and the "
1053
  "items below..."
1054
  msgstr ""
1055
 
1056
+ #: views/setup_page.php:78
1057
  msgid "Logged in as"
1058
  msgstr ""
1059
 
1060
+ #: views/setup_page.php:84
1061
  msgid "Logout"
1062
  msgstr ""
1063
 
1064
+ #: views/setup_page.php:99
1065
  msgid "Your Lists"
1066
  msgstr ""
1067
 
1068
+ #: views/setup_page.php:103
1069
+ msgid "Please select the MailChimp list you’d like to connect to your form."
1070
  msgstr ""
1071
 
1072
+ #: views/setup_page.php:104
1073
+ msgid "Note:"
1074
+ msgstr ""
1075
+
1076
+ #: views/setup_page.php:104
1077
+ msgid ""
1078
+ "Updating your list will not remove list settings in this plugin, but "
1079
+ "changing lists will."
1080
+ msgstr ""
1081
+
1082
+ #: views/setup_page.php:117
1083
  msgid ""
1084
  "Uh-oh, you don't have any lists defined! Please visit %s, login, and setup a "
1085
  "list before using this tool!"
1086
  msgstr ""
1087
 
1088
+ #: views/setup_page.php:130
1089
  msgid "Select A List"
1090
  msgstr ""
1091
 
1092
+ #: views/setup_page.php:143
1093
  msgid "Update List"
1094
  msgstr ""
1095
 
1096
+ #: views/setup_page.php:164
1097
+ msgid "Reset List Options and Select again"
1098
+ msgstr ""
1099
+
1100
+ #: views/setup_page.php:168
1101
+ msgid "Subscribe Form Widget Settings for this List"
1102
+ msgstr ""
1103
+
1104
+ #: views/setup_page.php:169
1105
+ msgid "Selected MailChimp List"
1106
+ msgstr ""
1107
+
1108
+ #: views/setup_page.php:189
1109
+ msgid "Header"
1110
  msgstr ""
1111
 
1112
+ #: views/setup_page.php:192 views/setup_page.php:200
1113
  msgid ""
1114
+ "Add your own text, HTML markup (including image links), or keep it blank."
 
1115
  msgstr ""
1116
 
1117
+ #: views/setup_page.php:197
1118
+ msgid "Sub-header"
1119
  msgstr ""
1120
 
1121
+ #: views/setup_page.php:201
1122
+ msgid "This will be displayed under the heading and above the form."
1123
  msgstr ""
1124
 
1125
+ #: views/setup_page.php:206
1126
+ msgid "Submit Button"
1127
  msgstr ""
1128
 
1129
+ #: views/setup_page.php:213 views/setup_page.php:242 views/setup_page.php:287
1130
+ #: views/setup_page.php:337
1131
  msgid "Update Subscribe Form Settings"
1132
  msgstr ""
1133
 
1134
+ #: views/setup_page.php:217
1135
+ msgid "Remove CSS"
1136
  msgstr ""
1137
 
1138
+ #: views/setup_page.php:217
1139
  msgid ""
1140
+ "This will disable all MailChimp CSS, so it’s recommended for WordPress "
1141
+ "experts only."
 
1142
  msgstr ""
1143
 
1144
+ #: views/setup_page.php:226
1145
+ msgid "Enabled?"
1146
  msgstr ""
1147
 
1148
+ #: views/setup_page.php:226
1149
+ msgid "Edit the default MailChimp CSS style."
 
 
 
1150
  msgstr ""
1151
 
1152
+ #: views/setup_page.php:228
1153
+ msgid "Border Width (px)"
1154
+ msgstr ""
1155
+
1156
+ #: views/setup_page.php:229
1157
+ msgid "Set to 0 for no border, do not enter"
1158
  msgstr ""
1159
 
1160
+ #: views/setup_page.php:231
1161
+ msgid "Border Color"
1162
  msgstr ""
1163
 
1164
+ #: views/setup_page.php:232 views/setup_page.php:235 views/setup_page.php:238
1165
+ msgid "Do not enter initial"
1166
  msgstr ""
1167
 
1168
+ #: views/setup_page.php:234
1169
+ msgid "Text Color"
1170
+ msgstr ""
1171
+
1172
+ #: views/setup_page.php:237
1173
+ msgid "Background Color"
1174
  msgstr ""
1175
 
1176
+ #: views/setup_page.php:248
1177
+ msgid "MonkeyRewards"
1178
  msgstr ""
1179
 
1180
+ #: views/setup_page.php:250
1181
+ msgid ""
1182
+ "We’ll add a \"powered by MailChimp\" link to your form that will help you "
1183
+ "earn <a href=\"http://kb.mailchimp.com/accounts/account-setup/monkeyrewards-"
1184
+ "credits\" target=\"_blank\">MonkeyRewards</a>. You can turn it off at any "
1185
+ "time."
1186
  msgstr ""
1187
 
1188
+ #: views/setup_page.php:255
1189
+ msgid "Use JavaScript Support?"
1190
  msgstr ""
1191
 
1192
+ #: views/setup_page.php:257
1193
  msgid ""
1194
+ "This plugin uses JavaScript submission, and it should degrade gracefully for "
1195
+ "users not using JavaScript. It is optional, and you can turn it off at any "
1196
+ "time."
1197
  msgstr ""
1198
 
1199
+ #: views/setup_page.php:262
1200
+ msgid "Use JavaScript Datepicker?"
1201
  msgstr ""
1202
 
1203
+ #: views/setup_page.php:264
1204
+ msgid "We’ll use the jQuery UI Datepicker for dates."
1205
  msgstr ""
1206
 
1207
+ #: views/setup_page.php:269
1208
+ msgid "Use Double Opt-In (Recommended)?"
1209
+ msgstr ""
1210
+
1211
+ #: views/setup_page.php:271
1212
+ msgid ""
1213
+ "Before new your subscribers are added via the plugin, they'll need to "
1214
+ "confirm their email address."
1215
  msgstr ""
1216
 
1217
+ #: views/setup_page.php:276
1218
+ msgid "Include Unsubscribe link?"
 
1219
  msgstr ""
1220
 
1221
+ #: views/setup_page.php:278
1222
+ msgid "We’ll automatically add a link to your list’s unsubscribe form."
1223
  msgstr ""
1224
 
1225
+ #: views/setup_page.php:292
1226
+ msgid "Merge Fields Included"
1227
  msgstr ""
1228
 
1229
+ #: views/setup_page.php:299
1230
+ msgid "No Merge Fields found."
1231
  msgstr ""
1232
 
1233
+ #: views/setup_page.php:306
1234
  msgid "Name"
1235
  msgstr ""
1236
 
1237
+ #: views/setup_page.php:307
1238
  msgid "Tag"
1239
  msgstr ""
1240
 
1241
+ #: views/setup_page.php:308
1242
  msgid "Required?"
1243
  msgstr ""
1244
 
1245
+ #: views/setup_page.php:309
1246
  msgid "Include?"
1247
  msgstr ""
1248
 
1249
+ #: views/setup_page.php:344
1250
+ msgid "Group Settings"
1251
  msgstr ""
1252
 
1253
+ #: views/setup_page.php:351
1254
  msgid "No Interest Groups Setup for this List"
1255
  msgstr ""
1256
 
1257
+ #: views/setup_page.php:363
1258
  msgid "Show?"
1259
  msgstr ""
1260
 
1261
+ #: views/setup_page.php:370
1262
  msgid "Input Type"
1263
  msgstr ""
1264
 
1265
+ #: views/setup_page.php:374
1266
  msgid "Options"
1267
  msgstr ""
1268
 
1269
+ #. #-#-#-#-# plugin.pot (MailChimp 1.5.1) #-#-#-#-#
1270
+ #. Plugin Name of the plugin/theme
1271
+ #. #-#-#-#-# plugin.pot (MailChimp 1.5.1) #-#-#-#-#
1272
+ #. Author of the plugin/theme
1273
+ msgid "MailChimp"
1274
  msgstr ""
1275
 
1276
+ #. Plugin URI of the plugin/theme
1277
+ msgid "http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/"
1278
  msgstr ""
1279
 
1280
+ #. Description of the plugin/theme
1281
+ msgid ""
1282
+ "The MailChimp plugin allows you to quickly and easily add a signup form for "
1283
+ "your MailChimp list."
1284
  msgstr ""
1285
 
1286
+ #. Author URI of the plugin/theme
1287
+ msgid "https://mailchimp.com/"
1288
  msgstr ""
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: MailChimp
3
  Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
4
  Requires at least: 2.8
5
  Tested up to: 4.5
6
- Stable tag: 1.5.1
7
 
8
  == Description ==
9
 
@@ -127,6 +127,15 @@ Added support for multiple interest groups, field formatting based on type and d
127
 
128
  == Changelog ==
129
 
 
 
 
 
 
 
 
 
 
130
  = 1.5.1 =
131
  * Bugfix for fatal error in MailChimp lib
132
 
3
  Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
4
  Requires at least: 2.8
5
  Tested up to: 4.5
6
+ Stable tag: 1.5.3
7
 
8
  == Description ==
9
 
127
 
128
  == Changelog ==
129
 
130
+ = 1.5.3 =
131
+ * Fix PHP7 compatibility issue
132
+ * Cut down on size of API requests for users with large lists.
133
+ * Fix CSS issue on removing MailChimp style.
134
+
135
+ = 1.5.2 =
136
+ * General bugfixes for merge fields.
137
+ * When reinitializing, update merge field values.
138
+
139
  = 1.5.1 =
140
  * Bugfix for fatal error in MailChimp lib
141
 
test.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ $phone = array('area' => '123', 'base' => '456','ext' => '0000');
3
+ var_dump(array_filter($phone));
tests/bootstrap.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PHPUnit bootstrap file
4
+ *
5
+ * @package mailchimp
6
+ */
7
+
8
+ $_tests_dir = getenv( 'WP_TESTS_DIR' );
9
+ if ( ! $_tests_dir ) {
10
+ $_tests_dir = '/tmp/wordpress-tests-lib';
11
+ }
12
+
13
+ // Give access to tests_add_filter() function.
14
+ require_once $_tests_dir . '/includes/functions.php';
15
+
16
+ /**
17
+ * Manually load the plugin being tested.
18
+ */
19
+ function _manually_load_plugin() {
20
+ require dirname( dirname( __FILE__ ) ) . '/mailchimp.php';
21
+ }
22
+ tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
23
+
24
+ // Start up the WP testing environment.
25
+ require $_tests_dir . '/includes/bootstrap.php';
tests/test-sample.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SampleTest
4
+ *
5
+ * @package
6
+ */
7
+
8
+ /**
9
+ * Sample test case.
10
+ */
11
+ class SampleTest extends WP_UnitTestCase {
12
+ public $apikey = 'a885bcc7f6edcd28f0060ac9b336312d-us3';
13
+ public $list_id = '';
14
+
15
+ function test_missing_apikey() {
16
+ $apikey = 'asdf';
17
+ $api = new MailChimp_API($apikey);
18
+ $key = mailchimpSF_verify_key($api);
19
+
20
+ $this->assertTrue(is_wp_error($key));
21
+ }
22
+
23
+ function test_correct_apikey() {
24
+ $apikey = $this->apikey; // REMOVE ME.
25
+ try {
26
+ $api = new MailChimp_API($apikey);
27
+ $value = true;
28
+ } catch (Exception $e) {
29
+ $value = false;
30
+ }
31
+
32
+ $this->assertTrue($value);
33
+ }
34
+
35
+ function test_missing_required_merge_vars() {
36
+ $fname = array(
37
+ 'tag' => 'FNAME',
38
+ 'name' => 'First Name',
39
+ 'type' => 'text',
40
+ 'required' => 'Y'
41
+ );
42
+
43
+ $merge_vars[] = $fname;
44
+
45
+ $submit = mailchimpSF_merge_submit($merge_vars);
46
+
47
+ // Merge value defaults to empty string, which should error
48
+ $this->assertTrue(is_wp_error($submit));
49
+ $this->assertTrue(is_object($submit));
50
+ }
51
+
52
+ function test_required_merge_var() {
53
+ $name = 'mc_mv_FNAME';
54
+ $fname = array(
55
+ 'tag' => 'FNAME',
56
+ 'name' => 'First Name',
57
+ 'type' => 'text',
58
+ 'required' => 'Y'
59
+ );
60
+ $merge_vars[] = $fname;
61
+ $_POST[$name] = 'Hello World';
62
+
63
+ $submit = mailchimpSF_merge_submit($merge_vars);
64
+
65
+ $this->assertFalse(is_wp_error($submit));
66
+ $this->assertTrue(is_object($submit));
67
+ }
68
+
69
+ function test_invalid_phone_number() {
70
+ $var['name'] = 'Phone';
71
+ $value = array('asd','555','1234');
72
+ $phone = mailchimpSF_merge_validate_phone($value, $var);
73
+
74
+ $this->assertTrue(is_wp_error($phone));
75
+ $this->assertTrue(is_object($phone));
76
+ }
77
+
78
+ function test_valid_phone_number() {
79
+ $var['name'] = 'Phone';
80
+ $value = array('123','456','7890');
81
+ $phone = mailchimpSF_merge_validate_phone($value, $var);
82
+
83
+ $this->assertFalse(is_wp_error($phone));
84
+ $this->assertTrue(is_string($phone));
85
+ }
86
+
87
+ function test_invalid_address() {
88
+ $var = array(
89
+ 'tag' => 'ADDRESS',
90
+ 'name' => 'Address',
91
+ 'type' => 'Address',
92
+ 'required' => 'Y'
93
+ );
94
+ $value = array(
95
+ 'addr1' => '123 Magic Street'
96
+ );
97
+ $submit = mailchimpSF_merge_validate_address($value, $var);
98
+
99
+ $this->assertTrue(is_wp_error($submit));
100
+ $this->assertTrue(is_object($submit));
101
+ }
102
+
103
+ function test_remove_empty_merge_feilds() {
104
+ $merge = new StdClass();
105
+ $merge->fname = 'test';
106
+ $merge->test = ' ';
107
+ $merge->hello = null;
108
+
109
+ $submit = mailchimpSF_merge_remove_empty($merge);
110
+
111
+ $this->assertTrue($merge->fname === $submit->fname);
112
+ $this->assertTrue(empty($submit->test));
113
+ $this->assertTrue(empty($submit->hello));
114
+ }
115
+
116
+ function test_delete_everything() {
117
+ $fname = array(
118
+ 'tag' => 'FNAME',
119
+ 'name' => 'First Name',
120
+ 'type' => 'text',
121
+ 'required' => 'Y'
122
+ );
123
+
124
+ $ig = array(
125
+ 'id' => '123'
126
+ );
127
+
128
+ $igs[] = $ig;
129
+
130
+ update_option('mc_list_id', '123');
131
+ update_option('mc_list_name', 'asdf');
132
+ update_option('mc_interest_groups', $igs);
133
+ update_option('mc_merge_vars', array($fname));
134
+ update_option('mc_show_interest_groups_123', 'on');
135
+ update_option('mc_mv_FNAME', $fname);
136
+
137
+ $this->assertTrue(is_string(get_option('mc_list_id')));
138
+ $this->assertTrue(is_string(get_option('mc_list_name')));
139
+ $this->assertTrue(is_string(get_option('mc_show_interest_groups_123')));
140
+ $this->assertTrue(is_array(get_option('mc_mv_FNAME')));
141
+
142
+ mailchimpSF_delete_setup();
143
+
144
+ $this->assertFalse(get_option('mc_list_id'));
145
+ $this->assertFalse(get_option('mc_list_name'));
146
+ $this->assertFalse(get_option('mc_show_interest_groups_123'));
147
+ $this->assertFalse(get_option('mc_mv_FNAME'));
148
+ }
149
+
150
+ function test_add_email_field() {
151
+ $merge = array(
152
+ array(
153
+ 'tag' => 'TEST',
154
+ 'name' => 'test',
155
+ 'type' => 'text',
156
+ 'required' => false,
157
+ 'public' => true,
158
+ 'display_order' => 2,
159
+ 'default_value' => null
160
+ )
161
+ );
162
+ $merge = mailchimpSF_add_email_field($merge);
163
+
164
+ $this->assertTrue($merge[0]['tag'] == 'EMAIL');
165
+ }
166
+
167
+ }
views/setup_page.php CHANGED
@@ -106,7 +106,7 @@ if ($api){
106
  <form method="post" action="options-general.php?page=mailchimpSF_options">
107
  <?php
108
  //we *could* support paging, but few users have that many lists (and shouldn't)
109
- $lists = $api->get('lists',100);
110
  $lists = $lists['lists'];
111
 
112
  if (count($lists) == 0) {
@@ -271,6 +271,12 @@ if (get_option('mc_list_id') == '') return;
271
  <em><label for="mc_double_optin"><?php esc_html_e('Before new your subscribers are added via the plugin, they\'ll need to confirm their email address.', 'mailchimp_i18n'); ?></label></em>
272
  </td>
273
  </tr>
 
 
 
 
 
 
274
 
275
  <tr valign="top" class="last-row">
276
  <th scope="row"><?php esc_html_e('Include Unsubscribe link?', 'mailchimp_i18n'); ?></th>
106
  <form method="post" action="options-general.php?page=mailchimpSF_options">
107
  <?php
108
  //we *could* support paging, but few users have that many lists (and shouldn't)
109
+ $lists = $api->get('lists', 100, array('fields' => 'lists.id,lists.name,lists.email_type_option'));
110
  $lists = $lists['lists'];
111
 
112
  if (count($lists) == 0) {
271
  <em><label for="mc_double_optin"><?php esc_html_e('Before new your subscribers are added via the plugin, they\'ll need to confirm their email address.', 'mailchimp_i18n'); ?></label></em>
272
  </td>
273
  </tr>
274
+ <tr valign="top">
275
+ <th scope="row"><?php esc_html_e('Update existing subscribers?', 'mailchimp_i18n'); ?></th>
276
+ <td><input name="mc_update_existing" type="checkbox" <?php checked(get_option('mc_update_existing'), true); ?> id="mc_update_existing" class="code" />
277
+ <em><label for="mc_double_optin"><?php esc_html_e('If an existing subscriber fills out this form, we will update their information with what\'s provided.', 'mailchimp_i18n'); ?></label></em>
278
+ </td>
279
+ </tr>
280
 
281
  <tr valign="top" class="last-row">
282
  <th scope="row"><?php esc_html_e('Include Unsubscribe link?', 'mailchimp_i18n'); ?></th>