MailChimp for WooCommerce - Version 2.4.2

Version Description

Download this release

Release Info

Developer ryanhungate
Plugin Icon wp plugin MailChimp for WooCommerce
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

CHANGELOG.txt CHANGED
@@ -1,4 +1,20 @@
1
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  = 2.4.1 =
3
  * adds scrolling frame for logs
4
  * fix for Coupon Deletion via WooCommerce API
1
  == Changelog ==
2
+ = 2.4.2 =
3
+ * WooCommerce Version 4.3 tested
4
+ * adds Mailchimp support form
5
+ * moves navigation to WooCommerce nav as a sub-item
6
+ * removes bubble h1 title element
7
+ * log tab ui enhancements
8
+ * next button for setup wizard moved to bottom of page
9
+ * required field ui enhancement
10
+ * adds a banner for setup completion in Wordpress
11
+ * overview tab ui enhancements
12
+ * audience settings tab ux improvements
13
+ * fix for cart non-numeric error
14
+ * fix for woocommerce setup wizard redirect
15
+ * fix for abandoned cart on product variations
16
+ * fix for invalid session object
17
+ * adds customer filter for on-hold orders
18
  = 2.4.1 =
19
  * adds scrolling frame for logs
20
  * fix for Coupon Deletion via WooCommerce API
README.txt CHANGED
@@ -4,10 +4,10 @@ Tags: ecommerce,email,workflows,mailchimp
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.4
7
- Stable tag: 2.4.1
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
- WC tested up to: 4.2
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  Connect your store to your Mailchimp audience to track sales, create targeted emails, send abandoned cart emails, and more.
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.4
7
+ Stable tag: 2.4.2
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
+ WC tested up to: 4.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  Connect your store to your Mailchimp audience to track sales, create targeted emails, send abandoned cart emails, and more.
admin/class-mailchimp-woocommerce-admin.php CHANGED
@@ -86,6 +86,18 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
86
  && isset($_REQUEST['_disconnect-nonce'])
87
  && wp_verify_nonce($_REQUEST['_disconnect-nonce'], '_disconnect-nonce-'.mailchimp_get_store_id());
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  /**
91
  * Register the stylesheets for the admin area.
@@ -93,10 +105,10 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
93
  * @since 1.0.0
94
  */
95
  public function enqueue_styles($hook) {
96
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin.css', array(), $this->version, 'all' );
97
  wp_enqueue_style( $this->plugin_name . 'checkbox', plugin_dir_url( __FILE__ ) . 'css/checkbox.min.css', array(), $this->version, 'all' );
98
 
99
- if ( $hook === 'toplevel_page_mailchimp-woocommerce' ) {
100
  if ( get_bloginfo( 'version' ) < '5.3') {
101
  wp_enqueue_style( $this->plugin_name."-settings", plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin-settings-5.2.css', array(), $this->version, 'all' );
102
  }
@@ -110,9 +122,23 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
110
  * @since 1.0.0
111
  */
112
  public function enqueue_scripts($hook) {
113
- if ( $hook === 'toplevel_page_mailchimp-woocommerce' ) {
114
- wp_register_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailchimp-woocommerce-admin.js', array( 'jquery', 'swal' ), $this->version, false );
115
- wp_localize_script( $this->plugin_name, 'phpVars', array( 'removeReviewBannerRestUrl' => MailChimp_WooCommerce_Rest_Api::url('review-banner')) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  wp_enqueue_script( $this->plugin_name);
117
  wp_enqueue_script('swal', "//cdn.jsdelivr.net/npm/sweetalert2@8", '', $this->version, false);
118
  }
@@ -124,87 +150,15 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
124
  * @since 1.0.0
125
  */
126
  public function add_plugin_admin_menu() {
127
- // Add top level menu item
128
- add_menu_page(
129
- __('Mailchimp - WooCommerce Setup', 'mailchimp-for-woocommerce'),
130
- 'Mailchimp',
 
131
  mailchimp_get_allowed_capability(),
132
  $this->plugin_name,
133
- array($this, 'display_plugin_setup_page'), 'data:image/svg+xml;base64,'.$this->mailchimp_svg()
134
  );
135
-
136
- // only shows submenus if initial wizard is complete
137
- $show_submenus = ($this->getData('validation.store_info', false) && $this->getData('validation.campaign_defaults', false) && $this->getData('validation.newsletter_settings', false));
138
- if ($show_submenus) {
139
- // Add submenu items
140
- add_submenu_page(
141
- $this->plugin_name,
142
- esc_html__('Overview', 'mailchimp-for-woocommerce'),
143
- esc_html__('Overview', 'mailchimp-for-woocommerce'),
144
- mailchimp_get_allowed_capability(),
145
- $this->plugin_name . '&amp;tab=sync',
146
- array($this, 'display_plugin_setup_page')
147
- );
148
-
149
- add_submenu_page(
150
- $this->plugin_name,
151
- esc_html__('Store Settings', 'mailchimp-for-woocommerce'),
152
- esc_html__('Store Settings', 'mailchimp-for-woocommerce'),
153
- mailchimp_get_allowed_capability(),
154
- $this->plugin_name . '&amp;tab=store_info',
155
- array($this, 'display_plugin_setup_page')
156
- );
157
-
158
- add_submenu_page(
159
- $this->plugin_name,
160
- esc_html__('Audience Defaults', 'mailchimp-for-woocommerce'),
161
- esc_html__('Audience Defaults', 'mailchimp-for-woocommerce'),
162
- mailchimp_get_allowed_capability(),
163
- $this->plugin_name . '&amp;tab=campaign_defaults',
164
- array($this, 'display_plugin_setup_page')
165
- );
166
-
167
- add_submenu_page(
168
- $this->plugin_name,
169
- esc_html__('Audience Settings', 'mailchimp-for-woocommerce'),
170
- esc_html__('Audience Settings', 'mailchimp-for-woocommerce'),
171
- mailchimp_get_allowed_capability(),
172
- $this->plugin_name . '&amp;tab=newsletter_settings',
173
- array($this, 'display_plugin_setup_page')
174
- );
175
-
176
- add_submenu_page(
177
- $this->plugin_name,
178
- esc_html__('Logs', 'mailchimp-for-woocommerce'),
179
- esc_html__('Logs', 'mailchimp-for-woocommerce'),
180
- mailchimp_get_allowed_capability(),
181
- $this->plugin_name . '&amp;tab=logs',
182
- array($this, 'display_plugin_setup_page')
183
- );
184
-
185
- // Remove submenu duplicate of top level menu item
186
- remove_submenu_page( $this->plugin_name, $this->plugin_name );
187
-
188
- }
189
- }
190
-
191
- /**
192
- * Highlight correct item on admin plugin's submenu
193
- *
194
- * because of the nature of our settings pages being all the same url as opposed to separate php files,
195
- * we need to force highlight on correct item based on the $_GET[tab] param.
196
- *
197
- * @since 2.4.1
198
- */
199
- function highlight_admin_menu($parent_file){
200
- global $current_screen;
201
- global $submenu_file;
202
-
203
- if( $current_screen->base == 'toplevel_page_mailchimp-woocommerce' ) :
204
- $submenu_file = $parent_file . (isset($_GET['tab']) ? "&amp;tab=" . $_GET['tab'] : "&amp;tab=sync");
205
- endif;
206
-
207
- return $parent_file;
208
  }
209
 
210
  /**
@@ -215,7 +169,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
215
  wc_admin_connect_page(
216
  array(
217
  'id' => $this->plugin_name,
218
- 'screen_id' => 'toplevel_page_mailchimp-woocommerce',
219
  'title' => __( 'Mailchimp for WooCommerce', 'mailchimp-for-woocommerce' ),
220
  )
221
  );
@@ -289,9 +243,35 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
289
  if (get_option('mailchimp-woocommerce-sync.initial_sync') == 1 && get_option('mailchimp-woocommerce-sync.completed_at') > 0 ) {
290
  $this->mailchimp_show_initial_sync_message();
291
  }
 
 
 
292
  }
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  /**
296
  * Depending on the version we're on we may need to run some sort of migrations.
297
  */
@@ -564,7 +544,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
564
  }
565
  }
566
  //case sync
567
- else {
568
  // remove all the pointers to be sure
569
  $service = new MailChimp_Service();
570
  $service->removePointers(true, true);
@@ -719,7 +699,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
719
  }
720
 
721
  else {
722
- $suggestion = wp_remote_get( 'https://woocommerce.mailchimpapp.com/api/usernames/suggestions/' . $_POST['username']);
723
  $suggested_username = json_decode($suggestion['body'])->data;
724
  wp_send_json_error( array(
725
  'success' => false,
@@ -727,6 +707,41 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
727
  ));
728
  }
729
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
 
731
  public function mailchimp_woocommerce_ajax_create_account_signup() {
732
  $data = $_POST['data'];
@@ -1702,4 +1717,35 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
1702
  ));
1703
  }
1704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1705
  }
86
  && isset($_REQUEST['_disconnect-nonce'])
87
  && wp_verify_nonce($_REQUEST['_disconnect-nonce'], '_disconnect-nonce-'.mailchimp_get_store_id());
88
  }
89
+
90
+ /**
91
+ * Tests admin permissions, disconnect action and nonce
92
+ * @return bool
93
+ */
94
+ private function is_resyncing() {
95
+ return isset($_REQUEST['mailchimp_woocommerce_resync'])
96
+ && current_user_can( 'manage_options' )
97
+ && $_REQUEST['mailchimp_woocommerce_resync'] == 1
98
+ && isset($_REQUEST['_resync-nonce'])
99
+ && wp_verify_nonce($_REQUEST['_resync-nonce'], '_resync-nonce-'.mailchimp_get_store_id());
100
+ }
101
 
102
  /**
103
  * Register the stylesheets for the admin area.
105
  * @since 1.0.0
106
  */
107
  public function enqueue_styles($hook) {
108
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin.css', array(), $this->version.'.21', 'all' );
109
  wp_enqueue_style( $this->plugin_name . 'checkbox', plugin_dir_url( __FILE__ ) . 'css/checkbox.min.css', array(), $this->version, 'all' );
110
 
111
+ if ( $hook === 'woocommerce_page_mailchimp-woocommerce' ) {
112
  if ( get_bloginfo( 'version' ) < '5.3') {
113
  wp_enqueue_style( $this->plugin_name."-settings", plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin-settings-5.2.css', array(), $this->version, 'all' );
114
  }
122
  * @since 1.0.0
123
  */
124
  public function enqueue_scripts($hook) {
125
+ if ( $hook === 'woocommerce_page_mailchimp-woocommerce' ) {
126
+ wp_register_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailchimp-woocommerce-admin.js', array( 'jquery', 'swal' ), $this->version.'.21', false );
127
+ wp_localize_script(
128
+ $this->plugin_name,
129
+ 'phpVars',
130
+ array(
131
+ 'removeReviewBannerRestUrl' => MailChimp_WooCommerce_Rest_Api::url('review-banner'),
132
+ 'l10n' => array(
133
+ 'are_you_sure' => __('Are you sure?', 'mailchimp-for-woocommerce'),
134
+ 'log_delete_subtitle' => __('You will not be able to revert.', 'mailchimp-for-woocommerce'),
135
+ 'log_delete_confirm' => __('Yes, delete it!', 'mailchimp-for-woocommerce'),
136
+ 'no_cancel' => __('No, cancel!', 'mailchimp-for-woocommerce'),
137
+ 'store_disconnect_subtitle' => __('You are about to disconnect your store from Mailchimp.', 'mailchimp-for-woocommerce'),
138
+ 'store_disconnect_confirm' => __('Yes, disconnect.', 'mailchimp-for-woocommerce'),
139
+ ),
140
+ )
141
+ );
142
  wp_enqueue_script( $this->plugin_name);
143
  wp_enqueue_script('swal', "//cdn.jsdelivr.net/npm/sweetalert2@8", '', $this->version, false);
144
  }
150
  * @since 1.0.0
151
  */
152
  public function add_plugin_admin_menu() {
153
+ // Add woocommerce menu subitem
154
+ add_submenu_page(
155
+ 'woocommerce',
156
+ __( 'Mailchimp for WooCommerce', 'mailchimp-for-woocommerce'),
157
+ __( 'Mailchimp', 'mailchimp-for-woocommerce' ),
158
  mailchimp_get_allowed_capability(),
159
  $this->plugin_name,
160
+ array($this, 'display_plugin_setup_page')
161
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
163
 
164
  /**
169
  wc_admin_connect_page(
170
  array(
171
  'id' => $this->plugin_name,
172
+ 'screen_id' => 'woocommerce_page_mailchimp-woocommerce',
173
  'title' => __( 'Mailchimp for WooCommerce', 'mailchimp-for-woocommerce' ),
174
  )
175
  );
243
  if (get_option('mailchimp-woocommerce-sync.initial_sync') == 1 && get_option('mailchimp-woocommerce-sync.completed_at') > 0 ) {
244
  $this->mailchimp_show_initial_sync_message();
245
  }
246
+ if (isset($_GET['log_removed']) && $_GET['log_removed'] == "1") {
247
+ add_settings_error('mailchimp_log_settings', '', __('Log file deleted.', 'mailchimp-for-woocommerce'), 'info');
248
+ }
249
  }
250
  }
251
 
252
+
253
+ /**
254
+ * Displays notice when plugin is installed but not yet configured / connected to Mailchimp.
255
+ */
256
+ public function initial_notice() {
257
+ if (!mailchimp_is_configured()) {
258
+ $class = 'notice notice-warning is-dismissible';
259
+ $message = sprintf(
260
+ /* translators: Placeholders %1$s - opening strong HTML tag, %2$s - closing strong HTML tag, %3$s - opening link HTML tag, %4$s - closing link HTML tag */
261
+ esc_html__(
262
+ '%1$sMailchimp for Woocommerce%2$s is not yet connected to a Mailchimp account. To complete the connection, %3$svisit the plugin settings page%4$s.',
263
+ 'facebook-for-woocommerce'
264
+ ),
265
+ '<strong>',
266
+ '</strong>',
267
+ '<a href="' . admin_url( 'admin.php?page=') . $this->plugin_name . '">',
268
+ '</a>'
269
+ );
270
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
271
+ }
272
+ }
273
+
274
+
275
  /**
276
  * Depending on the version we're on we may need to run some sort of migrations.
277
  */
544
  }
545
  }
546
  //case sync
547
+ elseif ($this->is_resyncing()) {
548
  // remove all the pointers to be sure
549
  $service = new MailChimp_Service();
550
  $service->removePointers(true, true);
699
  }
700
 
701
  else {
702
+ $suggestion = wp_remote_get( 'https://woocommerce.mailchimpapp.com/api/usernames/suggestions/' . preg_replace('/[^A-Za-z0-9\-\@\.]/', '', $_POST['username']));
703
  $suggested_username = json_decode($suggestion['body'])->data;
704
  wp_send_json_error( array(
705
  'success' => false,
707
  ));
708
  }
709
  }
710
+
711
+ public function mailchimp_woocommerce_ajax_support_form() {
712
+ $data = $_POST['data'];
713
+
714
+ // try to figure out user IP address
715
+ if ($_SERVER['REMOTE_ADDR'] == '::1' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
716
+ $data['ip_address'] = '127.0.0.1';
717
+ }
718
+ else {
719
+ $data['ip_address'] = isset($_SERVER['HTTP_CLIENT_IP']) ? $_SERVER['HTTP_CLIENT_IP'] : (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
720
+ }
721
+
722
+ $pload = array(
723
+ 'headers' => array(
724
+ 'Content-type' => 'application/json',
725
+ ),
726
+ 'body' => json_encode($data),
727
+ 'timeout' => 30,
728
+ );
729
+
730
+ $response = wp_remote_post( 'https://woocommerce.mailchimpapp.com/api/support', $pload);
731
+ $response_body = json_decode($response['body']);
732
+ if ($response['response']['code'] == 200 && $response_body->success == true ){
733
+
734
+ wp_send_json_success($response_body);
735
+ }
736
+
737
+ else if ($response['response']['code'] == 404 ){
738
+ wp_send_json_error(array(
739
+ 'success' => false,
740
+ 'error' => $response
741
+ ));
742
+ }
743
+
744
+ }
745
 
746
  public function mailchimp_woocommerce_ajax_create_account_signup() {
747
  $data = $_POST['data'];
1717
  ));
1718
  }
1719
 
1720
+ public function mailchimp_woocommerce_ajax_load_log_file() {
1721
+ if (isset($_POST['log_file']) && !empty($_POST['log_file'])) {
1722
+ $requested_log_file = $_POST['log_file'];
1723
+ }
1724
+ else {
1725
+ return wp_send_json_error( __('No log file provided', 'mailchimp-for-woocommerce'));
1726
+ }
1727
+
1728
+ $files = defined('WC_LOG_DIR') ? @scandir( WC_LOG_DIR ) : array();
1729
+
1730
+ $logs = array();
1731
+ if (!empty($files)) {
1732
+ foreach (array_reverse($files) as $key => $value) {
1733
+ if (!in_array( $value, array( '.', '..' ))) {
1734
+ if (!is_dir($value) && mailchimp_string_contains($value, 'mailchimp_woocommerce')) {
1735
+ $logs[sanitize_title($value)] = $value;
1736
+ }
1737
+ }
1738
+ }
1739
+ }
1740
+
1741
+ if (!empty($requested_log_file) && isset($logs[sanitize_title($requested_log_file)])) {
1742
+ $viewed_log = $logs[sanitize_title($requested_log_file)];
1743
+ } else {
1744
+ return wp_send_json_error( __('Error loading log file contents', 'mailchimp-for-woocommerce'));
1745
+ }
1746
+
1747
+ return wp_send_json_success( esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ) );
1748
+
1749
+ }
1750
+
1751
  }
admin/css/mailchimp-woocommerce-admin-settings-5.2.css CHANGED
@@ -221,7 +221,7 @@
221
 
222
  .tab-content-submit,
223
  .mc-woocommerce-resync-button,
224
- .mc-woocommerce-copy-log-button {
225
  font-family: proxima-nova, Arial, Helvetica, sans-serif !important;
226
  font-size: 14px !important;
227
  line-height: 16px !important;
@@ -243,9 +243,11 @@
243
  color: #7FAD45;
244
  }
245
 
246
- .mc-woocommerce-copy-log-button {
247
- padding-bottom: 15px !important;
248
  text-decoration: none;
 
 
249
  }
250
 
251
  .tab-content-submit {
@@ -293,7 +295,7 @@
293
  }
294
 
295
  .mc-woocommerce-resync-button,
296
- .mc-woocommerce-copy-log-button {
297
  color: #3C3C3C !important;
298
  background: #E6E6E6 !important;
299
  box-shadow:0 1px 0 #E6E6E6 !important;
@@ -314,7 +316,7 @@
314
  }
315
 
316
  .mc-woocommerce-resync-button:hover,
317
- .mc-woocommerce-copy-log-button:hover {
318
  color: #3C3C3C !important;
319
  background: #DADADA !important;
320
  box-shadow:0 1px 0 #DADADA !important;
@@ -333,6 +335,17 @@
333
  box-shadow 0.3s ease-out;
334
  }
335
 
 
 
 
 
 
 
 
 
 
 
 
336
  .tab-content-submit:focus,.tab-content-submit:hover{
337
  background: rgb(149, 189, 101);
338
  border-color: rgb(149, 189, 101);
@@ -492,8 +505,7 @@
492
  margin-top: 14em;
493
  }
494
 
495
- .sync-content-wrapper .mc-woocommerce-disconnect-button,
496
- .mc-woocommerce-delete-log-button {
497
  cursor: pointer;
498
  padding-top: 1em;
499
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
@@ -519,12 +531,7 @@
519
  float: right;
520
  }
521
 
522
- .mc-woocommerce-delete-log-button {
523
- float: right;
524
- background: white;
525
- }
526
- .sync-content-wrapper .mc-woocommerce-disconnect-button:hover,
527
- .mc-woocommerce-delete-log-button:hover {
528
  color: #3C3C3C;
529
  background-color: #DADADA;
530
  -webkit-transition: background-color 0.3s ease-out;
@@ -533,8 +540,7 @@
533
  transition: background-color 0.3s ease-out;
534
  }
535
 
536
- .sync-content-wrapper .mc-woocommerce-disconnect-button svg,
537
- .mc-woocommerce-delete-log-button svg {
538
  margin-right: 2em;
539
  }
540
 
@@ -683,6 +689,7 @@
683
  .tab-content-wrapper .optional-settings-button:hover span {
684
  color: #628735;
685
  }
 
686
  .tab-content-wrapper .optional-settings-button span {
687
  text-transform: uppercase;
688
  color: #7FAD45 ;
@@ -697,7 +704,7 @@
697
  }
698
 
699
  .tab-content-wrapper .optional-settings-content {
700
- display: none;
701
  }
702
 
703
  /* Old styles from tabs.php */
@@ -712,6 +719,18 @@
712
  display: inline-block;
713
  }
714
 
 
 
 
 
 
 
 
 
 
 
 
 
715
  .view-log-submit {
716
  width: 15%;
717
  display: inline-block;
@@ -887,18 +906,24 @@
887
  @media screen and (max-width: 782px) {
888
  .tab-content-submit,
889
  .mc-woocommerce-resync-button,
890
- .mc-woocommerce-copy-log-button,
891
- .mc-woocommerce-delete-log-button {
892
  padding: 15px 35px 15px 35px !important;
893
  }
894
 
895
- .mc-woocommerce-copy-log-button,
896
- .mc-woocommerce-delete-log-button {
897
  width: 100%;
898
  padding: 15px 35px 15px 35px !important;
899
  text-align: center;
900
  }
901
 
 
 
 
 
 
 
 
 
902
  .tab-content-wrapper form{
903
  padding: 1em;
904
  }
221
 
222
  .tab-content-submit,
223
  .mc-woocommerce-resync-button,
224
+ .mc-woocommerce-log-button {
225
  font-family: proxima-nova, Arial, Helvetica, sans-serif !important;
226
  font-size: 14px !important;
227
  line-height: 16px !important;
243
  color: #7FAD45;
244
  }
245
 
246
+ .mc-woocommerce-log-button {
247
+ padding: 15px !important;
248
  text-decoration: none;
249
+ display:inline-block;
250
+ background-color: #FFFF;
251
  }
252
 
253
  .tab-content-submit {
295
  }
296
 
297
  .mc-woocommerce-resync-button,
298
+ .mc-woocommerce-log-button {
299
  color: #3C3C3C !important;
300
  background: #E6E6E6 !important;
301
  box-shadow:0 1px 0 #E6E6E6 !important;
316
  }
317
 
318
  .mc-woocommerce-resync-button:hover,
319
+ .mc-woocommerce-log-button:hover {
320
  color: #3C3C3C !important;
321
  background: #DADADA !important;
322
  box-shadow:0 1px 0 #DADADA !important;
335
  box-shadow 0.3s ease-out;
336
  }
337
 
338
+ .mc-woocommerce-log-button {
339
+ background: #fff !important;
340
+ box-shadow:none !important;
341
+ text-shadow: 0 -1px 1px #DADADA,1px 0 1px #DADADA,0 1px 1px #DADADA,-1px 0 1px #DADADA !important;
342
+ }
343
+
344
+ .mc-woocommerce-log-button:hover {
345
+ background: #eee !important;
346
+ }
347
+
348
+
349
  .tab-content-submit:focus,.tab-content-submit:hover{
350
  background: rgb(149, 189, 101);
351
  border-color: rgb(149, 189, 101);
505
  margin-top: 14em;
506
  }
507
 
508
+ .sync-content-wrapper .mc-woocommerce-disconnect-button {
 
509
  cursor: pointer;
510
  padding-top: 1em;
511
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
531
  float: right;
532
  }
533
 
534
+ .sync-content-wrapper .mc-woocommerce-disconnect-button:hover {
 
 
 
 
 
535
  color: #3C3C3C;
536
  background-color: #DADADA;
537
  -webkit-transition: background-color 0.3s ease-out;
540
  transition: background-color 0.3s ease-out;
541
  }
542
 
543
+ .sync-content-wrapper .mc-woocommerce-disconnect-button svg {
 
544
  margin-right: 2em;
545
  }
546
 
689
  .tab-content-wrapper .optional-settings-button:hover span {
690
  color: #628735;
691
  }
692
+ .tab-content-wrapper .optional-settings-label span
693
  .tab-content-wrapper .optional-settings-button span {
694
  text-transform: uppercase;
695
  color: #7FAD45 ;
704
  }
705
 
706
  .tab-content-wrapper .optional-settings-content {
707
+ display: block;
708
  }
709
 
710
  /* Old styles from tabs.php */
719
  display: inline-block;
720
  }
721
 
722
+ .log-file-actions {
723
+ display: flex;
724
+ justify-content: space-around;
725
+ align-items: stretch;
726
+ }
727
+
728
+ #log-actions {
729
+ float: right;
730
+ flex: 0 0 120px;
731
+ margin-left: 20px;
732
+ }
733
+
734
  .view-log-submit {
735
  width: 15%;
736
  display: inline-block;
906
  @media screen and (max-width: 782px) {
907
  .tab-content-submit,
908
  .mc-woocommerce-resync-button,
909
+ .mc-woocommerce-log-button {
 
910
  padding: 15px 35px 15px 35px !important;
911
  }
912
 
913
+ .mc-woocommerce-log-button {
 
914
  width: 100%;
915
  padding: 15px 35px 15px 35px !important;
916
  text-align: center;
917
  }
918
 
919
+ .log-file-actions {
920
+ display: block;
921
+ }
922
+
923
+ #log-actions {
924
+ float: left;
925
+ }
926
+
927
  .tab-content-wrapper form{
928
  padding: 1em;
929
  }
admin/css/mailchimp-woocommerce-admin-settings.css CHANGED
@@ -10,6 +10,10 @@
10
  src: local('Proxima Nova Alt Light'), url('../fonts/Mark Simonson - Proxima Nova Alt Light.woff') format('woff');
11
  }
