Version Description
- October 14, 2015 =
Fixes
- Error in Russian translation, causing a broken link on the MailChimp settings page.
Improvements
- Textual improvements to MailChimp settings page.
- Connectivity issues with MailChimp will now always show an error message.
- Renewing MailChimp lists will now also update the output of the
{subscriber_count}
tag.
Download this release
Release Info
Developer | DvanKooten |
Plugin | MailChimp for WordPress |
Version | 2.3.16 |
Comparing to | |
See all releases |
Code changes from version 2.3.15 to 2.3.16
- assets/css/admin.css +4 -0
- assets/css/admin.min.css +1 -1
- includes/admin/class-admin.php +0 -1
- includes/admin/class-usage-tracking-nag.php +45 -8
- includes/admin/class-usage-tracking.php +48 -2
- includes/class-api.php +138 -131
- includes/class-field-mapper.php +0 -328
- includes/class-mailchimp.php +2 -0
- includes/views/api-settings.php +26 -18
- languages/mailchimp-for-wp-pt_BR.mo +0 -0
- languages/mailchimp-for-wp-pt_BR.po +23 -23
- languages/mailchimp-for-wp-ru_RU.mo +0 -0
- languages/mailchimp-for-wp-ru_RU.po +4 -3
- mailchimp-for-wp.php +2 -3
- readme.txt +15 -1
- vendor/composer/include_paths.php +0 -10
assets/css/admin.css
CHANGED
@@ -6,6 +6,10 @@
|
|
6 |
margin-bottom: 20px;
|
7 |
}
|
8 |
|
|
|
|
|
|
|
|
|
9 |
#mc4wp-content{
|
10 |
float:left;
|
11 |
width:65%;
|
6 |
margin-bottom: 20px;
|
7 |
}
|
8 |
|
9 |
+
#mc4wp-admin hr {
|
10 |
+
margin: 20px 0 40px 0;
|
11 |
+
}
|
12 |
+
|
13 |
#mc4wp-content{
|
14 |
float:left;
|
15 |
width:65%;
|
assets/css/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#mc4wp-admin .page-title{background:url("../img/icon-large.png") left center no-repeat;padding-left:42px;line-height:32px;margin-bottom:20px}#mc4wp-content{float:left;width:65%}#mc4wp-sidebar{float:left;width:33%;margin-left:2%;border-left:1px solid #ccc;padding:0 0 0 2%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.valigntop{vertical-align:top!important}.mc4wp-box{margin-bottom:20px}.mc4wp-box label{font-weight:700}#mc4wp-upgrade-box{background:#222;color:#ddd;padding:20px}#mc4wp-upgrade-box a{color:#ccc}#mc4wp-upgrade-box h3{margin:0;color:#fff}#mc4wp-upgrade-box .mc4wp-upgrade-button{box-shadow:none;background:#FF8C00;border-color:#b56200;margin-right:10px;color:#fff}#mc4wp-fw h4{margin-top:0}#mc4wp-fw p{margin-bottom:1em}#mc4wp-fw-fields{display:none}#mc4wp-fw-preview{font-family:"Courier New",Courier,monospace;min-height:200px;font-size:11px;background:#fff;z-index:99}#mc4wp-lists{margin:0}#mc4wp-lists input{margin-right:5px}.mc4wp-settings tr.pro-feature td,.mc4wp-settings tr.pro-feature th,.pro-feature{color:#aaa}#mc4wp-admin .status{display:inline-block;margin-left:1em;padding:3px 6px;color:#fff;font-size:12px;font-weight:700}#mc4wp-admin .positive{background-color:#32cd32}#mc4wp-admin .negative{background-color:red}#mc4wp-admin .neutral{background:gray}#mc4wp-admin table th{text-align:left}#mc4wp-admin table.form-table tr td:first-child,#mc4wp-admin table.form-table tr th:first-child{padding-left:0}#mc4wp-admin td.nowrap{white-space:nowrap}#mc4wp-admin td.desc{font-style:italic;font-size:11px}.mc4wp-notice{padding:6px 8px;color:#31708f;background:#d9edf7;border:1px solid #bce8f1;margin:1em 0!important}#mc4wp-admin .mc4wp-col{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:50%;padding:0 5px}#mc4wp-admin .mc4wp-first{padding-left:0}#mc4wp-admin .mc4wp-last{padding-right:0}.mc4wp-well{background:#fff;padding:10px;border:1px solid #ccc}.mc4wp-title{font-size:1.4em;margin:1.6em 0 1em;padding:0 0 6px;border-bottom:1px solid #ddd}table.mc4wp-help,table.mc4wp-help td,table.mc4wp-help th{border:1px solid #ddd;border-collapse:collapse;font-size:12px}table.mc4wp-help td,table.mc4wp-help th{vertical-align:text-top;text-align:left;padding:5px 10px}table.mc4wp-help tr:hover{background-color:#ddd}#mc4wp-admin .wp-list-table code{float:right}.mc4wp-lists-overview{border-collapse:collapse;background:#fff;padding:20px;max-height:500px;overflow-y:scroll}.mc4wp-lists-overview table{border:0}.mc4wp-lists-overview th{font-weight:700;vertical-align:top}.mc4wp-lists-overview td,.mc4wp-lists-overview th{border:1px solid #efefef}.mc4wp-lists-overview h3{margin:0!important}@media(max-width:1279px){#mc4wp-content,#mc4wp-sidebar{float:none;width:100%;padding:0;margin:0}#mc4wp-sidebar{border-left:0;border-top:1px solid #ccc;margin-top:25px;padding-top:25px}#mc4wp-admin .wp-list-table code{float:none}}@media(max-width:860px){.mc4wp-hide-smallscreens{display:none}}
|
1 |
+
#mc4wp-admin .page-title{background:url("../img/icon-large.png") left center no-repeat;padding-left:42px;line-height:32px;margin-bottom:20px}#mc4wp-admin hr{margin:20px 0 40px}#mc4wp-content{float:left;width:65%}#mc4wp-sidebar{float:left;width:33%;margin-left:2%;border-left:1px solid #ccc;padding:0 0 0 2%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.valigntop{vertical-align:top!important}.mc4wp-box{margin-bottom:20px}.mc4wp-box label{font-weight:700}#mc4wp-upgrade-box{background:#222;color:#ddd;padding:20px}#mc4wp-upgrade-box a{color:#ccc}#mc4wp-upgrade-box h3{margin:0;color:#fff}#mc4wp-upgrade-box .mc4wp-upgrade-button{box-shadow:none;background:#FF8C00;border-color:#b56200;margin-right:10px;color:#fff}#mc4wp-fw h4{margin-top:0}#mc4wp-fw p{margin-bottom:1em}#mc4wp-fw-fields{display:none}#mc4wp-fw-preview{font-family:"Courier New",Courier,monospace;min-height:200px;font-size:11px;background:#fff;z-index:99}#mc4wp-lists{margin:0}#mc4wp-lists input{margin-right:5px}.mc4wp-settings tr.pro-feature td,.mc4wp-settings tr.pro-feature th,.pro-feature{color:#aaa}#mc4wp-admin .status{display:inline-block;margin-left:1em;padding:3px 6px;color:#fff;font-size:12px;font-weight:700}#mc4wp-admin .positive{background-color:#32cd32}#mc4wp-admin .negative{background-color:red}#mc4wp-admin .neutral{background:gray}#mc4wp-admin table th{text-align:left}#mc4wp-admin table.form-table tr td:first-child,#mc4wp-admin table.form-table tr th:first-child{padding-left:0}#mc4wp-admin td.nowrap{white-space:nowrap}#mc4wp-admin td.desc{font-style:italic;font-size:11px}.mc4wp-notice{padding:6px 8px;color:#31708f;background:#d9edf7;border:1px solid #bce8f1;margin:1em 0!important}#mc4wp-admin .mc4wp-col{float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:50%;padding:0 5px}#mc4wp-admin .mc4wp-first{padding-left:0}#mc4wp-admin .mc4wp-last{padding-right:0}.mc4wp-well{background:#fff;padding:10px;border:1px solid #ccc}.mc4wp-title{font-size:1.4em;margin:1.6em 0 1em;padding:0 0 6px;border-bottom:1px solid #ddd}table.mc4wp-help,table.mc4wp-help td,table.mc4wp-help th{border:1px solid #ddd;border-collapse:collapse;font-size:12px}table.mc4wp-help td,table.mc4wp-help th{vertical-align:text-top;text-align:left;padding:5px 10px}table.mc4wp-help tr:hover{background-color:#ddd}#mc4wp-admin .wp-list-table code{float:right}.mc4wp-lists-overview{border-collapse:collapse;background:#fff;padding:20px;max-height:500px;overflow-y:scroll}.mc4wp-lists-overview table{border:0}.mc4wp-lists-overview th{font-weight:700;vertical-align:top}.mc4wp-lists-overview td,.mc4wp-lists-overview th{border:1px solid #efefef}.mc4wp-lists-overview h3{margin:0!important}@media(max-width:1279px){#mc4wp-content,#mc4wp-sidebar{float:none;width:100%;padding:0;margin:0}#mc4wp-sidebar{border-left:0;border-top:1px solid #ccc;margin-top:25px;padding-top:25px}#mc4wp-admin .wp-list-table code{float:none}}@media(max-width:860px){.mc4wp-hide-smallscreens{display:none}}
|
includes/admin/class-admin.php
CHANGED
@@ -23,7 +23,6 @@ class MC4WP_Lite_Admin
|
|
23 |
*/
|
24 |
public function __construct() {
|
25 |
|
26 |
-
|
27 |
$this->plugin_file = plugin_basename( MC4WP_LITE_PLUGIN_FILE );
|
28 |
$this->mailchimp = new MC4WP_MailChimp();
|
29 |
$this->load_translations();
|
23 |
*/
|
24 |
public function __construct() {
|
25 |
|
|
|
26 |
$this->plugin_file = plugin_basename( MC4WP_LITE_PLUGIN_FILE );
|
27 |
$this->mailchimp = new MC4WP_MailChimp();
|
28 |
$this->load_translations();
|
includes/admin/class-usage-tracking-nag.php
CHANGED
@@ -13,15 +13,26 @@ class MC4WP_Usage_Tracking_Nag {
|
|
13 |
protected $required_capability = 'manage_options';
|
14 |
|
15 |
/**
|
16 |
-
* The name of the option to store whether this nag was shown in
|
17 |
*/
|
18 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
/**
|
21 |
* @param string $required_capability
|
22 |
*/
|
23 |
public function __construct( $required_capability = '' ) {
|
24 |
-
|
|
|
25 |
|
26 |
if( ! empty( $required_capability ) ) {
|
27 |
$this->required_capability = $required_capability;
|
@@ -43,15 +54,20 @@ class MC4WP_Usage_Tracking_Nag {
|
|
43 |
}
|
44 |
|
45 |
/**
|
46 |
-
*
|
47 |
*/
|
48 |
public function show() {
|
49 |
|
50 |
-
// only show this nag
|
51 |
if( $this->shown ) {
|
52 |
return;
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
55 |
?>
|
56 |
<div class="updated notice">
|
57 |
<p>
|
@@ -86,7 +102,6 @@ class MC4WP_Usage_Tracking_Nag {
|
|
86 |
|
87 |
$allow = ( isset( $_POST['allow'] ) ) ? (bool) $_POST['allow'] : false;
|
88 |
|
89 |
-
|
90 |
if ( $allow ) {
|
91 |
// update plugin options
|
92 |
$options = (array) get_option( 'mc4wp_lite', array() );
|
@@ -97,8 +112,30 @@ class MC4WP_Usage_Tracking_Nag {
|
|
97 |
MC4WP_Usage_Tracking::instance()->toggle( true );
|
98 |
}
|
99 |
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
102 |
$this->shown = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
104 |
}
|
13 |
protected $required_capability = 'manage_options';
|
14 |
|
15 |
/**
|
16 |
+
* @const string The name of the option to store whether this nag was shown in
|
17 |
*/
|
18 |
+
const OPTION_SHOWN = 'mc4wp_usage_tracking_nag_shown';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @const string
|
22 |
+
*/
|
23 |
+
const OPTION_DELAY = 'mc4wp_usage_tracking_nag_delay_started';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @const int The time to wait before showing the notice
|
27 |
+
*/
|
28 |
+
const DELAY_IN_SECONDS = 86400; // 1 day
|
29 |
|
30 |
/**
|
31 |
* @param string $required_capability
|
32 |
*/
|
33 |
public function __construct( $required_capability = '' ) {
|
34 |
+
|
35 |
+
$this->shown = get_option( self::OPTION_SHOWN, 0 );
|
36 |
|
37 |
if( ! empty( $required_capability ) ) {
|
38 |
$this->required_capability = $required_capability;
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
+
* @todo this should be translatable
|
58 |
*/
|
59 |
public function show() {
|
60 |
|
61 |
+
// only show this nag notice did not show before
|
62 |
if( $this->shown ) {
|
63 |
return;
|
64 |
}
|
65 |
|
66 |
+
// don't show this option right away but start showing it after DELAY_IN_SECONDS has passed
|
67 |
+
if( ! $this->is_delayed() ) {
|
68 |
+
$this->delay();
|
69 |
+
return;
|
70 |
+
}
|
71 |
?>
|
72 |
<div class="updated notice">
|
73 |
<p>
|
102 |
|
103 |
$allow = ( isset( $_POST['allow'] ) ) ? (bool) $_POST['allow'] : false;
|
104 |
|
|
|
105 |
if ( $allow ) {
|
106 |
// update plugin options
|
107 |
$options = (array) get_option( 'mc4wp_lite', array() );
|
112 |
MC4WP_Usage_Tracking::instance()->toggle( true );
|
113 |
}
|
114 |
|
115 |
+
$this->disable();
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Make sure nag never shows again and clean-up used options
|
120 |
+
*/
|
121 |
+
public function disable() {
|
122 |
$this->shown = 1;
|
123 |
+
update_option( self::OPTION_SHOWN, 1 );
|
124 |
+
delete_option( self::OPTION_DELAY );
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @return bool
|
129 |
+
*/
|
130 |
+
public function is_delayed() {
|
131 |
+
$delay_started = get_option( self::OPTION_DELAY, time() );
|
132 |
+
return time() > ( $delay_started + self::DELAY_IN_SECONDS );
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Delay this notice (sets an option with the current time)
|
137 |
+
*/
|
138 |
+
public function delay() {
|
139 |
+
add_option( self::OPTION_DELAY, time() );
|
140 |
}
|
141 |
}
|
includes/admin/class-usage-tracking.php
CHANGED
@@ -79,16 +79,42 @@ class MC4WP_Usage_Tracking {
|
|
79 |
'site' => md5( home_url() ),
|
80 |
'options' => $this->get_tracked_options(),
|
81 |
'number_of_mailchimp_lists' => $this->get_mailchimp_lists_count(),
|
82 |
-
'mc4wp_version' =>
|
83 |
'plugins' => (array) get_option( 'active_plugins', array() ),
|
84 |
'php_version' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
|
85 |
'curl_version' => $this->get_curl_version(),
|
86 |
-
'wp_version' => $GLOBALS['wp_version']
|
|
|
|
|
|
|
87 |
);
|
88 |
|
89 |
return $data;
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
/**
|
93 |
* @return int
|
94 |
*/
|
@@ -134,4 +160,24 @@ class MC4WP_Usage_Tracking {
|
|
134 |
$curl_version_info = curl_version();
|
135 |
return $curl_version_info['version'];
|
136 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
79 |
'site' => md5( home_url() ),
|
80 |
'options' => $this->get_tracked_options(),
|
81 |
'number_of_mailchimp_lists' => $this->get_mailchimp_lists_count(),
|
82 |
+
'mc4wp_version' => $this->get_mc4wp_version(),
|
83 |
'plugins' => (array) get_option( 'active_plugins', array() ),
|
84 |
'php_version' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
|
85 |
'curl_version' => $this->get_curl_version(),
|
86 |
+
'wp_version' => $GLOBALS['wp_version'],
|
87 |
+
'wp_language' => get_locale(),
|
88 |
+
'server_software' => $this->get_server_software(),
|
89 |
+
'using_https' => $this->is_site_using_https()
|
90 |
);
|
91 |
|
92 |
return $data;
|
93 |
}
|
94 |
|
95 |
+
/**
|
96 |
+
* Returns the MailChimp for WordPress version (either Lite or Pro if version < 3.0)
|
97 |
+
*
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
protected function get_mc4wp_version() {
|
101 |
+
|
102 |
+
if( defined( 'MC4WP_VERSION' ) ) {
|
103 |
+
return MC4WP_VERSION;
|
104 |
+
}
|
105 |
+
|
106 |
+
if( defined( 'MC4WP_LITE_VERSION' ) ) {
|
107 |
+
return MC4WP_LITE_VERSION;
|
108 |
+
}
|
109 |
+
|
110 |
+
if( defined( 'MC4WP_PRO_VERSION' ) ) {
|
111 |
+
return MC4WP_PRO_VERSION;
|
112 |
+
}
|
113 |
+
|
114 |
+
// never..
|
115 |
+
return 0;
|
116 |
+
}
|
117 |
+
|
118 |
/**
|
119 |
* @return int
|
120 |
*/
|
160 |
$curl_version_info = curl_version();
|
161 |
return $curl_version_info['version'];
|
162 |
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* @return bool
|
166 |
+
*/
|
167 |
+
protected function is_site_using_https() {
|
168 |
+
$site_url = site_url();
|
169 |
+
return strpos( $site_url, 'https://' ) === 0;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* @return string
|
174 |
+
*/
|
175 |
+
protected function get_server_software() {
|
176 |
+
|
177 |
+
if( ! isset( $_SERVER['SERVER_SOFTWARE'] ) ) {
|
178 |
+
return '';
|
179 |
+
}
|
180 |
+
|
181 |
+
return $_SERVER['SERVER_SOFTWARE'];
|
182 |
+
}
|
183 |
}
|
includes/class-api.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* Takes care of requests to the MailChimp API
|
5 |
-
*
|
6 |
-
* @uses WP_HTTP
|
7 |
-
*/
|
8 |
class MC4WP_API {
|
9 |
|
10 |
/**
|
11 |
-
* @var string
|
12 |
*/
|
13 |
private $api_url = 'https://api.mailchimp.com/2.0/';
|
14 |
|
15 |
/**
|
16 |
-
* @var string
|
17 |
*/
|
18 |
private $api_key = '';
|
19 |
|
20 |
/**
|
21 |
-
* @var string
|
22 |
*/
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
-
* @var int
|
27 |
*/
|
28 |
-
|
29 |
|
30 |
/**
|
31 |
-
* @var boolean
|
32 |
*/
|
33 |
private $connected = null;
|
34 |
|
@@ -38,10 +38,10 @@ class MC4WP_API {
|
|
38 |
private $last_response;
|
39 |
|
40 |
/**
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
public function __construct( $api_key ) {
|
46 |
$this->api_key = $api_key;
|
47 |
|
@@ -51,14 +51,14 @@ class MC4WP_API {
|
|
51 |
}
|
52 |
}
|
53 |
|
54 |
-
|
55 |
* Show an error message to administrators
|
56 |
*
|
57 |
* @param string $message
|
|
|
58 |
* @return bool
|
59 |
*/
|
60 |
private function show_error( $message ) {
|
61 |
-
|
62 |
if( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
63 |
return false;
|
64 |
}
|
@@ -72,52 +72,61 @@ class MC4WP_API {
|
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
82 |
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
-
|
|
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
$this->show_error( $result->msg );
|
93 |
-
}
|
94 |
-
} elseif( isset( $result->error ) ) {
|
95 |
-
$this->show_error( 'MailChimp Error: ' . $result->error );
|
96 |
} else {
|
97 |
-
$this->show_error(
|
98 |
}
|
|
|
|
|
99 |
}
|
100 |
-
|
101 |
}
|
102 |
|
|
|
103 |
return $this->connected;
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
public function subscribe(
|
121 |
$data = array(
|
122 |
'id' => $list_id,
|
123 |
'email' => array( 'email' => $email),
|
@@ -126,7 +135,7 @@ class MC4WP_API {
|
|
126 |
'double_optin' => $double_optin,
|
127 |
'update_existing' => $update_existing,
|
128 |
'replace_interests' => $replace_interests,
|
129 |
-
'send_welcome' => $send_welcome
|
130 |
);
|
131 |
|
132 |
$response = $this->call( 'lists/subscribe', $data );
|
@@ -139,13 +148,12 @@ class MC4WP_API {
|
|
139 |
}
|
140 |
|
141 |
/**
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
public function get_list_groupings( $list_id ) {
|
147 |
$result = $this->call( 'lists/interest-groupings', array( 'id' => $list_id ) );
|
148 |
-
|
149 |
if( is_array( $result ) ) {
|
150 |
return $result;
|
151 |
}
|
@@ -156,7 +164,7 @@ class MC4WP_API {
|
|
156 |
/**
|
157 |
* @param array $list_ids Array of ID's of the lists to fetch. (optional)
|
158 |
*
|
159 |
-
* @return
|
160 |
*/
|
161 |
public function get_lists( $list_ids = array() ) {
|
162 |
$args = array(
|
@@ -168,7 +176,7 @@ class MC4WP_API {
|
|
168 |
// set filter if the $list_ids parameter was set
|
169 |
if( count( $list_ids ) > 0 ) {
|
170 |
$args['filters'] = array(
|
171 |
-
'list_id' => implode( ',', $list_ids )
|
172 |
);
|
173 |
}
|
174 |
|
@@ -182,11 +190,10 @@ class MC4WP_API {
|
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
-
|
186 |
-
*
|
187 |
-
|
188 |
-
|
189 |
-
*/
|
190 |
public function get_lists_with_merge_vars( $list_ids ) {
|
191 |
$result = $this->call( 'lists/merge-vars', array('id' => $list_ids ) );
|
192 |
|
@@ -198,13 +205,13 @@ class MC4WP_API {
|
|
198 |
}
|
199 |
|
200 |
/**
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
public function get_subscriber_info( $list_id, $emails ) {
|
208 |
|
209 |
if( is_string( $emails ) ) {
|
210 |
$emails = array( $emails );
|
@@ -212,7 +219,7 @@ class MC4WP_API {
|
|
212 |
|
213 |
$result = $this->call( 'lists/member-info', array(
|
214 |
'id' => $list_id,
|
215 |
-
'emails' => $emails
|
216 |
)
|
217 |
);
|
218 |
|
@@ -223,6 +230,23 @@ class MC4WP_API {
|
|
223 |
return false;
|
224 |
}
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
/**
|
227 |
* @param $list_id
|
228 |
* @param array|string $email
|
@@ -237,7 +261,7 @@ class MC4WP_API {
|
|
237 |
// default to using email for updating
|
238 |
if( ! is_array( $email ) ) {
|
239 |
$email = array(
|
240 |
-
'email' => $email
|
241 |
);
|
242 |
}
|
243 |
|
@@ -246,7 +270,7 @@ class MC4WP_API {
|
|
246 |
'email' => $email,
|
247 |
'merge_vars' => $merge_vars,
|
248 |
'email_type' => $email_type,
|
249 |
-
'replace_interests' => $replace_interests
|
250 |
)
|
251 |
);
|
252 |
|
@@ -263,23 +287,6 @@ class MC4WP_API {
|
|
263 |
return false;
|
264 |
}
|
265 |
|
266 |
-
/**
|
267 |
-
* Checks if an email address is on a given list
|
268 |
-
*
|
269 |
-
* @param string $list_id
|
270 |
-
* @param string $email
|
271 |
-
* @return boolean
|
272 |
-
*/
|
273 |
-
public function list_has_subscriber( $list_id, $email ) {
|
274 |
-
$member_info = $this->get_subscriber_info( $list_id, array( array( 'email' => $email ) ) );
|
275 |
-
|
276 |
-
if( is_array( $member_info ) && isset( $member_info[0] ) ) {
|
277 |
-
return ( $member_info[0]->status === 'subscribed' );
|
278 |
-
}
|
279 |
-
|
280 |
-
return false;
|
281 |
-
}
|
282 |
-
|
283 |
/**
|
284 |
* Unsubscribes the given email or luid from the given MailChimp list
|
285 |
*
|
@@ -296,7 +303,7 @@ class MC4WP_API {
|
|
296 |
if( ! is_array( $struct ) ) {
|
297 |
// assume $struct is an email
|
298 |
$struct = array(
|
299 |
-
'email' => $struct
|
300 |
);
|
301 |
}
|
302 |
|
@@ -305,11 +312,12 @@ class MC4WP_API {
|
|
305 |
'email' => $struct,
|
306 |
'delete_member' => $delete_member,
|
307 |
'send_goodbye' => $send_goodbye,
|
308 |
-
'send_notify' => $send_notification
|
309 |
)
|
310 |
);
|
311 |
|
312 |
if( is_object( $response ) ) {
|
|
|
313 |
if ( isset( $response->complete ) && $response->complete ) {
|
314 |
return true;
|
315 |
}
|
@@ -319,15 +327,15 @@ class MC4WP_API {
|
|
319 |
}
|
320 |
|
321 |
/**
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
public function call( $method, array $data = array() ) {
|
332 |
|
333 |
$this->empty_last_response();
|
@@ -350,55 +358,55 @@ class MC4WP_API {
|
|
350 |
// test for wp errors
|
351 |
if( is_wp_error( $response ) ) {
|
352 |
// show error message to admins
|
353 |
-
$this->
|
354 |
return false;
|
355 |
}
|
356 |
|
357 |
-
//
|
358 |
-
if( $method === 'helper/ping' && is_array( $response ) && isset( $response['headers']['content-length'] ) && (int) $response['headers']['content-length'] === 44 ) {
|
359 |
-
return (object) array(
|
360 |
-
'msg' => "Everything's Chimpy!",
|
361 |
-
);
|
362 |
-
}
|
363 |
-
|
364 |
$body = wp_remote_retrieve_body( $response );
|
365 |
-
$
|
366 |
|
367 |
-
|
368 |
-
if( is_object( $response ) ) {
|
369 |
-
$this->last_response = $response;
|
370 |
|
371 |
-
|
372 |
-
|
|
|
|
|
373 |
}
|
374 |
|
375 |
-
|
376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
}
|
378 |
|
379 |
-
|
|
|
|
|
380 |
|
381 |
-
|
382 |
-
return false;
|
383 |
}
|
384 |
|
385 |
-
return $
|
386 |
}
|
387 |
|
388 |
/**
|
389 |
-
* Checks if an error
|
390 |
-
*
|
391 |
-
* @return bool
|
392 |
*/
|
393 |
public function has_error() {
|
394 |
return ( ! empty( $this->error_message ) );
|
395 |
}
|
396 |
|
397 |
/**
|
398 |
-
|
399 |
-
*
|
400 |
-
|
401 |
-
*/
|
402 |
public function get_error_message() {
|
403 |
return $this->error_message;
|
404 |
}
|
@@ -448,5 +456,4 @@ class MC4WP_API {
|
|
448 |
|
449 |
return $headers;
|
450 |
}
|
451 |
-
|
452 |
-
}
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Takes care of requests to the MailChimp API
|
5 |
+
*
|
6 |
+
* @uses WP_HTTP
|
7 |
+
*/
|
8 |
class MC4WP_API {
|
9 |
|
10 |
/**
|
11 |
+
* @var string The URL to the MailChimp API
|
12 |
*/
|
13 |
private $api_url = 'https://api.mailchimp.com/2.0/';
|
14 |
|
15 |
/**
|
16 |
+
* @var string The API key to use
|
17 |
*/
|
18 |
private $api_key = '';
|
19 |
|
20 |
/**
|
21 |
+
* @var string The error message of the latest API request (if any)
|
22 |
*/
|
23 |
+
private $error_message = '';
|
24 |
|
25 |
/**
|
26 |
+
* @var int The error code of the lastest API request (if any)
|
27 |
*/
|
28 |
+
private $error_code = 0;
|
29 |
|
30 |
/**
|
31 |
+
* @var boolean Boolean indicating whether the user is connected with MailChimp
|
32 |
*/
|
33 |
private $connected = null;
|
34 |
|
38 |
private $last_response;
|
39 |
|
40 |
/**
|
41 |
+
* Constructor
|
42 |
+
*
|
43 |
+
* @param string $api_key
|
44 |
+
*/
|
45 |
public function __construct( $api_key ) {
|
46 |
$this->api_key = $api_key;
|
47 |
|
51 |
}
|
52 |
}
|
53 |
|
54 |
+
/**
|
55 |
* Show an error message to administrators
|
56 |
*
|
57 |
* @param string $message
|
58 |
+
*
|
59 |
* @return bool
|
60 |
*/
|
61 |
private function show_error( $message ) {
|
|
|
62 |
if( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
63 |
return false;
|
64 |
}
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
+
* @param $message
|
76 |
+
*
|
77 |
+
* @return bool
|
78 |
+
*/
|
79 |
+
private function show_connection_error( $message ) {
|
80 |
+
$message = rtrim( $message, '.' ) . '. ' . sprintf( '<a href="%s">' . __( 'Read more about common connectivity issues.', 'mailchimp-for-wp' ) . '</a>', 'https://mc4wp.com/kb/solving-connectivity-issues/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=settings-notice' );
|
81 |
+
return $this->show_error( $message );
|
82 |
+
}
|
83 |
|
84 |
+
/**
|
85 |
+
* Pings the MailChimp API to see if we're connected
|
86 |
+
*
|
87 |
+
* The result is cached to ensure a maximum of 1 API call per page load
|
88 |
+
*
|
89 |
+
* @return boolean
|
90 |
+
*/
|
91 |
+
public function is_connected() {
|
92 |
+
if( $this->connected !== null ) {
|
93 |
+
return $this->connected;
|
94 |
+
}
|
95 |
|
96 |
+
$this->connected = false;
|
97 |
+
$result = $this->call( 'helper/ping' );
|
98 |
|
99 |
+
if( $result !== false ) {
|
100 |
+
if( isset( $result->msg ) ) {
|
101 |
+
if( $result->msg === "Everything's Chimpy!" ) {
|
102 |
+
$this->connected = true;
|
|
|
|
|
|
|
|
|
103 |
} else {
|
104 |
+
$this->show_error( $result->msg );
|
105 |
}
|
106 |
+
} elseif( isset( $result->error ) ) {
|
107 |
+
$this->show_error( 'MailChimp Error: ' . $result->error );
|
108 |
}
|
|
|
109 |
}
|
110 |
|
111 |
+
|
112 |
return $this->connected;
|
113 |
}
|
114 |
|
115 |
/**
|
116 |
+
* Sends a subscription request to the MailChimp API
|
117 |
+
*
|
118 |
+
* @param string $list_id The list id to subscribe to
|
119 |
+
* @param string $email The email address to subscribe
|
120 |
+
* @param array $merge_vars Array of extra merge variables
|
121 |
+
* @param string $email_type The email type to send to this email address. Possible values are `html` and `text`.
|
122 |
+
* @param boolean $double_optin Should this email be confirmed via double opt-in?
|
123 |
+
* @param boolean $update_existing Update information if this email is already on list?
|
124 |
+
* @param boolean $replace_interests Replace interest groupings, only if update_existing is true.
|
125 |
+
* @param boolean $send_welcome Send a welcome e-mail, only if double_optin is false.
|
126 |
+
*
|
127 |
+
* @return boolean|string True if success, 'error' if error
|
128 |
+
*/
|
129 |
+
public function subscribe($list_id, $email, array $merge_vars = array(), $email_type = 'html', $double_optin = true, $update_existing = false, $replace_interests = true, $send_welcome = false ) {
|
130 |
$data = array(
|
131 |
'id' => $list_id,
|
132 |
'email' => array( 'email' => $email),
|
135 |
'double_optin' => $double_optin,
|
136 |
'update_existing' => $update_existing,
|
137 |
'replace_interests' => $replace_interests,
|
138 |
+
'send_welcome' => $send_welcome
|
139 |
);
|
140 |
|
141 |
$response = $this->call( 'lists/subscribe', $data );
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
+
* Gets the Groupings for a given List
|
152 |
+
* @param int $list_id
|
153 |
+
* @return array|boolean
|
154 |
+
*/
|
155 |
public function get_list_groupings( $list_id ) {
|
156 |
$result = $this->call( 'lists/interest-groupings', array( 'id' => $list_id ) );
|
|
|
157 |
if( is_array( $result ) ) {
|
158 |
return $result;
|
159 |
}
|
164 |
/**
|
165 |
* @param array $list_ids Array of ID's of the lists to fetch. (optional)
|
166 |
*
|
167 |
+
* @return bool
|
168 |
*/
|
169 |
public function get_lists( $list_ids = array() ) {
|
170 |
$args = array(
|
176 |
// set filter if the $list_ids parameter was set
|
177 |
if( count( $list_ids ) > 0 ) {
|
178 |
$args['filters'] = array(
|
179 |
+
'list_id' => implode( ',', $list_ids )
|
180 |
);
|
181 |
}
|
182 |
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
+
* Get lists with their merge_vars for a given array of list id's
|
194 |
+
* @param array $list_ids
|
195 |
+
* @return array|boolean
|
196 |
+
*/
|
|
|
197 |
public function get_lists_with_merge_vars( $list_ids ) {
|
198 |
$result = $this->call( 'lists/merge-vars', array('id' => $list_ids ) );
|
199 |
|
205 |
}
|
206 |
|
207 |
/**
|
208 |
+
* Gets the member info for one or multiple emails on a list
|
209 |
+
*
|
210 |
+
* @param string $list_id
|
211 |
+
* @param array $emails
|
212 |
+
* @return array
|
213 |
+
*/
|
214 |
+
public function get_subscriber_info( $list_id, array $emails ) {
|
215 |
|
216 |
if( is_string( $emails ) ) {
|
217 |
$emails = array( $emails );
|
219 |
|
220 |
$result = $this->call( 'lists/member-info', array(
|
221 |
'id' => $list_id,
|
222 |
+
'emails' => $emails
|
223 |
)
|
224 |
);
|
225 |
|
230 |
return false;
|
231 |
}
|
232 |
|
233 |
+
/**
|
234 |
+
* Checks if an email address is on a given list
|
235 |
+
*
|
236 |
+
* @param string $list_id
|
237 |
+
* @param string $email
|
238 |
+
* @return boolean
|
239 |
+
*/
|
240 |
+
public function list_has_subscriber( $list_id, $email ) {
|
241 |
+
$member_info = $this->get_subscriber_info( $list_id, array( array( 'email' => $email ) ) );
|
242 |
+
|
243 |
+
if( is_array( $member_info ) && isset( $member_info[0] ) ) {
|
244 |
+
return ( $member_info[0]->status === 'subscribed' );
|
245 |
+
}
|
246 |
+
|
247 |
+
return false;
|
248 |
+
}
|
249 |
+
|
250 |
/**
|
251 |
* @param $list_id
|
252 |
* @param array|string $email
|
261 |
// default to using email for updating
|
262 |
if( ! is_array( $email ) ) {
|
263 |
$email = array(
|
264 |
+
'email' => $email
|
265 |
);
|
266 |
}
|
267 |
|
270 |
'email' => $email,
|
271 |
'merge_vars' => $merge_vars,
|
272 |
'email_type' => $email_type,
|
273 |
+
'replace_interests' => $replace_interests
|
274 |
)
|
275 |
);
|
276 |
|
287 |
return false;
|
288 |
}
|
289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
/**
|
291 |
* Unsubscribes the given email or luid from the given MailChimp list
|
292 |
*
|
303 |
if( ! is_array( $struct ) ) {
|
304 |
// assume $struct is an email
|
305 |
$struct = array(
|
306 |
+
'email' => $struct
|
307 |
);
|
308 |
}
|
309 |
|
312 |
'email' => $struct,
|
313 |
'delete_member' => $delete_member,
|
314 |
'send_goodbye' => $send_goodbye,
|
315 |
+
'send_notify' => $send_notification
|
316 |
)
|
317 |
);
|
318 |
|
319 |
if( is_object( $response ) ) {
|
320 |
+
|
321 |
if ( isset( $response->complete ) && $response->complete ) {
|
322 |
return true;
|
323 |
}
|
327 |
}
|
328 |
|
329 |
/**
|
330 |
+
* Calls the MailChimp API
|
331 |
+
*
|
332 |
+
* @uses WP_HTTP
|
333 |
+
*
|
334 |
+
* @param string $method
|
335 |
+
* @param array $data
|
336 |
+
*
|
337 |
+
* @return object
|
338 |
+
*/
|
339 |
public function call( $method, array $data = array() ) {
|
340 |
|
341 |
$this->empty_last_response();
|
358 |
// test for wp errors
|
359 |
if( is_wp_error( $response ) ) {
|
360 |
// show error message to admins
|
361 |
+
$this->show_connection_error( "Error connecting to MailChimp: " . $response->get_error_message() );
|
362 |
return false;
|
363 |
}
|
364 |
|
365 |
+
// decode response body
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
$body = wp_remote_retrieve_body( $response );
|
367 |
+
$data = json_decode( $body );
|
368 |
|
369 |
+
if( is_null( $data ) ) {
|
|
|
|
|
370 |
|
371 |
+
$code = (int) wp_remote_retrieve_response_code( $response );
|
372 |
+
if( $code !== 200 ) {
|
373 |
+
$message = sprintf( 'The MailChimp API server returned the following response: <em>%s %s</em>.', $code, wp_remote_retrieve_response_message( $response ) );
|
374 |
+
$this->show_connection_error( $message );
|
375 |
}
|
376 |
|
377 |
+
return false;
|
378 |
+
}
|
379 |
+
|
380 |
+
// store response
|
381 |
+
if( is_object( $data ) ) {
|
382 |
+
$this->last_response = $data;
|
383 |
+
|
384 |
+
if( ! empty( $data->error ) ) {
|
385 |
+
$this->error_message = $data->error;
|
386 |
}
|
387 |
|
388 |
+
if( ! empty( $data->code ) ) {
|
389 |
+
$this->error_code = (int) $data->code;
|
390 |
+
}
|
391 |
|
392 |
+
return $data;
|
|
|
393 |
}
|
394 |
|
395 |
+
return $data;
|
396 |
}
|
397 |
|
398 |
/**
|
399 |
+
* Checks if an error occured in the most recent request
|
400 |
+
* @return boolean
|
|
|
401 |
*/
|
402 |
public function has_error() {
|
403 |
return ( ! empty( $this->error_message ) );
|
404 |
}
|
405 |
|
406 |
/**
|
407 |
+
* Gets the most recent error message
|
408 |
+
* @return string
|
409 |
+
*/
|
|
|
410 |
public function get_error_message() {
|
411 |
return $this->error_message;
|
412 |
}
|
456 |
|
457 |
return $headers;
|
458 |
}
|
459 |
+
}
|
|
includes/class-field-mapper.php
DELETED
@@ -1,328 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class MC4WP_Field_Mapper {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* @var array
|
7 |
-
*/
|
8 |
-
protected $form_data = array();
|
9 |
-
|
10 |
-
/**
|
11 |
-
* @var array
|
12 |
-
*/
|
13 |
-
protected $lists = array();
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @var MC4WP_MailChimp
|
17 |
-
*/
|
18 |
-
protected $mailchimp;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var array|bool
|
22 |
-
*/
|
23 |
-
protected $list_fields_map;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $global_fields = array();
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @var array
|
32 |
-
*/
|
33 |
-
protected $mapped_fields = array( 'EMAIL' );
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @var array
|
37 |
-
*/
|
38 |
-
protected $unmapped_fields = array();
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @var bool
|
42 |
-
*/
|
43 |
-
public $success = false;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @var string
|
47 |
-
*/
|
48 |
-
protected $error_code = '';
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @param array $form_data
|
52 |
-
* @param array $lists
|
53 |
-
*/
|
54 |
-
public function __construct( array $form_data, array $lists ) {
|
55 |
-
$this->form_data = $form_data;
|
56 |
-
$this->lists = $lists;
|
57 |
-
|
58 |
-
$this->mailchimp = new MC4WP_MailChimp();
|
59 |
-
|
60 |
-
$this->list_fields_map = $this->map_lists_fields();
|
61 |
-
|
62 |
-
// only proceed if successful
|
63 |
-
if( $this->list_fields_map ) {
|
64 |
-
$this->success = true;
|
65 |
-
$this->global_fields = $this->map_global_fields();
|
66 |
-
$this->unmapped_fields = $this->find_unmapped_fields();
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
public function get_list_fields_map() {
|
71 |
-
return $this->list_fields_map;
|
72 |
-
}
|
73 |
-
|
74 |
-
public function get_global_fields() {
|
75 |
-
return $this->global_fields;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function get_mapped_fields() {
|
79 |
-
return $this->mapped_fields;
|
80 |
-
}
|
81 |
-
|
82 |
-
public function get_unmapped_fields() {
|
83 |
-
return $this->unmapped_fields;
|
84 |
-
}
|
85 |
-
|
86 |
-
public function get_error_code() {
|
87 |
-
return $this->error_code;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* @return array|bool
|
92 |
-
*/
|
93 |
-
public function map_lists_fields() {
|
94 |
-
|
95 |
-
$map = array();
|
96 |
-
|
97 |
-
// loop through selected lists
|
98 |
-
foreach( $this->lists as $list_id ) {
|
99 |
-
|
100 |
-
$list = $this->mailchimp->get_list( $list_id, false, true );
|
101 |
-
|
102 |
-
// skip this list if it's unexisting
|
103 |
-
if( ! is_object( $list ) || ! isset( $list->merge_vars ) ) {
|
104 |
-
continue;
|
105 |
-
}
|
106 |
-
|
107 |
-
// generate map for this given list
|
108 |
-
$list_map = $this->map_data_to_list( $list );
|
109 |
-
if( $list_map === false ) {
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
-
$map[ $list_id ] = $list_map;
|
114 |
-
}
|
115 |
-
|
116 |
-
return $map;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* @return array
|
121 |
-
*/
|
122 |
-
public function find_unmapped_fields() {
|
123 |
-
|
124 |
-
$unmapped_fields = array();
|
125 |
-
|
126 |
-
// is there still unmapped data left?
|
127 |
-
$total_fields_mapped = count( $this->mapped_fields ) + count( $this->global_fields );
|
128 |
-
|
129 |
-
if( $total_fields_mapped < count( $this->form_data ) ) {
|
130 |
-
foreach( $this->form_data as $field_key => $field_value ) {
|
131 |
-
|
132 |
-
if( $this->is_internal_var( $field_key ) ) {
|
133 |
-
continue;
|
134 |
-
}
|
135 |
-
|
136 |
-
if( ! in_array( $field_key, $this->mapped_fields ) ) {
|
137 |
-
$unmapped_fields[ $field_key ] = $field_value;
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
return $unmapped_fields;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* @return array
|
147 |
-
*/
|
148 |
-
private function map_global_fields() {
|
149 |
-
$global_fields = array();
|
150 |
-
|
151 |
-
// map global fields
|
152 |
-
$global_field_names = array( 'MC_LOCATION', 'MC_NOTES', 'MC_LANGUAGE' );
|
153 |
-
foreach( $global_field_names as $field_name ) {
|
154 |
-
if( isset( $this->form_data[ $field_name ] ) ) {
|
155 |
-
$global_fields[ $field_name ] = $this->form_data[ $field_name ];
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
return $global_fields;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* @param $list
|
164 |
-
*
|
165 |
-
* @return array
|
166 |
-
*/
|
167 |
-
private function map_data_to_list( $list ) {
|
168 |
-
|
169 |
-
// start with empty list map
|
170 |
-
$list_map = array();
|
171 |
-
|
172 |
-
// loop through other list fields
|
173 |
-
foreach( $list->merge_vars as $field ) {
|
174 |
-
|
175 |
-
// skip EMAIL field
|
176 |
-
if( $field->tag === 'EMAIL' ) {
|
177 |
-
continue;
|
178 |
-
}
|
179 |
-
|
180 |
-
// check if field is required
|
181 |
-
if( $field->req ) {
|
182 |
-
if( ! isset( $this->form_data[ $field->tag ] ) || '' === $this->form_data[ $field->tag ] ) {
|
183 |
-
$this->error_code = 'required_field_missing';
|
184 |
-
return false;
|
185 |
-
}
|
186 |
-
}
|
187 |
-
|
188 |
-
// if field is not set, continue.
|
189 |
-
if( ! isset( $this->form_data[ $field->tag ] ) ) {
|
190 |
-
continue;
|
191 |
-
}
|
192 |
-
|
193 |
-
// grab field value from data
|
194 |
-
$field_value = $this->form_data[ $field->tag ];
|
195 |
-
|
196 |
-
// format field value according to its type
|
197 |
-
$field_value = $this->format_field_value( $field_value, $field->field_type );
|
198 |
-
|
199 |
-
// add field value to map
|
200 |
-
$list_map[ $field->tag ] = $field_value;
|
201 |
-
}
|
202 |
-
|
203 |
-
// loop through list groupings if GROUPINGS data was sent
|
204 |
-
if( isset( $this->form_data['GROUPINGS'] ) && is_array( $this->form_data['GROUPINGS'] ) && ! empty( $list->interest_groupings ) ) {
|
205 |
-
|
206 |
-
$list_map['GROUPINGS'] = array();
|
207 |
-
|
208 |
-
foreach( $list->interest_groupings as $grouping ) {
|
209 |
-
|
210 |
-
// check if data for this group was sent
|
211 |
-
if( isset( $this->form_data['GROUPINGS'][$grouping->id] ) ) {
|
212 |
-
$group_data = $this->form_data['GROUPINGS'][$grouping->id];
|
213 |
-
} elseif( isset( $this->form_data['GROUPINGS'][$grouping->name] ) ) {
|
214 |
-
$group_data = $this->form_data['GROUPINGS'][$grouping->name];
|
215 |
-
} else {
|
216 |
-
// no data for this grouping was sent, just continue.
|
217 |
-
continue;
|
218 |
-
}
|
219 |
-
|
220 |
-
// format new grouping
|
221 |
-
$grouping = array(
|
222 |
-
'id' => $grouping->id,
|
223 |
-
'groups' => $group_data,
|
224 |
-
);
|
225 |
-
|
226 |
-
// make sure groups is an array
|
227 |
-
if( ! is_array( $grouping['groups'] ) ) {
|
228 |
-
$grouping['groups'] = sanitize_text_field( $grouping['groups'] );
|
229 |
-
$grouping['groups'] = explode( ',', $grouping['groups'] );
|
230 |
-
}
|
231 |
-
|
232 |
-
$list_map['GROUPINGS'][] = $grouping;
|
233 |
-
}
|
234 |
-
|
235 |
-
// unset GROUPINGS if no grouping data was found for this list
|
236 |
-
if( 0 === count( $list_map['GROUPINGS'] ) ) {
|
237 |
-
unset( $list_map['GROUPINGS'] );
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
// add to total map
|
242 |
-
return $list_map;
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Format field value according to its type
|
247 |
-
*
|
248 |
-
* @param $field_type
|
249 |
-
* @param $field_value
|
250 |
-
*
|
251 |
-
* @return array|string
|
252 |
-
*/
|
253 |
-
protected function format_field_value( $field_value, $field_type ) {
|
254 |
-
|
255 |
-
$field_type = strtolower( $field_type );
|
256 |
-
|
257 |
-
switch( $field_type ) {
|
258 |
-
|
259 |
-
// birthday fields need to be MM/DD for the MailChimp API
|
260 |
-
case 'birthday':
|
261 |
-
$field_value = (string) date( 'm/d', strtotime( $field_value ) );
|
262 |
-
break;
|
263 |
-
|
264 |
-
case 'address':
|
265 |
-
|
266 |
-
// auto-format if this is a string
|
267 |
-
if( is_string( $field_value ) ) {
|
268 |
-
|
269 |
-
// addr1, addr2, city, state, zip, country
|
270 |
-
$address_pieces = explode( ',', $field_value );
|
271 |
-
|
272 |
-
// try to fill it.... this is a long shot
|
273 |
-
$field_value = array(
|
274 |
-
'addr1' => $address_pieces[0],
|
275 |
-
'city' => ( isset( $address_pieces[1] ) ) ? $address_pieces[1] : '',
|
276 |
-
'state' => ( isset( $address_pieces[2] ) ) ? $address_pieces[2] : '',
|
277 |
-
'zip' => ( isset( $address_pieces[3] ) ) ? $address_pieces[3] : ''
|
278 |
-
);
|
279 |
-
} elseif( is_array( $field_value ) ) {
|
280 |
-
|
281 |
-
// merge with array of empty defaults to allow skipping certain fields
|
282 |
-
$default_address = array(
|
283 |
-
'addr1' => '',
|
284 |
-
'city' => '',
|
285 |
-
'state' => '',
|
286 |
-
'zip' => ''
|
287 |
-
);
|
288 |
-
|
289 |
-
$field_value = array_merge( $default_address, $field_value );
|
290 |
-
}
|
291 |
-
|
292 |
-
break;
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* @filter `mc4wp_format_field_value`
|
297 |
-
* @param mixed $field_value
|
298 |
-
* @param string $field_type
|
299 |
-
* @expects mixed
|
300 |
-
*
|
301 |
-
* Format a field value according to its MailChimp field type
|
302 |
-
*/
|
303 |
-
$field_value = apply_filters( 'mc4wp_format_field_value', $field_value, $field_type );
|
304 |
-
|
305 |
-
return $field_value;
|
306 |
-
}
|
307 |
-
|
308 |
-
/**
|
309 |
-
* @param $var
|
310 |
-
*
|
311 |
-
* @return bool
|
312 |
-
*/
|
313 |
-
protected function is_internal_var( $var ) {
|
314 |
-
|
315 |
-
if( $var[0] === '_' ) {
|
316 |
-
return true;
|
317 |
-
}
|
318 |
-
|
319 |
-
// Ignore those fields, we don't need them
|
320 |
-
$ignored_vars = array( 'CPTCH_NUMBER', 'CNTCTFRM_CONTACT_ACTION', 'CPTCH_RESULT', 'CPTCH_TIME' );
|
321 |
-
if( in_array( $var, $ignored_vars ) ) {
|
322 |
-
return true;
|
323 |
-
}
|
324 |
-
|
325 |
-
return false;
|
326 |
-
}
|
327 |
-
|
328 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-mailchimp.php
CHANGED
@@ -13,6 +13,8 @@ class MC4WP_MailChimp {
|
|
13 |
public function empty_cache() {
|
14 |
delete_transient( $this->transient_name );
|
15 |
delete_transient( $this->transient_name . '_fallback' );
|
|
|
|
|
16 |
}
|
17 |
|
18 |
/**
|
13 |
public function empty_cache() {
|
14 |
delete_transient( $this->transient_name );
|
15 |
delete_transient( $this->transient_name . '_fallback' );
|
16 |
+
delete_transient( 'mc4wp_list_counts' );
|
17 |
+
delete_transient( 'mc4wp_list_counts_fallback' );
|
18 |
}
|
19 |
|
20 |
/**
|
includes/views/api-settings.php
CHANGED
@@ -1,11 +1,5 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
if( ! defined( 'MC4WP_LITE_VERSION' ) ) {
|
4 |
-
header( 'Status: 403 Forbidden' );
|
5 |
-
header( 'HTTP/1.1 403 Forbidden' );
|
6 |
-
exit;
|
7 |
-
}
|
8 |
-
|
9 |
?>
|
10 |
<div id="mc4wp-admin" class="wrap mc4wp-settings">
|
11 |
|
@@ -19,22 +13,35 @@ if( ! defined( 'MC4WP_LITE_VERSION' ) ) {
|
|
19 |
|
20 |
<form action="options.php" method="post">
|
21 |
<?php settings_fields( 'mc4wp_lite_settings' ); ?>
|
22 |
-
|
23 |
-
<h3
|
24 |
MailChimp <?php _e( 'API Settings', 'mailchimp-for-wp' ); ?>
|
25 |
-
<?php if($connected) { ?>
|
26 |
-
<span class="status positive"><?php _e( 'CONNECTED' ,'mailchimp-for-wp' ); ?></span>
|
27 |
-
<?php } else { ?>
|
28 |
-
<span class="status neutral"><?php _e( 'NOT CONNECTED', 'mailchimp-for-wp' ); ?></span>
|
29 |
-
<?php } ?>
|
30 |
</h3>
|
|
|
31 |
<table class="form-table">
|
32 |
|
33 |
<tr valign="top">
|
34 |
-
<th scope="row"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
<td>
|
36 |
<input type="text" class="widefat" placeholder="<?php _e( 'Your MailChimp API key', 'mailchimp-for-wp' ); ?>" id="mailchimp_api_key" name="mc4wp_lite[api_key]" value="<?php echo esc_attr( $opts['api_key'] ); ?>" />
|
37 |
-
<p class="help"
|
|
|
|
|
|
|
38 |
</td>
|
39 |
|
40 |
</tr>
|
@@ -50,7 +57,8 @@ if( ! defined( 'MC4WP_LITE_VERSION' ) ) {
|
|
50 |
<label>
|
51 |
<?php /* hidden input field to send `0` when checkbox is not checked */ ?>
|
52 |
<input type="hidden" name="mc4wp_lite[allow_usage_tracking]" value="0" />
|
53 |
-
<input type="checkbox" name="mc4wp_lite[allow_usage_tracking]" value="1" <?php checked( $opts['allow_usage_tracking'], 1 ); ?>>
|
|
|
54 |
</label>
|
55 |
</p>
|
56 |
|
@@ -62,7 +70,7 @@ if( ! defined( 'MC4WP_LITE_VERSION' ) ) {
|
|
62 |
|
63 |
<?php if($connected) { ?>
|
64 |
|
65 |
-
<h3
|
66 |
<p><?php _e( 'The table below shows your MailChimp lists data. If you applied changes to your MailChimp lists, please use the following button to renew your cached data.', 'mailchimp-for-wp' ); ?></p>
|
67 |
|
68 |
<form method="post" action="">
|
1 |
<?php
|
2 |
+
defined( 'ABSPATH' ) or exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
?>
|
4 |
<div id="mc4wp-admin" class="wrap mc4wp-settings">
|
5 |
|
13 |
|
14 |
<form action="options.php" method="post">
|
15 |
<?php settings_fields( 'mc4wp_lite_settings' ); ?>
|
16 |
+
|
17 |
+
<h3>
|
18 |
MailChimp <?php _e( 'API Settings', 'mailchimp-for-wp' ); ?>
|
|
|
|
|
|
|
|
|
|
|
19 |
</h3>
|
20 |
+
|
21 |
<table class="form-table">
|
22 |
|
23 |
<tr valign="top">
|
24 |
+
<th scope="row">
|
25 |
+
<?php _e( 'Status', 'mailchimp-for-wp' ); ?>
|
26 |
+
</th>
|
27 |
+
<td>
|
28 |
+
<?php if($connected) { ?>
|
29 |
+
<span class="status positive"><?php _e( 'CONNECTED' ,'mailchimp-for-wp' ); ?></span>
|
30 |
+
<?php } else { ?>
|
31 |
+
<span class="status neutral"><?php _e( 'NOT CONNECTED', 'mailchimp-for-wp' ); ?></span>
|
32 |
+
<?php } ?>
|
33 |
+
</td>
|
34 |
+
</tr>
|
35 |
+
|
36 |
+
|
37 |
+
<tr valign="top">
|
38 |
+
<th scope="row"><label for="mailchimp_api_key"><?php _e( 'API Key', 'mailchimp-for-wp' ); ?></label></th>
|
39 |
<td>
|
40 |
<input type="text" class="widefat" placeholder="<?php _e( 'Your MailChimp API key', 'mailchimp-for-wp' ); ?>" id="mailchimp_api_key" name="mc4wp_lite[api_key]" value="<?php echo esc_attr( $opts['api_key'] ); ?>" />
|
41 |
+
<p class="help">
|
42 |
+
<?php _e( 'The API key for connecting with your MailChimp account.', 'mailchimp-for-wp' ); ?>
|
43 |
+
<a target="_blank" href="https://admin.mailchimp.com/account/api"><?php _e( 'Get your API key here.', 'mailchimp-for-wp' ); ?></a>
|
44 |
+
</p>
|
45 |
</td>
|
46 |
|
47 |
</tr>
|
57 |
<label>
|
58 |
<?php /* hidden input field to send `0` when checkbox is not checked */ ?>
|
59 |
<input type="hidden" name="mc4wp_lite[allow_usage_tracking]" value="0" />
|
60 |
+
<input type="checkbox" name="mc4wp_lite[allow_usage_tracking]" value="1" <?php checked( $opts['allow_usage_tracking'], 1 ); ?>>
|
61 |
+
<?php echo sprintf( __( 'Allow us to anonymously track how this plugin is used to help us make it better fit your needs. <a href="%s">This is what we track</a>.', 'mailchimp-for-wp' ), 'https://mc4wp.com/kb/what-is-usage-tracking/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=settings-page' ); ?>
|
62 |
</label>
|
63 |
</p>
|
64 |
|
70 |
|
71 |
<?php if($connected) { ?>
|
72 |
|
73 |
+
<h3><?php _e( 'MailChimp Data' ,'mailchimp-for-wp' ); ?></h3>
|
74 |
<p><?php _e( 'The table below shows your MailChimp lists data. If you applied changes to your MailChimp lists, please use the following button to renew your cached data.', 'mailchimp-for-wp' ); ?></p>
|
75 |
|
76 |
<form method="post" action="">
|
languages/mailchimp-for-wp-pt_BR.mo
CHANGED
Binary file
|
languages/mailchimp-for-wp-pt_BR.po
CHANGED
@@ -11,7 +11,7 @@ msgstr ""
|
|
11 |
"Project-Id-Version: MailChimp for WordPress\n"
|
12 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
|
13 |
"POT-Creation-Date: 2015-05-26 14:41:46+00:00\n"
|
14 |
-
"PO-Revision-Date: 2015-10-
|
15 |
"Last-Translator: Luiz Sobral <lctsobral@gmail.com>\n"
|
16 |
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/pt_BR/)\n"
|
17 |
"MIME-Version: 1.0\n"
|
@@ -860,7 +860,7 @@ msgstr "Altera o aspecto visual do formulário através da aplicação de regras
|
|
860 |
msgid ""
|
861 |
"You can add the CSS rules to your theme stylesheet using the <a "
|
862 |
"href=\"%s\">Theme Editor</a> or by using a plugin like %s"
|
863 |
-
msgstr ""
|
864 |
|
865 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:269
|
866 |
msgid ""
|
@@ -873,7 +873,7 @@ msgid ""
|
|
873 |
"If you need an easier way to style your forms, consider <a "
|
874 |
"href=\"%s\">upgrading to MailChimp for WordPress Pro</a> which comes with an"
|
875 |
" easy Styles Builder."
|
876 |
-
msgstr ""
|
877 |
|
878 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:272
|
879 |
#: mailchimp-for-wordpress-pro/includes/admin/class-admin.php:366
|
@@ -885,12 +885,12 @@ msgstr "Variáveis"
|
|
885 |
msgid ""
|
886 |
"The following list of variables can be used to <a href=\"%s\">add some "
|
887 |
"dynamic content to your form or success and error messages</a>."
|
888 |
-
msgstr ""
|
889 |
|
890 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:274
|
891 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:11
|
892 |
msgid "This allows you to personalise your form or response messages."
|
893 |
-
msgstr ""
|
894 |
|
895 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:282
|
896 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:16
|
@@ -962,7 +962,7 @@ msgstr "URL atual"
|
|
962 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:336
|
963 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:70
|
964 |
msgid "The value of the <strong>FNAME</strong> field, if set."
|
965 |
-
msgstr ""
|
966 |
|
967 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:10
|
968 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:31
|
@@ -984,12 +984,12 @@ msgstr "Botão Enviar"
|
|
984 |
|
985 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:20
|
986 |
msgid "Subscribe / unsubscribe choice"
|
987 |
-
msgstr ""
|
988 |
|
989 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:21
|
990 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:40
|
991 |
msgid "List choice"
|
992 |
-
msgstr ""
|
993 |
|
994 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:29
|
995 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:49
|
@@ -1047,7 +1047,7 @@ msgstr "MailChimp para WordPress está precisando de traduções. Se o plugin n
|
|
1047 |
msgid ""
|
1048 |
"Enjoying this plugin? <a href=\"%s\">Upgrade to MailChimp for WordPress "
|
1049 |
"Pro</a> for an even better plugin, you will love it."
|
1050 |
-
msgstr ""
|
1051 |
|
1052 |
#: mailchimp-for-wordpress/includes/views/parts/admin-footer.php:20
|
1053 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:13
|
@@ -1064,11 +1064,11 @@ msgid ""
|
|
1064 |
"Make sure to look at the <a href=\"%s\">MailChimp for WordPress "
|
1065 |
"documentation</a>, the plugin <a href=\"%s\">FAQ</a> or use the <a "
|
1066 |
"href=\"%s\">support forums</a> on WordPress.org."
|
1067 |
-
msgstr ""
|
1068 |
|
1069 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:14
|
1070 |
msgid "Do you enjoy this plugin?"
|
1071 |
-
msgstr ""
|
1072 |
|
1073 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:17
|
1074 |
msgid "Leave a %s plugin review on WordPress.org"
|
@@ -1090,7 +1090,7 @@ msgstr "Faça um review do plugin em seu blog e link para <a href=\"%s\"> págin
|
|
1090 |
|
1091 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:19
|
1092 |
msgid "There is an <a href=\"%s\">affiliate program</a> as well."
|
1093 |
-
msgstr ""
|
1094 |
|
1095 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:20
|
1096 |
msgid "Vote \"works\" on the WordPress.org plugin page"
|
@@ -1099,19 +1099,19 @@ msgstr "Vote \"funciona\" na página do plugin WordPress.org"
|
|
1099 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:10
|
1100 |
msgid ""
|
1101 |
"This plugin has an even better premium version, you will absolutely love it."
|
1102 |
-
msgstr ""
|
1103 |
|
1104 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:11
|
1105 |
msgid "Some differences with this free version of the plugin:"
|
1106 |
-
msgstr ""
|
1107 |
|
1108 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:14
|
1109 |
msgid "Multiple forms"
|
1110 |
-
msgstr ""
|
1111 |
|
1112 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:15
|
1113 |
msgid "Each subscribing to one or multiple MailChimp lists."
|
1114 |
-
msgstr ""
|
1115 |
|
1116 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:18
|
1117 |
msgid "AJAX forms"
|
@@ -1119,7 +1119,7 @@ msgstr "Formulários AJAX"
|
|
1119 |
|
1120 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:19
|
1121 |
msgid "Forms do not require a full page reload."
|
1122 |
-
msgstr ""
|
1123 |
|
1124 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:22
|
1125 |
#: mailchimp-for-wordpress-pro/includes/views/pages/admin-reports.php:14
|
@@ -1132,11 +1132,11 @@ msgstr ""
|
|
1132 |
|
1133 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:26
|
1134 |
msgid "Styles Builder"
|
1135 |
-
msgstr ""
|
1136 |
|
1137 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:27
|
1138 |
msgid "Create beautiful form themes with ease."
|
1139 |
-
msgstr ""
|
1140 |
|
1141 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:31
|
1142 |
msgid "Upgrade Now"
|
@@ -1215,7 +1215,7 @@ msgstr "A data de término não pode ser anterior à data de início"
|
|
1215 |
msgid ""
|
1216 |
"Couldn't create the stylesheet. Manually add the generated CSS to your theme"
|
1217 |
" stylesheet or use a plugin like <em>%s</em>."
|
1218 |
-
msgstr ""
|
1219 |
|
1220 |
#: mailchimp-for-wordpress-pro/includes/admin/class-styles-builder.php:437
|
1221 |
msgid "%sShow generated CSS%s"
|
@@ -1627,11 +1627,11 @@ msgstr "Outros erros"
|
|
1627 |
|
1628 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:39
|
1629 |
msgid "Submit button"
|
1630 |
-
msgstr ""
|
1631 |
|
1632 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:41
|
1633 |
msgid "Subscribe / unsubscribe action"
|
1634 |
-
msgstr ""
|
1635 |
|
1636 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:90
|
1637 |
msgid "Form usage"
|
@@ -1679,7 +1679,7 @@ msgstr "Nenhuma lista encontrada na sua conta."
|
|
1679 |
msgid ""
|
1680 |
"Need help? Have a look at the <a href=\"%s\">plugin documentation</a> or "
|
1681 |
"email us directly at <a href=\"%s\">support@mc4wp.com</a>."
|
1682 |
-
msgstr ""
|
1683 |
|
1684 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:11
|
1685 |
msgid ""
|
11 |
"Project-Id-Version: MailChimp for WordPress\n"
|
12 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
|
13 |
"POT-Creation-Date: 2015-05-26 14:41:46+00:00\n"
|
14 |
+
"PO-Revision-Date: 2015-10-09 11:56+0000\n"
|
15 |
"Last-Translator: Luiz Sobral <lctsobral@gmail.com>\n"
|
16 |
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/pt_BR/)\n"
|
17 |
"MIME-Version: 1.0\n"
|
860 |
msgid ""
|
861 |
"You can add the CSS rules to your theme stylesheet using the <a "
|
862 |
"href=\"%s\">Theme Editor</a> or by using a plugin like %s"
|
863 |
+
msgstr "Você pode adicionar as regras CSS para sua folha de estilo do tema usando o <a href=\"%s\"> Editor de temas </a> ou use um plugin como %s"
|
864 |
|
865 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:269
|
866 |
msgid ""
|
873 |
"If you need an easier way to style your forms, consider <a "
|
874 |
"href=\"%s\">upgrading to MailChimp for WordPress Pro</a> which comes with an"
|
875 |
" easy Styles Builder."
|
876 |
+
msgstr "Se você precisa de uma maneira mais fácil de formatar seus formulários, considere <a href=\"%s\"> atualizar para MailChimp PRO para WordPress</a>. Ele vem com um \"Construtor de Estilos\"."
|
877 |
|
878 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:272
|
879 |
#: mailchimp-for-wordpress-pro/includes/admin/class-admin.php:366
|
885 |
msgid ""
|
886 |
"The following list of variables can be used to <a href=\"%s\">add some "
|
887 |
"dynamic content to your form or success and error messages</a>."
|
888 |
+
msgstr "Use as variáveis para <a href=\"%s\">adicionar conteúdo dinâmico em seu formulário ou mensagens de sucesso e erro</a>."
|
889 |
|
890 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:274
|
891 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:11
|
892 |
msgid "This allows you to personalise your form or response messages."
|
893 |
+
msgstr "Permite personalizar o formulário ou as mensagens de resposta."
|
894 |
|
895 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:282
|
896 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:16
|
962 |
#: mailchimp-for-wordpress/includes/views/form-settings.php:336
|
963 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-text-variables.php:70
|
964 |
msgid "The value of the <strong>FNAME</strong> field, if set."
|
965 |
+
msgstr "O valor do campo <strong>FNAME</strong>, se configurado."
|
966 |
|
967 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:10
|
968 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:31
|
984 |
|
985 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:20
|
986 |
msgid "Subscribe / unsubscribe choice"
|
987 |
+
msgstr "Opção cadastrar / descadastrar"
|
988 |
|
989 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:21
|
990 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:40
|
991 |
msgid "List choice"
|
992 |
+
msgstr "Opção de lista"
|
993 |
|
994 |
#: mailchimp-for-wordpress/includes/views/parts/admin-field-wizard.php:29
|
995 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:49
|
1047 |
msgid ""
|
1048 |
"Enjoying this plugin? <a href=\"%s\">Upgrade to MailChimp for WordPress "
|
1049 |
"Pro</a> for an even better plugin, you will love it."
|
1050 |
+
msgstr "Gostando do plugin? <a href=\"%s\">Atualize para MailChimp para WordPress Pro agora</a> para ter um plugin ainda melhor, você vai adorar."
|
1051 |
|
1052 |
#: mailchimp-for-wordpress/includes/views/parts/admin-footer.php:20
|
1053 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:13
|
1064 |
"Make sure to look at the <a href=\"%s\">MailChimp for WordPress "
|
1065 |
"documentation</a>, the plugin <a href=\"%s\">FAQ</a> or use the <a "
|
1066 |
"href=\"%s\">support forums</a> on WordPress.org."
|
1067 |
+
msgstr "Certifique-se de olhar a <a href=\"%s\"> documentação do MailChimp for WordPress </a> ou usar o <a href=\"%s\">suporte e fóruns </a> no WordPress.org."
|
1068 |
|
1069 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:14
|
1070 |
msgid "Do you enjoy this plugin?"
|
1071 |
+
msgstr "Está gostando deste plugin?"
|
1072 |
|
1073 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:17
|
1074 |
msgid "Leave a %s plugin review on WordPress.org"
|
1090 |
|
1091 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:19
|
1092 |
msgid "There is an <a href=\"%s\">affiliate program</a> as well."
|
1093 |
+
msgstr "Há também um <a href=\"%s\">programa de afiliados</a>."
|
1094 |
|
1095 |
#: mailchimp-for-wordpress/includes/views/parts/admin-need-support.php:20
|
1096 |
msgid "Vote \"works\" on the WordPress.org plugin page"
|
1099 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:10
|
1100 |
msgid ""
|
1101 |
"This plugin has an even better premium version, you will absolutely love it."
|
1102 |
+
msgstr "Este plugin tem uma versão premium ainda melhor, você vai adorar."
|
1103 |
|
1104 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:11
|
1105 |
msgid "Some differences with this free version of the plugin:"
|
1106 |
+
msgstr "Algumas diferenças com esta versão gratuita do plugin:"
|
1107 |
|
1108 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:14
|
1109 |
msgid "Multiple forms"
|
1110 |
+
msgstr "Formulários multiplos"
|
1111 |
|
1112 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:15
|
1113 |
msgid "Each subscribing to one or multiple MailChimp lists."
|
1114 |
+
msgstr "Cada cadastro de uma ou várias listas MailChimp."
|
1115 |
|
1116 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:18
|
1117 |
msgid "AJAX forms"
|
1119 |
|
1120 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:19
|
1121 |
msgid "Forms do not require a full page reload."
|
1122 |
+
msgstr "Formulários não requerem o recarregamento da página inteira."
|
1123 |
|
1124 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:22
|
1125 |
#: mailchimp-for-wordpress-pro/includes/views/pages/admin-reports.php:14
|
1132 |
|
1133 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:26
|
1134 |
msgid "Styles Builder"
|
1135 |
+
msgstr "Construtor de Estilos"
|
1136 |
|
1137 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:27
|
1138 |
msgid "Create beautiful form themes with ease."
|
1139 |
+
msgstr "Crie temas para formulários lindos facilmente."
|
1140 |
|
1141 |
#: mailchimp-for-wordpress/includes/views/parts/admin-upgrade-to-pro.php:31
|
1142 |
msgid "Upgrade Now"
|
1215 |
msgid ""
|
1216 |
"Couldn't create the stylesheet. Manually add the generated CSS to your theme"
|
1217 |
" stylesheet or use a plugin like <em>%s</em>."
|
1218 |
+
msgstr "Não foi possível criar a folha de estilos. Adicione manualmente o CSS gerado na folha de estilos do seu tema usando um plugin como <em>%s</em>."
|
1219 |
|
1220 |
#: mailchimp-for-wordpress-pro/includes/admin/class-styles-builder.php:437
|
1221 |
msgid "%sShow generated CSS%s"
|
1627 |
|
1628 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:39
|
1629 |
msgid "Submit button"
|
1630 |
+
msgstr "Botão Enviar"
|
1631 |
|
1632 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:41
|
1633 |
msgid "Subscribe / unsubscribe action"
|
1634 |
+
msgstr "Ação cadastrar / descadastrar"
|
1635 |
|
1636 |
#: mailchimp-for-wordpress-pro/includes/views/metaboxes/required-form-settings.php:90
|
1637 |
msgid "Form usage"
|
1679 |
msgid ""
|
1680 |
"Need help? Have a look at the <a href=\"%s\">plugin documentation</a> or "
|
1681 |
"email us directly at <a href=\"%s\">support@mc4wp.com</a>."
|
1682 |
+
msgstr "Precisa de ajuda? Dê uma olhada na <a href=\"%s\">documentação do plugin</a> ou envie um e-mail diretamente para <a href=\"%s\">support@mc4wp.com</a>."
|
1683 |
|
1684 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:11
|
1685 |
msgid ""
|
languages/mailchimp-for-wp-ru_RU.mo
CHANGED
Binary file
|
languages/mailchimp-for-wp-ru_RU.po
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
# Translators:
|
4 |
# Alex Starshyn <nudnyj@gmail.com>, 2015
|
5 |
# Al Po <digows@gmail.com>, 2015
|
|
|
6 |
# dmitry <d1mas@msn.com>, 2015
|
7 |
# mick.levin <email.mick.levin@gmail.com>, 2015
|
8 |
# Eugen Morozov <burateen@gmail.com>, 2015
|
@@ -13,8 +14,8 @@ msgstr ""
|
|
13 |
"Project-Id-Version: MailChimp for WordPress\n"
|
14 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
|
15 |
"POT-Creation-Date: 2015-05-26 14:41:46+00:00\n"
|
16 |
-
"PO-Revision-Date: 2015-
|
17 |
-
"Last-Translator:
|
18 |
"Language-Team: Russian (Russia) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/ru_RU/)\n"
|
19 |
"MIME-Version: 1.0\n"
|
20 |
"Content-Type: text/plain; charset=UTF-8\n"
|
@@ -1049,7 +1050,7 @@ msgstr "MailChimp for WordPress нуждается в переводах на р
|
|
1049 |
msgid ""
|
1050 |
"Enjoying this plugin? <a href=\"%s\">Upgrade to MailChimp for WordPress "
|
1051 |
"Pro</a> for an even better plugin, you will love it."
|
1052 |
-
msgstr "Довольны ли вы этим плагином? <a href
|
1053 |
|
1054 |
#: mailchimp-for-wordpress/includes/views/parts/admin-footer.php:20
|
1055 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:13
|
3 |
# Translators:
|
4 |
# Alex Starshyn <nudnyj@gmail.com>, 2015
|
5 |
# Al Po <digows@gmail.com>, 2015
|
6 |
+
# Danny van Kooten <dannyvankooten@gmail.com>, 2015
|
7 |
# dmitry <d1mas@msn.com>, 2015
|
8 |
# mick.levin <email.mick.levin@gmail.com>, 2015
|
9 |
# Eugen Morozov <burateen@gmail.com>, 2015
|
14 |
"Project-Id-Version: MailChimp for WordPress\n"
|
15 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/mailchimp-for-wp\n"
|
16 |
"POT-Creation-Date: 2015-05-26 14:41:46+00:00\n"
|
17 |
+
"PO-Revision-Date: 2015-10-14 06:22+0000\n"
|
18 |
+
"Last-Translator: Danny van Kooten <dannyvankooten@gmail.com>\n"
|
19 |
"Language-Team: Russian (Russia) (http://www.transifex.com/ibericode/mailchimp-for-wordpress/language/ru_RU/)\n"
|
20 |
"MIME-Version: 1.0\n"
|
21 |
"Content-Type: text/plain; charset=UTF-8\n"
|
1050 |
msgid ""
|
1051 |
"Enjoying this plugin? <a href=\"%s\">Upgrade to MailChimp for WordPress "
|
1052 |
"Pro</a> for an even better plugin, you will love it."
|
1053 |
+
msgstr "Довольны ли вы этим плагином? <a href=\"%s\">Обновите его до версии <b>MailChimp for WordPress Pro</b></a>, чтобы получить ещё больше хороших функций, Вам это понравится!"
|
1054 |
|
1055 |
#: mailchimp-for-wordpress/includes/views/parts/admin-footer.php:20
|
1056 |
#: mailchimp-for-wordpress-pro/includes/views/parts/admin-footer.php:13
|
mailchimp-for-wp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MailChimp for WordPress Lite
|
4 |
Plugin URI: https://mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=plugins-page
|
5 |
Description: Lite version of MailChimp for WordPress. Adds various sign-up methods to your website.
|
6 |
-
Version: 2.3.
|
7 |
Author: ibericode
|
8 |
Author URI: https://ibericode.com/
|
9 |
Text Domain: mailchimp-for-wp
|
@@ -47,7 +47,7 @@ function mc4wp_load_plugin() {
|
|
47 |
}
|
48 |
|
49 |
// bootstrap the lite plugin
|
50 |
-
define( 'MC4WP_LITE_VERSION', '2.3.
|
51 |
define( 'MC4WP_LITE_PLUGIN_DIR', dirname( __FILE__ ) . '/' );
|
52 |
define( 'MC4WP_LITE_PLUGIN_URL', plugins_url( '/' , __FILE__ ) );
|
53 |
define( 'MC4WP_LITE_PLUGIN_FILE', __FILE__ );
|
@@ -71,7 +71,6 @@ function mc4wp_load_plugin() {
|
|
71 |
MC4WP_Usage_Tracking::instance()->add_hooks();
|
72 |
}
|
73 |
|
74 |
-
|
75 |
return true;
|
76 |
}
|
77 |
|
3 |
Plugin Name: MailChimp for WordPress Lite
|
4 |
Plugin URI: https://mc4wp.com/#utm_source=wp-plugin&utm_medium=mailchimp-for-wp&utm_campaign=plugins-page
|
5 |
Description: Lite version of MailChimp for WordPress. Adds various sign-up methods to your website.
|
6 |
+
Version: 2.3.16
|
7 |
Author: ibericode
|
8 |
Author URI: https://ibericode.com/
|
9 |
Text Domain: mailchimp-for-wp
|
47 |
}
|
48 |
|
49 |
// bootstrap the lite plugin
|
50 |
+
define( 'MC4WP_LITE_VERSION', '2.3.16' );
|
51 |
define( 'MC4WP_LITE_PLUGIN_DIR', dirname( __FILE__ ) . '/' );
|
52 |
define( 'MC4WP_LITE_PLUGIN_URL', plugins_url( '/' , __FILE__ ) );
|
53 |
define( 'MC4WP_LITE_PLUGIN_FILE', __FILE__ );
|
71 |
MC4WP_Usage_Tracking::instance()->add_hooks();
|
72 |
}
|
73 |
|
|
|
74 |
return true;
|
75 |
}
|
76 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://mc4wp.com/#utm_source=wp-plugin-repo&utm_medium=mailchimp-f
|
|
4 |
Tags: email, mailchimp, marketing, newsletter, signup, widget, mc4wp, contact form 7, woocommerce, buddypress,ibericode
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 4.3.1
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -18,6 +18,8 @@ MailChimp for WordPress, the absolute best. Add subscribers to your MailChimp li
|
|
18 |
|
19 |
This plugin helps you add subscribers to your MailChimp lists using various methods. You can create good looking opt-in forms or integrate with any other form on your site, like your comment form or WooCommerce checkout.
|
20 |
|
|
|
|
|
21 |
= MailChimp for WordPress features =
|
22 |
|
23 |
- Connect with your MailChimp account in just 1 click.
|
@@ -167,6 +169,18 @@ MailChimp for WordPress is being developed on GitHub. If you want to collaborate
|
|
167 |
|
168 |
== Changelog ==
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
= 2.3.15 - October 9, 2015 =
|
171 |
|
172 |
**Fixes**
|
4 |
Tags: email, mailchimp, marketing, newsletter, signup, widget, mc4wp, contact form 7, woocommerce, buddypress,ibericode
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 4.3.1
|
7 |
+
Stable tag: 2.3.16
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
18 |
|
19 |
This plugin helps you add subscribers to your MailChimp lists using various methods. You can create good looking opt-in forms or integrate with any other form on your site, like your comment form or WooCommerce checkout.
|
20 |
|
21 |
+
[youtube https://www.youtube.com/watch?v=92WzdjQcGSo]
|
22 |
+
|
23 |
= MailChimp for WordPress features =
|
24 |
|
25 |
- Connect with your MailChimp account in just 1 click.
|
169 |
|
170 |
== Changelog ==
|
171 |
|
172 |
+
= 2.3.16 - October 14, 2015 =
|
173 |
+
|
174 |
+
**Fixes**
|
175 |
+
|
176 |
+
- Error in Russian translation, causing a broken link on the MailChimp settings page.
|
177 |
+
|
178 |
+
**Improvements**
|
179 |
+
|
180 |
+
- Textual improvements to MailChimp settings page.
|
181 |
+
- Connectivity issues with MailChimp will now _always_ show an error message.
|
182 |
+
- Renewing MailChimp lists will now also update the output of the `{subscriber_count}` tag.
|
183 |
+
|
184 |
= 2.3.15 - October 9, 2015 =
|
185 |
|
186 |
**Fixes**
|
vendor/composer/include_paths.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// include_paths.php @generated by Composer
|
4 |
-
|
5 |
-
$vendorDir = dirname(dirname(__FILE__));
|
6 |
-
$baseDir = dirname($vendorDir);
|
7 |
-
|
8 |
-
return array(
|
9 |
-
$vendorDir . '/phpunit/php-file-iterator',
|
10 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|