12
 
 
 
 
 
13
  .mc-woocommerce-settings {
14
  width:90%;
15
  margin: 4em auto 0 auto !important;
@@ -33,32 +37,13 @@
33
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
34
  font-size: 12px !important;
35
  line-height: 16px !important;
36
- color: #B3B3B3 !important;
37
- }
38
- /* .notice {
39
- background: rgba(127, 173, 69, 0.1) !important;
40
- mix-blend-mode: normal !important;
41
- border: 1px solid rgba(127, 173, 69, 0.5) !important;
42
- box-sizing: border-box !important;
43
- border-radius: 4px !important;
44
  }
45
 
46
- .notice.notice-error {
47
- background: rgba(250, 50, 50, 0.1) !important;
48
- border: 1px solid rgba(250, 50, 50, 0.5) !important;
49
  }
50
 
51
- .notice.notice-info {
52
- background: rgba(0, 160, 210, 0.1) !important;
53
- border: 1px solid rgba(0, 160, 210, 0.5) !important;
54
- }
55
-
56
- .notice.notice-warning {
57
- background: rgba(255, 185, 0, 0.1) !important;
58
- border: 1px solid rgba(255, 185, 0, 0.5) !important;
59
- } */
60
-
61
-
62
  .nav-wizard-wrapper {
63
  cursor: default;
64
  margin-bottom: 110px !important;
@@ -70,19 +55,31 @@
70
  height: 13px;
71
  width: 57px;
72
  margin-right: 0.5em;
73
- border-bottom: 3px solid #E6E6E6;
74
  position: relative;
75
  align-items: center;
76
  text-align: center;
77
  text-transform: uppercase;
78
  }
79
 
80
- .nav-wizard-wrapper .wizard-tab-active,
81
- .nav-wizard-wrapper a.wizard-tab:hover {
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  border-bottom: 3px solid #212121;
83
  }
84
 
85
- .nav-wizard-wrapper .wizard-tab .wizard-tab-tooltip{
86
  display: none;
87
  }
88
 
@@ -90,7 +87,7 @@
90
  display: block;
91
  }
92
 
93
- .nav-wizard-wrapper .wizard-tab .wizard-tab-tooltip {
94
  position: absolute;
95
  left: 0;
96
  top: 40px;
@@ -102,9 +99,10 @@
102
  font-size: 14px;
103
  line-height: 17px;
104
  color: #3C3C3C;
 
105
  }
106
 
107
- .nav-wizard-wrapper .wizard-tab .wizard-tab-tooltip svg{
108
  position: absolute;
109
  left: 13px;
110
  top: -13px;
@@ -210,7 +208,7 @@
210
 
211
  .tab-content-wrapper p.submit {
212
  margin-top: 0 !important;
213
- padding-top: 0 !important;
214
  margin-bottom: 45px !important;
215
  font-weight: 600;
216
  }
@@ -219,9 +217,13 @@
219
  margin-top: 10px !important;
220
  }
221
 
 
 
 
 
222
  .tab-content-submit,
223
  .mc-woocommerce-resync-button,
224
- .mc-woocommerce-copy-log-button {
225
  font-family: proxima-nova, Arial, Helvetica, sans-serif !important;
226
  font-size: 14px !important;
227
  line-height: 16px !important;
@@ -243,9 +245,20 @@
243
  color: #7FAD45;
244
  }
245
 
246
- .mc-woocommerce-copy-log-button {
247
- padding-bottom: 15px !important;
248
  text-decoration: none;
 
 
 
 
 
 
 
 
 
 
 
249
  }
250
 
251
  .tab-content-submit {
@@ -293,7 +306,7 @@
293
  }
294
 
295
  .mc-woocommerce-resync-button,
296
- .mc-woocommerce-copy-log-button {
297
  color: #3C3C3C !important;
298
  background: #E6E6E6 !important;
299
  box-shadow:0 1px 0 #E6E6E6 !important;
@@ -314,7 +327,7 @@
314
  }
315
 
316
  .mc-woocommerce-resync-button:hover,
317
- .mc-woocommerce-copy-log-button:hover {
318
  color: #3C3C3C !important;
319
  background: #DADADA !important;
320
  box-shadow:0 1px 0 #DADADA !important;
@@ -334,6 +347,16 @@
334
  text-decoration: none !important;
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
337
  .tab-content-submit:focus,.tab-content-submit:hover{
338
  background: rgb(149, 189, 101);
339
  border-color: rgb(149, 189, 101);
@@ -371,6 +394,12 @@
371
  height: 164px;
372
  }
373
 
 
 
 
 
 
 
374
  .sync-comm-wrapper .comm_box_status {
375
  font-weight: 700;
376
  }
@@ -493,8 +522,7 @@
493
  margin-top: 14em;
494
  }
495
 
496
- .sync-content-wrapper .mc-woocommerce-disconnect-button,
497
- .mc-woocommerce-delete-log-button {
498
  cursor: pointer;
499
  padding-top: 1em;
500
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
@@ -520,12 +548,7 @@
520
  float: right;
521
  }
522
 
523
- .mc-woocommerce-delete-log-button {
524
- float: right;
525
- background: white;
526
- }
527
- .sync-content-wrapper .mc-woocommerce-disconnect-button:hover,
528
- .mc-woocommerce-delete-log-button:hover {
529
  color: #3C3C3C;
530
  background-color: #DADADA;
531
  -webkit-transition: background-color 0.3s ease-out;
@@ -535,8 +558,7 @@
535
  text-decoration: none !important;
536
  }
537
 
538
- .sync-content-wrapper .mc-woocommerce-disconnect-button svg,
539
- .mc-woocommerce-delete-log-button svg {
540
  margin-right: 2em;
541
  }
542
 
@@ -547,19 +569,32 @@
547
  clear:both;
548
  }
549
 
550
- .sync-comm-wrapper .box {
 
551
  padding: 0.5rem 0rem;
552
  margin: 0;
553
  }
554
 
 
 
 
 
 
 
 
555
  .tab-content-wrapper .box.box-half,
556
- .sync-content-wrapper .box.box-half {
 
557
  float: left;
558
  clear: none;
559
  width: 50%;
560
 
561
  }
562
 
 
 
 
 
563
  .sync-content-wrapper .box.box-half {
564
  height: 100%;
565
  }
@@ -597,7 +632,7 @@
597
 
598
  .tab-content-wrapper .mailchimp-select-wrapper {
599
  border: 1px solid #E6E6E6;
600
- padding: 9px 20px 8px 20px;
601
  -webkit-border-radius: 4px;
602
  -moz-border-radius: 4px;
603
  border-radius: 4px;
@@ -681,6 +716,7 @@
681
 
682
  }
683
 
 
684
  .tab-content-wrapper .optional-settings-button {
685
  margin-top: 3em;
686
  font-weight: 600;
@@ -689,12 +725,18 @@
689
  .tab-content-wrapper .optional-settings-button:hover span {
690
  color: #628735;
691
  }
 
 
692
  .tab-content-wrapper .optional-settings-button span {
693
  text-transform: uppercase;
694
  color: #7FAD45 ;
695
- padding-left: 2em;
696
- background: no-repeat left center url("data:image/svg+xml;charset=UTF-8,%3csvg width='13' height='8' viewBox='0 0 13 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M11.34 0.590027L6.75 5.17003L2.16 0.590027L0.75 2.00003L6.75 8.00003L12.75 2.00003L11.34 0.590027Z' fill='%23212121'/%3e%3c/svg%3e ");
697
  font-size: 14px;
 
 
 
 
 
 
698
  cursor: pointer;
699
  }
700
 
@@ -703,7 +745,7 @@
703
  }
704
 
705
  .tab-content-wrapper .optional-settings-content {
706
- display: none;
707
  }
708
 
709
  /* Old styles from tabs.php */
@@ -714,10 +756,22 @@
714
  }
715
 
716
  .view-log-select {
717
- width: 80%;
718
  display: inline-block;
719
  }
720
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  .view-log-submit {
722
  width: 15%;
723
  display: inline-block;
@@ -727,6 +781,7 @@
727
  background: #fff;
728
  border: 1px solid #e5e5e5;
729
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
 
730
  }
731
 
732
  #log-viewer pre {
@@ -756,19 +811,25 @@
756
  box-shadow: none !important;
757
  }
758
 
 
 
 
 
 
 
 
759
 
760
  /* account create modal */
761
  #mc-woocommerce-create-account-link {
762
  padding-top: 20px;
763
  }
764
 
765
- #mc-woocommerce-create-account {
766
  width: 100%;
767
  display: flex;
768
  align-items: center;
769
  justify-content: center;
770
  position: absolute;
771
- top: 50px;
772
  left: 0;
773
  visibility: hidden;
774
  display: none;
@@ -777,20 +838,29 @@
777
  opacity: 0.5; */
778
  }
779
 
780
- #mc-woocommerce-create-account .terms {
 
 
 
 
 
 
 
 
 
781
  padding-top: 20px;
782
  padding-bottom: 20px;
783
  }
784
 
785
- #mc-woocommerce-create-account .terms a {
786
  color: #7FAD45 !important;
787
  }
788
 
789
- #mc-woocommerce-create-account h3 {
790
  padding-bottom: 20px;
791
  }
792
 
793
- #mc-woocommerce-create-account .notices {
794
  background:#fff;
795
  border-left: 4px solid#fff;
796
  border-left-color: rgb(255, 255, 255);
@@ -800,12 +870,13 @@
800
  padding-right: 12px;
801
  }
802
 
803
- #mc-woocommerce-create-account:target {
 
804
  visibility: visible;
805
  display: block;
806
  }
807
 
808
- #mc-woocommerce-create-account .reveal-modal {
809
  position: relative;
810
  margin: 0 auto;
811
  width: 70%;
@@ -816,24 +887,39 @@
816
  line-height: 17px;
817
  }
818
 
819
- #mc-woocommerce-create-account .close-modal {
820
  position: absolute;
821
  left: 10px;
822
  top: 10px;
823
  }
824
 
825
- .mc-woocommerce-create-account-modal-header {
826
  text-align: center;
827
  padding-top: 30px;
828
  }
829
 
830
- .mc-woocommerce-create-account-modal-header h3{
 
 
 
 
 
 
 
 
 
 
 
831
  text-align: center;
832
  padding-top: 30px;
833
  font-size: 2em;
834
  }
835
 
836
- .mc-woocommerce-create-account-modal-footer {
 
 
 
 
837
  padding: 35px;
838
  bottom: 0px;
839
  color: #B0B4BD;
@@ -868,7 +954,8 @@
868
  padding-right: 12px;
869
  }
870
 
871
- .mc-woocommerce-create-account-step-error #connecting{
 
872
  border-left-color: #7FAD45;
873
  }
874
 
@@ -913,38 +1000,43 @@
913
 
914
  @media screen and (max-width: 782px) {
915
  .tab-content-submit,
916
- .mc-woocommerce-resync-button,
917
- .mc-woocommerce-copy-log-button,
918
- .mc-woocommerce-delete-log-button {
919
  padding: 15px 35px 15px 35px !important;
920
  }
921
 
922
- .mc-woocommerce-copy-log-button,
923
- .mc-woocommerce-delete-log-button {
924
- width: 100%;
925
- padding: 15px 35px 15px 35px !important;
926
- text-align: center;
927
  }
928
 
929
- .mc-woocommerce-delete-log-button {
930
- display: none;
931
  }
932
 
933
  .tab-content-wrapper form{
934
  padding: 1em;
935
  }
936
 
 
 
 
 
 
937
  .tab-content-wrapper .box.box-half,
938
  .tab-content-wrapper .box.box-third,
939
- .sync-comm-wrapper .box.box-half {
 
940
  width: 100%;
941
  }
942
 
 
 
 
 
943
  .sync-content-wrapper .sync-stats-wrapper {
944
  display: block;
945
- width: 90%;
946
  position:relative;
947
  margin-bottom: 2em;
 
948
  }
949
 
950
  .sync-content-wrapper .sync-stats-content-wrapper {
10
  src: local('Proxima Nova Alt Light'), url('../fonts/Mark Simonson - Proxima Nova Alt Light.woff') format('woff');
11
  }
12
 
13
+ html {
14
+ scroll-padding-top: 8em;
15
+ }
16
+
17
  .mc-woocommerce-settings {
18
  width:90%;
19
  margin: 4em auto 0 auto !important;
37
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
38
  font-size: 12px !important;
39
  line-height: 16px !important;
40
+ color: #b3b3b3 !important;
 
 
 
 
 
 
 
41
  }
42
 
43
+ .description.support-form {
44
+ color: #444 !important;
 
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
47
  .nav-wizard-wrapper {
48
  cursor: default;
49
  margin-bottom: 110px !important;
55
  height: 13px;
56
  width: 57px;
57
  margin-right: 0.5em;
 
58
  position: relative;
59
  align-items: center;
60
  text-align: center;
61
  text-transform: uppercase;
62
  }
63
 
64
+ .nav-wizard-wrapper .wizard-tab .marker{
65
+ display: block;
66
+ height: 13px;
67
+ width: 57px;
68
+ border-bottom: 3px solid #E6E6E6;
69
+ }
70
+
71
+ .nav-wizard-wrapper .wizard-tab .marker-disabled{
72
+ display: block;
73
+ height: 13px;
74
+ width: 57px;
75
+ border-bottom: 3px solid #E6E6E6;
76
+ }
77
+
78
+ .nav-wizard-wrapper .wizard-tab .marker:hover{
79
  border-bottom: 3px solid #212121;
80
  }
81
 
82
+ .nav-wizard-wrapper .wizard-tab-tooltip{
83
  display: none;
84
  }
85
 
87
  display: block;
88
  }
89
 
90
+ .nav-wizard-wrapper .wizard-tab-tooltip {
91
  position: absolute;
92
  left: 0;
93
  top: 40px;
99
  font-size: 14px;
100
  line-height: 17px;
101
  color: #3C3C3C;
102
+ cursor: default;
103
  }
104
 
105
+ .nav-wizard-wrapper .wizard-tab-tooltip svg{
106
  position: absolute;
107
  left: 13px;
108
  top: -13px;
208
 
209
  .tab-content-wrapper p.submit {
210
  margin-top: 0 !important;
211
+ padding-top: 35px !important;
212
  margin-bottom: 45px !important;
213
  font-weight: 600;
214
  }
217
  margin-top: 10px !important;
218
  }
219
 
220
+ .tab-content-wrapper .required-field-mark {
221
+ color: red;
222
+ }
223
+
224
  .tab-content-submit,
225
  .mc-woocommerce-resync-button,
226
+ .mc-woocommerce-log-button {
227
  font-family: proxima-nova, Arial, Helvetica, sans-serif !important;
228
  font-size: 14px !important;
229
  line-height: 16px !important;
245
  color: #7FAD45;
246
  }
247
 
248
+ .mc-woocommerce-log-button {
249
+ padding: 15px !important;
250
  text-decoration: none;
251
+ display:inline-block;
252
+ background-color: #FFFF;
253
+ }
254
+
255
+ .mc-woocommerce-log-button.delete-log-button:hover span {
256
+ color: red;
257
+ }
258
+
259
+ .mc-woocommerce-log-button.mc-woocommerce-copy-log-button span.yes {
260
+ color: green;
261
+ display:none;
262
  }
263
 
264
  .tab-content-submit {
306
  }
307
 
308
  .mc-woocommerce-resync-button,
309
+ .mc-woocommerce-log-button {
310
  color: #3C3C3C !important;
311
  background: #E6E6E6 !important;
312
  box-shadow:0 1px 0 #E6E6E6 !important;
327
  }
328
 
329
  .mc-woocommerce-resync-button:hover,
330
+ .mc-woocommerce-log-button:hover {
331
  color: #3C3C3C !important;
332
  background: #DADADA !important;
333
  box-shadow:0 1px 0 #DADADA !important;
347
  text-decoration: none !important;
348
  }
349
 
350
+ .mc-woocommerce-log-button {
351
+ background: #fff !important;
352
+ box-shadow:none !important;
353
+ text-shadow: 0 -1px 1px #DADADA,1px 0 1px #DADADA,0 1px 1px #DADADA,-1px 0 1px #DADADA !important;
354
+ }
355
+
356
+ .mc-woocommerce-log-button:hover {
357
+ background: #eee !important;
358
+ }
359
+
360
  .tab-content-submit:focus,.tab-content-submit:hover{
361
  background: rgb(149, 189, 101);
362
  border-color: rgb(149, 189, 101);
394
  height: 164px;
395
  }
396
 
397
+ .sync-more-wrapper {
398
+ position:relative;
399
+ padding: 4px 0em;
400
+ height: 264px;
401
+ }
402
+
403
  .sync-comm-wrapper .comm_box_status {
404
  font-weight: 700;
405
  }
522
  margin-top: 14em;
523
  }
524
 
525
+ .sync-content-wrapper .mc-woocommerce-disconnect-button {
 
526
  cursor: pointer;
527
  padding-top: 1em;
528
  font-family: proxima-nova, Arial, Helvetica, sans-serif;
548
  float: right;
549
  }
550
 
551
+ .sync-content-wrapper .mc-woocommerce-disconnect-button:hover {
 
 
 
 
 
552
  color: #3C3C3C;
553
  background-color: #DADADA;
554
  -webkit-transition: background-color 0.3s ease-out;
558
  text-decoration: none !important;
559
  }
560
 
561
+ .sync-content-wrapper .mc-woocommerce-disconnect-button svg {
 
562
  margin-right: 2em;
563
  }
564
 
569
  clear:both;
570
  }
571
 
572
+ .sync-comm-wrapper .box,
573
+ .sync-more-wrapper .box {
574
  padding: 0.5rem 0rem;
575
  margin: 0;
576
  }
577
 
578
+ .sync-more-wrapper .box {
579
+ height: 200px !important;
580
+ -webkit-border-radius: 4px;
581
+ -moz-border-radius: 4px;
582
+ border-radius: 4px;
583
+ }
584
+
585
  .tab-content-wrapper .box.box-half,
586
+ .sync-content-wrapper .box.box-half,
587
+ .sync-more-wrapper .box.box-half {
588
  float: left;
589
  clear: none;
590
  width: 50%;
591
 
592
  }
593
 
594
+ .sync-more-wrapper .box.box-half .content{
595
+ padding: 0 2em;
596
+ }
597
+
598
  .sync-content-wrapper .box.box-half {
599
  height: 100%;
600
  }
632
 
633
  .tab-content-wrapper .mailchimp-select-wrapper {
634
  border: 1px solid #E6E6E6;
635
+ padding: 6px 6px 4px 20px;
636
  -webkit-border-radius: 4px;
637
  -moz-border-radius: 4px;
638
  border-radius: 4px;
716
 
717
  }
718
 
719
+ .tab-content-wrapper .optional-settings-label,
720
  .tab-content-wrapper .optional-settings-button {
721
  margin-top: 3em;
722
  font-weight: 600;
725
  .tab-content-wrapper .optional-settings-button:hover span {
726
  color: #628735;
727
  }
728
+
729
+ .tab-content-wrapper .optional-settings-label span,
730
  .tab-content-wrapper .optional-settings-button span {
731
  text-transform: uppercase;
732
  color: #7FAD45 ;
 
 
733
  font-size: 14px;
734
+ cursor: default;
735
+ }
736
+
737
+ .tab-content-wrapper .optional-settings-button span {
738
+ background: no-repeat left center url("data:image/svg+xml;charset=UTF-8,%3csvg width='13' height='8' viewBox='0 0 13 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M11.34 0.590027L6.75 5.17003L2.16 0.590027L0.75 2.00003L6.75 8.00003L12.75 2.00003L11.34 0.590027Z' fill='%23212121'/%3e%3c/svg%3e ");
739
+ padding-left: 2em;
740
  cursor: pointer;
741
  }
742
 
745
  }
746
 
747
  .tab-content-wrapper .optional-settings-content {
748
+ display: block;
749
  }
750
 
751
  /* Old styles from tabs.php */
756
  }
757
 
758
  .view-log-select {
759
+ width: 100%;
760
  display: inline-block;
761
  }
762
 
763
+ .log-file-actions {
764
+ display: flex;
765
+ justify-content: space-around;
766
+ align-items: stretch;
767
+ }
768
+
769
+ #log-actions {
770
+ float: right;
771
+ flex: 0 0 120px;
772
+ margin-left: 20px;
773
+ }
774
+
775
  .view-log-submit {
776
  width: 15%;
777
  display: inline-block;
781
  background: #fff;
782
  border: 1px solid #e5e5e5;
783
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
784
+ text-align: center;
785
  }
786
 
787
  #log-viewer pre {
811
  box-shadow: none !important;
812
  }
813
 
814
+ #log-viewer .spinner {
815
+ float:none;
816
+ background-size: 16px 16px;
817
+ width: 16px;
818
+ height: 16px;
819
+ margin: 30px 10px
820
+ }
821
 
822
  /* account create modal */
823
  #mc-woocommerce-create-account-link {
824
  padding-top: 20px;
825
  }
826
 
827
+ .mc-woocommerce-modal {
828
  width: 100%;
829
  display: flex;
830
  align-items: center;
831
  justify-content: center;
832
  position: absolute;
 
833
  left: 0;
834
  visibility: hidden;
835
  display: none;
838
  opacity: 0.5; */
839
  }
840
 
841
+ #mc-woocommerce-support-form {
842
+ bottom:0px;
843
+ padding-bottom: 20px;
844
+ }
845
+
846
+ #mc-woocommerce-create-account {
847
+ top:50px;
848
+ }
849
+
850
+ .mc-woocommerce-modal .terms {
851
  padding-top: 20px;
852
  padding-bottom: 20px;
853
  }
854
 
855
+ .mc-woocommerce-modal .terms a {
856
  color: #7FAD45 !important;
857
  }
858
 
859
+ .mc-woocommerce-modal h3 {
860
  padding-bottom: 20px;
861
  }
862
 
863
+ .mc-woocommerce-modal .notices {
864
  background:#fff;
865
  border-left: 4px solid#fff;
866
  border-left-color: rgb(255, 255, 255);
870
  padding-right: 12px;
871
  }
872
 
873
+ #mc-woocommerce-create-account:target,
874
+ #mc-woocommerce-support-form:target {
875
  visibility: visible;
876
  display: block;
877
  }
878
 
879
+ .mc-woocommerce-modal .reveal-modal {
880
  position: relative;
881
  margin: 0 auto;
882
  width: 70%;
887
  line-height: 17px;
888
  }
889
 
890
+ .mc-woocommerce-modal .close-modal {
891
  position: absolute;
892
  left: 10px;
893
  top: 10px;
894
  }
895
 
896
+ .mc-woocommerce-modal .modal-header {
897
  text-align: center;
898
  padding-top: 30px;
899
  }
900
 
901
+ #mc-woocommerce-support-form .modal-header svg{
902
+ display: inline;
903
+ }
904
+
905
+ #mc-woocommerce-support-form .modal-header h3{
906
+ text-align: center;
907
+ padding: 0px 0 20px 30px;
908
+ font-size: 2em;
909
+ display: inline-block;
910
+ }
911
+
912
+ .mc-woocommerce-modal .modal-header h3{
913
  text-align: center;
914
  padding-top: 30px;
915
  font-size: 2em;
916
  }
917
 
918
+ #mc-woocommerce-support-form h3{
919
+ padding-bottom: 0;
920
+ }
921
+
922
+ .mc-woocommerce-modal .modal-footer {
923
  padding: 35px;
924
  bottom: 0px;
925
  color: #B0B4BD;
954
  padding-right: 12px;
955
  }
956
 
957
+ .mc-woocommerce-create-account-step-error #connecting,
958
+ .mc-woocommerce-create-account-step-error #success{
959
  border-left-color: #7FAD45;
960
  }
961
 
1000
 
1001
  @media screen and (max-width: 782px) {
1002
  .tab-content-submit,
1003
+ .mc-woocommerce-resync-button {
 
 
1004
  padding: 15px 35px 15px 35px !important;
1005
  }
1006
 
1007
+ .log-file-actions {
1008
+ display: block;
 
 
 
1009
  }
1010
 
1011
+ #log-actions {
1012
+ float: left;
1013
  }
1014
 
1015
  .tab-content-wrapper form{
1016
  padding: 1em;
1017
  }
1018
 
1019
+ .tab-content-wrapper .mailchimp-select-wrapper select {
1020
+
1021
+ font-size: 16px;
1022
+ line-height: 32px;
1023
+ }
1024
  .tab-content-wrapper .box.box-half,
1025
  .tab-content-wrapper .box.box-third,
1026
+ .sync-comm-wrapper .box.box-half,
1027
+ .sync-more-wrapper .box.box-half {
1028
  width: 100%;
1029
  }
1030
 
1031
+ .sync-more-wrapper .box.box-half:last-child {
1032
+ margin-top: 26px;
1033
+ }
1034
+
1035
  .sync-content-wrapper .sync-stats-wrapper {
1036
  display: block;
 
1037
  position:relative;
1038
  margin-bottom: 2em;
1039
+ margin-right: 0;
1040
  }
1041
 
1042
  .sync-content-wrapper .sync-stats-content-wrapper {
admin/js/mailchimp-woocommerce-admin.js CHANGED
@@ -3,14 +3,13 @@
3
 
4
  $( window ).load(function() {
5
  // show/hide wizard tabs tooltips
6
- $('a.wizard-tab').hover(function (e) {
7
  e.stopPropagation();
8
  $('.wizard-tab-tooltip').hide();
9
- $(this).find('.wizard-tab-tooltip').show();
10
-
11
  });
12
 
13
- $('a.wizard-tab').mouseleave(function (e) {
14
  e.stopPropagation();
15
  $('.wizard-tab-tooltip').hide();
16
  $('.wizard-tab-active .wizard-tab-tooltip').show();
@@ -28,10 +27,56 @@
28
  $(this).find('span').addClass('active');
29
  optionalSettings = true;
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
 
 
32
 
 
 
 
 
 
 
33
  });
34
 
 
 
 
 
 
 
35
  // copy log button
36
  $('.mc-woocommerce-copy-log-button').click(function (e) {
37
  e.preventDefault();
@@ -42,6 +87,66 @@
42
  /* Copy the text inside the text field */
43
  document.execCommand("copy");
44
  $temp.remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  });
46
 
47
  /*
@@ -50,6 +155,8 @@
50
  */
51
  var mailchimp_woocommerce_disconnect_done = false;
52
  $('#mailchimp_woocommerce_disconnect').click(function (e){
 
 
53
  // this is to trigger the event even after preventDefault() is issued.
54
  if (mailchimp_woocommerce_disconnect_done) {
55
  mailchimp_woocommerce_disconnect_done = false; // reset flag
@@ -58,8 +165,6 @@
58
 
59
  e.preventDefault();
60
 
61
- var me = $(e.target);
62
-
63
  const swalWithBootstrapButtons = Swal.mixin({
64
  customClass: {
65
  confirmButton: 'button button-primary tab-content-submit disconnect-button',
@@ -69,13 +174,13 @@
69
  })
70
 
71
  swalWithBootstrapButtons.fire({
72
- title: 'Are you sure?',
73
- text: "You are about to disconnect your store from Mailchimp.",
74
  type: 'warning',
75
  showCancelButton: true,
76
- confirmButtonText: 'Yes, disconnect.',
77
- cancelButtonText: 'No, cancel!',
78
- reverseButtons: true
79
  }).then((result) => {
80
  if (result.value) {
81
  var query = window.location.href.match(/^(.*)\&/);
@@ -85,7 +190,23 @@
85
  }
86
  try {
87
  mailchimp_woocommerce_disconnect_done = true;
88
- me.click();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  } catch (e) {
90
  console.error('clicking event for disconnect failed', e);
91
  }
@@ -97,7 +218,7 @@
97
  * Change wp_http_referer URL in case of in-wizard tab change
98
  */
99
  var mailchimp_woocommerce_submit_done = false;
100
- $('#mailchimp_woocommerce_options .tab-content-submit:not(.oauth-connect)').click(function(e){
101
  // this is to trigger the event even after preventDefault() is issued.
102
  if (mailchimp_woocommerce_submit_done) {
103
  mailchimp_woocommerce_submit_done = false; // reset flag
@@ -192,9 +313,22 @@
192
  $('#mailchimp-oauth-error').hide();
193
  $('#mailchimp-oauth-waiting').hide();
194
  $('#mailchimp-oauth-connecting').show();
 
 
 
 
 
 
 
 
 
195
 
196
  // ping status to check if auth was accepted
197
- $.post(domain + '/api/status/' + token).done(function(statusData){
 
 
 
 
198
  if (statusData.status == "accepted") {
199
  // call for finish endpoint to retrieve access_token
200
  var finishData = {
@@ -509,6 +643,116 @@
509
  $("#mc-woocommerce-create-account-go").click();
510
  }
511
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  });
513
  })( jQuery );
514
 
3
 
4
  $( window ).load(function() {
5
  // show/hide wizard tabs tooltips
6
+ $('.wizard-tab a').hover(function (e) {
7
  e.stopPropagation();
8
  $('.wizard-tab-tooltip').hide();
9
+ $(this).next('.wizard-tab-tooltip').show();
 
10
  });
11
 
12
+ $('.wizard-tab a').mouseleave(function (e) {
13
  e.stopPropagation();
14
  $('.wizard-tab-tooltip').hide();
15
  $('.wizard-tab-active .wizard-tab-tooltip').show();
27
  $(this).find('span').addClass('active');
28
  optionalSettings = true;
29
  }
30
+ });
31
+
32
+ // re-enable disable select input on audience settings submit
33
+ $('#mailchimp_woocommerce_options').on('submit', function() {
34
+ $('select[name="mailchimp-woocommerce[mailchimp_list]"]').prop('disabled', false);
35
+ });
36
+
37
+ // load new log file on log select change
38
+ $('#log_file').change(function (e) {
39
+ e.preventDefault();
40
+ // prevents Log Deleted notification to show up
41
+ removeLogDeletedParamFromFormHttpRef();
42
+
43
+ var data = {
44
+ action:'mailchimp_woocommerce_load_log_file',
45
+ log_file: $('#log_file').val()
46
+ };
47
+
48
+ $('#log-viewer #log-content').css("visibility", "hidden");
49
+ $('#log-viewer .spinner').show().css("visibility", "visible");
50
+
51
+ $.post(ajaxurl, data, function(response) {
52
+ if (response.success) {
53
+ $('#log-content').html(response.data)
54
+ }
55
+ else {
56
+ $('#log-content').html('Error: ' + response.data)
57
+ }
58
+
59
+ $('#log-viewer .spinner').hide().css("visibility", "hidden");
60
+ $('#log-viewer #log-content').css("visibility", "visible");
61
+ });
62
 
63
+
64
+ });
65
 
66
+ $('#mailchimp-log-pref').change(function (e) {
67
+ e.preventDefault();
68
+ // prevents Log Deleted notification to show up
69
+ removeLogDeletedParamFromFormHttpRef();
70
+
71
+ $('#mailchimp_woocommerce_options').submit();
72
  });
73
 
74
+ // Remove log_deleted param from _wp_http_referer hidden input
75
+ function removeLogDeletedParamFromFormHttpRef() {
76
+ var currentFormRefererUrl = $('input[name="_wp_http_referer"]').val();
77
+ $('input[name="_wp_http_referer"]').val(currentFormRefererUrl.replace('&log_removed=1', ''))
78
+ }
79
+
80
  // copy log button
81
  $('.mc-woocommerce-copy-log-button').click(function (e) {
82
  e.preventDefault();
87
  /* Copy the text inside the text field */
88
  document.execCommand("copy");
89
  $temp.remove();
90
+ $('.mc-woocommerce-copy-log-button span.clipboard').hide();
91
+ $('.mc-woocommerce-copy-log-button span.yes').show();
92
+ });
93
+
94
+ $('.mc-woocommerce-copy-log-button').mouseleave(function (e) {
95
+ $('.mc-woocommerce-copy-log-button span.clipboard').show();
96
+ $('.mc-woocommerce-copy-log-button span.yes').hide();
97
+ });
98
+
99
+ // delete log button
100
+ var mailchimp_woocommerce_delete_log = false;
101
+ $('.delete-log-button').click(function (e) {
102
+ if (mailchimp_woocommerce_delete_log) {
103
+ mailchimp_woocommerce_delete_log = false; // reset flag
104
+ return; // let the event bubble away
105
+ }
106
+ e.preventDefault();
107
+ var me = $(e.target);
108
+
109
+ Swal.fire({
110
+ title: phpVars.l10n.are_you_sure,
111
+ text: phpVars.l10n.log_delete_subtitle,
112
+ type: 'warning',
113
+ showCancelButton: true,
114
+ confirmButtonColor: '#3085d6',
115
+ cancelButtonColor: '#d33',
116
+ confirmButtonText: phpVars.l10n.log_delete_confirm,
117
+ cancelButtonText: phpVars.l10n.no_cancel,
118
+ customClass: {
119
+ confirmButton: 'button button-primary tab-content-submit disconnect-button',
120
+ cancelButton: 'button button-default mc-woocommerce-resync-button disconnect-button'
121
+ },
122
+ buttonsStyling: false,
123
+ reverseButtons: true,
124
+
125
+ }).then((result) => {
126
+ if (result.value) {
127
+ mailchimp_woocommerce_delete_log = true;
128
+ me.click();
129
+ }
130
+ })
131
+ });
132
+
133
+ $('.mc-woocommerce-resync-button').click(function(e) {
134
+ e.preventDefault();
135
+ Swal.fire({
136
+ title: 'Resync Request In Progress',
137
+ onBeforeOpen: () => {
138
+ Swal.showLoading()
139
+ }
140
+ });
141
+ var form = $('#mailchimp_woocommerce_options');
142
+ var data = form.serialize();
143
+ data+="&mailchimp_woocommerce_resync=1"
144
+ return $.ajax({type: "POST", url: form.attr('action'), data: data}).done(function(data) {
145
+ window.location.reload();
146
+ }).fail(function(xhr) {
147
+ Swal.hideLoading();
148
+ Swal.showValidationMessage("Could not resync orders, please try again.");
149
+ });
150
  });
151
 
152
  /*
155
  */
156
  var mailchimp_woocommerce_disconnect_done = false;
157
  $('#mailchimp_woocommerce_disconnect').click(function (e){
158
+ var me = $(this);
159
+
160
  // this is to trigger the event even after preventDefault() is issued.
161
  if (mailchimp_woocommerce_disconnect_done) {
162
  mailchimp_woocommerce_disconnect_done = false; // reset flag
165
 
166
  e.preventDefault();
167
 
 
 
168
  const swalWithBootstrapButtons = Swal.mixin({
169
  customClass: {
170
  confirmButton: 'button button-primary tab-content-submit disconnect-button',
174
  })
175
 
176
  swalWithBootstrapButtons.fire({
177
+ title: phpVars.l10n.are_you_sure,
178
+ text: phpVars.l10n.store_disconnect_subtitle,
179
  type: 'warning',
180
  showCancelButton: true,
181
+ confirmButtonText: phpVars.l10n.store_disconnect_confirm,
182
+ cancelButtonText: phpVars.l10n.no_cancel,
183
+ reverseButtons: true,
184
  }).then((result) => {
185
  if (result.value) {
186
  var query = window.location.href.match(/^(.*)\&/);
190
  }
191
  try {
192
  mailchimp_woocommerce_disconnect_done = true;
193
+ var form = $('#mailchimp_woocommerce_options');
194
+ var data = form.serialize();
195
+ data+="&mailchimp_woocommerce_disconnect_store=1"
196
+
197
+ Swal.fire({
198
+ title: 'Disconnecting Store In Progress',
199
+ onBeforeOpen: () => {
200
+ Swal.showLoading()
201
+ }
202
+ });
203
+
204
+ return $.ajax({type: "POST", url: form.attr('action'), data: data }).done(function(data) {
205
+ window.location.reload();
206
+ }).fail(function(xhr) {
207
+ Swal.hideLoading();
208
+ Swal.showValidationMessage("Could not delete store.");
209
+ });
210
  } catch (e) {
211
  console.error('clicking event for disconnect failed', e);
212
  }
218
  * Change wp_http_referer URL in case of in-wizard tab change
219
  */
220
  var mailchimp_woocommerce_submit_done = false;
221
+ $('#mailchimp_woocommerce_options .tab-content-submit:not(.oauth-connect):not(#mc-woocommerce-support-form-submit)').click(function(e){
222
  // this is to trigger the event even after preventDefault() is issued.
223
  if (mailchimp_woocommerce_submit_done) {
224
  mailchimp_woocommerce_submit_done = false; // reset flag
313
  $('#mailchimp-oauth-error').hide();
314
  $('#mailchimp-oauth-waiting').hide();
315
  $('#mailchimp-oauth-connecting').show();
316
+
317
+ // grab a copy of the ajax settings default headers
318
+ var previous_default_headers = ($.ajaxSettings && $.ajaxSettings.headers) ?
319
+ $.ajaxSettings.headers : {};
320
+
321
+ // set the default headers to NOTHING because the oauth server will block
322
+ // any non standard header that it was not expecting to receive and it was
323
+ // preventing folks from being able to connect.
324
+ $.ajaxSettings.headers = {};
325
 
326
  // ping status to check if auth was accepted
327
+ $.post(domain + '/api/status/' + token).done(function(statusData) {
328
+
329
+ // set the headers back to the previous defaults
330
+ $.ajaxSettings.headers = previous_default_headers;
331
+
332
  if (statusData.status == "accepted") {
333
  // call for finish endpoint to retrieve access_token
334
  var finishData = {
643
  $("#mc-woocommerce-create-account-go").click();
644
  }
645
  });
646
+
647
+ $('a#mc-woocommerce-support-form-submit').click(function (e) {
648
+ var accountId = $('input#account_id');
649
+ var storeId = $('input#store_id');
650
+ var email = $('input#email');
651
+ var firstName = $('input#first_name');
652
+ var lastName = $('input#last_name');
653
+ var subject = $('input#subject');
654
+ var message = $('textarea#message');
655
+
656
+ var isValid = true;
657
+
658
+ var spinner = $(this).next('.spinner');
659
+ spinner.css('visibility', 'visible');
660
+ $('#success').hide();
661
+ $('#error').hide();
662
+
663
+ if (! email[0].checkValidity()) {
664
+ $('#email_error').show();
665
+ isValid= false;
666
+ }
667
+ else {
668
+ $('#email_error').hide();
669
+ }
670
+
671
+ if (! firstName[0].checkValidity()) {
672
+ $('#first_name_error').show();
673
+ isValid= false;
674
+ }
675
+ else {
676
+ $('#first_name_error').hide();
677
+ }
678
+
679
+ if (! lastName[0].checkValidity()) {
680
+ $('#last_name_error').show();
681
+ isValid= false;
682
+ }
683
+ else {
684
+ $('#last_name_error').hide();
685
+ }
686
+
687
+ if (! subject[0].checkValidity()) {
688
+ $('#subject_error').show();
689
+ isValid= false;
690
+ }
691
+ else {
692
+ $('#subject_error').hide();
693
+ }
694
+
695
+ if (! message[0].checkValidity()) {
696
+ $('#message_error').show();
697
+ isValid= false;
698
+ }
699
+ else {
700
+ $('#message_error').hide();
701
+ }
702
+
703
+ if (isValid) {
704
+ var data = {
705
+ action:'mailchimp_woocommerce_support_form',
706
+ data: {
707
+ email: email.val(),
708
+ first_name: firstName.val(),
709
+ last_name: lastName.val(),
710
+ subject: subject.val(),
711
+ message: message.val(),
712
+ account_id: accountId.val(),
713
+ store_id: storeId.val(),
714
+ },
715
+ };
716
+
717
+ Swal.fire({
718
+ title: 'Sending Support Request',
719
+ html: 'please wait',
720
+ onBeforeOpen: () => {
721
+ Swal.showLoading();
722
+ $.post(ajaxurl, data, function(response) {
723
+ Swal.hideLoading();
724
+ if (response.success) {
725
+ location.hash = '#mc-woocommerce-support-form-button';
726
+ $('#success').show();
727
+ subject.val('');
728
+ message.val('');
729
+ spinner.css('visibility', 'hidden');
730
+ Swal.fire({
731
+ icon: 'success',
732
+ timer: 2000,
733
+ title: 'Message Received',
734
+ html: 'Thanks, your message has been received.',
735
+ });
736
+ } else if (response.data.error) {
737
+ $('#error').show();
738
+ spinner.css('visibility', 'hidden');
739
+ }
740
+ }).fail(function (err) {
741
+ Swal.fire({
742
+ icon: 'error',
743
+ timer: 2000,
744
+ title: 'Oops, something went wrong!',
745
+ html: err,
746
+ });
747
+ });
748
+ },
749
+ });
750
+ }
751
+ else {
752
+ spinner.css('visibility', 'hidden')
753
+ }
754
+ });
755
+
756
  });
757
  })( jQuery );
758
 
admin/partials/mailchimp-woocommerce-admin-tabs.php CHANGED
@@ -24,6 +24,7 @@ if (!$show_sync_tab && (bool) get_site_transient('mailchimp_woocommerce_start_sy
24
  $show_campaign_defaults = true;
25
  $has_valid_api_key = false;
26
  $allow_new_list = true;
 
27
  $show_wizard = true;
28
  $clicked_sync_button = $is_mailchimp_post && $active_tab == 'sync';
29
  $has_api_error = isset($options['api_ping_error']) && !empty($options['api_ping_error']) ? $options['api_ping_error'] : null;
@@ -37,6 +38,8 @@ if (isset($options['mailchimp_api_key'])) {
37
  if (($mailchimp_lists = $handler->getMailChimpLists()) && is_array($mailchimp_lists)) {
38
  $show_campaign_defaults = true;
39
  $allow_new_list = false;
 
 
40
  }
41
 
42
  // only display this button if the data is not syncing and we have a valid api key
@@ -101,11 +104,17 @@ else {
101
  }
102
 
103
  if ($active_tab == 'campaign_defaults' ) {
104
- wp_kses(_e('Please fill out the audience default<br/>campaign information', 'mailchimp-for-woocommerce'), $allowed_html);
105
  }
106
 
107
  if ($active_tab == 'newsletter_settings' ) {
108
- wp_kses(_e('Please apply your audience settings. If you don’t<br/>have an audience, you can choose to create one', 'mailchimp-for-woocommerce'), $allowed_html);
 
 
 
 
 
 
109
  }
110
  if ($active_tab == 'sync' && $show_sync_tab) {
111
  if (mailchimp_is_done_syncing()) {
@@ -123,48 +132,58 @@ else {
123
  </p>
124
  <?php if($show_wizard): ?>
125
  <div class="nav-wizard-wrapper">
126
- <a href="?page=mailchimp-woocommerce&tab=api_key" class="wizard-tab <?php echo $active_tab == 'api_key' ? 'wizard-tab-active' : ''; ?>">
 
127
  <div class="wizard-tab-tooltip wizard-tab-tooltip-api-key "><?= esc_html_e('Connect', 'mailchimp-for-woocommerce');?>
128
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
129
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
130
  </svg>
131
  </div>
132
- </a>
133
-
134
  <?php if ($has_valid_api_key) : ?>
135
- <a href="?page=mailchimp-woocommerce&tab=store_info" class="wizard-tab <?php echo $active_tab == 'store_info' ? 'wizard-tab-active' : ''; ?>">
 
136
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Store Settings', 'mailchimp-for-woocommerce');?>
137
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
138
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
139
  </svg>
140
  </div>
141
- </a>
142
  <?php else: ?>
143
- <span class="wizard-tab"></span>
 
 
144
  <?php endif; ?>
145
 
146
  <?php if ($handler->hasValidStoreInfo() && $show_campaign_defaults && $this->getData('validation.store_info', false)) : ?>
147
- <a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="wizard-tab <?php echo $active_tab == 'campaign_defaults' ? 'wizard-tab-active' : ''; ?>">
 
148
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Defaults', 'mailchimp-for-woocommerce');?>
149
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
150
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
151
  </svg>
152
  </div>
153
- </a>
154
  <?php else: ?>
155
- <span class="wizard-tab"></span>
 
 
156
  <?php endif; ?>
157
 
158
  <?php if ($handler->hasValidCampaignDefaults() && $this->getData('validation.campaign_defaults', false)) : ?>
159
- <a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="wizard-tab <?php echo $active_tab == 'newsletter_settings' ? 'wizard-tab-active' : ''; ?>">
 
160
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Settings', 'mailchimp-for-woocommerce');?>
161
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
162
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
163
  </svg>
164
  </div>
165
- </a>
166
  <?php else: ?>
167
- <span class="wizard-tab"></span>
 
 
168
  <?php endif; ?>
169
  </div>
170
  <?php else: ?>
@@ -190,7 +209,7 @@ else {
190
 
191
  <?php
192
  $settings_errors = get_settings_errors();
193
- if (!$show_wizard || ($show_wizard && isset($settings_errors[0]) && $settings_errors[0]['type'] != 'updated' )) {
194
  echo mailchimp_settings_errors();
195
  }
196
  ?>
@@ -200,16 +219,6 @@ else {
200
  <?php endif; ?>
201
  <form id="mailchimp_woocommerce_options" method="post" name="cleanup_options" action="options.php">
202
  <div class="box">
203
- <?php
204
- if ($active_tab !== 'api_key' && $active_tab !== 'sync') {
205
- if ($active_tab == 'newsletter_settings' && !mailchimp_is_configured()) {
206
- $submit_button_label = __('Start sync','mailchimp-for-woocommerce');
207
- }
208
- else $submit_button_label = !$show_wizard ? __('Save all changes') : __('Next');
209
- submit_button($submit_button_label, 'primary tab-content-submit','mailchimp_submit', TRUE);
210
- }
211
- ?>
212
-
213
  <?php if ($show_wizard) : ?>
214
  <input type="hidden" name="mailchimp_woocommerce_wizard_on" value=1>
215
  <?php endif; ?>
@@ -251,7 +260,15 @@ else {
251
  <?php if ($active_tab == 'logs' && $show_sync_tab): ?>
252
  <?php include_once 'tabs/logs.php'; ?>
253
  <?php endif; ?>
254
-
 
 
 
 
 
 
 
 
255
  </form>
256
 
257
  <?php if ($active_tab == 'api_key'): ?>
24
  $show_campaign_defaults = true;
25
  $has_valid_api_key = false;
26
  $allow_new_list = true;
27
+ $only_one_list = false;
28
  $show_wizard = true;
29
  $clicked_sync_button = $is_mailchimp_post && $active_tab == 'sync';
30
  $has_api_error = isset($options['api_ping_error']) && !empty($options['api_ping_error']) ? $options['api_ping_error'] : null;
38
  if (($mailchimp_lists = $handler->getMailChimpLists()) && is_array($mailchimp_lists)) {
39
  $show_campaign_defaults = true;
40
  $allow_new_list = false;
41
+ $only_one_list = count($mailchimp_lists) === 1;
42
+
43
  }
44
 
45
  // only display this button if the data is not syncing and we have a valid api key
104
  }
105
 
106
  if ($active_tab == 'campaign_defaults' ) {
107
+ wp_kses(_e('Please review the audience default<br/>campaign information', 'mailchimp-for-woocommerce'), $allowed_html);
108
  }
109
 
110
  if ($active_tab == 'newsletter_settings' ) {
111
+ if ($only_one_list) {
112
+ wp_kses(_e('Please apply your <br/>audience settings.', 'mailchimp-for-woocommerce'), $allowed_html);
113
+ }
114
+ else {
115
+ wp_kses(_e('Please apply your audience settings. ', 'mailchimp-for-woocommerce'), $allowed_html);
116
+ wp_kses(_e('If you don’t<br/>have an audience, you can choose to create one', 'mailchimp-for-woocommerce'), $allowed_html);
117
+ }
118
  }
119
  if ($active_tab == 'sync' && $show_sync_tab) {
120
  if (mailchimp_is_done_syncing()) {
132
  </p>
133
  <?php if($show_wizard): ?>
134
  <div class="nav-wizard-wrapper">
135
+ <div class="wizard-tab <?php echo $active_tab == 'api_key' ? 'wizard-tab-active' : ''; ?>" >
136
+ <a href="?page=mailchimp-woocommerce&tab=api_key" class="marker"></a>
137
  <div class="wizard-tab-tooltip wizard-tab-tooltip-api-key "><?= esc_html_e('Connect', 'mailchimp-for-woocommerce');?>
138
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
139
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
140
  </svg>
141
  </div>
142
+ </div>
143
+
144
  <?php if ($has_valid_api_key) : ?>
145
+ <div class="wizard-tab <?php echo $active_tab == 'store_info' ? 'wizard-tab-active' : ''; ?>">
146
+ <a href="?page=mailchimp-woocommerce&tab=store_info" class="marker"></a>
147
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Store Settings', 'mailchimp-for-woocommerce');?>
148
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
149
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
150
  </svg>
151
  </div>
152
+ </div>
153
  <?php else: ?>
154
+ <div class="wizard-tab">
155
+ <span class="marker-disabled"></span>
156
+ </div>
157
  <?php endif; ?>
158
 
159
  <?php if ($handler->hasValidStoreInfo() && $show_campaign_defaults && $this->getData('validation.store_info', false)) : ?>
160
+ <div class="wizard-tab <?php echo $active_tab == 'campaign_defaults' ? 'wizard-tab-active' : ''; ?>">
161
+ <a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="marker"></a>
162
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Defaults', 'mailchimp-for-woocommerce');?>
163
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
164
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
165
  </svg>
166
  </div>
167
+ </div>
168
  <?php else: ?>
169
+ <div class="wizard-tab">
170
+ <span class="marker-disabled"></span>
171
+ </div>
172
  <?php endif; ?>
173
 
174
  <?php if ($handler->hasValidCampaignDefaults() && $this->getData('validation.campaign_defaults', false)) : ?>
175
+ <div class="wizard-tab <?php echo $active_tab == 'newsletter_settings' ? 'wizard-tab-active' : ''; ?>">
176
+ <a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="marker"></a>
177
  <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Settings', 'mailchimp-for-woocommerce');?>
178
  <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
179
  <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
180
  </svg>
181
  </div>
182
+ </div>
183
  <?php else: ?>
184
+ <div class="wizard-tab">
185
+ <span class="marker-disabled"></span>
186
+ </div>
187
  <?php endif; ?>
188
  </div>
189
  <?php else: ?>
209
 
210
  <?php
211
  $settings_errors = get_settings_errors();
212
+ if (!$show_wizard || ($show_wizard && isset($settings_errors[0]) && $settings_errors[0]['type'] != 'success' )) {
213
  echo mailchimp_settings_errors();
214
  }
215
  ?>
219
  <?php endif; ?>
220
  <form id="mailchimp_woocommerce_options" method="post" name="cleanup_options" action="options.php">
221
  <div class="box">
 
 
 
 
 
 
 
 
 
 
222
  <?php if ($show_wizard) : ?>
223
  <input type="hidden" name="mailchimp_woocommerce_wizard_on" value=1>
224
  <?php endif; ?>
260
  <?php if ($active_tab == 'logs' && $show_sync_tab): ?>
261
  <?php include_once 'tabs/logs.php'; ?>
262
  <?php endif; ?>
263
+ <?php
264
+ if ($active_tab !== 'api_key' && $active_tab !== 'sync' && $active_tab !== 'logs') {
265
+ if ($active_tab == 'newsletter_settings' && !mailchimp_is_configured()) {
266
+ $submit_button_label = __('Start sync','mailchimp-for-woocommerce');
267
+ }
268
+ else $submit_button_label = !$show_wizard ? __('Save all changes') : __('Next');
269
+ submit_button($submit_button_label, 'primary tab-content-submit','mailchimp_submit', TRUE);
270
+ }
271
+ ?>
272
  </form>
273
 
274
  <?php if ($active_tab == 'api_key'): ?>
admin/partials/tabs/api_key_create_account.php CHANGED
@@ -1,11 +1,11 @@
1
  <p id="mc-woocommerce-create-account-link" class="create-account-link alignright">Don’t have a Mailchimp account yet? <a style="font-weight:bold !important;" href='#mc-woocommerce-create-account'>Create one here</a></p>
2
- <div id="mc-woocommerce-create-account">
3
  <div id="exampleModal" class="reveal-modal">
4
  <a href="#" class="close-modal"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
5
  <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="black"/>
6
  </svg>
7
  </a>
8
- <div class="mc-woocommerce-create-account-modal-header">
9
  <svg width="100px" height="100px" viewBox="0 0 46 49" fill="none" xmlns="http://www.w3.org/2000/svg">
10
  <path d="M34.5458 23.5193C34.8988 23.4778 35.2361 23.4759 35.5457 23.5193C35.7252 23.107 35.7568 22.397 35.5951 21.6239C35.3544 20.4741 35.029 19.7778 34.3584 19.8863C33.6859 19.9948 33.6622 20.8271 33.9028 21.9769C34.037 22.6238 34.2776 23.1761 34.5458 23.5193Z" fill="black"/>
11
  <path d="M28.7763 24.4284C29.2575 24.6394 29.5534 24.7795 29.6678 24.6572C29.7427 24.5803 29.719 24.4363 29.6046 24.2489C29.368 23.8624 28.8788 23.4679 28.3621 23.249C27.303 22.7934 26.0407 22.9453 25.0664 23.6454C24.745 23.8801 24.4393 24.2075 24.4826 24.4047C24.4965 24.4698 24.5458 24.5172 24.6582 24.5329C24.9225 24.5625 25.8494 24.0951 26.9164 24.03C27.6718 23.9827 28.295 24.2174 28.7763 24.4284Z" fill="black"/>
@@ -187,7 +187,7 @@
187
  </div>
188
 
189
 
190
- <div class="mc-woocommerce-create-account-modal-footer">
191
  ©2001–<?= date('Y') ?> All Rights Reserved. Mailchimp® is a registered trademark of The Rocket Science Group. Cookie Preferences, Privacy, and Terms.
192
  </div>
193
 
1
  <p id="mc-woocommerce-create-account-link" class="create-account-link alignright">Don’t have a Mailchimp account yet? <a style="font-weight:bold !important;" href='#mc-woocommerce-create-account'>Create one here</a></p>
2
+ <div id="mc-woocommerce-create-account" class="mc-woocommerce-modal">
3
  <div id="exampleModal" class="reveal-modal">
4
  <a href="#" class="close-modal"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
5
  <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="black"/>
6
  </svg>
7
  </a>
8
+ <div class="modal-header">
9
  <svg width="100px" height="100px" viewBox="0 0 46 49" fill="none" xmlns="http://www.w3.org/2000/svg">
10
  <path d="M34.5458 23.5193C34.8988 23.4778 35.2361 23.4759 35.5457 23.5193C35.7252 23.107 35.7568 22.397 35.5951 21.6239C35.3544 20.4741 35.029 19.7778 34.3584 19.8863C33.6859 19.9948 33.6622 20.8271 33.9028 21.9769C34.037 22.6238 34.2776 23.1761 34.5458 23.5193Z" fill="black"/>
11
  <path d="M28.7763 24.4284C29.2575 24.6394 29.5534 24.7795 29.6678 24.6572C29.7427 24.5803 29.719 24.4363 29.6046 24.2489C29.368 23.8624 28.8788 23.4679 28.3621 23.249C27.303 22.7934 26.0407 22.9453 25.0664 23.6454C24.745 23.8801 24.4393 24.2075 24.4826 24.4047C24.4965 24.4698 24.5458 24.5172 24.6582 24.5329C24.9225 24.5625 25.8494 24.0951 26.9164 24.03C27.6718 23.9827 28.295 24.2174 28.7763 24.4284Z" fill="black"/>
187
  </div>
188
 
189
 
190
+ <div class="modal-footer">
191
  ©2001–<?= date('Y') ?> All Rights Reserved. Mailchimp® is a registered trademark of The Rocket Science Group. Cookie Preferences, Privacy, and Terms.
192
  </div>
193
 
admin/partials/tabs/campaign_defaults.php CHANGED
@@ -21,28 +21,32 @@ if (!$handler->hasValidStoreInfo()) {
21
  </legend>
22
  <div class="box box-half">
23
  <label for="<?php echo $this->plugin_name; ?>-campaign-from-name-label">
24
- <?php esc_html_e('Default from name', 'mailchimp-for-woocommerce'); ?>
 
25
  </label>
26
  <input type="text" id="<?php echo $this->plugin_name; ?>-campaign-from-name-label" name="<?php echo $this->plugin_name; ?>[campaign_from_name]" value="<?php echo isset($options['campaign_from_name']) ? $options['campaign_from_name'] : get_option('blogname') ?>" required/>
27
  </div>
28
 
29
  <div class="box box-half">
30
  <label for="<?php echo $this->plugin_name; ?>-campaign-from-email-label">
31
- <?php esc_html_e('Default from email', 'mailchimp-for-woocommerce'); ?>
 
32
  </label>
33
  <input type="email" id="<?php echo $this->plugin_name; ?>-campaign-from-email-label" name="<?php echo $this->plugin_name; ?>[campaign_from_email]" value="<?php echo isset($options['campaign_from_email']) ? $options['campaign_from_email'] : get_option('admin_email') ?>" required/>
34
  </div>
35
 
36
  <div class="box box-half">
37
  <label for="<?php echo $this->plugin_name; ?>-campaign-subject-label">
38
- <?php esc_html_e('Default subject', 'mailchimp-for-woocommerce'); ?>
 
39
  </label>
40
  <input type="text" id="<?php echo $this->plugin_name; ?>-campaign-subject-label" name="<?php echo $this->plugin_name; ?>[campaign_subject]" value="<?php echo isset($options['campaign_subject']) ? $options['campaign_subject'] : esc_html__('Store Newsletter', 'mailchimp-for-woocommerce'); ?>" required/>
41
  </div>
42
 
43
  <div class="box box-half">
44
  <label for="<?php echo $this->plugin_name; ?>-campaign-language-label">
45
- <?php esc_html_e('Default language', 'mailchimp-for-woocommerce'); ?>
 
46
  </label>
47
 
48
  <div class="mailchimp-select-wrapper">
@@ -59,7 +63,8 @@ if (!$handler->hasValidStoreInfo()) {
59
 
60
  <div class="box">
61
  <label for="<?php echo $this->plugin_name; ?>-campaign-permission-reminder-label">
62
- <?php esc_html_e('Permission reminder message', 'mailchimp-for-woocommerce'); ?>
 
63
  </label>
64
  <textarea
65
  rows="4"
21
  </legend>
22
  <div class="box box-half">
23
  <label for="<?php echo $this->plugin_name; ?>-campaign-from-name-label">
24
+ <?php esc_html_e('From Name', 'mailchimp-for-woocommerce'); ?>
25
+ <span class="required-field-mark">*</span>
26
  </label>
27
  <input type="text" id="<?php echo $this->plugin_name; ?>-campaign-from-name-label" name="<?php echo $this->plugin_name; ?>[campaign_from_name]" value="<?php echo isset($options['campaign_from_name']) ? $options['campaign_from_name'] : get_option('blogname') ?>" required/>
28
  </div>
29
 
30
  <div class="box box-half">
31
  <label for="<?php echo $this->plugin_name; ?>-campaign-from-email-label">
32
+ <?php esc_html_e('From Email', 'mailchimp-for-woocommerce'); ?>
33
+ <span class="required-field-mark">*</span>
34
  </label>
35
  <input type="email" id="<?php echo $this->plugin_name; ?>-campaign-from-email-label" name="<?php echo $this->plugin_name; ?>[campaign_from_email]" value="<?php echo isset($options['campaign_from_email']) ? $options['campaign_from_email'] : get_option('admin_email') ?>" required/>
36
  </div>
37
 
38
  <div class="box box-half">
39
  <label for="<?php echo $this->plugin_name; ?>-campaign-subject-label">
40
+ <?php esc_html_e('Subject', 'mailchimp-for-woocommerce'); ?>
41
+ <span class="required-field-mark">*</span>
42
  </label>
43
  <input type="text" id="<?php echo $this->plugin_name; ?>-campaign-subject-label" name="<?php echo $this->plugin_name; ?>[campaign_subject]" value="<?php echo isset($options['campaign_subject']) ? $options['campaign_subject'] : esc_html__('Store Newsletter', 'mailchimp-for-woocommerce'); ?>" required/>
44
  </div>
45
 
46
  <div class="box box-half">
47
  <label for="<?php echo $this->plugin_name; ?>-campaign-language-label">
48
+ <?php esc_html_e('Language', 'mailchimp-for-woocommerce'); ?>
49
+ <span class="required-field-mark">*</span>
50
  </label>
51
 
52
  <div class="mailchimp-select-wrapper">
63
 
64
  <div class="box">
65
  <label for="<?php echo $this->plugin_name; ?>-campaign-permission-reminder-label">
66
+ <?php esc_html_e('Permission reminder message', 'mailchimp-for-woocommerce'); ?>
67
+ <span class="required-field-mark">*</span>
68
  </label>
69
  <textarea
70
  rows="4"
admin/partials/tabs/logs.php CHANGED
@@ -3,13 +3,13 @@ if (!empty( $_REQUEST['handle'])) {
3
  if (!empty($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'remove_log')) {
4
  $log_handler = new WC_Log_Handler_File();
5
  $log_handler->remove($_REQUEST['handle']);
6
- wp_redirect('admin.php?page=mailchimp-woocommerce&tab=logs');
7
  }
8
  }
9
  $files = defined('WC_LOG_DIR') ? @scandir( WC_LOG_DIR ) : array();
10
  $logs = array();
11
  if (!empty($files)) {
12
- foreach ($files as $key => $value) {
13
  if (!in_array( $value, array( '.', '..' ))) {
14
  if (!is_dir($value) && mailchimp_string_contains($value, 'mailchimp_woocommerce')) {
15
  $logs[sanitize_title($value)] = $value;
@@ -35,11 +35,11 @@ $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37
35
 
36
  <fieldset>
37
  <legend class="screen-reader-text">
38
- <span><?php esc_html_e('Logging Preference', 'mailchimp-for-woocommerce');?></span>
39
  </legend>
40
 
41
- <div class="box fieldset-header" >
42
- <label for="<?php echo $this->plugin_name; ?>-logging"><h3 style="padding-top: 1em;"><?php esc_html_e('Logging Preferences', 'mailchimp-for-woocommerce');?></h3></label>
43
  </div>
44
 
45
  <div class="box box-half">
@@ -52,8 +52,8 @@ $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37
52
  </p>
53
  </div>
54
  <div class="box box-half">
55
- <div class="mailchimp-select-wrapper">
56
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_logging]" required>
57
  <?php $logging_preference = mailchimp_environment_variables()->logging; ?>
58
  <?php
59
  foreach(array('none' => esc_html__('None', 'mailchimp-for-woocommerce'), 'debug' => esc_html__('Debug', 'mailchimp-for-woocommerce'), 'standard' => esc_html__('Standard', 'mailchimp-for-woocommerce')) as $log_value => $log_label) {
@@ -61,6 +61,7 @@ $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37
61
  }
62
  ?>
63
  </select>
 
64
  </div>
65
  </div>
66
  </fieldset>
@@ -72,7 +73,7 @@ $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37
72
  </h3>
73
  </div>
74
 
75
- <div class="box">
76
  <input type="hidden" name="<?php echo $this->plugin_name; ?>[mailchimp_active_tab]" value="logs"/>
77
  <div class="mailchimp-select-wrapper view-log-select">
78
  <select id="log_file" name="log_file">
@@ -81,27 +82,24 @@ $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37
81
  <?php endforeach; ?>
82
  </select>
83
  </div>
84
- <input type="submit" class="button tab-content-submit view-log-submit" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>" />
 
 
 
 
 
 
 
 
 
 
85
  </div>
86
 
87
  </fieldset>
88
  <div class="box">
89
  <?php if (isset($logs) && isset($viewed_log)) : ?>
90
  <div id="log-viewer">
91
- <div id="log-header">
92
- <?php if ( ! empty( $handle ) ) : ?>
93
- <a style="display:inline-block" class="mc-woocommerce-copy-log-button" href="#">
94
- <?php esc_html_e('Copy log', 'mailchimp-for-woocommerce'); ?>
95
- </a>
96
- <a class="mc-woocommerce-delete-log-button" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title($viewed_log) ), admin_url( 'admin.php?page=mailchimp-woocommerce&tab=logs&mc_action=remove_log' ) ), 'remove_log' ) ); ?>">
97
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
98
- <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="#3C3C3C"/>
99
- </svg>
100
- <?php esc_html_e('Delete log', 'mailchimp-for-woocommerce'); ?>
101
-
102
- </a>
103
- <?php endif; ?>
104
- </div>
105
  <textarea id="log-content" readonly><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></textarea>
106
 
107
  </div>
3
  if (!empty($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'remove_log')) {
4
  $log_handler = new WC_Log_Handler_File();
5
  $log_handler->remove($_REQUEST['handle']);
6
+ wp_redirect('admin.php?page=mailchimp-woocommerce&tab=logs&log_removed=1');
7
  }
8
  }
9
  $files = defined('WC_LOG_DIR') ? @scandir( WC_LOG_DIR ) : array();
10
  $logs = array();
11
  if (!empty($files)) {
12
+ foreach (array_reverse($files) as $key => $value) {
13
  if (!in_array( $value, array( '.', '..' ))) {
14
  if (!is_dir($value) && mailchimp_string_contains($value, 'mailchimp_woocommerce')) {
15
  $logs[sanitize_title($value)] = $value;
35
 
36
  <fieldset>
37
  <legend class="screen-reader-text">
38
+ <span><?php esc_html_e('Logging Preferences', 'mailchimp-for-woocommerce');?></span>
39
  </legend>
40
 
41
+ <div class="box" >
42
+ <label for="<?php echo $this->plugin_name; ?>-logging"><h3><?php esc_html_e('Logging Preferences', 'mailchimp-for-woocommerce');?></h3></label>
43
  </div>
44
 
45
  <div class="box box-half">
52
  </p>
53
  </div>
54
  <div class="box box-half">
55
+ <div class="log-select mailchimp-select-wrapper">
56
+ <select id="mailchimp-log-pref" name="<?php echo $this->plugin_name; ?>[mailchimp_logging]" required>
57
  <?php $logging_preference = mailchimp_environment_variables()->logging; ?>
58
  <?php
59
  foreach(array('none' => esc_html__('None', 'mailchimp-for-woocommerce'), 'debug' => esc_html__('Debug', 'mailchimp-for-woocommerce'), 'standard' => esc_html__('Standard', 'mailchimp-for-woocommerce')) as $log_value => $log_label) {
61
  }
62
  ?>
63
  </select>
64
+
65
  </div>
66
  </div>
67
  </fieldset>
73
  </h3>
74
  </div>
75
 
76
+ <div class="box log-file-actions">
77
  <input type="hidden" name="<?php echo $this->plugin_name; ?>[mailchimp_active_tab]" value="logs"/>
78
  <div class="mailchimp-select-wrapper view-log-select">
79
  <select id="log_file" name="log_file">
82
  <?php endforeach; ?>
83
  </select>
84
  </div>
85
+ <div id="log-actions">
86
+ <?php if ( ! empty( $handle ) ) : ?>
87
+ <a class="mc-woocommerce-log-button mc-woocommerce-copy-log-button" title="<?= __('Copy Log to clipboard', 'mailchimp-for-woocommerce');?>" href="#">
88
+ <span class="dashicons dashicons-clipboard clipboard" style="transform: rotate(-45deg) translateY(2px) translateX(-2px);"></span>
89
+ <span class="dashicons dashicons-yes yes"></span>
90
+ </a>
91
+ <a class="mc-woocommerce-log-button delete-log-button" title="<?= __('Delete Log', 'mailchimp-for-woocommerce');?>" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'handle' => sanitize_title($viewed_log) ), admin_url( 'admin.php?page=mailchimp-woocommerce&tab=logs&mc_action=remove_log' ) ), 'remove_log' ) ); ?>">
92
+ <span class="dashicons dashicons-trash"></span>
93
+ </a>
94
+ <?php endif; ?>
95
+ </div>
96
  </div>
97
 
98
  </fieldset>
99
  <div class="box">
100
  <?php if (isset($logs) && isset($viewed_log)) : ?>
101
  <div id="log-viewer">
102
+ <span class="spinner" style="display:none;"></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  <textarea id="log-content" readonly><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></textarea>
104
 
105
  </div>
admin/partials/tabs/newsletter_settings.php CHANGED
@@ -41,7 +41,7 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
41
  <strong><?php esc_html_e('Sync audience with your store', 'mailchimp-for-woocommerce'); ?></strong>
42
  </label>
43
  <div class="mailchimp-select-wrapper">
44
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_list]" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
45
 
46
  <?php if(!isset($allow_new_list) || $allow_new_list === true): ?>
47
  <option value="create_new"><?php esc_html_e('Create New Audience', 'mailchimp-for-woocommerce');?></option>
@@ -55,7 +55,7 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
55
  if (is_array($mailchimp_lists)) {
56
  $selected_list = isset($options['mailchimp_list']) ? $options['mailchimp_list'] : null;
57
  foreach ($mailchimp_lists as $key => $value ) {
58
- echo '<option value="' . esc_attr( $key ) . '" ' . selected(((string) $key === (string) $selected_list), true, false) . '>' . esc_html( $value ) . '</option>';
59
  }
60
  }
61
  ?>
@@ -77,7 +77,7 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
77
  </label>
78
  </div>
79
 
80
- <div class="box optional-settings-button" >
81
  <span><?php esc_html_e('Optional Audience Settings', 'mailchimp-for-woocommerce');?></span>
82
  </div>
83
 
41
  <strong><?php esc_html_e('Sync audience with your store', 'mailchimp-for-woocommerce'); ?></strong>
42
  </label>
43
  <div class="mailchimp-select-wrapper">
44
+ <select name="<?php echo $this->plugin_name; ?>[mailchimp_list]" required <?php echo ($list_is_configured || $only_one_list) ? 'disabled' : '' ?>>
45
 
46
  <?php if(!isset($allow_new_list) || $allow_new_list === true): ?>
47
  <option value="create_new"><?php esc_html_e('Create New Audience', 'mailchimp-for-woocommerce');?></option>
55
  if (is_array($mailchimp_lists)) {
56
  $selected_list = isset($options['mailchimp_list']) ? $options['mailchimp_list'] : null;
57
  foreach ($mailchimp_lists as $key => $value ) {
58
+ echo '<option value="' . esc_attr( $key ) . '" ' . selected(((string) $key === (string) $selected_list || $only_one_list), true, false) . '>' . esc_html( $value ) . '</option>';
59
  }
60
  }
61
  ?>
77
  </label>
78
  </div>
79
 
80
+ <div class="box optional-settings-label" >
81
  <span><?php esc_html_e('Optional Audience Settings', 'mailchimp-for-woocommerce');?></span>
82
  </div>
83
 
admin/partials/tabs/store_info.php CHANGED
@@ -17,6 +17,7 @@ if (!$handler->hasValidApiKey()) {
17
  <div class="box box-half" >
18
  <label for="<?php echo $this->plugin_name; ?>-store-name-label">
19
  <span> <?php esc_html_e('Name', 'mailchimp-for-woocommerce'); ?></span>
 
20
  </label>
21
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-name-label" name="<?php echo $this->plugin_name; ?>[store_name]" value="<?php echo isset($options['store_name']) ? $options['store_name'] : get_option('blogname') ?>" />
22
  </div>
@@ -24,6 +25,7 @@ if (!$handler->hasValidApiKey()) {
24
  <div class="box box-half" >
25
  <label for="<?php echo $this->plugin_name; ?>-admin-email-label">
26
  <span> <?php esc_html_e('Email', 'mailchimp-for-woocommerce'); ?></span>
 
27
  </label>
28
  <input required type="email" id="<?php echo $this->plugin_name; ?>-admin-email-label" name="<?php echo $this->plugin_name; ?>[admin_email]" value="<?php echo isset($options['admin_email']) ? $options['admin_email'] : get_option('admin_email') ?>" />
29
  </div>
@@ -31,6 +33,7 @@ if (!$handler->hasValidApiKey()) {
31
  <div class="box box-half" >
32
  <label for="<?php echo $this->plugin_name; ?>-store-address-label">
33
  <span> <?php esc_html_e('Street address', 'mailchimp-for-woocommerce'); ?></span>
 
34
  </label>
35
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-address-label" name="<?php echo $this->plugin_name; ?>[store_street]" value="<?php echo isset($options['store_street']) ? $options['store_street'] : WC()->countries->get_base_address(); ?>" />
36
  </div>
@@ -38,6 +41,7 @@ if (!$handler->hasValidApiKey()) {
38
  <div class="box box-half" >
39
  <label for="<?php echo $this->plugin_name; ?>-store-city-label">
40
  <span> <?php esc_html_e('City', 'mailchimp-for-woocommerce'); ?></span>
 
41
  </label>
42
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-city-label" name="<?php echo $this->plugin_name; ?>[store_city]" value="<?php echo isset($options['store_city']) ? $options['store_city'] : WC()->countries->get_base_city(); ?>" />
43
  </div>
@@ -45,6 +49,7 @@ if (!$handler->hasValidApiKey()) {
45
  <div class="box box-half" >
46
  <label for="<?php echo $this->plugin_name; ?>-store-state-label">
47
  <span> <?php esc_html_e('State', 'mailchimp-for-woocommerce'); ?></span>
 
48
  </label>
49
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-state-label" name="<?php echo $this->plugin_name; ?>[store_state]" value="<?php echo isset($options['store_state']) ? $options['store_state'] : WC()->countries->get_base_state(); ?>" />
50
  </div>
@@ -52,6 +57,7 @@ if (!$handler->hasValidApiKey()) {
52
  <div class="box box-half" >
53
  <label for="<?php echo $this->plugin_name; ?>-store-postal-code-label">
54
  <span> <?php esc_html_e('Postal Code', 'mailchimp-for-woocommerce'); ?></span>
 
55
  </label>
56
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-postal-code-label" name="<?php echo $this->plugin_name; ?>[store_postal_code]" value="<?php echo isset($options['store_postal_code']) ? $options['store_postal_code'] : WC()->countries->get_base_postcode(); ?>" />
57
  </div>
@@ -59,6 +65,7 @@ if (!$handler->hasValidApiKey()) {
59
  <div class="box box-half" >
60
  <label for="<?php echo $this->plugin_name; ?>-store-country-label">
61
  <span> <?php esc_html_e('Country', 'mailchimp-for-woocommerce'); ?></span>
 
62
  </label>
63
 
64
  <?php global $woocommerce;
@@ -85,6 +92,7 @@ if (!$handler->hasValidApiKey()) {
85
  <div class="box box-half" >
86
  <label for="<?php echo $this->plugin_name; ?>-store-phone-label">
87
  <span> <?php esc_html_e('Phone Number', 'mailchimp-for-woocommerce'); ?></span>
 
88
  </label>
89
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-phone-label" name="<?php echo $this->plugin_name; ?>[store_phone]" value="<?php echo isset($options['store_phone']) ? $options['store_phone'] : '' ?>" />
90
  </div>
@@ -98,6 +106,7 @@ if (!$handler->hasValidApiKey()) {
98
  <div class="box box-half" >
99
  <label for="<?php echo $this->plugin_name; ?>-store-locale-label">
100
  <span><?php esc_html_e('Locale', 'mailchimp-for-woocommerce'); ?></span>
 
101
  </label>
102
  <div class="mailchimp-select-wrapper">
103
  <select name="<?php echo $this->plugin_name; ?>[store_locale]" required>
@@ -124,6 +133,7 @@ if (!$handler->hasValidApiKey()) {
124
  <div class="box" >
125
  <label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
126
  <span><?php esc_html_e('Timezone', 'mailchimp-for-woocommerce'); ?></span>
 
127
  </label>
128
  <div class="mailchimp-select-wrapper">
129
  <select name="<?php echo $this->plugin_name; ?>[store_timezone]" required>
@@ -142,7 +152,7 @@ if (!$handler->hasValidApiKey()) {
142
  // Only admins should see mailchimp_permission_cap radio buttons
143
  if (current_user_can('manage_options')) : ?>
144
 
145
- <div class="box optional-settings-button" >
146
  <span><?php esc_html_e('Optional Store Settings', 'mailchimp-for-woocommerce');?></span>
147
  </div>
148
 
17
  <div class="box box-half" >
18
  <label for="<?php echo $this->plugin_name; ?>-store-name-label">
19
  <span> <?php esc_html_e('Name', 'mailchimp-for-woocommerce'); ?></span>
20
+ <span class="required-field-mark">*</span>
21
  </label>
22
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-name-label" name="<?php echo $this->plugin_name; ?>[store_name]" value="<?php echo isset($options['store_name']) ? $options['store_name'] : get_option('blogname') ?>" />
23
  </div>
25
  <div class="box box-half" >
26
  <label for="<?php echo $this->plugin_name; ?>-admin-email-label">
27
  <span> <?php esc_html_e('Email', 'mailchimp-for-woocommerce'); ?></span>
28
+ <span class="required-field-mark">*</span>
29
  </label>
30
  <input required type="email" id="<?php echo $this->plugin_name; ?>-admin-email-label" name="<?php echo $this->plugin_name; ?>[admin_email]" value="<?php echo isset($options['admin_email']) ? $options['admin_email'] : get_option('admin_email') ?>" />
31
  </div>
33
  <div class="box box-half" >
34
  <label for="<?php echo $this->plugin_name; ?>-store-address-label">
35
  <span> <?php esc_html_e('Street address', 'mailchimp-for-woocommerce'); ?></span>
36
+ <span class="required-field-mark">*</span>
37
  </label>
38
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-address-label" name="<?php echo $this->plugin_name; ?>[store_street]" value="<?php echo isset($options['store_street']) ? $options['store_street'] : WC()->countries->get_base_address(); ?>" />
39
  </div>
41
  <div class="box box-half" >
42
  <label for="<?php echo $this->plugin_name; ?>-store-city-label">
43
  <span> <?php esc_html_e('City', 'mailchimp-for-woocommerce'); ?></span>
44
+ <span class="required-field-mark">*</span>
45
  </label>
46
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-city-label" name="<?php echo $this->plugin_name; ?>[store_city]" value="<?php echo isset($options['store_city']) ? $options['store_city'] : WC()->countries->get_base_city(); ?>" />
47
  </div>
49
  <div class="box box-half" >
50
  <label for="<?php echo $this->plugin_name; ?>-store-state-label">
51
  <span> <?php esc_html_e('State', 'mailchimp-for-woocommerce'); ?></span>
52
+ <span class="required-field-mark">*</span>
53
  </label>
54
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-state-label" name="<?php echo $this->plugin_name; ?>[store_state]" value="<?php echo isset($options['store_state']) ? $options['store_state'] : WC()->countries->get_base_state(); ?>" />
55
  </div>
57
  <div class="box box-half" >
58
  <label for="<?php echo $this->plugin_name; ?>-store-postal-code-label">
59
  <span> <?php esc_html_e('Postal Code', 'mailchimp-for-woocommerce'); ?></span>
60
+ <span class="required-field-mark">*</span>
61
  </label>
62
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-postal-code-label" name="<?php echo $this->plugin_name; ?>[store_postal_code]" value="<?php echo isset($options['store_postal_code']) ? $options['store_postal_code'] : WC()->countries->get_base_postcode(); ?>" />
63
  </div>
65
  <div class="box box-half" >
66
  <label for="<?php echo $this->plugin_name; ?>-store-country-label">
67
  <span> <?php esc_html_e('Country', 'mailchimp-for-woocommerce'); ?></span>
68
+ <span class="required-field-mark">*</span>
69
  </label>
70
 
71
  <?php global $woocommerce;
92
  <div class="box box-half" >
93
  <label for="<?php echo $this->plugin_name; ?>-store-phone-label">
94
  <span> <?php esc_html_e('Phone Number', 'mailchimp-for-woocommerce'); ?></span>
95
+ <span class="required-field-mark">*</span>
96
  </label>
97
  <input required type="text" id="<?php echo $this->plugin_name; ?>-store-phone-label" name="<?php echo $this->plugin_name; ?>[store_phone]" value="<?php echo isset($options['store_phone']) ? $options['store_phone'] : '' ?>" />
98
  </div>
106
  <div class="box box-half" >
107
  <label for="<?php echo $this->plugin_name; ?>-store-locale-label">
108
  <span><?php esc_html_e('Locale', 'mailchimp-for-woocommerce'); ?></span>
109
+ <span class="required-field-mark">*</span>
110
  </label>
111
  <div class="mailchimp-select-wrapper">
112
  <select name="<?php echo $this->plugin_name; ?>[store_locale]" required>
133
  <div class="box" >
134
  <label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
135
  <span><?php esc_html_e('Timezone', 'mailchimp-for-woocommerce'); ?></span>
136
+ <span class="required-field-mark">*</span>
137
  </label>
138
  <div class="mailchimp-select-wrapper">
139
  <select name="<?php echo $this->plugin_name; ?>[store_timezone]" required>
152
  // Only admins should see mailchimp_permission_cap radio buttons
153
  if (current_user_can('manage_options')) : ?>
154
 
155
+ <div class="box optional-settings-label" >
156
  <span><?php esc_html_e('Optional Store Settings', 'mailchimp-for-woocommerce');?></span>
157
  </div>
158
 
admin/partials/tabs/store_sync.php CHANGED
@@ -70,6 +70,7 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
70
  }
71
  ?>
72
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
 
73
  <div class="sync-content-wrapper">
74
  <div class="sync-stats-wrapper sync-stats-store">
75
  <div class="box sync-stats-card promo_rules" >
@@ -131,18 +132,14 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
131
  <div class="sync-controls-wrapper">
132
  <div class="box sync-controls">
133
  <?php wp_nonce_field( '_disconnect-nonce-'.$store_id, '_disconnect-nonce' ); ?>
 
134
 
135
- <button id="mailchimp_woocommerce_disconnect"
136
- type="submit"
137
- name="mailchimp_woocommerce_disconnect_store"
138
- class="mc-woocommerce-disconnect-button"
139
- value="1">
140
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
141
  <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="#3C3C3C"/>
142
  </svg>
143
  <?php esc_html_e('DISCONNECT STORE', 'mailchimp-for-woocommerce');?>
144
- </button>
145
-
146
  <p><strong><?php esc_html_e('Account Connected', 'mailchimp-for-woocommerce');?></strong></p> <p id="mailchimp_account_connected"><?php echo $account_name; ?></p>
147
  <br/>
148
  <p><strong><?php esc_html_e('Audience Connected', 'mailchimp-for-woocommerce');?></strong></p>
@@ -204,19 +201,123 @@ $comm_enabled = $opt != null ? $opt : '0';
204
 
205
  </div>
206
 
207
- <?php if($mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1')): ?>
208
- <h3 style="padding-top: 1em;"><?php esc_html_e('Advanced', 'mailchimp-for-woocommerce');?></h3>
209
- <p id="resync_data_help_text">
210
- <?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', 'mailchimp-for-woocommerce');?>
211
- </p>
212
- <?php submit_button(__('Force Resync', 'mailchimp-for-woocommerce'), 'primary mc-woocommerce-resync-button','submit', TRUE); ?>
213
- <?php endif; ?>
214
-
215
- <h3 style="padding-top: 1em;"><?php esc_html_e('More Information', 'mailchimp-for-woocommerce'); ?></h3>
216
- <ul>
217
- <li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Is this plugin helping your e-commerce business? <a href=%s target=_blank>Please leave us a ★★★★★ review!</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
218
- <li><?= sprintf(/* translators: %s - WP-CLI URL. */wp_kses( __( 'Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/wiki/Advanced-Queue-Setup-In-CLI-mode' ) );?></li>
219
- <li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', 'mailchimp-for-woocommerce');?></li>
220
- <li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help? Visit Mailchimp <a href=%s target=_blank>support</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://us1.admin.mailchimp.com/support?support_key=woo_forum' ) );?></li>
221
- <li><?= sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */wp_kses( __( 'By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
222
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
71
  ?>
72
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
73
+
74
  <div class="sync-content-wrapper">
75
  <div class="sync-stats-wrapper sync-stats-store">
76
  <div class="box sync-stats-card promo_rules" >
132
  <div class="sync-controls-wrapper">
133
  <div class="box sync-controls">
134
  <?php wp_nonce_field( '_disconnect-nonce-'.$store_id, '_disconnect-nonce' ); ?>
135
+ <?php wp_nonce_field( '_resync-nonce-'.$store_id, '_resync-nonce' ); ?>
136
 
137
+ <a id="mailchimp_woocommerce_disconnect" class="mc-woocommerce-disconnect-button">
 
 
 
 
138
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
139
  <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="#3C3C3C"/>
140
  </svg>
141
  <?php esc_html_e('DISCONNECT STORE', 'mailchimp-for-woocommerce');?>
142
+ </a>
 
143
  <p><strong><?php esc_html_e('Account Connected', 'mailchimp-for-woocommerce');?></strong></p> <p id="mailchimp_account_connected"><?php echo $account_name; ?></p>
144
  <br/>
145
  <p><strong><?php esc_html_e('Audience Connected', 'mailchimp-for-woocommerce');?></strong></p>
201
 
202
  </div>
203
 
204
+
205
+ <?php $show_resync = $mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1'); ?>
206
+ <div class="sync-content-wrapper sync-more-wrapper">
207
+ <div class="box box-half">
208
+ <div class="content">
209
+ <h3 style="padding-top: 1em;"><?php esc_html_e('Synchronization', 'mailchimp-for-woocommerce');?></h3>
210
+ <p id="resync_data_help_text">
211
+ <?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', 'mailchimp-for-woocommerce');?>
212
+ </p>
213
+ <?php if ($show_resync) : ?>
214
+ <?php submit_button(__('Resync now', 'mailchimp-for-woocommerce'), 'primary mc-woocommerce-resync-button','submit', TRUE); ?>
215
+ <?php else : ?>
216
+ <?php submit_button(__('Resync now', 'mailchimp-for-woocommerce'), 'mc-woocommerce-resync-button','submit', TRUE, ['disabled' => true]); ?>
217
+ <p class="description"><?php _e('Sync is running. Please wait until it finishes.', 'mailchimp-for-woocommerce') ?></p>
218
+ <?php endif;?>
219
+ </div>
220
+ </div>
221
+
222
+ <div class="box box-half">
223
+ <div class="content">
224
+ <h3 style="padding-top: 1em;"><?php esc_html_e('More Information', 'mailchimp-for-woocommerce'); ?></h3>
225
+ <ul>
226
+ <li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Is this plugin helping your e-commerce business? <a href=%s target=_blank>Please leave us a ★★★★★ review!</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
227
+ <li><?= sprintf(/* translators: %s - WP-CLI URL. */wp_kses( __( 'Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/wiki/Advanced-Queue-Setup-In-CLI-mode' ) );?></li>
228
+ <li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', 'mailchimp-for-woocommerce');?></li>
229
+ <li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help? Visit <a href=%s target=_blank>Mailchimp support</a> or <a id=%s href=%s>send us an email.</a> ', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'id' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://us1.admin.mailchimp.com/support?support_key=woo_forum' ), 'mc-woocommerce-support-form-button', '#mc-woocommerce-support-form' );?></li>
230
+ <li><?= sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */wp_kses( __( 'By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>.', 'mailchimp-for-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
231
+ </ul>
232
+ </div>
233
+ </div>
234
+
235
+ </div>
236
+
237
+ <div id="mc-woocommerce-support-form" class="mc-woocommerce-modal">
238
+ <div id="exampleModal" class="reveal-modal">
239
+ <a href="#mc-woocommerce-support-form-button" class="close-modal"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
240
+ <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z" fill="black"/>
241
+ </svg>
242
+ </a>
243
+ <div class="modal-header">
244
+ <svg width="50px" height="50px" viewBox="0 0 46 49" fill="none" xmlns="http://www.w3.org/2000/svg">
245
+ <path d="M34.5458 23.5193C34.8988 23.4778 35.2361 23.4759 35.5457 23.5193C35.7252 23.107 35.7568 22.397 35.5951 21.6239C35.3544 20.4741 35.029 19.7778 34.3584 19.8863C33.6859 19.9948 33.6622 20.8271 33.9028 21.9769C34.037 22.6238 34.2776 23.1761 34.5458 23.5193Z" fill="black"/>
246
+ <path d="M28.7763 24.4284C29.2575 24.6394 29.5534 24.7795 29.6678 24.6572C29.7427 24.5803 29.719 24.4363 29.6046 24.2489C29.368 23.8624 28.8788 23.4679 28.3621 23.249C27.303 22.7934 26.0407 22.9453 25.0664 23.6454C24.745 23.8801 24.4393 24.2075 24.4826 24.4047C24.4965 24.4698 24.5458 24.5172 24.6582 24.5329C24.9225 24.5625 25.8494 24.0951 26.9164 24.03C27.6718 23.9827 28.295 24.2174 28.7763 24.4284Z" fill="black"/>
247
+ <path d="M27.8105 24.9806C27.1852 25.0793 26.8381 25.2863 26.6172 25.4777C26.4279 25.6433 26.3115 25.8267 26.3115 25.9549C26.3115 26.0161 26.3391 26.0516 26.3589 26.0693C26.3865 26.095 26.422 26.1088 26.4614 26.1088C26.6034 26.1088 26.919 25.9826 26.919 25.9826C27.7907 25.6709 28.3647 25.7084 28.9346 25.7735C29.2502 25.809 29.3981 25.8287 29.4672 25.7202C29.4869 25.6887 29.5125 25.6216 29.4494 25.521C29.3054 25.2804 28.6723 24.8781 27.8105 24.9806Z" fill="black"/>
248
+ <path d="M32.5975 27.0061C33.0235 27.2152 33.4909 27.1324 33.6428 26.8227C33.7946 26.5131 33.5737 26.093 33.1497 25.8839C32.7237 25.6749 32.2563 25.7577 32.1044 26.0673C31.9506 26.377 32.1734 26.7971 32.5975 27.0061Z" fill="black"/>
249
+ <path d="M35.3306 24.6177C34.9854 24.6118 34.6995 24.9905 34.6916 25.4638C34.6837 25.9372 34.9578 26.3257 35.303 26.3317C35.6481 26.3376 35.9341 25.9589 35.942 25.4855C35.9499 25.0122 35.6757 24.6237 35.3306 24.6177Z" fill="black"/>
250
+ <path d="M12.1324 33.1577C12.0456 33.0492 11.9056 33.0827 11.7695 33.1143C11.6749 33.136 11.5664 33.1616 11.448 33.1596C11.1936 33.1557 10.9786 33.0452 10.8583 32.8598C10.7006 32.6192 10.7104 32.2583 10.884 31.8461C10.9076 31.7909 10.9353 31.7297 10.9648 31.6607C11.241 31.0394 11.7064 30 11.1857 29.008C10.7932 28.2625 10.1542 27.797 9.38702 27.7004C8.64939 27.6077 7.89006 27.8798 7.40685 28.4143C6.64358 29.2565 6.52328 30.4044 6.6712 30.8087C6.72445 30.9566 6.80925 30.998 6.87237 31.0059C7.00254 31.0237 7.19385 30.929 7.31416 30.6055C7.32205 30.5819 7.33388 30.5464 7.34769 30.501C7.40094 30.3294 7.50152 30.0099 7.66522 29.7555C7.86245 29.4478 8.17012 29.2348 8.53105 29.1579C8.89789 29.079 9.2746 29.15 9.58819 29.3551C10.1227 29.7062 10.3298 30.361 10.101 30.9862C9.98264 31.3096 9.79133 31.9289 9.83275 32.4378C9.91756 33.4673 10.5507 33.8795 11.1206 33.9249C11.6729 33.9466 12.0594 33.6349 12.1581 33.4081C12.2133 33.274 12.164 33.1932 12.1324 33.1577Z" fill="black"/>
251
+ <path d="M44.044 31.2761C44.0223 31.2012 43.8862 30.7002 43.6969 30.0967C43.5075 29.4932 43.3142 29.0672 43.3142 29.0672C44.0696 27.9351 44.0834 26.9233 43.9828 26.3514C43.8763 25.6414 43.5805 25.0359 42.9829 24.4107C42.3873 23.7854 41.1684 23.1445 39.4545 22.6632C39.2593 22.608 38.6123 22.4305 38.5551 22.4127C38.5512 22.3753 38.5078 20.2945 38.4684 19.3991C38.4408 18.7522 38.3836 17.7444 38.0719 16.7504C37.6992 15.4053 37.0483 14.2298 36.2377 13.4764C38.4763 11.157 39.8726 8.60091 39.8707 6.40774C39.8647 2.19102 34.6855 0.914962 28.3033 3.55781C28.2974 3.55978 26.9602 4.1278 26.9503 4.13174C26.9444 4.12582 24.5066 1.73346 24.4692 1.7019C17.1954 -4.64488 -5.55475 20.6436 1.71899 26.7853L3.30864 28.1323C2.89644 29.2013 2.73471 30.4241 2.86685 31.7396C3.03647 33.4299 3.90822 35.0511 5.32234 36.3015C6.66348 37.4908 8.42669 38.2422 10.1386 38.2402C12.9688 44.7626 19.4359 48.7643 27.0193 48.9891C35.153 49.2317 41.981 45.4134 44.8428 38.5578C45.0301 38.0765 45.825 35.909 45.825 33.9939C45.825 32.0729 44.7382 31.2761 44.044 31.2761ZM10.7638 36.41C10.5173 36.4514 10.2649 36.4691 10.0104 36.4632C7.55298 36.3981 4.90027 34.1852 4.63598 31.5621C4.34409 28.6629 5.82527 26.4322 8.44839 25.9017C8.76198 25.8386 9.14066 25.8011 9.54892 25.8228C11.0183 25.9037 13.1838 27.0318 13.6789 30.2328C14.1187 33.0689 13.4225 35.9564 10.7638 36.41ZM8.02041 24.1681C6.38736 24.4856 4.9476 25.4106 4.06797 26.6886C3.54137 26.2508 2.56115 25.4007 2.38956 25.0694C0.985306 22.4009 3.92202 17.2138 5.97516 14.285C11.0478 7.04676 18.9922 1.56581 22.6705 2.55984C23.2681 2.72945 25.2482 5.02518 25.2482 5.02518C25.2482 5.02518 21.5719 7.06451 18.1618 9.90853C13.5704 13.4468 10.0992 18.5885 8.02041 24.1681ZM33.8079 35.3252C33.8611 35.3035 33.8986 35.2424 33.8927 35.1812C33.8848 35.1063 33.8177 35.0531 33.7448 35.0609C33.7448 35.0609 29.8969 35.6309 26.26 34.2996C26.6564 33.0117 27.7096 33.4772 29.3012 33.6054C32.1709 33.777 34.7408 33.3569 36.642 32.8125C38.2889 32.3392 40.4505 31.4083 42.1309 30.0829C42.6969 31.3274 42.8981 32.6962 42.8981 32.6962C42.8981 32.6962 43.3359 32.6173 43.7028 32.8441C44.0499 33.0571 44.3024 33.5009 44.1288 34.6448C43.7758 36.7847 42.8665 38.5223 41.338 40.1198C40.4071 41.1217 39.277 41.9935 37.9852 42.6266C37.2988 42.9875 36.5671 43.2991 35.7959 43.5516C30.033 45.4331 24.1339 43.3642 22.2326 38.9207C22.0807 38.5874 21.9525 38.2363 21.852 37.8714C21.0414 34.9426 21.7297 31.43 23.8795 29.2171C23.8795 29.2171 23.8795 29.2171 23.8795 29.2151C24.0116 29.0751 24.1477 28.9094 24.1477 28.7004C24.1477 28.5248 24.0372 28.3414 23.9406 28.2112C23.1892 27.1206 20.5818 25.2607 21.1045 21.6613C21.4792 19.0757 23.7414 17.2553 25.8498 17.3637C26.0273 17.3736 26.2067 17.3834 26.3842 17.3953C27.2974 17.4485 28.0942 17.5669 28.8476 17.5984C30.1059 17.6537 31.238 17.4702 32.5792 16.3519C33.0308 15.9752 33.3937 15.6478 34.0071 15.5453C34.0722 15.5335 34.2319 15.4763 34.5534 15.492C34.8808 15.5098 35.1924 15.5985 35.4725 15.7859C36.5474 16.5018 36.6992 18.2335 36.7545 19.4997C36.786 20.2235 36.8728 21.9729 36.9044 22.4759C36.9734 23.6237 37.2751 23.7874 37.8846 23.9886C38.2278 24.101 38.5473 24.1858 39.0167 24.318C40.4387 24.7183 41.2828 25.1227 41.8153 25.6433C42.1329 25.9688 42.2808 26.3139 42.3261 26.6433C42.4938 27.8661 41.3755 29.3788 38.4171 30.7515C35.1826 32.2524 31.2577 32.6331 28.5459 32.3313C28.3388 32.3076 27.5992 32.2248 27.5952 32.2248C25.4257 31.9329 24.1891 34.7355 25.4908 36.6565C26.329 37.8951 28.6149 38.6998 30.9008 38.6998C36.1431 38.6998 40.1724 36.4613 41.6713 34.5284C41.7167 34.4712 41.7206 34.4633 41.7916 34.3568C41.8646 34.2464 41.8055 34.1852 41.7128 34.2464C40.488 35.0846 35.0484 38.4099 29.2322 37.4099C29.2322 37.4099 28.5261 37.2936 27.8792 37.0431C27.3664 36.8439 26.2935 36.3508 26.1634 35.2483C30.8514 36.6979 33.8079 35.3252 33.8079 35.3252ZM26.3704 34.4476C26.3704 34.4476 26.3724 34.4476 26.3704 34.4476C26.3724 34.4495 26.3724 34.4495 26.3724 34.4515C26.3724 34.4495 26.3724 34.4476 26.3704 34.4476ZM17.3887 14.2554C19.1914 12.1707 21.4121 10.3602 23.4002 9.34249C23.4692 9.30699 23.5422 9.38193 23.5047 9.44899C23.3469 9.73497 23.0432 10.3464 22.9466 10.8118C22.9308 10.8848 23.0097 10.9381 23.0708 10.8966C24.3074 10.0525 26.4612 9.14921 28.3486 9.03284C28.4295 9.02693 28.4689 9.13146 28.4039 9.18076C28.1159 9.40166 27.8023 9.70539 27.5735 10.0131C27.5341 10.0663 27.5716 10.1413 27.6366 10.1413C28.962 10.1511 30.8317 10.6146 32.0486 11.297C32.1315 11.3424 32.0723 11.5021 31.9796 11.4824C30.1375 11.0603 27.1199 10.7389 23.986 11.5041C21.1893 12.1865 19.0533 13.2397 17.4952 14.3738C17.4203 14.4329 17.3256 14.3304 17.3887 14.2554Z" fill="black"/>
252
+ </svg>
253
+ <h3><?= __('Send us a support ticket', 'mailchimp-for-woocommerce');?></h3>
254
+ <p class="description support-form"><?= __('The best way to get in touch with us is by submitting a ticket in the form below. </br> We do our best to get back to you within 48 hours. We look forward to hear from you!', 'mailchimp-for-woocommerce');?></p>
255
+
256
+ </div>
257
+
258
+ <div id="mc-woocommerce-create-account-step-1" class="mc-woocommerce-create-account-step tab-content-wrapper" >
259
+ <fieldset >
260
+ <?php $user_id = get_current_user_id(); ?>
261
+
262
+ <input id="store_id" name="store_id" type="hidden" value="<?= mailchimp_get_store_id(); ?>">
263
+ <input id="account_id" name="account_id" type="hidden" value="<?= $account_details['account_id']?>">
264
+ <input id="org" name="org" type="hidden" value="<?= get_bloginfo( 'name' );?>">
265
+
266
+ <div class="box box-half" >
267
+ <label for="first_name">
268
+ <span> <?php esc_html_e('First name', 'mailchimp-for-woocommerce'); ?></span>
269
+ </label>
270
+ <input required type="text" id="first_name" name="first_name_edited" value="<?= $account_details['first_name']?>"/>
271
+ </div>
272
+
273
+ <div class="box box-half" >
274
+ <label for="last_name">
275
+ <span> <?php esc_html_e('Last name', 'mailchimp-for-woocommerce'); ?></span>
276
+ </label>
277
+ <input required type="text" id="last_name" name="last_name_edited" value="<?= $account_details['last_name']?>"/>
278
+ </div>
279
+
280
+ <div class="box" >
281
+ <label for="email">
282
+ <span> <?php esc_html_e('Email', 'mailchimp-for-woocommerce'); ?></span>
283
+ </label>
284
+ <input required type="email" id="email" name="email" value="<?= $account_details['email']?>"/>
285
+ </div>
286
+
287
+ <div class="box" >
288
+ <label for="subject">
289
+ <span> <?php esc_html_e('Subject', 'mailchimp-for-woocommerce'); ?></span>
290
+ </label>
291
+ <input required type="text" id="subject" name="subject"/>
292
+ </div>
293
+
294
+ <div class="box" >
295
+ <label for="message">
296
+ <span> <?php esc_html_e('Message', 'mailchimp-for-woocommerce'); ?></span>
297
+ </label>
298
+ <textarea required id="message" name="message"></textarea>
299
+ </div>
300
+
301
+ <div class="box">
302
+ <a id="mc-woocommerce-support-form-submit" class="button button-primary whitebtn tab-content-submit"><?php esc_html_e('Send', 'mailchimp-for-woocommerce'); ?></a>
303
+ <span class="spinner"></span>
304
+ </div>
305
+
306
+ <div class="box mc-woocommerce-create-account-step-error alignright" >
307
+ <p id ="email_error"><?= esc_html__( 'Invalid Email. Please double check.', 'mailchimp-for-woocommerce' ); ?></p>
308
+ <p id ="first_name_error"><?= esc_html__( 'Invalid First Name. Please double check.', 'mailchimp-for-woocommerce' ); ?></p>
309
+ <p id ="last_name_error"><?= esc_html__( 'Invalid Last Name. Please double check.', 'mailchimp-for-woocommerce' ); ?></p>
310
+ <p id ="subject_error"><?= esc_html__( 'Invalid Subject. Please double check.', 'mailchimp-for-woocommerce' ); ?></p>
311
+ <p id ="message_error"><?= esc_html__( 'Invalid Message. Please double check.', 'mailchimp-for-woocommerce' ); ?></p>
312
+ <p id ="success"><?= esc_html__( 'Message sent...', 'mailchimp-for-woocommerce' ); ?></p>
313
+ <p id ="error"><?= esc_html__( 'Error: Message not sent...', 'mailchimp-for-woocommerce' ); ?></p>
314
+ </div>
315
+
316
+ </fieldset>
317
+ </div>
318
+ <div class="modal-footer">
319
+ ©2001–<?= date('Y') ?> All Rights Reserved. Mailchimp® is a registered trademark of The Rocket Science Group. Cookie Preferences, Privacy, and Terms.
320
+ </div>
321
+
322
+ </div>
323
+ </div>
bootstrap.php CHANGED
@@ -87,7 +87,7 @@ function mailchimp_environment_variables() {
87
  return (object) array(
88
  'repo' => 'master',
89
  'environment' => 'production', // staging or production
90
- 'version' => '2.4.1',
91
  'php_version' => phpversion(),
92
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
93
  'wc_version' => function_exists('WC') ? WC()->version : null,
@@ -1129,10 +1129,11 @@ function mailchimp_settings_errors() {
1129
  * @param null $language
1130
  * @param string $caller
1131
  * @param string $status_if_new
 
1132
  * @throws MailChimp_WooCommerce_Error
1133
  * @throws MailChimp_WooCommerce_ServerError
1134
  */
1135
- function mailchimp_member_language_update($user_email = null, $language = null, $caller = '', $status_if_new = 'transactional') {
1136
  mailchimp_debug('debug', "mailchimp_member_language_update", array(
1137
  'user_email' => $user_email,
1138
  'user_language' => $language,
@@ -1152,14 +1153,18 @@ function mailchimp_member_language_update($user_email = null, $language = null,
1152
  if ($member['status'] === 'transactional' && in_array($status_if_new, array('subscribed', 'pending'))) {
1153
  $member['status'] = $status_if_new;
1154
  }
1155
- mailchimp_get_api()->update($list_id, $user_email, $member['status'], null, null, $language);
 
 
1156
  // set transient to prevent too many calls to update language
1157
  mailchimp_set_transient($caller . ".member.{$hash}", true, 3600);
1158
  mailchimp_log($caller . '.member.updated', "Updated {$user_email} subscriber status to {$member['status']} and language to {$language}");
1159
  } catch (\Exception $e) {
1160
  if ($e->getCode() == 404) {
 
 
1161
  // member doesn't exist yet, create as transactional ( or what was passed in the function args )
1162
- mailchimp_get_api()->subscribe($list_id, $user_email, $status_if_new, array(), array(), $language);
1163
  // set transient to prevent too many calls to update language
1164
  mailchimp_set_transient($caller . ".member.{$hash}", true, 3600);
1165
  mailchimp_log($caller . '.member.created', "Added {$user_email} as transactional, setting language to [{$language}]");
87
  return (object) array(
88
  'repo' => 'master',
89
  'environment' => 'production', // staging or production
90
+ 'version' => '2.4.2',
91
  'php_version' => phpversion(),
92
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
93
  'wc_version' => function_exists('WC') ? WC()->version : null,
1129
  * @param null $language
1130
  * @param string $caller
1131
  * @param string $status_if_new
1132
+ * @param MailChimp_WooCommerce_Order|null $order
1133
  * @throws MailChimp_WooCommerce_Error
1134
  * @throws MailChimp_WooCommerce_ServerError
1135
  */
1136
+ function mailchimp_member_language_update($user_email = null, $language = null, $caller = '', $status_if_new = 'transactional', $order = null) {
1137
  mailchimp_debug('debug', "mailchimp_member_language_update", array(
1138
  'user_email' => $user_email,
1139
  'user_language' => $language,
1153
  if ($member['status'] === 'transactional' && in_array($status_if_new, array('subscribed', 'pending'))) {
1154
  $member['status'] = $status_if_new;
1155
  }
1156
+ $merge_fields = $order ? apply_filters('mailchimp_get_ecommerce_merge_tags', array(), $order) : array();
1157
+ if (!is_array($merge_fields)) $merge_fields = array();
1158
+ mailchimp_get_api()->update($list_id, $user_email, $member['status'], $merge_fields, null, $language);
1159
  // set transient to prevent too many calls to update language
1160
  mailchimp_set_transient($caller . ".member.{$hash}", true, 3600);
1161
  mailchimp_log($caller . '.member.updated', "Updated {$user_email} subscriber status to {$member['status']} and language to {$language}");
1162
  } catch (\Exception $e) {
1163
  if ($e->getCode() == 404) {
1164
+ $merge_fields = $order ? apply_filters('mailchimp_get_ecommerce_merge_tags', array(), $order) : array();
1165
+ if (!is_array($merge_fields)) $merge_fields = array();
1166
  // member doesn't exist yet, create as transactional ( or what was passed in the function args )
1167
+ mailchimp_get_api()->subscribe($list_id, $user_email, $status_if_new, $merge_fields, array(), $language);
1168
  // set transient to prevent too many calls to update language
1169
  mailchimp_set_transient($caller . ".member.{$hash}", true, 3600);
1170
  mailchimp_log($caller . '.member.created', "Added {$user_email} as transactional, setting language to [{$language}]");
includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php CHANGED
@@ -216,7 +216,8 @@ class MailChimp_WooCommerce_Transform_Orders
216
  $order->addItem($item);
217
  }
218
 
219
- return $order;
 
220
  }
221
 
222
  /**
216
  $order->addItem($item);
217
  }
218
 
219
+ // let the store owner alter this if they need to use on-hold orders
220
+ return apply_filters('mailchimp_filter_ecommerce_order', $order, $woo);
221
  }
222
 
223
  /**
includes/class-mailchimp-woocommerce-options.php CHANGED
@@ -34,6 +34,16 @@ abstract class MailChimp_WooCommerce_Options
34
  return;
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
37
  if (!isset($_GET['activate-multi'])) {
38
  wp_redirect("admin.php?page=mailchimp-woocommerce");
39
  }
34
  return;
35
  }
36
 
37
+ // the woocommerce onboarding wizard will have a profile
38
+ $onboarding_profile = get_option('woocommerce_onboarding_profile');
39
+ // if the onboarding profile has business extensions
40
+ if (is_array($onboarding_profile) && array_key_exists('business_extensions', $onboarding_profile)) {
41
+ // if the business extensions contains our plugin, we just skip this.
42
+ if (is_array($onboarding_profile['business_extensions']) && in_array('mailchimp-for-woocommerce', $onboarding_profile['business_extensions'])) {
43
+ return;
44
+ }
45
+ }
46
+
47
  if (!isset($_GET['activate-multi'])) {
48
  wp_redirect("admin.php?page=mailchimp-woocommerce");
49
  }
includes/class-mailchimp-woocommerce-service.php CHANGED
@@ -665,6 +665,12 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
665
  if (!($woo = WC()) || empty($woo->session)) {
666
  return $default;
667
  }
 
 
 
 
 
 
668
  return $woo->session->get($key, $default);
669
  }
670
 
@@ -740,8 +746,8 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
740
 
741
  $this->getCartItems();
742
 
743
- if (isset($_GET['language'])) {
744
- $this->user_language = $_GET['language'];
745
  }
746
 
747
  $this->handleCartUpdated();
665
  if (!($woo = WC()) || empty($woo->session)) {
666
  return $default;
667
  }
668
+
669
+ // not really sure why this would be the case, but if there is no session we can't get it anyway.
670
+ if (!is_object($woo->session) || !method_exists($woo->session, 'get')) {
671
+ return $default;
672
+ }
673
+
674
  return $woo->session->get($key, $default);
675
  }
676
 
746
 
747
  $this->getCartItems();
748
 
749
+ if (isset($_GET['mc_language'])) {
750
+ $this->user_language = $_GET['mc_language'];
751
  }
752
 
753
  $this->handleCartUpdated();
includes/class-mailchimp-woocommerce.php CHANGED
@@ -230,7 +230,6 @@ class MailChimp_WooCommerce
230
 
231
  // Add menu item
232
  $this->loader->add_action('admin_menu', $plugin_admin, 'add_plugin_admin_menu');
233
- $this->loader->add_filter('parent_file', $plugin_admin, 'highlight_admin_menu');
234
 
235
  // Add WooCommerce Navigation Bar
236
  $this->loader->add_action('admin_menu', $plugin_admin, 'add_woocommerce_navigation_bar');
@@ -240,7 +239,8 @@ class MailChimp_WooCommerce
240
  $this->loader->add_filter('plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links');
241
 
242
  // make sure we're listening for the admin init
243
- $this->loader->add_action('admin_init', $plugin_admin, 'options_update');
 
244
 
245
  // put the menu on the admin top bar.
246
  //$this->loader->add_action('admin_bar_menu', $plugin_admin, 'admin_bar', 100);
@@ -264,12 +264,16 @@ class MailChimp_WooCommerce
264
  // Create new mailchimp Account methods
265
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_create_account_check_username', $plugin_admin, 'mailchimp_woocommerce_ajax_create_account_check_username' );
266
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_create_account_signup', $plugin_admin, 'mailchimp_woocommerce_ajax_create_account_signup' );
 
267
 
268
  // add Shop Manager capability to save options
269
  $this->loader->add_action('option_page_capability_mailchimp-woocommerce', $plugin_admin, 'mailchimp_woocommerce_option_page_capability');
270
 
271
  // set communications box status
272
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_communication_status', $plugin_admin, 'mailchimp_woocommerce_communication_status' );
 
 
 
273
  }
274
 
275
  /**
230
 
231
  // Add menu item
232
  $this->loader->add_action('admin_menu', $plugin_admin, 'add_plugin_admin_menu');
 
233
 
234
  // Add WooCommerce Navigation Bar
235
  $this->loader->add_action('admin_menu', $plugin_admin, 'add_woocommerce_navigation_bar');
239
  $this->loader->add_filter('plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links');
240
 
241
  // make sure we're listening for the admin init
242
+ $this->loader->add_action('admin_init', $plugin_admin, 'options_update');
243
+ $this->loader->add_action('admin_notices', $plugin_admin, 'initial_notice');
244
 
245
  // put the menu on the admin top bar.
246
  //$this->loader->add_action('admin_bar_menu', $plugin_admin, 'admin_bar', 100);
264
  // Create new mailchimp Account methods
265
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_create_account_check_username', $plugin_admin, 'mailchimp_woocommerce_ajax_create_account_check_username' );
266
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_create_account_signup', $plugin_admin, 'mailchimp_woocommerce_ajax_create_account_signup' );
267
+ $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_support_form', $plugin_admin, 'mailchimp_woocommerce_ajax_support_form' );
268
 
269
  // add Shop Manager capability to save options
270
  $this->loader->add_action('option_page_capability_mailchimp-woocommerce', $plugin_admin, 'mailchimp_woocommerce_option_page_capability');
271
 
272
  // set communications box status
273
  $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_communication_status', $plugin_admin, 'mailchimp_woocommerce_communication_status' );
274
+
275
+ // Load log file via ajax
276
+ $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_load_log_file', $plugin_admin, 'mailchimp_woocommerce_ajax_load_log_file' );
277
  }
278
 
279
  /**
includes/processes/class-mailchimp-woocommerce-cart-update.php CHANGED
@@ -136,9 +136,11 @@ class MailChimp_WooCommerce_Cart_Update extends Mailchimp_Woocommerce_Job
136
 
137
  foreach ($this->cart_data as $hash => $item) {
138
  try {
139
- $line = $this->transformLineItem($hash, $item);
140
- $cart->addItem($line);
141
- $order_total += ($item['quantity'] * $line->getPrice());
 
 
142
  $products[] = $line;
143
  } catch (\Exception $e) {}
144
  }
@@ -211,22 +213,26 @@ class MailChimp_WooCommerce_Cart_Update extends Mailchimp_Woocommerce_Job
211
  */
212
  protected function transformLineItem($hash, $item)
213
  {
214
- $product = wc_get_product($item['product_id']);
215
- $price = $product ? $product->get_price() : 0;
216
-
217
- $line = new MailChimp_WooCommerce_LineItem();
218
- $line->setId($hash);
219
- $line->setProductId($item['product_id']);
220
 
221
- if (isset($item['variation_id']) && $item['variation_id'] > 0) {
222
- $line->setProductVariantId($item['variation_id']);
 
 
223
  } else {
224
- $line->setProductVariantId($item['product_id']);
225
  }
226
 
 
 
 
 
 
 
 
227
  $line->setQuantity($item['quantity']);
228
  $line->setPrice($price);
229
-
230
  return $line;
231
  }
232
  }
136
 
137
  foreach ($this->cart_data as $hash => $item) {
138
  try {
139
+ $cart->addItem(($line = $this->transformLineItem($hash, $item)));
140
+ $qty = isset($item['quantity']) && is_numeric($item['quantity']) ? $item['quantity'] : 1;
141
+ if (($price = $line->getPrice()) && is_numeric($price)) {
142
+ $order_total += ($qty * $price);
143
+ }
144
  $products[] = $line;
145
  } catch (\Exception $e) {}
146
  }
213
  */
214
  protected function transformLineItem($hash, $item)
215
  {
216
+ $variant_id = isset($item['variation_id']) && $item['variation_id'] > 0 ? $item['variation_id'] : null;
217
+ $product_id = $item['product_id'];
 
 
 
 
218
 
219
+ // if the cart contains a variant id with no parent id, we need to use this instead of the main product id.
220
+ if ($variant_id) {
221
+ $product = wc_get_product($variant_id);
222
+ $product_id = $product->get_parent_id();
223
  } else {
224
+ $product = wc_get_product($product_id);
225
  }
226
 
227
+ $price = $product ? $product->get_price() : 0;
228
+ $line = new MailChimp_WooCommerce_LineItem();
229
+ $line->setId($hash);
230
+ $line->setProductId($product_id);
231
+ if (!empty($variant_id)) {
232
+ $line->setProductVariantId($variant_id);
233
+ }
234
  $line->setQuantity($item['quantity']);
235
  $line->setPrice($price);
 
236
  return $line;
237
  }
238
  }
includes/processes/class-mailchimp-woocommerce-single-order.php CHANGED
@@ -319,7 +319,7 @@ class MailChimp_WooCommerce_Single_Order extends Mailchimp_Woocommerce_Job
319
  }
320
 
321
  // Maybe sync subscriber to set correct member.language
322
- mailchimp_member_language_update($email, $this->user_language, 'order', $status_if_new);
323
 
324
  mailchimp_log('order_submit.success', $log);
325
 
319
  }
320
 
321
  // Maybe sync subscriber to set correct member.language
322
+ mailchimp_member_language_update($email, $this->user_language, 'order', $status_if_new, $order);
323
 
324
  mailchimp_log('order_submit.success', $log);
325
 
languages/mc-woocommerce.pot CHANGED
@@ -2,20 +2,21 @@
2
  # This file is distributed under the same license as the Mailchimp for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mailchimp for WooCommerce 2.4.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mailchimp-for-woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2020-05-19T08:19:38+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: mailchimp-for-woocommerce\n"
16
 
17
  #. Plugin Name of the plugin
18
- #: admin/class-mailchimp-woocommerce-admin.php:219
 
19
  msgid "Mailchimp for WooCommerce"
20
  msgstr ""
21
 
@@ -28,6 +29,7 @@ msgid "Connects WooCommerce to Mailchimp to sync your store data, send targeted
28
  msgstr ""
29
 
30
  #. Author of the plugin
 
31
  msgid "Mailchimp"
32
  msgstr ""
33
 
@@ -35,181 +37,217 @@ msgstr ""
35
  msgid "https://mailchimp.com"
36
  msgstr ""
37
 
38
- #: admin/class-mailchimp-woocommerce-admin.php:129
39
- msgid "Mailchimp - WooCommerce Setup"
40
  msgstr ""
41
 
42
- #: admin/class-mailchimp-woocommerce-admin.php:142
43
- #: admin/class-mailchimp-woocommerce-admin.php:143
44
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:176
45
- msgid "Overview"
46
  msgstr ""
47
 
48
- #: admin/class-mailchimp-woocommerce-admin.php:151
49
- #: admin/class-mailchimp-woocommerce-admin.php:152
50
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:136
51
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:177
52
- #: admin/partials/tabs/store_info.php:15
53
- msgid "Store Settings"
54
  msgstr ""
55
 
56
- #: admin/class-mailchimp-woocommerce-admin.php:160
57
- #: admin/class-mailchimp-woocommerce-admin.php:161
58
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:148
59
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:180
60
- #: admin/partials/tabs/campaign_defaults.php:19
61
- msgid "Audience Defaults"
62
  msgstr ""
63
 
64
- #: admin/class-mailchimp-woocommerce-admin.php:169
65
- #: admin/class-mailchimp-woocommerce-admin.php:170
66
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:160
67
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:183
68
- #: admin/partials/tabs/newsletter_settings.php:36
69
- msgid "Audience Settings"
70
  msgstr ""
71
 
72
- #: admin/class-mailchimp-woocommerce-admin.php:178
73
- #: admin/class-mailchimp-woocommerce-admin.php:179
74
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:186
75
- msgid "Logs"
 
 
76
  msgstr ""
77
 
78
- #: admin/class-mailchimp-woocommerce-admin.php:375
79
  #: includes/class-mailchimp-woocommerce-deactivation-survey.php:379
80
  msgid "Mailchimp for Woocommerce"
81
  msgstr ""
82
 
83
- #: admin/class-mailchimp-woocommerce-admin.php:376
84
  msgid "We dectected that this site has the following constants defined, likely at wp-config.php file"
85
  msgstr ""
86
 
87
- #: admin/class-mailchimp-woocommerce-admin.php:378
88
  msgid "These constants are deprecated since Mailchimp for Woocommerce version 2.3. Please refer to the <a href=\"https://github.com/mailchimp/mc-woocommerce/wiki/\">plugin official wiki</a> for further details."
89
  msgstr ""
90
 
91
- #: admin/class-mailchimp-woocommerce-admin.php:537
92
  msgid "Store Disconnected"
93
  msgstr ""
94
 
95
- #: admin/class-mailchimp-woocommerce-admin.php:541
96
  msgid "Store Disconnect Failed"
97
  msgstr ""
98
 
99
- #: admin/class-mailchimp-woocommerce-admin.php:884
 
 
 
 
 
 
100
  msgid "As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address."
101
  msgstr ""
102
 
103
- #: admin/class-mailchimp-woocommerce-admin.php:892
104
  msgid "As part of the Mailchimp Terms of Use, we require a valid phone number for your store."
105
  msgstr ""
106
 
107
- #: admin/class-mailchimp-woocommerce-admin.php:900
108
  msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
109
  msgstr ""
110
 
111
  #. translators: %s - plugin name.
112
- #: admin/class-mailchimp-woocommerce-admin.php:918
113
- #: admin/partials/tabs/campaign_defaults.php:68
114
  msgid "You were subscribed to the newsletter from %s"
115
  msgstr ""
116
 
117
- #: admin/class-mailchimp-woocommerce-admin.php:923
118
- #: admin/class-mailchimp-woocommerce-admin.php:1018
119
  msgid "One or more fields were not updated"
120
  msgstr ""
121
 
122
- #: admin/class-mailchimp-woocommerce-admin.php:970
123
  #: admin/partials/tabs/newsletter_settings.php:97
124
  #: includes/class-mailchimp-woocommerce-newsletter.php:43
125
  msgid "Subscribe to our newsletter"
126
  msgstr ""
127
 
128
- #: admin/class-mailchimp-woocommerce-admin.php:1083
129
  msgid "You must supply your Mailchimp API key to pull the audiences."
130
  msgstr ""
131
 
132
- #: admin/class-mailchimp-woocommerce-admin.php:1548
 
 
 
 
 
 
 
 
133
  msgid "Starting the sync process..."
134
  msgstr ""
135
 
136
- #: admin/class-mailchimp-woocommerce-admin.php:1550
137
  msgid "The plugin has started the initial sync with your store, and the process will work in the background automatically."
138
  msgstr ""
139
 
140
- #: admin/class-mailchimp-woocommerce-admin.php:1552
141
  msgid "Sometimes the sync can take a while, especially on sites with lots of orders and/or products. It is safe to navigate away from this screen while it is running."
142
  msgstr ""
143
 
144
- #: admin/class-mailchimp-woocommerce-admin.php:1568
145
  msgid "Your store is synced with Mailchimp!"
146
  msgstr ""
147
 
148
  #. translators: %1$s: Number of synced orders %2$s: Audience name
149
- #: admin/class-mailchimp-woocommerce-admin.php:1571
150
  msgid "We've successfully synced %1$s orders to your Audience %2$s, that's awesome!"
151
  msgstr ""
152
 
153
  #. translators: %s - Wordpress.org plugin review URL.
154
- #: admin/class-mailchimp-woocommerce-admin.php:1579
155
  msgid "Could you please do us a favor and leave the plugin a 5-star <a href=%s target='_blank'>rating on Wordpress.org</a>? It helps our community know that we're working hard to make it better each day."
156
  msgstr ""
157
 
158
- #: admin/class-mailchimp-woocommerce-admin.php:1582
159
  msgid "Leave a Review"
160
  msgstr ""
161
 
162
- #: admin/class-mailchimp-woocommerce-admin.php:1607
163
  msgid "Saved"
164
  msgstr ""
165
 
166
- #: admin/class-mailchimp-woocommerce-admin.php:1612
167
  msgid "Error setting communications status"
168
  msgstr ""
169
 
170
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:65
171
  msgid "Mailchimp says: Please upgrade your PHP version to a minimum of 7.0"
172
  msgstr ""
173
 
174
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:71
175
  msgid "Mailchimp says: API Request Error - "
176
  msgstr ""
177
 
178
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:96
179
  msgid "Add Mailchimp for WooCommerce to build custom segments,<br/>send automations, and track purchase activity in Mailchimp"
180
  msgstr ""
181
 
182
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:100
183
  msgid "Please provide a bit of information<br/>about your WooCommerce store"
184
  msgstr ""
185
 
186
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:104
187
- msgid "Please fill out the audience default<br/>campaign information"
 
 
 
 
188
  msgstr ""
189
 
190
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:108
191
- msgid "Please apply your audience settings. If you don’t<br/>have an audience, you can choose to create one"
192
  msgstr ""
193
 
194
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:112
 
 
 
 
195
  msgid "Sweet! You're connected with<br/>Mailchimp and syncing data"
196
  msgstr ""
197
 
198
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:115
199
  msgid "Connect your WooCommerce store to a<br/>Mailchimp audience in less than 60 seconds"
200
  msgstr ""
201
 
202
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:120
203
  msgid "Log events from the <br/>Mailchimp plugin"
204
  msgstr ""
205
 
206
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:127
207
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:174
208
  #: admin/partials/tabs/api_key.php:10
209
  msgid "Connect"
210
  msgstr ""
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  #: admin/partials/mailchimp-woocommerce-admin-tabs.php:205
 
 
 
 
213
  msgid "Start sync"
214
  msgstr ""
215
 
@@ -243,7 +281,7 @@ msgid "Connected! Please wait while loading next step"
243
  msgstr ""
244
 
245
  #: admin/partials/tabs/api_key_create_account.php:33
246
- #: admin/partials/tabs/store_info.php:26
247
  msgid "Email"
248
  msgstr ""
249
 
@@ -272,12 +310,12 @@ msgid "Address Line 2"
272
  msgstr ""
273
 
274
  #: admin/partials/tabs/api_key_create_account.php:82
275
- #: admin/partials/tabs/store_info.php:40
276
  msgid "City"
277
  msgstr ""
278
 
279
  #: admin/partials/tabs/api_key_create_account.php:89
280
- #: admin/partials/tabs/store_info.php:47
281
  msgid "State"
282
  msgstr ""
283
 
@@ -286,7 +324,7 @@ msgid "Zip"
286
  msgstr ""
287
 
288
  #: admin/partials/tabs/api_key_create_account.php:103
289
- #: admin/partials/tabs/store_info.php:61
290
  msgid "Country"
291
  msgstr ""
292
 
@@ -295,7 +333,7 @@ msgid "Phone"
295
  msgstr ""
296
 
297
  #: admin/partials/tabs/api_key_create_account.php:135
298
- #: admin/partials/tabs/store_info.php:126
299
  msgid "Timezone"
300
  msgstr ""
301
 
@@ -345,33 +383,30 @@ msgid "Connecting..."
345
  msgstr ""
346
 
347
  #: admin/partials/tabs/campaign_defaults.php:24
348
- msgid "Default from name"
349
  msgstr ""
350
 
351
- #: admin/partials/tabs/campaign_defaults.php:31
352
- msgid "Default from email"
353
  msgstr ""
354
 
355
- #: admin/partials/tabs/campaign_defaults.php:38
356
- msgid "Default subject"
357
  msgstr ""
358
 
359
- #: admin/partials/tabs/campaign_defaults.php:40
360
  msgid "Store Newsletter"
361
  msgstr ""
362
 
363
- #: admin/partials/tabs/campaign_defaults.php:45
364
- msgid "Default language"
365
  msgstr ""
366
 
367
- #: admin/partials/tabs/campaign_defaults.php:62
368
  msgid "Permission reminder message"
369
  msgstr ""
370
 
371
  #: admin/partials/tabs/logs.php:38
372
- msgid "Logging Preference"
373
- msgstr ""
374
-
375
  #: admin/partials/tabs/logs.php:42
376
  msgid "Logging Preferences"
377
  msgstr ""
@@ -396,16 +431,16 @@ msgstr ""
396
  msgid "Standard"
397
  msgstr ""
398
 
399
- #: admin/partials/tabs/logs.php:71
400
  msgid "Recent Logs"
401
  msgstr ""
402
 
403
- #: admin/partials/tabs/logs.php:94
404
- msgid "Copy log"
405
  msgstr ""
406
 
407
- #: admin/partials/tabs/logs.php:100
408
- msgid "Delete log"
409
  msgstr ""
410
 
411
  #: admin/partials/tabs/newsletter_settings.php:41
@@ -501,10 +536,6 @@ msgstr ""
501
  msgid "Define the product image size used by abandoned carts, order notifications, and product recommendations."
502
  msgstr ""
503
 
504
- #: admin/partials/tabs/newsletter_settings.php:164
505
- msgid "Size"
506
- msgstr ""
507
-
508
  #: admin/partials/tabs/notices.php:6
509
  msgid "Mailchimp says: You must enter in a valid API key."
510
  msgstr ""
@@ -533,59 +564,59 @@ msgstr ""
533
  msgid "Name"
534
  msgstr ""
535
 
536
- #: admin/partials/tabs/store_info.php:33
537
  msgid "Street address"
538
  msgstr ""
539
 
540
- #: admin/partials/tabs/store_info.php:54
541
  msgid "Postal Code"
542
  msgstr ""
543
 
544
- #: admin/partials/tabs/store_info.php:87
545
  msgid "Phone Number"
546
  msgstr ""
547
 
548
- #: admin/partials/tabs/store_info.php:93
549
  msgid "Locale Settings"
550
  msgstr ""
551
 
552
- #: admin/partials/tabs/store_info.php:95
553
  msgid "Please apply your locale settings. If you're unsure about these, use the defaults."
554
  msgstr ""
555
 
556
- #: admin/partials/tabs/store_info.php:100
557
  msgid "Locale"
558
  msgstr ""
559
 
560
- #: admin/partials/tabs/store_info.php:104
561
  msgid "Select store's locale"
562
  msgstr ""
563
 
564
- #: admin/partials/tabs/store_info.php:119
565
  msgid "Woocommerce Currency"
566
  msgstr ""
567
 
568
- #: admin/partials/tabs/store_info.php:130
569
  msgid "Select store's timezone"
570
  msgstr ""
571
 
572
- #: admin/partials/tabs/store_info.php:146
573
  msgid "Optional Store Settings"
574
  msgstr ""
575
 
576
- #: admin/partials/tabs/store_info.php:152
577
  msgid "Plugin Permission Level"
578
  msgstr ""
579
 
580
- #: admin/partials/tabs/store_info.php:153
581
  msgid "Select the minimum permission capability to manage Mailchimp for Woocommerce options"
582
  msgstr ""
583
 
584
- #: admin/partials/tabs/store_info.php:160
585
  msgid "Administrators Only"
586
  msgstr ""
587
 
588
- #: admin/partials/tabs/store_info.php:163
589
  msgid "Shop Managers and Administrators"
590
  msgstr ""
591
 
@@ -662,47 +693,56 @@ msgstr ""
662
  msgid "disabled"
663
  msgstr ""
664
 
665
- #: admin/partials/tabs/store_sync.php:208
666
- msgid "Advanced"
667
  msgstr ""
668
 
669
- #: admin/partials/tabs/store_sync.php:210
670
  msgid "You can resync your audience at any time without losing any of your e-commerce data."
671
  msgstr ""
672
 
673
- #: admin/partials/tabs/store_sync.php:212
674
- msgid "Force Resync"
 
675
  msgstr ""
676
 
677
- #: admin/partials/tabs/store_sync.php:215
 
 
 
 
678
  msgid "More Information"
679
  msgstr ""
680
 
681
  #. translators: %s - Plugin review URL.
682
- #: admin/partials/tabs/store_sync.php:217
683
  msgid "Is this plugin helping your e-commerce business? <a href=%s target=_blank>Please leave us a ★★★★★ review!</a>."
684
  msgstr ""
685
 
686
  #. translators: %s - WP-CLI URL.
687
- #: admin/partials/tabs/store_sync.php:218
688
  msgid "Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>."
689
  msgstr ""
690
 
691
  #. translators: %s - WP-CLI URL.
692
- #: admin/partials/tabs/store_sync.php:219
693
  msgid "Order and customer information will not sync if they contain an Amazon or generic email address."
694
  msgstr ""
695
 
696
  #. translators: %s - Mailchimp Support URL.
697
- #: admin/partials/tabs/store_sync.php:220
698
  msgid "Need help? Visit Mailchimp <a href=%s target=_blank>support</a>."
699
  msgstr ""
700
 
701
  #. translators: %s - Mailchimp Privacy Policy URL.
702
- #: admin/partials/tabs/store_sync.php:221
703
  msgid "By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>."
704
  msgstr ""
705
 
 
 
 
 
706
  #: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
707
  msgid "Please select an option"
708
  msgstr ""
2
  # This file is distributed under the same license as the Mailchimp for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mailchimp for WooCommerce 2.4.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mailchimp-for-woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-06-29T11:13:21+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: mailchimp-for-woocommerce\n"
16
 
17
  #. Plugin Name of the plugin
18
+ #: admin/class-mailchimp-woocommerce-admin.php:144
19
+ #: admin/class-mailchimp-woocommerce-admin.php:161
20
  msgid "Mailchimp for WooCommerce"
21
  msgstr ""
22
 
29
  msgstr ""
30
 
31
  #. Author of the plugin
32
+ #: admin/class-mailchimp-woocommerce-admin.php:145
33
  msgid "Mailchimp"
34
  msgstr ""
35
 
37
  msgid "https://mailchimp.com"
38
  msgstr ""
39
 
40
+ #: admin/class-mailchimp-woocommerce-admin.php:121
41
+ msgid "Are you sure?"
42
  msgstr ""
43
 
44
+ #: admin/class-mailchimp-woocommerce-admin.php:122
45
+ msgid "You will not be able to revert."
 
 
46
  msgstr ""
47
 
48
+ #: admin/class-mailchimp-woocommerce-admin.php:123
49
+ msgid "Yes, delete it!"
 
 
 
 
50
  msgstr ""
51
 
52
+ #: admin/class-mailchimp-woocommerce-admin.php:124
53
+ msgid "No, cancel!"
 
 
 
 
54
  msgstr ""
55
 
56
+ #: admin/class-mailchimp-woocommerce-admin.php:125
57
+ msgid "You are about to disconnect your store from Mailchimp."
 
 
 
 
58
  msgstr ""
59
 
60
+ #: admin/class-mailchimp-woocommerce-admin.php:126
61
+ msgid "Yes, disconnect."
62
+ msgstr ""
63
+
64
+ #: admin/class-mailchimp-woocommerce-admin.php:235
65
+ msgid "Log file deleted."
66
  msgstr ""
67
 
68
+ #: admin/class-mailchimp-woocommerce-admin.php:359
69
  #: includes/class-mailchimp-woocommerce-deactivation-survey.php:379
70
  msgid "Mailchimp for Woocommerce"
71
  msgstr ""
72
 
73
+ #: admin/class-mailchimp-woocommerce-admin.php:360
74
  msgid "We dectected that this site has the following constants defined, likely at wp-config.php file"
75
  msgstr ""
76
 
77
+ #: admin/class-mailchimp-woocommerce-admin.php:362
78
  msgid "These constants are deprecated since Mailchimp for Woocommerce version 2.3. Please refer to the <a href=\"https://github.com/mailchimp/mc-woocommerce/wiki/\">plugin official wiki</a> for further details."
79
  msgstr ""
80
 
81
+ #: admin/class-mailchimp-woocommerce-admin.php:531
82
  msgid "Store Disconnected"
83
  msgstr ""
84
 
85
+ #: admin/class-mailchimp-woocommerce-admin.php:535
86
  msgid "Store Disconnect Failed"
87
  msgstr ""
88
 
89
+ #: admin/class-mailchimp-woocommerce-admin.php:793
90
+ #: admin/class-mailchimp-woocommerce-admin.php:998
91
+ #: admin/class-mailchimp-woocommerce-admin.php:1556
92
+ msgid "Cannot create or update Store at Mailchimp."
93
+ msgstr ""
94
+
95
+ #: admin/class-mailchimp-woocommerce-admin.php:887
96
  msgid "As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address."
97
  msgstr ""
98
 
99
+ #: admin/class-mailchimp-woocommerce-admin.php:895
100
  msgid "As part of the Mailchimp Terms of Use, we require a valid phone number for your store."
101
  msgstr ""
102
 
103
+ #: admin/class-mailchimp-woocommerce-admin.php:903
104
  msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
105
  msgstr ""
106
 
107
  #. translators: %s - plugin name.
108
+ #: admin/class-mailchimp-woocommerce-admin.php:921
109
+ #: admin/partials/tabs/campaign_defaults.php:73
110
  msgid "You were subscribed to the newsletter from %s"
111
  msgstr ""
112
 
113
+ #: admin/class-mailchimp-woocommerce-admin.php:926
114
+ #: admin/class-mailchimp-woocommerce-admin.php:1023
115
  msgid "One or more fields were not updated"
116
  msgstr ""
117
 
118
+ #: admin/class-mailchimp-woocommerce-admin.php:973
119
  #: admin/partials/tabs/newsletter_settings.php:97
120
  #: includes/class-mailchimp-woocommerce-newsletter.php:43
121
  msgid "Subscribe to our newsletter"
122
  msgstr ""
123
 
124
+ #: admin/class-mailchimp-woocommerce-admin.php:1088
125
  msgid "You must supply your Mailchimp API key to pull the audiences."
126
  msgstr ""
127
 
128
+ #: admin/class-mailchimp-woocommerce-admin.php:1357
129
+ msgid "Cannot create or update List at Mailchimp."
130
+ msgstr ""
131
+
132
+ #: admin/class-mailchimp-woocommerce-admin.php:1357
133
+ msgid "Please retry."
134
+ msgstr ""
135
+
136
+ #: admin/class-mailchimp-woocommerce-admin.php:1572
137
  msgid "Starting the sync process..."
138
  msgstr ""
139
 
140
+ #: admin/class-mailchimp-woocommerce-admin.php:1574
141
  msgid "The plugin has started the initial sync with your store, and the process will work in the background automatically."
142
  msgstr ""
143
 
144
+ #: admin/class-mailchimp-woocommerce-admin.php:1576
145
  msgid "Sometimes the sync can take a while, especially on sites with lots of orders and/or products. It is safe to navigate away from this screen while it is running."
146
  msgstr ""
147
 
148
+ #: admin/class-mailchimp-woocommerce-admin.php:1592
149
  msgid "Your store is synced with Mailchimp!"
150
  msgstr ""
151
 
152
  #. translators: %1$s: Number of synced orders %2$s: Audience name
153
+ #: admin/class-mailchimp-woocommerce-admin.php:1595
154
  msgid "We've successfully synced %1$s orders to your Audience %2$s, that's awesome!"
155
  msgstr ""
156
 
157
  #. translators: %s - Wordpress.org plugin review URL.
158
+ #: admin/class-mailchimp-woocommerce-admin.php:1603
159
  msgid "Could you please do us a favor and leave the plugin a 5-star <a href=%s target='_blank'>rating on Wordpress.org</a>? It helps our community know that we're working hard to make it better each day."
160
  msgstr ""
161
 
162
+ #: admin/class-mailchimp-woocommerce-admin.php:1606
163
  msgid "Leave a Review"
164
  msgstr ""
165
 
166
+ #: admin/class-mailchimp-woocommerce-admin.php:1631
167
  msgid "Saved"
168
  msgstr ""
169
 
170
+ #: admin/class-mailchimp-woocommerce-admin.php:1636
171
  msgid "Error setting communications status"
172
  msgstr ""
173
 
174
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:68
175
  msgid "Mailchimp says: Please upgrade your PHP version to a minimum of 7.0"
176
  msgstr ""
177
 
178
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:74
179
  msgid "Mailchimp says: API Request Error - "
180
  msgstr ""
181
 
182
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:99
183
  msgid "Add Mailchimp for WooCommerce to build custom segments,<br/>send automations, and track purchase activity in Mailchimp"
184
  msgstr ""
185
 
186
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:103
187
  msgid "Please provide a bit of information<br/>about your WooCommerce store"
188
  msgstr ""
189
 
190
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:107
191
+ msgid "Please review the audience default<br/>campaign information"
192
+ msgstr ""
193
+
194
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:112
195
+ msgid "Please apply your <br/>audience settings."
196
  msgstr ""
197
 
198
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:115
199
+ msgid "Please apply your audience settings. "
200
  msgstr ""
201
 
202
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:116
203
+ msgid "If you don’t<br/>have an audience, you can choose to create one"
204
+ msgstr ""
205
+
206
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:121
207
  msgid "Sweet! You're connected with<br/>Mailchimp and syncing data"
208
  msgstr ""
209
 
210
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:124
211
  msgid "Connect your WooCommerce store to a<br/>Mailchimp audience in less than 60 seconds"
212
  msgstr ""
213
 
214
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:129
215
  msgid "Log events from the <br/>Mailchimp plugin"
216
  msgstr ""
217
 
218
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:137
219
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:193
220
  #: admin/partials/tabs/api_key.php:10
221
  msgid "Connect"
222
  msgstr ""
223
 
224
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:147
225
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:196
226
+ #: admin/partials/tabs/store_info.php:15
227
+ msgid "Store Settings"
228
+ msgstr ""
229
+
230
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:162
231
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:199
232
+ #: admin/partials/tabs/campaign_defaults.php:19
233
+ msgid "Audience Defaults"
234
+ msgstr ""
235
+
236
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:177
237
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:202
238
+ #: admin/partials/tabs/newsletter_settings.php:36
239
+ msgid "Audience Settings"
240
+ msgstr ""
241
+
242
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:195
243
+ msgid "Overview"
244
+ msgstr ""
245
+
246
  #: admin/partials/mailchimp-woocommerce-admin-tabs.php:205
247
+ msgid "Logs"
248
+ msgstr ""
249
+
250
+ #: admin/partials/mailchimp-woocommerce-admin-tabs.php:266
251
  msgid "Start sync"
252
  msgstr ""
253
 
281
  msgstr ""
282
 
283
  #: admin/partials/tabs/api_key_create_account.php:33
284
+ #: admin/partials/tabs/store_info.php:27
285
  msgid "Email"
286
  msgstr ""
287
 
310
  msgstr ""
311
 
312
  #: admin/partials/tabs/api_key_create_account.php:82
313
+ #: admin/partials/tabs/store_info.php:43
314
  msgid "City"
315
  msgstr ""
316
 
317
  #: admin/partials/tabs/api_key_create_account.php:89
318
+ #: admin/partials/tabs/store_info.php:51
319
  msgid "State"
320
  msgstr ""
321
 
324
  msgstr ""
325
 
326
  #: admin/partials/tabs/api_key_create_account.php:103
327
+ #: admin/partials/tabs/store_info.php:67
328
  msgid "Country"
329
  msgstr ""
330
 
333
  msgstr ""
334
 
335
  #: admin/partials/tabs/api_key_create_account.php:135
336
+ #: admin/partials/tabs/store_info.php:135
337
  msgid "Timezone"
338
  msgstr ""
339
 
383
  msgstr ""
384
 
385
  #: admin/partials/tabs/campaign_defaults.php:24
386
+ msgid "From Name"
387
  msgstr ""
388
 
389
+ #: admin/partials/tabs/campaign_defaults.php:32
390
+ msgid "From Email"
391
  msgstr ""
392
 
393
+ #: admin/partials/tabs/campaign_defaults.php:40
394
+ msgid "Subject"
395
  msgstr ""
396
 
397
+ #: admin/partials/tabs/campaign_defaults.php:43
398
  msgid "Store Newsletter"
399
  msgstr ""
400
 
401
+ #: admin/partials/tabs/campaign_defaults.php:48
402
+ msgid "Language"
403
  msgstr ""
404
 
405
+ #: admin/partials/tabs/campaign_defaults.php:66
406
  msgid "Permission reminder message"
407
  msgstr ""
408
 
409
  #: admin/partials/tabs/logs.php:38
 
 
 
410
  #: admin/partials/tabs/logs.php:42
411
  msgid "Logging Preferences"
412
  msgstr ""
431
  msgid "Standard"
432
  msgstr ""
433
 
434
+ #: admin/partials/tabs/logs.php:72
435
  msgid "Recent Logs"
436
  msgstr ""
437
 
438
+ #: admin/partials/tabs/logs.php:87
439
+ msgid "Copy Log to clipboard"
440
  msgstr ""
441
 
442
+ #: admin/partials/tabs/logs.php:91
443
+ msgid "Delete Log"
444
  msgstr ""
445
 
446
  #: admin/partials/tabs/newsletter_settings.php:41
536
  msgid "Define the product image size used by abandoned carts, order notifications, and product recommendations."
537
  msgstr ""
538
 
 
 
 
 
539
  #: admin/partials/tabs/notices.php:6
540
  msgid "Mailchimp says: You must enter in a valid API key."
541
  msgstr ""
564
  msgid "Name"
565
  msgstr ""
566
 
567
+ #: admin/partials/tabs/store_info.php:35
568
  msgid "Street address"
569
  msgstr ""
570
 
571
+ #: admin/partials/tabs/store_info.php:59
572
  msgid "Postal Code"
573
  msgstr ""
574
 
575
+ #: admin/partials/tabs/store_info.php:94
576
  msgid "Phone Number"
577
  msgstr ""
578
 
579
+ #: admin/partials/tabs/store_info.php:101
580
  msgid "Locale Settings"
581
  msgstr ""
582
 
583
+ #: admin/partials/tabs/store_info.php:103
584
  msgid "Please apply your locale settings. If you're unsure about these, use the defaults."
585
  msgstr ""
586
 
587
+ #: admin/partials/tabs/store_info.php:108
588
  msgid "Locale"
589
  msgstr ""
590
 
591
+ #: admin/partials/tabs/store_info.php:113
592
  msgid "Select store's locale"
593
  msgstr ""
594
 
595
+ #: admin/partials/tabs/store_info.php:128
596
  msgid "Woocommerce Currency"
597
  msgstr ""
598
 
599
+ #: admin/partials/tabs/store_info.php:140
600
  msgid "Select store's timezone"
601
  msgstr ""
602
 
603
+ #: admin/partials/tabs/store_info.php:156
604
  msgid "Optional Store Settings"
605
  msgstr ""
606
 
607
+ #: admin/partials/tabs/store_info.php:162
608
  msgid "Plugin Permission Level"
609
  msgstr ""
610
 
611
+ #: admin/partials/tabs/store_info.php:163
612
  msgid "Select the minimum permission capability to manage Mailchimp for Woocommerce options"
613
  msgstr ""
614
 
615
+ #: admin/partials/tabs/store_info.php:170
616
  msgid "Administrators Only"
617
  msgstr ""
618
 
619
+ #: admin/partials/tabs/store_info.php:173
620
  msgid "Shop Managers and Administrators"
621
  msgstr ""
622
 
693
  msgid "disabled"
694
  msgstr ""
695
 
696
+ #: admin/partials/tabs/store_sync.php:211
697
+ msgid "Synchronization"
698
  msgstr ""
699
 
700
+ #: admin/partials/tabs/store_sync.php:213
701
  msgid "You can resync your audience at any time without losing any of your e-commerce data."
702
  msgstr ""
703
 
704
+ #: admin/partials/tabs/store_sync.php:216
705
+ #: admin/partials/tabs/store_sync.php:218
706
+ msgid "Resync now"
707
  msgstr ""
708
 
709
+ #: admin/partials/tabs/store_sync.php:219
710
+ msgid "Sync is running. Please wait until it finishes."
711
+ msgstr ""
712
+
713
+ #: admin/partials/tabs/store_sync.php:226
714
  msgid "More Information"
715
  msgstr ""
716
 
717
  #. translators: %s - Plugin review URL.
718
+ #: admin/partials/tabs/store_sync.php:228
719
  msgid "Is this plugin helping your e-commerce business? <a href=%s target=_blank>Please leave us a ★★★★★ review!</a>."
720
  msgstr ""
721
 
722
  #. translators: %s - WP-CLI URL.
723
+ #: admin/partials/tabs/store_sync.php:229
724
  msgid "Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>."
725
  msgstr ""
726
 
727
  #. translators: %s - WP-CLI URL.
728
+ #: admin/partials/tabs/store_sync.php:230
729
  msgid "Order and customer information will not sync if they contain an Amazon or generic email address."
730
  msgstr ""
731
 
732
  #. translators: %s - Mailchimp Support URL.
733
+ #: admin/partials/tabs/store_sync.php:231
734
  msgid "Need help? Visit Mailchimp <a href=%s target=_blank>support</a>."
735
  msgstr ""
736
 
737
  #. translators: %s - Mailchimp Privacy Policy URL.
738
+ #: admin/partials/tabs/store_sync.php:232
739
  msgid "By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>."
740
  msgstr ""
741
 
742
+ #: bootstrap.php:240
743
+ msgid "Error retrieving list for double_optin check"
744
+ msgstr ""
745
+
746
  #: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
747
  msgid "Please select an option"
748
  msgstr ""
mailchimp-woocommerce.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Mailchimp for WooCommerce
17
  * Plugin URI: https://mailchimp.com/connect-your-store/
18
  * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff.
19
- * Version: 2.4.1
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
@@ -26,7 +26,7 @@
26
  * Requires at least: 4.9
27
  * Tested up to: 5.4
28
  * WC requires at least: 3.5
29
- * WC tested up to: 4.1
30
  */
31
 
32
  // If this file is called directly, abort.
16
  * Plugin Name: Mailchimp for WooCommerce
17
  * Plugin URI: https://mailchimp.com/connect-your-store/
18
  * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff.
19
+ * Version: 2.4.2
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
26
  * Requires at least: 4.9
27
  * Tested up to: 5.4
28
  * WC requires at least: 3.5
29
+ * WC tested up to: 4.3
30
  */
31
 
32
  // If this file is called directly, abort.
public/js/mailchimp-woocommerce-public.js CHANGED
@@ -33,7 +33,7 @@ function mailchimpHandleBillingEmail(selector) {
33
  var b = void 0 !== a ? a.value : "";
34
  if (!mailchimp_cart.valueEmail(b) || mailchimp_submitted_email === b) { return false; }
35
  mailchimp_cart.setEmail(b);
36
- var c = mailchimp_public_data.ajax_url + "?action=mailchimp_set_user_by_email&email=" + b + "&language=" + mailchimp_public_data.language;
37
  var d = new XMLHttpRequest;
38
  d.open("POST", c, !0);
39
  d.onload = function () {
33
  var b = void 0 !== a ? a.value : "";
34
  if (!mailchimp_cart.valueEmail(b) || mailchimp_submitted_email === b) { return false; }
35
  mailchimp_cart.setEmail(b);
36
+ var c = mailchimp_public_data.ajax_url + "?action=mailchimp_set_user_by_email&email=" + b + "&mc_language=" + mailchimp_public_data.language;
37
  var d = new XMLHttpRequest;
38
  d.open("POST", c, !0);
39
  d.onload = function () {
public/js/mailchimp-woocommerce-public.min.js CHANGED
@@ -1 +1 @@
1
- var mailchimp,mailchimp_cart,mailchimp_billing_email,mailchimp_username_email,mailchimp_registration_email,mailchimp_submitted_email=!1,mailchimpReady=function(e){/in/.test(document.readyState)?setTimeout("mailchimpReady("+e+")",9):e()};function mailchimpGetCurrentUserByHash(e){try{var i=mailchimp_public_data.ajax_url+"?action=mailchimp_get_user_by_hash&hash="+e,a=new XMLHttpRequest;a.open("POST",i,!0),a.onload=function(){if(a.status>=200&&a.status<400){var e=JSON.parse(a.responseText);if(!e)return;mailchimp_cart.valueEmail(e.email)&&mailchimp_cart.setEmail(e.email)}},a.onerror=function(){console.log("mailchimp.get_email_by_hash.request.error",a.responseText)},a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","application/json"),a.send()}catch(e){console.log("mailchimp.get_email_by_hash.error",e)}}function mailchimpHandleBillingEmail(e){try{e||(e="#billing_email");var i=document.querySelector(e),a=void 0!==i?i.value:"";if(!mailchimp_cart.valueEmail(a)||mailchimp_submitted_email===a)return!1;mailchimp_cart.setEmail(a);var t=mailchimp_public_data.ajax_url+"?action=mailchimp_set_user_by_email&email="+a+"&language="+mailchimp_public_data.language,n=new XMLHttpRequest;return n.open("POST",t,!0),n.onload=function(){var e=n.status>=200&&n.status<400,i=e?"mailchimp.handle_billing_email.request.success":"mailchimp.handle_billing_email.request.error";e&&(mailchimp_submitted_email=a),console.log(i,n.responseText)},n.onerror=function(){console.log("mailchimp.handle_billing_email.request.error",n.responseText)},n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Accept","application/json"),n.send(),!0}catch(i){console.log("mailchimp.handle_billing_email.error",i),mailchimp_submitted_email=!1}}!function(){"use strict";var e,i,a,t={extend:function(e,i){for(var a in i||{})i.hasOwnProperty(a)&&(e[a]=i[a]);return e},getQueryStringVars:function(){var e=window.location.search||"",i=[],a={};if((e=e.substr(1)).length)for(var t in i=e.split("&")){var n=i[t];if("string"==typeof n){var l=n.split("="),r=l[0],m=l[1];r.length&&(void 0===a[r]&&(a[r]=[]),a[r].push(m))}}return a},unEscape:function(e){return decodeURIComponent(e)},escape:function(e){return encodeURIComponent(e)},createDate:function(e,i){e||(e=0);var a=new Date,t=i?a.getDate()-e:a.getDate()+e;return a.setDate(t),a},arrayUnique:function(e){for(var i=e.concat(),a=0;a<i.length;++a)for(var t=a+1;t<i.length;++t)i[a]===i[t]&&i.splice(t,1);return i},objectCombineUnique:function(e){for(var i=e[0],a=1;a<e.length;a++){var t=e[a];for(var n in t)i[n]=t[n]}return i}},n=(e=document,(a=function(e,i,t){return 1===arguments.length?a.get(e):a.set(e,i,t)}).get=function(i,t){return e.cookie!==a._cacheString&&a._populateCache(),null==a._cache[i]?t:a._cache[i]},a.defaults={path:"/"},a.set=function(t,n,l){switch(l={path:l&&l.path||a.defaults.path,domain:l&&l.domain||a.defaults.domain,expires:l&&l.expires||a.defaults.expires,secure:l&&l.secure!==i?l.secure:a.defaults.secure},n===i&&(l.expires=-1),typeof l.expires){case"number":l.expires=new Date((new Date).getTime()+1e3*l.expires);break;case"string":l.expires=new Date(l.expires)}return t=encodeURIComponent(t)+"="+(n+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent),t+=l.path?";path="+l.path:"",t+=l.domain?";domain="+l.domain:"",t+=l.expires?";expires="+l.expires.toGMTString():"",t+=l.secure?";secure":"",e.cookie=t,a},a.expire=function(e,t){return a.set(e,i,t)},a._populateCache=function(){a._cache={};try{a._cacheString=e.cookie;for(var t=a._cacheString.split("; "),n=0;n<t.length;n++){var l=t[n].indexOf("="),r=decodeURIComponent(t[n].substr(0,l));l=decodeURIComponent(t[n].substr(l+1)),a._cache[r]===i&&(a._cache[r]=l)}}catch(e){console.log(e)}},a.enabled=function(){var e="1"===a.set("cookies.js","1").get("cookies.js");return a.expire("cookies.js"),e}(),a);mailchimp={storage:n,utils:t},mailchimp_cart=new function(){return this.email_types="input[type=email]",this.regex_email=/^([A-Za-z0-9_+\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,this.current_email=null,this.previous_email=null,this.expireUser=function(){this.current_email=null,mailchimp.storage.expire("mailchimp.cart.current_email")},this.expireSaved=function(){mailchimp.storage.expire("mailchimp.cart.items")},this.setEmail=function(e){if(!this.valueEmail(e))return!1;this.setPreviousEmail(this.getEmail()),mailchimp.storage.set("mailchimp.cart.current_email",this.current_email=e)},this.getEmail=function(){if(this.current_email)return this.current_email;var e=mailchimp.storage.get("mailchimp.cart.current_email",!1);return!(!e||!this.valueEmail(e))&&(this.current_email=e)},this.setPreviousEmail=function(e){if(!this.valueEmail(e))return!1;mailchimp.storage.set("mailchimp.cart.previous_email",this.previous_email=e)},this.valueEmail=function(e){return this.regex_email.test(e)},this}}(),mailchimpReady(function(){if(void 0===e)var e={site_url:document.location.origin,defaulted:!0,ajax_url:document.location.origin+"/wp-admin?admin-ajax.php"};try{var i=mailchimp.utils.getQueryStringVars();void 0!==i.mc_cart_id&&mailchimpGetCurrentUserByHash(i.mc_cart_id),mailchimp_username_email=document.querySelector("#username"),mailchimp_billing_email=document.querySelector("#billing_email"),mailchimp_registration_email=document.querySelector("#reg_email"),mailchimp_billing_email&&(mailchimp_billing_email.onblur=function(){mailchimpHandleBillingEmail("#billing_email")},mailchimp_billing_email.onfocus=function(){mailchimpHandleBillingEmail("#billing_email")}),mailchimp_username_email&&(mailchimp_username_email.onblur=function(){mailchimpHandleBillingEmail("#username")},mailchimp_username_email.onfocus=function(){mailchimpHandleBillingEmail("#username")}),mailchimp_registration_email&&(mailchimp_registration_email.onblur=function(){mailchimpHandleBillingEmail("#reg_email")},mailchimp_registration_email.onfocus=function(){mailchimpHandleBillingEmail("#reg_email")})}catch(e){console.log("mailchimp ready error",e)}});
1
+ var mailchimp,mailchimp_cart,mailchimp_billing_email,mailchimp_username_email,mailchimp_registration_email,mailchimp_submitted_email=!1,mailchimpReady=function(e){/in/.test(document.readyState)?setTimeout("mailchimpReady("+e+")",9):e()};function mailchimpGetCurrentUserByHash(e){try{var i=mailchimp_public_data.ajax_url+"?action=mailchimp_get_user_by_hash&hash="+e,a=new XMLHttpRequest;a.open("POST",i,!0),a.onload=function(){if(a.status>=200&&a.status<400){var e=JSON.parse(a.responseText);if(!e)return;mailchimp_cart.valueEmail(e.email)&&mailchimp_cart.setEmail(e.email)}},a.onerror=function(){console.log("mailchimp.get_email_by_hash.request.error",a.responseText)},a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Accept","application/json"),a.send()}catch(e){console.log("mailchimp.get_email_by_hash.error",e)}}function mailchimpHandleBillingEmail(e){try{e||(e="#billing_email");var i=document.querySelector(e),a=void 0!==i?i.value:"";if(!mailchimp_cart.valueEmail(a)||mailchimp_submitted_email===a)return!1;mailchimp_cart.setEmail(a);var t=mailchimp_public_data.ajax_url+"?action=mailchimp_set_user_by_email&email="+a+"&mc_language="+mailchimp_public_data.language,n=new XMLHttpRequest;return n.open("POST",t,!0),n.onload=function(){var e=n.status>=200&&n.status<400,i=e?"mailchimp.handle_billing_email.request.success":"mailchimp.handle_billing_email.request.error";e&&(mailchimp_submitted_email=a),console.log(i,n.responseText)},n.onerror=function(){console.log("mailchimp.handle_billing_email.request.error",n.responseText)},n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Accept","application/json"),n.send(),!0}catch(i){console.log("mailchimp.handle_billing_email.error",i),mailchimp_submitted_email=!1}}!function(){"use strict";var e,i,a,t={extend:function(e,i){for(var a in i||{})i.hasOwnProperty(a)&&(e[a]=i[a]);return e},getQueryStringVars:function(){var e=window.location.search||"",i=[],a={};if((e=e.substr(1)).length)for(var t in i=e.split("&")){var n=i[t];if("string"==typeof n){var l=n.split("="),r=l[0],m=l[1];r.length&&(void 0===a[r]&&(a[r]=[]),a[r].push(m))}}return a},unEscape:function(e){return decodeURIComponent(e)},escape:function(e){return encodeURIComponent(e)},createDate:function(e,i){e||(e=0);var a=new Date,t=i?a.getDate()-e:a.getDate()+e;return a.setDate(t),a},arrayUnique:function(e){for(var i=e.concat(),a=0;a<i.length;++a)for(var t=a+1;t<i.length;++t)i[a]===i[t]&&i.splice(t,1);return i},objectCombineUnique:function(e){for(var i=e[0],a=1;a<e.length;a++){var t=e[a];for(var n in t)i[n]=t[n]}return i}},n=(e=document,(a=function(e,i,t){return 1===arguments.length?a.get(e):a.set(e,i,t)}).get=function(i,t){return e.cookie!==a._cacheString&&a._populateCache(),null==a._cache[i]?t:a._cache[i]},a.defaults={path:"/"},a.set=function(t,n,l){switch(l={path:l&&l.path||a.defaults.path,domain:l&&l.domain||a.defaults.domain,expires:l&&l.expires||a.defaults.expires,secure:l&&l.secure!==i?l.secure:a.defaults.secure},n===i&&(l.expires=-1),typeof l.expires){case"number":l.expires=new Date((new Date).getTime()+1e3*l.expires);break;case"string":l.expires=new Date(l.expires)}return t=encodeURIComponent(t)+"="+(n+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent),t+=l.path?";path="+l.path:"",t+=l.domain?";domain="+l.domain:"",t+=l.expires?";expires="+l.expires.toGMTString():"",t+=l.secure?";secure":"",e.cookie=t,a},a.expire=function(e,t){return a.set(e,i,t)},a._populateCache=function(){a._cache={};try{a._cacheString=e.cookie;for(var t=a._cacheString.split("; "),n=0;n<t.length;n++){var l=t[n].indexOf("="),r=decodeURIComponent(t[n].substr(0,l));l=decodeURIComponent(t[n].substr(l+1)),a._cache[r]===i&&(a._cache[r]=l)}}catch(e){console.log(e)}},a.enabled=function(){var e="1"===a.set("cookies.js","1").get("cookies.js");return a.expire("cookies.js"),e}(),a);mailchimp={storage:n,utils:t},mailchimp_cart=new function(){return this.email_types="input[type=email]",this.regex_email=/^([A-Za-z0-9_+\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,this.current_email=null,this.previous_email=null,this.expireUser=function(){this.current_email=null,mailchimp.storage.expire("mailchimp.cart.current_email")},this.expireSaved=function(){mailchimp.storage.expire("mailchimp.cart.items")},this.setEmail=function(e){if(!this.valueEmail(e))return!1;this.setPreviousEmail(this.getEmail()),mailchimp.storage.set("mailchimp.cart.current_email",this.current_email=e)},this.getEmail=function(){if(this.current_email)return this.current_email;var e=mailchimp.storage.get("mailchimp.cart.current_email",!1);return!(!e||!this.valueEmail(e))&&(this.current_email=e)},this.setPreviousEmail=function(e){if(!this.valueEmail(e))return!1;mailchimp.storage.set("mailchimp.cart.previous_email",this.previous_email=e)},this.valueEmail=function(e){return this.regex_email.test(e)},this}}(),mailchimpReady(function(){if(void 0===e)var e={site_url:document.location.origin,defaulted:!0,ajax_url:document.location.origin+"/wp-admin?admin-ajax.php"};try{var i=mailchimp.utils.getQueryStringVars();void 0!==i.mc_cart_id&&mailchimpGetCurrentUserByHash(i.mc_cart_id),mailchimp_username_email=document.querySelector("#username"),mailchimp_billing_email=document.querySelector("#billing_email"),mailchimp_registration_email=document.querySelector("#reg_email"),mailchimp_billing_email&&(mailchimp_billing_email.onblur=function(){mailchimpHandleBillingEmail("#billing_email")},mailchimp_billing_email.onfocus=function(){mailchimpHandleBillingEmail("#billing_email")}),mailchimp_username_email&&(mailchimp_username_email.onblur=function(){mailchimpHandleBillingEmail("#username")},mailchimp_username_email.onfocus=function(){mailchimpHandleBillingEmail("#username")}),mailchimp_registration_email&&(mailchimp_registration_email.onblur=function(){mailchimpHandleBillingEmail("#reg_email")},mailchimp_registration_email.onfocus=function(){mailchimpHandleBillingEmail("#reg_email")})}catch(e){console.log("mailchimp ready error",e)}});