MailChimp for WooCommerce - Version 2.2

Version Description

  • plugin reskin
  • support for oauth to Mailchimp
  • fixes sync issues with altered order IDs
  • fixes issues with trashed coupons
Download this release

Release Info

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

Code changes from version 2.1.17 to 2.2

Files changed (33) hide show
  1. README.txt +6 -1
  2. admin/class-mailchimp-woocommerce-admin.php +234 -58
  3. admin/js/mailchimp-woocommerce-admin.js +197 -0
  4. admin/partials/mailchimp-woocommerce-admin-tabs.php +194 -110
  5. admin/partials/tabs/api_key.php +14 -9
  6. admin/partials/tabs/campaign_defaults.php +49 -80
  7. admin/partials/tabs/logs.php +67 -44
  8. admin/partials/tabs/newsletter_settings.php +139 -123
  9. admin/partials/tabs/store_info.php +125 -195
  10. admin/partials/tabs/store_sync.php +140 -27
  11. bootstrap.php +23 -6
  12. includes/api/assets/class-mailchimp-order.php +14 -4
  13. includes/api/class-mailchimp-api.php +67 -16
  14. includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php +1 -1
  15. includes/api/helpers/class-mailchimp-woocommerce-api-currency-codes.php +15 -0
  16. includes/class-mailchimp-woocommerce-activator.php +1 -1
  17. includes/class-mailchimp-woocommerce-deactivation-survey.php +17 -17
  18. includes/class-mailchimp-woocommerce-i18n.php +1 -1
  19. includes/class-mailchimp-woocommerce-privacy.php +3 -3
  20. includes/class-mailchimp-woocommerce-rest-api.php +12 -1
  21. includes/class-mailchimp-woocommerce-service.php +3 -2
  22. includes/class-mailchimp-woocommerce.php +4 -0
  23. includes/processes/class-mailchimp-woocommerce-abstract-sync.php +1 -1
  24. includes/processes/class-mailchimp-woocommerce-cart-update.php +1 -1
  25. includes/processes/class-mailchimp-woocommerce-rest-queue.php +1 -1
  26. includes/processes/class-mailchimp-woocommerce-single-coupon.php +1 -1
  27. includes/processes/class-mailchimp-woocommerce-single-order.php +6 -1
  28. includes/processes/class-mailchimp-woocommerce-single-product.php +1 -1
  29. includes/processes/class-mailchimp-woocommerce-user-submit.php +1 -1
  30. languages/mailchimp-woocommerce-pt_BR.mo +0 -0
  31. languages/mailchimp-woocommerce-pt_BR.po +0 -774
  32. languages/mailchimp-woocommerce.pot +0 -626
  33. mailchimp-woocommerce.php +5 -5
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce,email,workflows,mailchimp
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.3
6
  Tested up to: 5.1
7
- Stable tag: 2.1.17
8
  Requires PHP: 7.0
9
  WC tested up to: 3.5.4
10
  License: GPLv2 or later
@@ -62,6 +62,11 @@ The Mailchimp for WooCommerce supports Wordpress Multi Sites and below are a few
62
  - Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
63
  Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
64
  == Changelog ==
 
 
 
 
 
65
  = 2.1.17 =
66
  * Re add resync button to sync tab, after sync finishes
67
  * Renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.3
6
  Tested up to: 5.1
7
+ Stable tag: 2.2
8
  Requires PHP: 7.0
9
  WC tested up to: 3.5.4
10
  License: GPLv2 or later
62
  - Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
63
  Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
64
  == Changelog ==
65
+ = 2.2 =
66
+ * plugin reskin
67
+ * support for oauth to Mailchimp
68
+ * fixes sync issues with altered order IDs
69
+ * fixes issues with trashed coupons
70
  = 2.1.17 =
71
  * Re add resync button to sync tab, after sync finishes
72
  * Renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
admin/class-mailchimp-woocommerce-admin.php CHANGED
@@ -50,13 +50,49 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
50
  return static::instance();
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Register the stylesheets for the admin area.
55
  *
56
  * @since 1.0.0
57
  */
58
- public function enqueue_styles() {
59
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin.css', array(), $this->version, 'all' );
 
 
 
 
60
  }
61
 
62
  /**
@@ -64,8 +100,11 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
64
  *
65
  * @since 1.0.0
66
  */
67
- public function enqueue_scripts() {
68
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailchimp-woocommerce-admin.js', array( 'jquery' ), $this->version, false );
 
 
 
69
  }
70
 
71
  /**
@@ -165,10 +204,14 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
165
  update_option( $this->plugin_name.'_cart_table_add_index_update', true);
166
  }
167
  else {
168
- $sql = "ALTER TABLE {$wpdb->prefix}mailchimp_carts ADD PRIMARY KEY (email);";
169
- // only update the option if the query returned sucessfully
170
- if ($wpdb->query($sql)) {
171
- update_option( $this->plugin_name.'_cart_table_add_index_update', true);
 
 
 
 
172
  }
173
  }
174
  }
@@ -264,7 +307,6 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
264
  if (empty($active_tab) && $input['woocommerce_settings_save_general']) {
265
  unset($input['woocommerce_settings_save_general']);
266
  $data['store_currency_code'] = (string) $input['store_currency_code'];
267
- //return $this->getOptions();
268
  }
269
 
270
  switch ($active_tab) {
@@ -286,15 +328,26 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
286
  break;
287
 
288
  case 'sync':
289
- // remove all the pointers to be sure
290
- $service = new MailChimp_Service();
291
- $service->removePointers(true, true);
292
-
293
- static::startSync();
294
-
295
- $this->showSyncStartedMessage();
296
-
297
- $this->setData('sync.config.resync', true);
 
 
 
 
 
 
 
 
 
 
 
298
  break;
299
 
300
  case 'logs':
@@ -315,9 +368,9 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
315
 
316
  break;
317
  }
318
-
319
- // if no API is provided, check if the one saved on the database is still valid.
320
- if (!$input['mailchimp_api_key'] && $this->getOption('mailchimp_api_key')) {
321
  // set api key for validation
322
  $input['mailchimp_api_key'] = $this->getOption('mailchimp_api_key');
323
  $api_key_valid = $this->validatePostApiKey($input);
@@ -379,6 +432,61 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
379
  return $data;
380
  }
381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  /**
383
  * STEP 2.
384
  *
@@ -409,7 +517,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
409
 
410
  $data['active_tab'] = 'store_info';
411
 
412
- return array();
413
  }
414
 
415
  $this->setData('validation.store_info', true);
@@ -500,7 +608,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
500
  */
501
  protected function addInvalidAddressAlert()
502
  {
503
- add_settings_error('mailchimp_store_settings', '', __('As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address.', 'mailchimp-woocommerce'));
504
  }
505
 
506
  /**
@@ -508,7 +616,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
508
  */
509
  protected function addInvalidPhoneAlert()
510
  {
511
- add_settings_error('mailchimp_store_settings', '', __('As part of the Mailchimp Terms of Use, we require a valid phone number for your store.', 'mailchimp-woocommerce'));
512
  }
513
 
514
  /**
@@ -516,7 +624,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
516
  */
517
  protected function addInvalidStoreNameAlert()
518
  {
519
- add_settings_error('mailchimp_store_settings', '', __('Mailchimp for WooCommerce requires a Store Name to connect your store.', 'mailchimp-woocommerce'));
520
  }
521
 
522
  /**
@@ -534,12 +642,12 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
534
  'campaign_from_email' => isset($input['campaign_from_email']) && is_email($input['campaign_from_email']) ? $input['campaign_from_email'] : false,
535
  'campaign_subject' => isset($input['campaign_subject']) ? $input['campaign_subject'] : get_option('blogname'),
536
  'campaign_language' => isset($input['campaign_language']) ? $input['campaign_language'] : 'en',
537
- 'campaign_permission_reminder' => isset($input['campaign_permission_reminder']) ? $input['campaign_permission_reminder'] : sprintf(/* translators: %s - plugin name. */esc_html__( 'You were subscribed to the newsletter from %s', $this->plugin_name ),get_option('blogname')),
538
  );
539
 
540
  if (!$this->hasValidCampaignDefaults($data)) {
541
  $this->setData('validation.campaign_defaults', false);
542
-
543
  return array('active_tab' => 'campaign_defaults');
544
  }
545
 
@@ -580,7 +688,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
580
 
581
  $data = array(
582
  'mailchimp_list' => isset($input['mailchimp_list']) ? $input['mailchimp_list'] : $this->getOption('mailchimp_list', ''),
583
- 'newsletter_label' => (isset($input['newsletter_label']) && $input['newsletter_label'] != '') ? wp_kses($input['newsletter_label'], $allowed_html) : $this->getOption('newsletter_label', __('Subscribe to our newsletter', 'mailchimp-woocommerce')),
584
  'mailchimp_auto_subscribe' => isset($input['mailchimp_auto_subscribe']) ? (bool) $input['mailchimp_auto_subscribe'] : $this->getOption('mailchimp_auto_subscribe', '0'),
585
  'mailchimp_checkbox_defaults' => $checkbox,
586
  'mailchimp_checkbox_action' => isset($input['mailchimp_checkbox_action']) ? $input['mailchimp_checkbox_action'] : $this->getOption('mailchimp_checkbox_action', 'woocommerce_after_checkout_billing_form'),
@@ -600,7 +708,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
600
  // sync the store with MC
601
  $this->syncStore(array_merge($this->getOptions(), $data));
602
 
603
- // if there was already a store in mailchimp, use the list ID from mailchimp
604
  if ($this->swapped_list_id) {
605
  $data['mailchimp_list'] = $this->swapped_list_id;
606
  }
@@ -689,7 +797,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
689
  public function hasValidMailChimpList()
690
  {
691
  if (!$this->hasValidApiKey()) {
692
- add_settings_error('mailchimp_api_key', '', __('You must supply your Mailchimp API key to pull the audiences.', 'mailchimp-woocommerce'));
693
  return false;
694
  }
695
 
@@ -803,44 +911,111 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
803
  var endpoint = '<?php echo MailChimp_WooCommerce_Rest_Api::url('sync/stats'); ?>';
804
  var on_sync_tab = '<?php echo (mailchimp_check_if_on_sync_tab() ? 'yes' : 'no')?>';
805
  var sync_status = '<?php echo ((mailchimp_has_started_syncing() && !mailchimp_is_done_syncing()) ? 'historical' : 'current') ?>';
 
 
 
 
806
 
807
  if (on_sync_tab === 'yes') {
808
- var call_mailchimp_for_stats = function () {
809
- jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'visible');
810
  jQuery.get(endpoint, function(response) {
811
  if (response.success) {
812
-
813
  // if the response is now finished - but the original sync status was "historical"
814
  // perform a page refresh because we need the re-sync buttons to show up again.
815
  if (response.has_finished === true && sync_status === 'historical') {
816
- return document.location.reload(true);
817
  }
818
-
819
- jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'hidden');
820
-
821
- jQuery('#mailchimp_product_count').html(response.products_in_mailchimp.toLocaleString(undefined, {
822
- maximumFractionDigits: 0
823
- }));
824
-
825
- jQuery('#mailchimp_order_count').html(response.orders_in_mailchimp.toLocaleString(undefined, {
826
- maximumFractionDigits: 0
827
- }));
828
-
829
- jQuery('#mailchimp_last_updated').html(response.date);
830
-
831
- // only call status again if sync is running.
832
  if (response.has_started && !response.has_finished) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
833
  setTimeout(function() {
834
- call_mailchimp_for_stats();
835
  }, 10000);
 
 
 
 
 
 
 
 
836
  }
837
  }
838
  });
839
  };
840
-
841
- setTimeout(function() {
842
- call_mailchimp_for_stats();
843
- }, 10000);
844
  }
845
  });
846
  </script> <?php
@@ -974,7 +1149,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
974
 
975
  } catch (\Exception $e) {
976
  if (mailchimp_string_contains($e->getMessage(),'woocommerce already exists in the account' )) {
977
- // retrieve mailchimp store using domain
978
  $stores = $this->api()->stores();
979
  //iterate thru stores, find correct store ID and save it to db
980
  foreach ($stores as $mc_store) {
@@ -1037,8 +1212,9 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
1037
  if (isset($data['store_phone']) && $data['store_phone']) {
1038
  $address->setPhone($data['store_phone']);
1039
  }
1040
-
1041
- $address->setCountryCode(WC_Countries::get_base_country());
 
1042
 
1043
  return $address;
1044
  }
@@ -1083,11 +1259,11 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
1083
  */
1084
  private function showSyncStartedMessage()
1085
  {
1086
- $text = __('Starting the sync process...', 'mailchimp-woocommerce').'<br/>'.
1087
  '<p id="sync-status-message">'.
1088
- __('Please hang tight while we work our mojo.', 'mailchimp-woocommerce') .
1089
  ' ' .
1090
- __('Sometimes the sync can take a while, especially on sites with lots of orders and/or products.', 'mailchimp-woocommerce') .
1091
  '</p>';
1092
  add_settings_error('mailchimp-woocommerce_notice', $this->plugin_name, $text, 'updated');
1093
  }
50
  return static::instance();
51
  }
52
 
53
+ /**
54
+ * @return bool
55
+ */
56
+ private function disconnect_store()
57
+ {
58
+ $options = array();
59
+ $options['mailchimp_api_key'] = null;
60
+ $options['active_tab'] = 'api_key';
61
+ $options['mailchimp_list'] = null;
62
+
63
+ update_option('mailchimp-woocommerce-validation.store_info', false);
64
+ update_option('mailchimp-woocommerce-validation.campaign_defaults', false);
65
+ update_option('mailchimp-woocommerce-validation.newsletter_settings', false);
66
+ update_option('mailchimp-woocommerce-sync.started_at', false);
67
+ update_option('mailchimp-woocommerce-sync.completed_at', false);
68
+ update_option('mailchimp-woocommerce-resource-last-updated', false);
69
+
70
+ return $options;
71
+ }
72
+
73
+ /**
74
+ * Tests admin permissions, disconnect action and nonce
75
+ * @return bool
76
+ */
77
+ private function is_disconnecting() {
78
+ return isset($_REQUEST['mailchimp_woocommerce_disconnect_store'])
79
+ && current_user_can( 'manage_options' )
80
+ && $_REQUEST['mailchimp_woocommerce_disconnect_store'] == 1
81
+ && isset($_REQUEST['_disconnect-nonce'])
82
+ && wp_verify_nonce($_REQUEST['_disconnect-nonce'], '_disconnect-nonce-'.mailchimp_get_store_id());
83
+ }
84
+
85
  /**
86
  * Register the stylesheets for the admin area.
87
  *
88
  * @since 1.0.0
89
  */
90
+ public function enqueue_styles($hook) {
91
  wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin.css', array(), $this->version, 'all' );
92
+
93
+ if ( $hook === 'toplevel_page_mailchimp-woocommerce' ) {
94
+ wp_enqueue_style( $this->plugin_name."-settings", plugin_dir_url( __FILE__ ) . 'css/mailchimp-woocommerce-admin-settings.css', array(), $this->version, 'all' );
95
+ }
96
  }
97
 
98
  /**
100
  *
101
  * @since 1.0.0
102
  */
103
+ public function enqueue_scripts($hook) {
104
+ if ( $hook === 'toplevel_page_mailchimp-woocommerce' ) {
105
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mailchimp-woocommerce-admin.js', array( 'jquery', 'swal' ), $this->version, false );
106
+ wp_enqueue_script('swal', "//cdn.jsdelivr.net/npm/sweetalert2@8", '', $this->version, false);
107
+ }
108
  }
109
 
110
  /**
204
  update_option( $this->plugin_name.'_cart_table_add_index_update', true);
205
  }
206
  else {
207
+ //remove table duplicates
208
+ $delete_sql = "DELETE carts_1 FROM {$wpdb->prefix}mailchimp_carts carts_1 INNER JOIN {$wpdb->prefix}mailchimp_carts carts_2 WHERE carts_1.created_at < carts_2.created_at AND carts_1.email = carts_2.email;";
209
+ if ($wpdb->query($delete_sql) !== false) {
210
+ $sql = "ALTER TABLE {$wpdb->prefix}mailchimp_carts ADD PRIMARY KEY (email);";
211
+ // only update the option if the query returned sucessfully
212
+ if ($wpdb->query($sql) !== false) {
213
+ update_option( $this->plugin_name.'_cart_table_add_index_update', true);
214
+ }
215
  }
216
  }
217
  }
307
  if (empty($active_tab) && $input['woocommerce_settings_save_general']) {
308
  unset($input['woocommerce_settings_save_general']);
309
  $data['store_currency_code'] = (string) $input['store_currency_code'];
 
310
  }
311
 
312
  switch ($active_tab) {
328
  break;
329
 
330
  case 'sync':
331
+ // case disconnect
332
+ if ($this->is_disconnecting()) {
333
+ // Disconnect store!
334
+ if ($data = $this->disconnect_store()) {
335
+ add_settings_error('mailchimp_store_settings', '', __('Store Disconnected', 'mc-woocommerce'),'notice-info');
336
+ }
337
+ else {
338
+ $data['active_tab'] = 'sync';
339
+ add_settings_error('mailchimp_store_settings', '', __('Store Disconnect Failed', 'mc-woocommerce'),'notice-warning');
340
+ }
341
+ }
342
+ //case sync
343
+ else {
344
+ // remove all the pointers to be sure
345
+ $service = new MailChimp_Service();
346
+ $service->removePointers(true, true);
347
+ static::startSync();
348
+ $this->showSyncStartedMessage();
349
+ $this->setData('sync.config.resync', true);
350
+ }
351
  break;
352
 
353
  case 'logs':
368
 
369
  break;
370
  }
371
+
372
+ // if no API is provided, check if the one saved on the database is still valid, ** only not if disconnect store is issued **.
373
+ if (!$this->is_disconnecting() && !isset($input['mailchimp_api_key']) && $this->getOption('mailchimp_api_key')) {
374
  // set api key for validation
375
  $input['mailchimp_api_key'] = $this->getOption('mailchimp_api_key');
376
  $api_key_valid = $this->validatePostApiKey($input);
432
  return $data;
433
  }
434
 
435
+ /**
436
+ * Mailchimp OAuth connection start
437
+ */
438
+ public function mailchimp_woocommerce_ajax_oauth_start()
439
+ {
440
+ $secret = uniqid();
441
+ $args = array(
442
+ 'domain' => site_url(),
443
+ 'secret' => $secret,
444
+ );
445
+
446
+ $pload = array(
447
+ 'headers' => array(
448
+ 'Content-type' => 'application/json',
449
+ ),
450
+ 'body' => json_encode($args)
451
+ );
452
+
453
+ $response = wp_remote_post( 'https://woocommerce.mailchimpapp.com/api/start', $pload);
454
+ if ($response['response']['code'] == 201 ){
455
+ set_site_transient('mailchimp-woocommerce-oauth-secret', $secret, 60*60);
456
+ wp_send_json_success($response);
457
+ }
458
+ else wp_send_json_error( $response );
459
+
460
+ }
461
+
462
+ /**
463
+ * Mailchimp OAuth connection finish
464
+ */
465
+ public function mailchimp_woocommerce_ajax_oauth_finish()
466
+ {
467
+ $args = array(
468
+ 'domain' => site_url(),
469
+ 'secret' => get_site_transient('mailchimp-woocommerce-oauth-secret'),
470
+ 'token' => $_POST['token']
471
+ );
472
+
473
+ $pload = array(
474
+ 'headers' => array(
475
+ 'Content-type' => 'application/json',
476
+ ),
477
+ 'body' => json_encode($args)
478
+ );
479
+
480
+ $response = wp_remote_post( 'https://woocommerce.mailchimpapp.com/api/finish', $pload);
481
+ if ($response['response']['code'] == 200 ){
482
+ delete_site_transient('mailchimp-woocommerce-oauth-secret');
483
+ // save api_key? If yes, we can skip api key validation for validatePostApiKey();
484
+ wp_send_json_success($response);
485
+ }
486
+ else wp_send_json_error( $response );
487
+
488
+ }
489
+
490
  /**
491
  * STEP 2.
492
  *
517
 
518
  $data['active_tab'] = 'store_info';
519
 
520
+ return $input;
521
  }
522
 
523
  $this->setData('validation.store_info', true);
608
  */
609
  protected function addInvalidAddressAlert()
610
  {
611
+ add_settings_error('mailchimp_store_settings', '', __('As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address.', 'mc-woocommerce'));
612
  }
613
 
614
  /**
616
  */
617
  protected function addInvalidPhoneAlert()
618
  {
619
+ add_settings_error('mailchimp_store_settings', '', __('As part of the Mailchimp Terms of Use, we require a valid phone number for your store.', 'mc-woocommerce'));
620
  }
621
 
622
  /**
624
  */
625
  protected function addInvalidStoreNameAlert()
626
  {
627
+ add_settings_error('mailchimp_store_settings', '', __('Mailchimp for WooCommerce requires a Store Name to connect your store.', 'mc-woocommerce'));
628
  }
629
 
630
  /**
642
  'campaign_from_email' => isset($input['campaign_from_email']) && is_email($input['campaign_from_email']) ? $input['campaign_from_email'] : false,
643
  'campaign_subject' => isset($input['campaign_subject']) ? $input['campaign_subject'] : get_option('blogname'),
644
  'campaign_language' => isset($input['campaign_language']) ? $input['campaign_language'] : 'en',
645
+ 'campaign_permission_reminder' => isset($input['campaign_permission_reminder']) ? $input['campaign_permission_reminder'] : sprintf(/* translators: %s - plugin name. */esc_html__( 'You were subscribed to the newsletter from %s', 'mc-woocommerce' ),get_option('blogname')),
646
  );
647
 
648
  if (!$this->hasValidCampaignDefaults($data)) {
649
  $this->setData('validation.campaign_defaults', false);
650
+ add_settings_error('mailchimp_list_settings', '', __('One or more fields were not updated', 'mc-woocommerce'));
651
  return array('active_tab' => 'campaign_defaults');
652
  }
653
 
688
 
689
  $data = array(
690
  'mailchimp_list' => isset($input['mailchimp_list']) ? $input['mailchimp_list'] : $this->getOption('mailchimp_list', ''),
691
+ 'newsletter_label' => (isset($input['newsletter_label']) && $input['newsletter_label'] != '') ? wp_kses($input['newsletter_label'], $allowed_html) : $this->getOption('newsletter_label', __('Subscribe to our newsletter', 'mc-woocommerce')),
692
  'mailchimp_auto_subscribe' => isset($input['mailchimp_auto_subscribe']) ? (bool) $input['mailchimp_auto_subscribe'] : $this->getOption('mailchimp_auto_subscribe', '0'),
693
  'mailchimp_checkbox_defaults' => $checkbox,
694
  'mailchimp_checkbox_action' => isset($input['mailchimp_checkbox_action']) ? $input['mailchimp_checkbox_action'] : $this->getOption('mailchimp_checkbox_action', 'woocommerce_after_checkout_billing_form'),
708
  // sync the store with MC
709
  $this->syncStore(array_merge($this->getOptions(), $data));
710
 
711
+ // if there was already a store in Mailchimp, use the list ID from Mailchimp
712
  if ($this->swapped_list_id) {
713
  $data['mailchimp_list'] = $this->swapped_list_id;
714
  }
797
  public function hasValidMailChimpList()
798
  {
799
  if (!$this->hasValidApiKey()) {
800
+ add_settings_error('mailchimp_api_key', '', __('You must supply your Mailchimp API key to pull the audiences.', 'mc-woocommerce'));
801
  return false;
802
  }
803
 
911
  var endpoint = '<?php echo MailChimp_WooCommerce_Rest_Api::url('sync/stats'); ?>';
912
  var on_sync_tab = '<?php echo (mailchimp_check_if_on_sync_tab() ? 'yes' : 'no')?>';
913
  var sync_status = '<?php echo ((mailchimp_has_started_syncing() && !mailchimp_is_done_syncing()) ? 'historical' : 'current') ?>';
914
+
915
+ var promo_rulesProgress = 0;
916
+ var orderProgress = 0;
917
+ var productProgress = 0;
918
 
919
  if (on_sync_tab === 'yes') {
920
+ var call_mailchimp_for_stats = function (showSpinner = false) {
921
+ if (showSpinner ) jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'visible');
922
  jQuery.get(endpoint, function(response) {
923
  if (response.success) {
924
+
925
  // if the response is now finished - but the original sync status was "historical"
926
  // perform a page refresh because we need the re-sync buttons to show up again.
927
  if (response.has_finished === true && sync_status === 'historical') {
928
+ return document.location.reload(true);
929
  }
930
+
 
 
 
 
 
 
 
 
 
 
 
 
 
931
  if (response.has_started && !response.has_finished) {
932
+ jQuery('.sync-stats-audience .sync-loader').css('visibility', 'visible');
933
+ jQuery('.sync-stats-audience .card_count').hide();
934
+
935
+ jQuery('.sync-stats-store .card_count').hide();
936
+
937
+ jQuery('.sync-stats-card .progress-bar-wrapper').show();
938
+
939
+ if (response.promo_rules_page == 'complete') {
940
+ promo_rulesProgress = 100;
941
+ jQuery('#mailchimp_promo_rules_count').html(response.promo_rules_in_mailchimp.toLocaleString(undefined, {maximumFractionDigits: 0})).css('display', 'inline-block');
942
+ jQuery('.sync-stats-card.promo_rules .progress-bar-wrapper').hide();
943
+ } else {
944
+ if (response.promo_rules_in_mailchimp == 0) {
945
+ promo_rulesProgress = 0;
946
+ promo_rulesPartial = "0 / " + response.promo_rules_in_store;
947
+ } else if (response.promo_rules_in_mailchimp == response.promo_rules_in_store) {
948
+ promo_rulesProgress = (100 / Math.ceil(response.promo_rules_in_store / 5) + 1) * (response.promo_rules_page - 1) ;
949
+ promo_rulesPartial = (((response.promo_rules_page - 1) * 5) < response.promo_rules_in_mailchimp ? (response.promo_rules_page - 1) * 5 : response.promo_rules_in_mailchimp) + " / " + response.promo_rules_in_store;
950
+ } else {
951
+ promo_rulesProgress = response.promo_rules_in_mailchimp / response.promo_rules_in_store * 100
952
+ promo_rulesPartial = response.promo_rules_in_mailchimp + " / " + response.promo_rules_in_store;
953
+ }
954
+ if (promo_rulesProgress > 100) promo_rulesProgress = 100;
955
+ jQuery('.mailchimp_promo_rules_count_partial').html(promo_rulesPartial);
956
+ }
957
+ jQuery('.sync-stats-card.promo_rules .progress-bar').width(promo_rulesProgress+"%");
958
+
959
+ if (response.products_page == 'complete') {
960
+ productsProgress = 100;
961
+ jQuery('#mailchimp_product_count').html(response.products_in_mailchimp.toLocaleString(undefined, {maximumFractionDigits: 0})).css('display', 'inline-block');
962
+ jQuery('.sync-stats-card.products .progress-bar-wrapper').hide();
963
+ } else {
964
+ if (response.products_in_mailchimp == 0) {
965
+ productsProgress = 0;
966
+ productsPartial = "0 / " + response.products_in_store;
967
+ } else if (response.products_in_mailchimp == response.products_in_store) {
968
+ productsProgress = (100 / Math.ceil(response.products_in_store / 5) + 1) * (response.products_page - 1) ;
969
+ productsPartial = (((response.products_page - 1) * 5) < response.products_in_mailchimp ? (response.products_page - 1) * 5 : response.products_in_mailchimp) + " / " + response.products_in_store;
970
+ } else {
971
+ productsProgress = response.products_in_mailchimp / response.products_in_store * 100
972
+ productsPartial = response.products_in_mailchimp + " / " + response.products_in_store;
973
+ }
974
+ if (productsProgress > 100) productsProgress = 100;
975
+ jQuery('.mailchimp_product_count_partial').html(productsPartial);
976
+ }
977
+ jQuery('.sync-stats-card.products .progress-bar').width(productsProgress+"%");
978
+
979
+ if (response.orders_page == 'complete') {
980
+ ordersProgress = 100;
981
+ jQuery('#mailchimp_order_count').html(response.orders_in_mailchimp.toLocaleString(undefined, {maximumFractionDigits: 0})).css('display', 'inline-block');
982
+ jQuery('.sync-stats-card.orders .progress-bar-wrapper').hide();
983
+ } else {
984
+ if (response.orders_in_mailchimp == 0) {
985
+ ordersProgress = 0;
986
+ ordersPartial = "0 / " + response.orders_in_store;
987
+ } else if (response.orders_in_mailchimp == response.orders_in_store) {
988
+ ordersProgress = (100 / Math.ceil(response.orders_in_store / 5) + 1) * (response.orders_page - 1) ;
989
+ ordersPartial = (((response.orders_page - 1) * 5) < response.orders_in_mailchimp ? (response.orders_page - 1) * 5 : response.orders_in_mailchimp) + " / " + response.orders_in_store;
990
+ } else {
991
+ ordersProgress = response.orders_in_mailchimp / response.orders_in_store * 100
992
+ ordersPartial = response.orders_in_mailchimp + " / " + response.orders_in_store;
993
+ }
994
+ if (ordersProgress > 100) ordersProgress = 100;
995
+ jQuery('.mailchimp_order_count_partial').html(ordersPartial);
996
+ }
997
+ jQuery('.sync-stats-card.orders .progress-bar').width(ordersProgress+"%");
998
+
999
+ jQuery('#mailchimp_last_updated').html(response.date);
1000
+
1001
+ // only call status again if sync is running.
1002
  setTimeout(function() {
1003
+ call_mailchimp_for_stats(true);
1004
  }, 10000);
1005
+ jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'hidden');
1006
+ }
1007
+ else {
1008
+ jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'hidden');
1009
+ jQuery('.sync-stats-card .progress-bar-wrapper').hide();
1010
+ jQuery('#mailchimp_order_count').css('display', 'inline-block');
1011
+ jQuery('#mailchimp_product_count').css('display', 'inline-block');
1012
+ jQuery('#mailchimp_promo_rules_count').css('display', 'inline-block');
1013
  }
1014
  }
1015
  });
1016
  };
1017
+
1018
+ call_mailchimp_for_stats();
 
 
1019
  }
1020
  });
1021
  </script> <?php
1149
 
1150
  } catch (\Exception $e) {
1151
  if (mailchimp_string_contains($e->getMessage(),'woocommerce already exists in the account' )) {
1152
+ // retrieve Mailchimp store using domain
1153
  $stores = $this->api()->stores();
1154
  //iterate thru stores, find correct store ID and save it to db
1155
  foreach ($stores as $mc_store) {
1212
  if (isset($data['store_phone']) && $data['store_phone']) {
1213
  $address->setPhone($data['store_phone']);
1214
  }
1215
+
1216
+ $woo_countries = new WC_Countries();
1217
+ $address->setCountryCode($woo_countries->get_base_country());
1218
 
1219
  return $address;
1220
  }
1259
  */
1260
  private function showSyncStartedMessage()
1261
  {
1262
+ $text = __('Starting the sync process...', 'mc-woocommerce').'<br/>'.
1263
  '<p id="sync-status-message">'.
1264
+ __('The plugin has started the initial sync with your store, and the process will work in the background automatically.', 'mc-woocommerce') .
1265
  ' ' .
1266
+ __('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.', 'mc-woocommerce') .
1267
  '</p>';
1268
  add_settings_error('mailchimp-woocommerce_notice', $this->plugin_name, $text, 'updated');
1269
  }
admin/js/mailchimp-woocommerce-admin.js CHANGED
@@ -28,5 +28,202 @@
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
 
 
 
 
 
 
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  })( jQuery );
28
  * Although scripts in the WordPress core, Plugins and Themes may be
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
+ $( window ).load(function() {
32
+ // show/hide wizard tabs tooltips
33
+ $('a.wizard-tab').hover(function (e) {
34
+ e.stopPropagation();
35
+ $('.wizard-tab-tooltip').hide();
36
+ $(this).find('.wizard-tab-tooltip').show();
37
 
38
+ });
39
+
40
+ $('a.wizard-tab').mouseleave(function (e) {
41
+ e.stopPropagation();
42
+ $('.wizard-tab-tooltip').hide();
43
+ $('.wizard-tab-active .wizard-tab-tooltip').show();
44
+ });
45
+
46
+ // show/hide optional settings
47
+ var optionalSettings = false;
48
+ $('.optional-settings-button').click(function () {
49
+ if (optionalSettings) {
50
+ $('.optional-settings-content').slideUp();
51
+ $(this).find('span').removeClass('active');
52
+ optionalSettings = false;
53
+ } else {
54
+ $('.optional-settings-content').slideDown();
55
+ $(this).find('span').addClass('active');
56
+ optionalSettings = true;
57
+ }
58
+
59
+
60
+ });
61
+
62
+ // copy log button
63
+ $('.mc-woocommerce-copy-log-button').click(function (e) {
64
+ e.preventDefault();
65
+ var copyText = $('#log-text');
66
+ var $temp = $("<textarea>");
67
+ $("body").append($temp);
68
+ $temp.val($(copyText).text()).select();
69
+ /* Copy the text inside the text field */
70
+ document.execCommand("copy");
71
+ $temp.remove();
72
+ });
73
+
74
+ /*
75
+ * Shows dialog on store disconnect
76
+ * Change wp_http_referer URL in case of store disconnect
77
+ */
78
+ var mailchimp_woocommerce_disconnect_done = false;
79
+ $('#mailchimp_woocommerce_disconnect').click(function (e){
80
+ // this is to trigger the event even after preventDefault() is issued.
81
+ if (mailchimp_woocommerce_disconnect_done) {
82
+ mailchimp_woocommerce_disconnect_done = false; // reset flag
83
+ return; // let the event bubble away
84
+ }
85
+
86
+ e.preventDefault();
87
+
88
+ const swalWithBootstrapButtons = Swal.mixin({
89
+ customClass: {
90
+ confirmButton: 'button button-primary tab-content-submit disconnect-button',
91
+ cancelButton: 'button button-default mc-woocommerce-resync-button disconnect-button'
92
+ },
93
+ buttonsStyling: false,
94
+ })
95
+
96
+ swalWithBootstrapButtons.fire({
97
+ title: 'Are you sure?',
98
+ text: "You are about to disconnect your store from Mailchimp.",
99
+ type: 'warning',
100
+ showCancelButton: true,
101
+ confirmButtonText: 'Yes, disconnect.',
102
+ cancelButtonText: 'No, cancel!',
103
+ reverseButtons: true
104
+ }).then((result) => {
105
+ if (result.value) {
106
+ var query = window.location.href.match(/^(.*)\&/);
107
+ if (query){
108
+ history.replaceState({}, "", query[1]);
109
+ $('input[name=_wp_http_referer]').val(query[1]);
110
+ }
111
+ mailchimp_woocommerce_disconnect_done = true;
112
+ e.target.click();
113
+ }
114
+ })
115
+ });
116
+
117
+ /*
118
+ * Change wp_http_referer URL in case of in-wizard tab change
119
+ */
120
+ var mailchimp_woocommerce_submit_done = false;
121
+ $('#mailchimp_woocommerce_options .tab-content-submit:not(.oauth-connect)').click(function(e){
122
+ // this is to trigger the event even after preventDefault() is issued.
123
+ if (mailchimp_woocommerce_submit_done) {
124
+ mailchimp_woocommerce_submit_done = false; // reset flag
125
+ return; // let the event bubble away
126
+ }
127
+ e.preventDefault();
128
+
129
+ if ($('input[name=mailchimp_woocommerce_wizard_on]').val() == 1) {
130
+ var query = window.location.href.match(/^(.*)\&/);
131
+ if (query){
132
+ history.replaceState({}, "", query[1]);
133
+ $('input[name=_wp_http_referer]').val(query[1]);
134
+ }
135
+ }
136
+ mailchimp_woocommerce_submit_done = true;
137
+ e.target.click();
138
+
139
+ });
140
+
141
+ // Mailchimp OAuth connection (tab "connect")
142
+ $('#mailchimp_woocommerce_options #mailchimp-oauth-connect').click(function(e){
143
+ var token = '';
144
+ var startData = {action:'mailchimp_woocommerce_oauth_start'};
145
+ $('#mailchimp-oauth-api-key-valid').hide();
146
+ $('#mailchimp-oauth-waiting').show();
147
+ $.post(ajaxurl, startData, function(startResponse) {
148
+ if (startResponse.success) {
149
+ token = JSON.parse(startResponse.data.body).token;
150
+ var domain = 'https://woocommerce.mailchimpapp.com';
151
+ var options = {
152
+ path: domain+'/auth/start/'+token,
153
+ windowName: 'Mailchimp For WooCommerce OAuth',
154
+ height: 500,
155
+ width: 800,
156
+ };
157
+ var left = (screen.width - options.width) / 2;
158
+ var top = (screen.height - options.height) / 4;
159
+ var window_options = 'toolbar=no, location=no, directories=no, ' +
160
+ 'status=no, menubar=no, scrollbars=no, resizable=no, ' +
161
+ 'copyhistory=no, width=' + options.width +
162
+ ', height=' + options.height + ', top=' + top + ', left=' + left +
163
+ 'domain='+domain.replace('https://', '');
164
+
165
+ // open Mailchimp OAuth popup
166
+ var popup = window.open(options.path, options.windowName, window_options);
167
+
168
+ // While the popup is open, wait. when closed, try to get status=accepted
169
+ var oauthInterval = window.setInterval(function(){
170
+ if (popup.closed) {
171
+ // hide/show messages
172
+ $('#mailchimp-oauth-waiting').hide();
173
+ $('#mailchimp-oauth-connecting').show();
174
+
175
+ // clear interval
176
+ window.clearInterval(oauthInterval);
177
+
178
+ // ping status to check if auth was accepted
179
+ $.post(domain + '/api/status/' + token).done(function(statusData){
180
+ if (statusData.status == "accepted") {
181
+
182
+ // call for finish endpoint to retrieve access_token
183
+ var finishData = {
184
+ action: 'mailchimp_woocommerce_oauth_finish',
185
+ token: token
186
+ }
187
+
188
+ $.post(ajaxurl, finishData, function(finishResponse) {
189
+ if (finishResponse.success) {
190
+ // hide/show messages
191
+ $('#mailchimp-oauth-connecting').hide();
192
+ $('#mailchimp-oauth-connected').show();
193
+
194
+ // get access_token from finishResponse and fill api-key field value including data_center
195
+ var accessToken = JSON.parse(finishResponse.data.body).access_token + '-' + JSON.parse(finishResponse.data.body).data_center
196
+ $('#mailchimp-woocommerce-mailchimp-api-key').val(accessToken);
197
+
198
+ // always go to next step on success, so change url of wp_http_referer
199
+ if ($('input[name=mailchimp_woocommerce_wizard_on]').val() == 1) {
200
+ var query = window.location.href.match(/^(.*)\&/);
201
+ if (query){
202
+ history.replaceState({}, "", query[1]);
203
+ $('input[name=_wp_http_referer]').val(query[1]);
204
+ }
205
+ }
206
+ // submit api_key/access_token form
207
+ $('#mailchimp_woocommerce_options').submit();
208
+ }
209
+ else {
210
+ console.log('Error calling OAuth finish endpoint. Data:', finishResponse);
211
+ }
212
+ });
213
+ }
214
+ else {
215
+ console.log('Error calling OAuth status endpoint. Data:', statusData);
216
+ }
217
+ });
218
+ }
219
+ }, 250);
220
+
221
+ }
222
+ else {
223
+ console.log("start response:",startResponse);
224
+ }
225
+ });
226
+ });
227
+ });
228
+
229
  })( jQuery );
admin/partials/mailchimp-woocommerce-admin-tabs.php CHANGED
@@ -1,16 +1,18 @@
1
  <?php
2
- $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'api_key';
3
- $is_mailchimp_post = isset($_POST['mailchimp_woocommerce_settings_hidden']) && $_POST['mailchimp_woocommerce_settings_hidden'] === 'Y';
4
-
5
  $handler = MailChimp_WooCommerce_Admin::connect();
6
 
7
- //Grab all options for this particular tab we're viewing.
8
  $options = get_option($this->plugin_name, array());
9
 
10
- if (!isset($_GET['tab']) && isset($options['active_tab'])) {
11
- $active_tab = $options['active_tab'];
 
 
12
  }
13
 
 
 
14
  $show_sync_tab = isset($_GET['resync']) ? $_GET['resync'] === '1' : false;
15
 
16
  // if we have a transient set to start the sync on this page view, initiate it now that the values have been saved.
@@ -22,6 +24,7 @@ if (!$show_sync_tab && (bool) get_site_transient('mailchimp_woocommerce_start_sy
22
  $show_campaign_defaults = true;
23
  $has_valid_api_key = false;
24
  $allow_new_list = true;
 
25
  $clicked_sync_button = $is_mailchimp_post && $active_tab == 'sync';
26
  $has_api_error = isset($options['api_ping_error']) && !empty($options['api_ping_error']) ? $options['api_ping_error'] : null;
27
 
@@ -40,49 +43,28 @@ if (isset($options['mailchimp_api_key'])) {
40
  if ((bool) $this->getData('sync.started_at', false)) {
41
  $show_sync_tab = true;
42
  }
 
 
 
 
 
 
43
  }
44
  } catch (\Exception $e) {
45
  $has_api_error = $e->getMessage().' on '.$e->getLine().' in '.$e->getFile();
46
  }
47
  }
48
-
 
 
49
  if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue_listen')) {
50
  mailchimp_call_rest_api_queue_manually();
51
  }
52
 
53
  ?>
54
 
55
- <style>
56
- #sync-status-message strong {
57
- font-weight:inherit;
58
- }
59
- #log-viewer {
60
- background: #fff;
61
- border: 1px solid #e5e5e5;
62
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
63
- padding: 5px 20px;
64
- }
65
- #log-viewer-select {
66
- padding: 10px 0 8px;
67
- line-height: 28px;
68
- }
69
- #log-viewer pre {
70
- font-family: monospace;
71
- white-space: pre-wrap;
72
- }
73
- user agent stylesheet
74
- pre, xmp, plaintext, listing {
75
- display: block;
76
- font-family: monospace;
77
- white-space: pre;
78
- margin: 1em 0px;
79
- }
80
- </style>
81
-
82
-
83
-
84
  <?php if (!defined('PHP_VERSION_ID') || (PHP_VERSION_ID < 70000)): ?>
85
- <div data-dismissible="notice-php-version" class="error notice notice-error is-dismissible">
86
  <p><?php esc_html_e('Mailchimp says: Please upgrade your PHP version to a minimum of 7.0', 'mc-woocommerce'); ?></p>
87
  </div>
88
  <?php endif; ?>
@@ -93,83 +75,185 @@ if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue
93
  </div>
94
  <?php endif; ?>
95
 
96
- <?php settings_errors(); ?>
 
 
 
 
 
97
 
98
  <!-- Create a header in the default WordPress 'wrap' container -->
99
- <div class="wrap">
100
- <div id="icon-themes" class="icon32"></div>
101
- <h2><?= __('Mailchimp for Woocommerce Settings', 'mc-woocommerce');?></h2>
102
-
103
- <h2 class="nav-tab-wrapper">
104
- <a href="?page=mailchimp-woocommerce&tab=api_key" class="nav-tab <?php echo $active_tab == 'api_key' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Connect', 'mc-woocommerce');?></a>
105
- <?php if($has_valid_api_key): ?>
106
- <a href="?page=mailchimp-woocommerce&tab=store_info" class="nav-tab <?php echo $active_tab == 'store_info' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Store Settings', 'mc-woocommerce');?></a>
107
- <?php if ($handler->hasValidStoreInfo()) : ?>
108
- <?php if($show_campaign_defaults): ?>
109
- <a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="nav-tab <?php echo $active_tab == 'campaign_defaults' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Defaults', 'mc-woocommerce');?></a>
110
- <?php endif; ?>
111
- <?php if($handler->hasValidCampaignDefaults()): ?>
112
- <a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="nav-tab <?php echo $active_tab == 'newsletter_settings' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Settings', 'mc-woocommerce');?></a>
113
- <?php endif; ?>
114
- <?php if($show_sync_tab): ?>
115
- <a href="?page=mailchimp-woocommerce&tab=sync" class="nav-tab <?php echo $active_tab == 'sync' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Sync', 'mc-woocommerce');?></a>
116
- <a href="?page=mailchimp-woocommerce&tab=logs" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Logs', 'mc-woocommerce');?></a>
117
- <?php endif; ?>
118
- <?php endif;?>
119
- <?php endif; ?>
120
- </h2>
121
-
122
- <form method="post" name="cleanup_options" action="options.php">
123
-
124
- <input type="hidden" name="mailchimp_woocommerce_settings_hidden" value="Y">
125
-
126
  <?php
127
- if (!$clicked_sync_button) {
128
- settings_fields($this->plugin_name);
129
- do_settings_sections($this->plugin_name);
130
- include('tabs/notices.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
  ?>
133
-
134
- <input type="hidden" name="<?php echo $this->plugin_name; ?>[mailchimp_active_tab]" value="<?php echo esc_attr($active_tab); ?>"/>
135
-
136
- <?php if ($active_tab == 'api_key' ): ?>
137
- <?php include_once 'tabs/api_key.php'; ?>
138
- <?php endif; ?>
139
-
140
- <?php if ($active_tab == 'store_info' && $has_valid_api_key): ?>
141
- <?php include_once 'tabs/store_info.php'; ?>
142
- <?php endif; ?>
143
-
144
- <?php if ($active_tab == 'campaign_defaults' ): ?>
145
- <?php include_once 'tabs/campaign_defaults.php'; ?>
146
- <?php endif; ?>
147
-
148
- <?php if ($active_tab == 'newsletter_settings' ): ?>
149
- <?php include_once 'tabs/newsletter_settings.php'; ?>
150
- <?php endif; ?>
151
-
152
- <?php if ($active_tab == 'sync' && $show_sync_tab): ?>
153
- <?php include_once 'tabs/store_sync.php'; ?>
154
- <?php endif; ?>
155
-
156
- <?php if ($active_tab == 'logs' && $show_sync_tab): ?>
157
- <?php include_once 'tabs/logs.php'; ?>
158
- <?php endif; ?>
159
-
160
- <?php if ($active_tab !== 'sync' && $active_tab !== 'logs') submit_button(__('Save all changes'), 'primary','submit', TRUE); ?>
161
-
162
- </form>
163
-
164
- <?php if ($active_tab == 'sync'): ?>
165
- <h2 style="padding-top: 1em;"><?php esc_html_e('More Information', 'mc-woocommerce'); ?></h2>
166
- <ul>
167
- <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-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/issues/158' ) );?></li>
168
- <li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', 'mc-woocommerce');?></li>
169
- <li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help to connect your store? Visit the Mailchimp <a href=%s target=_blank>Knowledge Base</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/' ) );?></li>
170
- <li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Want to tell us how we\'re doing? <a href=%s target=_blank>Leave a review on Wordpress.org</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
171
- <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-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
172
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  <?php endif; ?>
174
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  </div><!-- /.wrap -->
1
  <?php
2
+ // Grab plugin admin object
 
 
3
  $handler = MailChimp_WooCommerce_Admin::connect();
4
 
5
+ // Grab all options for this particular tab we're viewing.
6
  $options = get_option($this->plugin_name, array());
7
 
8
+ $active_tab = isset($_GET['tab']) ? $_GET['tab'] : (isset($options['active_tab']) ? $options['active_tab'] : 'api_key');
9
+
10
+ if (!mailchimp_is_configured()) {
11
+ if ($active_tab == 'sync' || $active_tab == 'logs' ) isset($options['active_tab']) ? $options['active_tab'] : 'api_key';
12
  }
13
 
14
+ $is_mailchimp_post = isset($_POST['mailchimp_woocommerce_settings_hidden']) && $_POST['mailchimp_woocommerce_settings_hidden'] === 'Y';
15
+
16
  $show_sync_tab = isset($_GET['resync']) ? $_GET['resync'] === '1' : false;
17
 
18
  // if we have a transient set to start the sync on this page view, initiate it now that the values have been saved.
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;
30
 
43
  if ((bool) $this->getData('sync.started_at', false)) {
44
  $show_sync_tab = true;
45
  }
46
+
47
+ //display wizard if not all steps are complete
48
+ if ($show_sync_tab && $this->getData('validation.store_info', false) && $this->getData('validation.campaign_defaults', false) && $this->getData('validation.newsletter_settings', false)) {
49
+ $show_wizard = false;
50
+ }
51
+
52
  }
53
  } catch (\Exception $e) {
54
  $has_api_error = $e->getMessage().' on '.$e->getLine().' in '.$e->getFile();
55
  }
56
  }
57
+ else {
58
+ $active_tab = 'api_key';
59
+ }
60
  if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue_listen')) {
61
  mailchimp_call_rest_api_queue_manually();
62
  }
63
 
64
  ?>
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <?php if (!defined('PHP_VERSION_ID') || (PHP_VERSION_ID < 70000)): ?>
67
+ <div data-dismissible="notice-php-version" class="error notice notice-error">
68
  <p><?php esc_html_e('Mailchimp says: Please upgrade your PHP version to a minimum of 7.0', 'mc-woocommerce'); ?></p>
69
  </div>
70
  <?php endif; ?>
75
  </div>
76
  <?php endif; ?>
77
 
78
+ <?php
79
+ $settings_errors = get_settings_errors();
80
+ if (!$show_wizard || ($show_wizard && isset($settings_errors[0]) && $settings_errors[0]['type'] != 'updated' )) {
81
+ settings_errors();
82
+ }
83
+ ?>
84
 
85
  <!-- Create a header in the default WordPress 'wrap' container -->
86
+ <div class="mc-woocommerce-settings wrap">
87
+
88
+ <svg width="46" height="49" viewBox="0 0 46 49" fill="none" xmlns="http://www.w3.org/2000/svg">
89
+ <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"/>
90
+ <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"/>
91
+ <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"/>
92
+ <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"/>
93
+ <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"/>
94
+ <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"/>
95
+ <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"/>
96
+ </svg>
97
+
98
+ <p class="mc-woocommerce-settings-subtitles">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  <?php
100
+
101
+ $allowed_html = array(
102
+ 'br' => array()
103
+ );
104
+
105
+ if ($active_tab == 'api_key' ) {
106
+ wp_kses(_e('Add Mailchimp for WooCommerce to build custom segments,<br/>send automations, and track purchase activity in Mailchimp', 'mc-woocommerce'), $allowed_html);
107
+ }
108
+
109
+ if ($active_tab == 'store_info' && $has_valid_api_key) {
110
+ wp_kses(_e('Please provide a bit of information<br/>about your WooCommerce store', 'mc-woocommerce'), $allowed_html);
111
+ }
112
+
113
+ if ($active_tab == 'campaign_defaults' ) {
114
+ wp_kses(_e('Please fill out the audience default<br/>campaign information', 'mc-woocommerce'), $allowed_html);
115
+ }
116
+
117
+ if ($active_tab == 'newsletter_settings' ) {
118
+ wp_kses(_e('Please apply your audience settings. If you don’t<br/>have an audience, you can choose to create one', 'mc-woocommerce'), $allowed_html);
119
+ }
120
+ if ($active_tab == 'sync' && $show_sync_tab) {
121
+ wp_kses(_e('Connect your WooCommerce store to a<br/>Mailchimp audience in less than 60 seconds', 'mc-woocommerce'), $allowed_html);
122
+ }
123
+
124
+ if ($active_tab == 'logs' && $show_sync_tab) {
125
+ wp_kses(_e('Log events from the <br/>Mailchimp plugin', 'mc-woocommerce'), $allowed_html);
126
  }
127
  ?>
128
+ </p>
129
+ <?php if($show_wizard): ?>
130
+ <div class="nav-wizard-wrapper">
131
+ <a href="?page=mailchimp-woocommerce&tab=api_key" class="wizard-tab <?php echo $active_tab == 'api_key' ? 'wizard-tab-active' : ''; ?>">
132
+ <div class="wizard-tab-tooltip wizard-tab-tooltip-api-key "><?= esc_html_e('Connect', 'mc-woocommerce');?>
133
+ <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
134
+ <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
135
+ </svg>
136
+ </div>
137
+ </a>
138
+
139
+ <?php if ($has_valid_api_key) : ?>
140
+ <a href="?page=mailchimp-woocommerce&tab=store_info" class="wizard-tab <?php echo $active_tab == 'store_info' ? 'wizard-tab-active' : ''; ?>">
141
+ <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Store Settings', 'mc-woocommerce');?>
142
+ <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
143
+ <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
144
+ </svg>
145
+ </div>
146
+ </a>
147
+ <?php else: ?>
148
+ <span class="wizard-tab"></span>
149
+ <?php endif; ?>
150
+
151
+ <?php if ($handler->hasValidStoreInfo() && $show_campaign_defaults && $this->getData('validation.store_info', false)) : ?>
152
+ <a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="wizard-tab <?php echo $active_tab == 'campaign_defaults' ? 'wizard-tab-active' : ''; ?>">
153
+ <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Defaults', 'mc-woocommerce');?>
154
+ <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
155
+ <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
156
+ </svg>
157
+ </div>
158
+ </a>
159
+ <?php else: ?>
160
+ <span class="wizard-tab"></span>
161
+ <?php endif; ?>
162
+
163
+ <?php if ($handler->hasValidCampaignDefaults() && $this->getData('validation.campaign_defaults', false)) : ?>
164
+ <a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="wizard-tab <?php echo $active_tab == 'newsletter_settings' ? 'wizard-tab-active' : ''; ?>">
165
+ <div class="wizard-tab-tooltip wizard-tab-tooltip-store-info "><?= esc_html_e('Audience Settings', 'mc-woocommerce');?>
166
+ <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg">
167
+ <rect x="14.498" width="20" height="20" transform="rotate(45 14.498 0)" fill="white"/>
168
+ </svg>
169
+ </div>
170
+ </a>
171
+ <?php else: ?>
172
+ <span class="wizard-tab"></span>
173
+ <?php endif; ?>
174
+ </div>
175
+ <?php else: ?>
176
+ <div class="nav-tab-wrapper">
177
+ <?php if($has_valid_api_key): ?>
178
+ <?php if ($active_tab == 'api_key'): ?>
179
+ <a href="?page=mailchimp-woocommerce&tab=api_key" class="nav-tab <?php echo $active_tab == 'api_key' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Connect', 'mc-woocommerce');?></a>
180
+ <?php endif ;?>
181
+ <a href="?page=mailchimp-woocommerce&tab=sync" class="nav-tab <?php echo $active_tab == 'sync' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Overview', 'mc-woocommerce');?></a>
182
+ <a href="?page=mailchimp-woocommerce&tab=store_info" class="nav-tab <?php echo $active_tab == 'store_info' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Store Settings', 'mc-woocommerce');?></a>
183
+ <?php if ($handler->hasValidStoreInfo()) : ?>
184
+ <?php if($show_campaign_defaults): ?>
185
+ <a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="nav-tab <?php echo $active_tab == 'campaign_defaults' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Defaults', 'mc-woocommerce');?></a>
186
+ <?php endif; ?>
187
+ <?php if($handler->hasValidCampaignDefaults()): ?>
188
+ <a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="nav-tab <?php echo $active_tab == 'newsletter_settings' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Settings', 'mc-woocommerce');?></a>
189
+ <?php endif; ?>
190
+ <?php endif;?>
191
+ <a href="?page=mailchimp-woocommerce&tab=logs" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Logs', 'mc-woocommerce');?></a>
192
+ <?php endif; ?>
193
+ </div>
194
  <?php endif; ?>
195
+ <h2><!-- Needed to show the notifications on the right spot --></h2>
196
+
197
+ <?php if ($active_tab != 'sync'): ?>
198
+ <div class="tab-content-wrapper">
199
+ <?php endif; ?>
200
+ <form id="mailchimp_woocommerce_options" method="post" name="cleanup_options" action="options.php">
201
+ <div class="box">
202
+ <?php
203
+ if ($active_tab !== 'api_key' && $active_tab !== 'sync') {
204
+ if ($active_tab == 'newsletter_settings' && !mailchimp_is_configured()) {
205
+ $submit_button_label = __('Start sync','mc-woocommerce');
206
+ }
207
+ else $submit_button_label = !$show_wizard ? __('Save all changes') : __('Next');
208
+ submit_button($submit_button_label, 'primary tab-content-submit','mailchimp_submit', TRUE);
209
+ }
210
+ ?>
211
+
212
+ <?php if ($show_wizard) : ?>
213
+ <input type="hidden" name="mailchimp_woocommerce_wizard_on" value=1>
214
+ <?php endif; ?>
215
+
216
+ <input type="hidden" name="mailchimp_woocommerce_settings_hidden" value="Y">
217
+
218
+ <?php
219
+ if (!$clicked_sync_button) {
220
+ settings_fields($this->plugin_name);
221
+ do_settings_sections($this->plugin_name);
222
+ include('tabs/notices.php');
223
+ }
224
+ ?>
225
+ </div>
226
+
227
+
228
+ <input type="hidden" name="<?php echo $this->plugin_name; ?>[mailchimp_active_tab]" value="<?php echo esc_attr($active_tab); ?>"/>
229
+
230
+ <?php if ($active_tab == 'api_key' ): ?>
231
+ <?php include_once 'tabs/api_key.php'; ?>
232
+ <?php endif; ?>
233
+
234
+ <?php if ($active_tab == 'store_info' && $has_valid_api_key): ?>
235
+ <?php include_once 'tabs/store_info.php'; ?>
236
+ <?php endif; ?>
237
+
238
+ <?php if ($active_tab == 'campaign_defaults' ): ?>
239
+ <?php include_once 'tabs/campaign_defaults.php'; ?>
240
+ <?php endif; ?>
241
+
242
+ <?php if ($active_tab == 'newsletter_settings' ): ?>
243
+ <?php include_once 'tabs/newsletter_settings.php'; ?>
244
+ <?php endif; ?>
245
+
246
+ <?php if ($active_tab == 'sync' && $show_sync_tab): ?>
247
+ <?php include_once 'tabs/store_sync.php'; ?>
248
+ <?php endif; ?>
249
+
250
+ <?php if ($active_tab == 'logs' && $show_sync_tab): ?>
251
+ <?php include_once 'tabs/logs.php'; ?>
252
+ <?php endif; ?>
253
+
254
+ </form>
255
+ <?php if ($active_tab != 'sync'): ?>
256
+ </div>
257
+ <?php endif; ?>
258
+
259
  </div><!-- /.wrap -->
admin/partials/tabs/api_key.php CHANGED
@@ -1,15 +1,20 @@
1
  <input type="hidden" name="mailchimp_active_settings_tab" value="api_key"/>
2
 
3
- <h2 style="padding-top: 1em;"><?php esc_html_e('API Information', $this->plugin_name);?></h2>
4
- <p><?php esc_html_e('To find your Mailchimp API key, log into your account settings > Extras > API keys. From there, either grab an existing key or generate a new one for your WooCommerce store.', $this->plugin_name);?></p>
5
-
6
  <!-- remove some meta and generators from the <head> -->
7
- <fieldset>
8
  <legend class="screen-reader-text">
9
- <span><?php esc_html_e('Mailchimp API Key', $this->plugin_name);?></span>
10
  </legend>
11
- <label for="<?php echo $this->plugin_name; ?>-mailchimp-api-key">
12
- <input style="width: 30%;" type="password" id="<?php echo $this->plugin_name; ?>-mailchimp-api-key" name="<?php echo $this->plugin_name; ?>[mailchimp_api_key]" value="<?php echo isset($options['mailchimp_api_key']) ? $options['mailchimp_api_key'] : '' ?>" />
13
- <span><?php esc_html_e('Enter your Mailchimp API key.', $this->plugin_name); ?></span>
14
- </label>
 
 
 
 
 
 
 
15
  </fieldset>
 
1
  <input type="hidden" name="mailchimp_active_settings_tab" value="api_key"/>
2
 
 
 
 
3
  <!-- remove some meta and generators from the <head> -->
4
+ <fieldset class="full">
5
  <legend class="screen-reader-text">
6
+ <span><?php esc_html_e('Connect your store to Mailchimp', 'mc-woocommerce');?></span>
7
  </legend>
8
+
9
+
10
+ <a id="mailchimp-oauth-connect" class="button button-primary tab-content-submit oauth-connect"><?php $has_valid_api_key ? esc_html_e('Reconnect', 'mc-woocommerce') : esc_html_e('Connect', 'mc-woocommerce');?></a>
11
+ <h4><?php esc_html_e('Connect your store to Mailchimp', 'mc-woocommerce'); ?></h4>
12
+ <input type="hidden" id="<?php echo $this->plugin_name; ?>-mailchimp-api-key" name="<?php echo $this->plugin_name; ?>[mailchimp_api_key]" value="<?php echo isset($options['mailchimp_api_key']) ? $options['mailchimp_api_key'] : '' ?>" required/>
13
+ <?php if ($has_valid_api_key) :?>
14
+ <p id="mailchimp-oauth-api-key-valid"><?php esc_html_e('Already connected. You can reconnect with another Mailchimp account if you want.' , 'mc-woocommerce');?></p>
15
+ <?php endif;?>
16
+ <p id="mailchimp-oauth-waiting" class="oauth-description"><?php esc_html_e('Connecting. A new window will open with Mailchimp\'s OAuth service. Please log-in an we will take care of the rest.' , 'mc-woocommerce');?></p>
17
+ <p id="mailchimp-oauth-connecting" class="oauth-description"><?php esc_html_e('Connection in progress' , 'mc-woocommerce');?></p>
18
+ <p id="mailchimp-oauth-connected" class="oauth-description "><?php esc_html_e('Connected! Please wait while loading next step', 'mc-woocommerce');?></p>
19
  </fieldset>
20
+
admin/partials/tabs/campaign_defaults.php CHANGED
@@ -13,91 +13,60 @@ if (!$handler->hasValidStoreInfo()) {
13
 
14
  <input type="hidden" name="mailchimp_active_settings_tab" value="campaign_defaults"/>
15
 
16
- <h2 style="padding-top: 1em;"><?php _e('Audience Defaults', $this->plugin_name);?></h2>
17
- <p><?php esc_html_e('Please fill out the default campaign information.', $this->plugin_name);?></p>
18
-
19
- <fieldset>
20
  <legend class="screen-reader-text">
21
- <span><?php esc_html_e('Contact Name', $this->plugin_name)?></span>
22
  </legend>
23
- <label for="<?php echo $this->plugin_name; ?>-campaign-from-name-label">
24
- <input style="width: 30%;" 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'] : '' ?>" required/>
25
- <?php
26
- esc_html_e('Default from name', $this->plugin_name);
27
- if (empty($options['campaign_from_name']) ) {
28
- echo '<span style="color:red;">*</span>';
29
- }
30
- ?>
31
- </label>
32
- </fieldset>
33
-
34
- <fieldset>
35
- <legend class="screen-reader-text">
36
- <span><?php esc_html_e('From Email', $this->plugin_name)?></span>
37
  </legend>
38
- <label for="<?php echo $this->plugin_name; ?>-campaign-from-email-label">
39
- <input style="width: 30%;" type="text" 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/>
40
- <?php
41
- esc_html_e('Default from email', $this->plugin_name);
42
- if (empty($options['campaign_from_email']) ) {
43
- echo '<span style="color:red;">*</span>';
44
- }
45
- ?>
46
- </label>
47
- </fieldset>
48
 
49
- <fieldset>
50
- <legend class="screen-reader-text">
51
- <span><?php esc_html_e('Default subject', $this->plugin_name)?></span>
52
- </legend>
53
- <label for="<?php echo $this->plugin_name; ?>-campaign-subject-label">
54
- <input style="width: 30%;" 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'] : get_option('blogname') ?>" required/>
55
- <?php
56
- esc_html_e('Default subject', $this->plugin_name);
57
- if (empty($options['campaign_subject']) ) {
58
- echo '<span style="color:red;">*</span>';
59
- }
60
- ?>
61
- </label>
62
- </fieldset>
63
 
64
- <fieldset>
65
- <legend class="screen-reader-text">
66
- <span><?php esc_html_e('Default language', $this->plugin_name)?></span>
67
- </legend>
68
- <label for="<?php echo $this->plugin_name; ?>-campaign-language-label">
69
- <select id="<?php echo $this->plugin_name; ?>-campaign-language-label" name="<?php echo $this->plugin_name; ?>[campaign_language]" style="width:30%" required>
70
- <?php $selected_locale = isset($options['campaign_language']) && !empty($options['campaign_language']) ? $options['campaign_language'] : 'en'; ?>
71
- <?php
72
- foreach(MailChimp_Api_Locales::simple() as $locale_key => $local_value) {
73
- echo '<option value="' . esc_attr( $locale_key ) . '" ' . selected($locale_key === $selected_locale, true, false ) . '>' . esc_html( $local_value ) . '</option>';
74
- }
75
- ?>
76
- </select>
77
- <?php
78
- esc_html_e('Default language', $this->plugin_name);
79
- if (empty($options['campaign_language']) ) {
80
- echo '<span style="color:red;">*</span>';
81
- }
82
- ?>
83
- </label>
84
- </fieldset>
85
 
86
- <fieldset>
87
- <legend class="screen-reader-text">
88
- <span><?php esc_html_e('Permission Reminder', $this->plugin_name)?></span>
89
- </legend>
90
- <label for="<?php echo $this->plugin_name; ?>-campaign-permission-reminder-label">
91
- <textarea
92
- style="width: 30%;"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  id="<?php echo $this->plugin_name; ?>-campaign-permission-reminder-label"
94
  name="<?php echo $this->plugin_name; ?>[campaign_permission_reminder]"
95
- required><?php echo isset($options['campaign_permission_reminder']) ? $options['campaign_permission_reminder'] : sprintf(/* translators: %s - plugin name. */esc_html__( 'You were subscribed to the newsletter from %s', $this->plugin_name ),get_option('blogname'));?></textarea>
96
- <?php
97
- esc_html_e('Permission reminder message', $this->plugin_name);
98
- if (empty($options['campaign_permission_reminder']) ) {
99
- echo '<span style="color:red;">*</span>';
100
- }
101
- ?>
102
- </label>
103
- </fieldset>
13
 
14
  <input type="hidden" name="mailchimp_active_settings_tab" value="campaign_defaults"/>
15
 
16
+ <fieldset class="">
17
+ <legend>
 
 
18
  <legend class="screen-reader-text">
19
+ <span><?php esc_html_e('Audience Defaults', 'mc-woocommerce');?></span>
20
  </legend>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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', 'mc-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', 'mc-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', 'mc-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', 'mc-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', 'mc-woocommerce'); ?>
46
+ </label>
47
+
48
+ <div class="mailchimp-select-wrapper">
49
+ <select id="<?php echo $this->plugin_name; ?>-campaign-language-label" name="<?php echo $this->plugin_name; ?>[campaign_language]" required>
50
+ <?php $selected_locale = isset($options['campaign_language']) && !empty($options['campaign_language']) ? $options['campaign_language'] : 'en'; ?>
51
+ <?php
52
+ foreach(MailChimp_Api_Locales::simple() as $locale_key => $local_value) {
53
+ echo '<option value="' . esc_attr( $locale_key ) . '" ' . selected($locale_key === $selected_locale, true, false ) . '>' . esc_html( $local_value ) . '</option>';
54
+ }
55
+ ?>
56
+ </select>
57
+ </div>
58
+ </div>
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', 'mc-woocommerce'); ?>
63
+ </label>
64
+ <textarea
65
+ rows="4"
66
  id="<?php echo $this->plugin_name; ?>-campaign-permission-reminder-label"
67
  name="<?php echo $this->plugin_name; ?>[campaign_permission_reminder]"
68
+ required><?php echo isset($options['campaign_permission_reminder']) ? $options['campaign_permission_reminder'] : sprintf(/* translators: %s - plugin name. */esc_html__( 'You were subscribed to the newsletter from %s', 'mc-woocommerce' ),get_option('blogname'));?>
69
+ </textarea>
70
+ </div>
71
+
72
+ </fieldset>
 
 
 
 
admin/partials/tabs/logs.php CHANGED
@@ -32,58 +32,81 @@ if (!empty($requested_log_file) && isset($logs[sanitize_title($requested_log_fil
32
  $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37 ? strlen($viewed_log) - 37 : strlen($viewed_log) - 4) : '';
33
  ?>
34
 
35
- <h2 style="padding-top: 1em;"><?php esc_html_e('Logging Preference', 'mc-woocommerce');?></h2>
36
- <p>
37
- <?php esc_html_e('Advanced troubleshooting can be conducted with the logging capability turned on.
38
- By default, it’s set to “none” and you may toggle to either “standard” or “debug” as needed.
39
- With standard logging, you can see basic information about the data submission to Mailchimp including any errors.
40
- “Debug” gives a much deeper insight that is useful to share with support if problems arise.', 'mc-woocommerce');
41
- ?>
42
- </p>
43
  <fieldset>
44
  <legend class="screen-reader-text">
45
  <span><?php esc_html_e('Logging Preference', 'mc-woocommerce');?></span>
46
  </legend>
47
- <label for="<?php echo $this->plugin_name; ?>-logging">
48
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_logging]" style="width:30%" required>
49
- <?php $logging_preference = mailchimp_environment_variables()->logging; ?>
50
- <?php
51
- foreach(array('none' => esc_html__('None', 'mc-woocommerce'), 'debug' => esc_html__('Debug', 'mc-woocommerce'), 'standard' => esc_html__('Standard', 'mc-woocommerce')) as $log_value => $log_label) {
52
- echo '<option value="'.esc_attr($log_value).'" '.selected($log_value === $logging_preference, true, false ) . '>' . esc_html($log_label) . '</option>';
53
- }
 
 
 
 
54
  ?>
55
- </select>
56
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
57
  </fieldset>
58
 
59
- <?php submit_button(__('Save all changes'), 'primary','submit', TRUE);?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
- <?php if (isset($logs) && isset($viewed_log)) : ?>
62
- <div id="log-viewer-select">
63
- <div class="alignleft">
64
- <h2>
65
- <?php echo esc_html( $viewed_log ); ?>
66
  <?php if ( ! empty( $handle ) ) : ?>
67
- <a class="page-title-action" 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' ) ); ?>" class="button"><?php esc_html_e( 'Delete log', 'woocommerce' );?></a>
 
 
 
 
 
 
 
 
 
68
  <?php endif; ?>
69
- </h2>
 
 
 
70
  </div>
71
- <div class="alignright">
72
- <form action="<?php echo admin_url( 'admin.php?page=mailchimp-woocommerce&tab=logs&mc_action=view_log' ); ?>" method="post">
73
- <input type="hidden" name="<?php echo $this->plugin_name; ?>[mailchimp_active_tab]" value="logs"/>
74
- <select name="log_file">
75
- <?php foreach ( $logs as $log_key => $log_file ) : ?>
76
- <option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo esc_html( $log_file ); ?> (<?php echo date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), filemtime( WC_LOG_DIR . $log_file ) ); ?>)</option>
77
- <?php endforeach; ?>
78
- </select>
79
- <input type="submit" class="button" value="<?php esc_attr_e( 'View', 'woocommerce' ); ?>" />
80
- </form>
81
- </div>
82
- <div class="clear"></div>
83
- </div>
84
- <div id="log-viewer">
85
- <pre><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></pre>
86
- </div>
87
- <?php else : ?>
88
- <div class="updated woocommerce-message inline"><p><?php _e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div>
89
- <?php endif; ?>
32
  $handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37 ? strlen($viewed_log) - 37 : strlen($viewed_log) - 4) : '';
33
  ?>
34
 
35
+
 
 
 
 
 
 
 
36
  <fieldset>
37
  <legend class="screen-reader-text">
38
  <span><?php esc_html_e('Logging Preference', 'mc-woocommerce');?></span>
39
  </legend>
40
+
41
+ <div class="box fieldset-header" >
42
+ <label for="<?php echo $this->plugin_name; ?>-logging"><h2 style="padding-top: 1em;"><?php esc_html_e('Logging Preferences', 'mc-woocommerce');?></h2></label>
43
+ </div>
44
+
45
+ <div class="box box-half">
46
+ <p>
47
+ <?php esc_html_e('Advanced troubleshooting can be conducted with the logging capability turned on.
48
+ By default, it’s set to “standard” and you may toggle to either “debug” or “none” as needed.
49
+ With standard logging, you can see basic information about the data submission to Mailchimp including any errors.
50
+ “Debug” gives a much deeper insight that is useful to share with support if problems arise.', 'mc-woocommerce');
51
  ?>
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', 'mc-woocommerce'), 'debug' => esc_html__('Debug', 'mc-woocommerce'), 'standard' => esc_html__('Standard', 'mc-woocommerce')) as $log_value => $log_label) {
60
+ echo '<option value="'.esc_attr($log_value).'" '.selected($log_value === $logging_preference, true, false ) . '>' . esc_html($log_label) . '</option>';
61
+ }
62
+ ?>
63
+ </select>
64
+ </div>
65
+ </div>
66
  </fieldset>
67
 
68
+ <fieldset>
69
+ <div class="box fieldset-header" >
70
+ <h2>
71
+ <?php esc_html_e('Recent Logs', 'mc-woocommerce'); ?>
72
+ </h2>
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">
79
+ <?php foreach ( $logs as $log_key => $log_file ) : ?>
80
+ <option value="<?php echo esc_attr( $log_key ); ?>" <?php selected( sanitize_title( $viewed_log ), $log_key ); ?>><?php echo date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), filemtime( WC_LOG_DIR . $log_file ) ); ?> - <?php echo esc_html( $log_file ); ?></option>
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 style="height: 100px;">
92
  <?php if ( ! empty( $handle ) ) : ?>
93
+ <a style="display:inline-block" 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' ) ); ?>">
94
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
95
+ <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"/>
96
+ </svg>
97
+ <?php esc_html_e('Delete log', 'mc-woocommerce'); ?>
98
+
99
+ </a>
100
+ <a style="display:inline-block" class="mc-woocommerce-copy-log-button" href="#">
101
+ <?php esc_html_e('Copy log', 'mc-woocommerce'); ?>
102
+ </a>
103
  <?php endif; ?>
104
+ </div>
105
+ <div>
106
+ <pre id="log-text"><?php echo esc_html( file_get_contents( WC_LOG_DIR . $viewed_log ) ); ?></pre>
107
+ </div>
108
  </div>
109
+ <?php else : ?>
110
+ <div class="updated woocommerce-message inline"><p><?php _e( 'There are currently no logs to view.', 'woocommerce' ); ?></p></div>
111
+ <?php endif; ?>
112
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/tabs/newsletter_settings.php CHANGED
@@ -31,133 +31,149 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
31
  <?php endif; ?>
32
 
33
  <input type="hidden" name="mailchimp_active_settings_tab" value="newsletter_settings"/>
34
-
35
- <h2 style="padding-top: 1em;"><?php esc_html_e('Audience Settings', 'mc-woocommerce');?></h2>
36
- <p><?php esc_html_e('Please apply your audience settings. If you don\'t have an audience, you can choose to create one.', 'mc-woocommerce');?></p>
37
-
38
- <fieldset>
39
- <legend class="screen-reader-text">
40
- <span><?php esc_html_e('Audience Name', 'mc-woocommerce');?></span>
41
- </legend>
42
- <label for="<?php echo $this->plugin_name; ?>-mailchimp-list-label">
43
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_list]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
44
-
45
- <?php if(!isset($allow_new_list) || $allow_new_list === true): ?>
46
- <option value="create_new"><?php esc_html_e('Create New Audience', 'mc-woocommerce');?></option>
47
- <?php endif ?>
48
-
49
- <?php if(isset($allow_new_list) && $allow_new_list === false): ?>
50
- <option value="">-- <?php esc_html_e('Select Audience', 'mc-woocommerce');?> --</option>
51
- <?php endif; ?>
52
-
53
- <?php
54
- if (is_array($mailchimp_lists)) {
55
- $selected_list = isset($options['mailchimp_list']) ? $options['mailchimp_list'] : null;
56
- foreach ($mailchimp_lists as $key => $value ) {
57
- echo '<option value="' . esc_attr( $key ) . '" ' . selected(((string) $key === (string) $selected_list), true, false) . '>' . esc_html( $value ) . '</option>';
58
- }
59
- }
60
- ?>
61
- </select>
62
- <span><?php esc_html_e('Choose an audience to sync with your store.', $this->plugin_name); ?></span>
63
- </label>
64
- </fieldset>
65
-
66
- <fieldset>
67
- <legend class="screen-reader-text">
68
- <span><?php esc_html_e('Auto Subscribe On Initial Sync', 'mc-woocommerce');?></span>
69
- </legend>
70
- <label for="<?php echo $this->plugin_name; ?>-mailchimp-auto-subscribe">
71
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_auto_subscribe]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
72
-
73
- <?php
74
- $enable_auto_subscribe = (array_key_exists('mailchimp_auto_subscribe', $options) && !is_null($options['mailchimp_auto_subscribe'])) ? $options['mailchimp_auto_subscribe'] : '1';
75
-
76
- foreach (array('0' => esc_html__('No', 'mc-woocommerce'), '1' => esc_html__('Yes', 'mc-woocommerce')) as $key => $value ) {
77
- echo '<option value="' . esc_attr( $key ) . '" ' . selected($key == $enable_auto_subscribe, true, false ) . '>' . esc_html( $value ) . '</option>';
78
- }
79
- ?>
80
-
81
- </select>
82
- <span><?php esc_html_e('During initial sync, auto subscribe the existing customers.', $this->plugin_name); ?></span>
83
- </label>
84
- </fieldset>
85
-
86
- <h2 style="padding-top: 1em;"><?php esc_html_e('Opt-in Settings', 'mc-woocommerce');?></h2>
87
- <p><?php esc_html_e('Add text to go along with the opt-in checkbox, and choose a default display option. Customers can click a box at checkout to opt in to your newsletter. Write a signup message and choose how you want this checkbox to appear.', 'mc-woocommerce');?> </p>
88
-
89
  <fieldset>
90
  <legend class="screen-reader-text">
91
- <span><?php esc_html_e('Newsletter Label', 'mc-woocommerce');?></span>
92
  </legend>
93
- <label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label">
94
- <textarea style="width: 30%;" rows="3" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label" name="<?php echo $this->plugin_name; ?>[newsletter_label]"><?php echo isset($options['newsletter_label']) ? esc_html($options['newsletter_label']) : esc_html__('Subscribe to our newsletter', 'mc-woocommerce'); ?></textarea>
95
- <span><?php esc_html_e('Enter text for the opt-in checkbox', $this->plugin_name); ?></span>
96
- </label>
97
- <p class="description"><?= esc_html(__('HTML tags allowed: <a href="" target="" title=""></a> and <br>', 'mc-woocommerce')); ?></p>
98
- </fieldset>
99
-
100
- <h4 style="padding-top: 1em;"><?php esc_html_e('Checkbox Display Options', 'mc-woocommerce');?></h4>
101
 
102
- <fieldset>
103
- <legend class="screen-reader-text">
104
- <span><?php esc_html_e('Checkbox Display Options', 'mc-woocommerce');?></span>
105
- </legend>
106
- <?php $checkbox_default_settings = (array_key_exists('mailchimp_checkbox_defaults', $options) && !is_null($options['mailchimp_checkbox_defaults'])) ? $options['mailchimp_checkbox_defaults'] : 'check'; ?>
107
- <label>
108
- <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="check"<?php if($checkbox_default_settings === 'check') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, checked by default', 'mc-woocommerce');?><br>
109
- </label>
110
- <br/>
111
- <label>
112
- <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="uncheck"<?php if($checkbox_default_settings === 'uncheck') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, unchecked by default', 'mc-woocommerce');?><br/>
113
- </label>
114
- <br/>
115
- <label>
116
- <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="hide"<?php if($checkbox_default_settings === 'hide') echo ' checked="checked" '; ?>><?php esc_html_e('Hidden, unchecked by default', 'mc-woocommerce');?><br/>
117
- </label>
118
- </fieldset>
119
-
120
- <h4 style="padding-top: 1em;"><?php esc_html_e('Advanced Checkbox Settings', 'mc-woocommerce');?></h4>
121
- <p><?= sprintf(/* translators: %s - Woocommerce Actions documentation URL. */wp_kses( __( 'To change the location of the opt-in checkbox at checkout, input one of the <a href=%s target=_blank>available WooCommerce form actions.</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://docs.woocommerce.com/wc-apidocs/hook-docs.html' ) ); ?></p>
122
-
123
- <fieldset>
124
- <legend class="screen-reader-text">
125
- <span><?php esc_html_e('Newsletter Checkbox Action', 'mc-woocommerce');?></span>
126
- </legend>
127
- <label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action">
128
- <input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_action]" value="<?php echo isset($options['mailchimp_checkbox_action']) ? $options['mailchimp_checkbox_action'] : 'woocommerce_after_checkout_billing_form' ?>" />
129
- <span><?php esc_html_e('Enter a WooCommerce form action', $this->plugin_name); ?></span>
130
- </label>
131
- </fieldset>
132
-
133
- <h2 style="padding-top: 1em;"><?php esc_html_e('Audience Member Tags', 'mc-woocommerce');?></h2>
134
- <p><?= __( 'Add a comma separated list of tags to add to the user at Mailchimp', 'mailchimp-woocommerce' ); ?></p>
135
-
136
- <fieldset>
137
- <legend class="screen-reader-text">
138
- <span><?php esc_html_e('Audience Member Tags', 'mc-woocommerce');?></span>
139
- </legend>
140
- <label for="<?php echo $this->plugin_name; ?>-user-tags">
141
- <input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-user-tags" name="<?php echo $this->plugin_name; ?>[mailchimp_user_tags]" value="<?php echo isset($options['mailchimp_user_tags']) ? str_replace(',',', ',$options['mailchimp_user_tags']) : '' ?>" />
142
- </label>
143
- </fieldset>
144
 
145
- <h2 style="padding-top: 1em;"><?php esc_html_e('Product Image Size', 'mc-woocommerce');?></h2>
146
- <p><?php esc_html_e('Define the product image size used by abandoned carts, order notifications, and product recommendations.', 'mc-woocommerce');?></p>
 
147
 
148
- <fieldset>
149
- <legend class="screen-reader-text">
150
- <span><?php esc_html_e('Product Image Size', 'mc-woocommerce');?></span>
151
- </legend>
152
- <label for="<?php echo $this->plugin_name; ?>-mailchimp-product_image_key">
153
- <select name="<?php echo $this->plugin_name; ?>[mailchimp_product_image_key]" style="width:30%">
154
- <?php
155
- $enable_auto_subscribe = (array_key_exists('mailchimp_product_image_key', $options) && !is_null($options['mailchimp_product_image_key'])) ? $options['mailchimp_product_image_key'] : 'medium';
156
- foreach (mailchimp_woocommerce_get_all_image_sizes_list() as $key => $value ) {
157
- echo '<option value="' . esc_attr( $key ) . '" ' . selected($key == $enable_auto_subscribe, true, false ) . '>' . esc_html( $value ) . '</option>';
158
- }
159
- ?>
160
- </select>
161
- <span><?php esc_html_e('Select an image size', $this->plugin_name); ?></span>
162
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  </fieldset>
31
  <?php endif; ?>
32
 
33
  <input type="hidden" name="mailchimp_active_settings_tab" value="newsletter_settings"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  <fieldset>
35
  <legend class="screen-reader-text">
36
+ <span><?php esc_html_e('Audience Settings', 'mc-woocommerce');?></span>
37
  </legend>
 
 
 
 
 
 
 
 
38
 
39
+ <div class="box" >
40
+ <label for="<?php echo $this->plugin_name; ?>-mailchimp-list-label">
41
+ <strong><?php esc_html_e('Sync audience with your store', 'mc-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', 'mc-woocommerce');?></option>
48
+ <?php endif ?>
49
+
50
+ <?php if(isset($allow_new_list) && $allow_new_list === false): ?>
51
+ <option value="">-- <?php esc_html_e('Select Audience', 'mc-woocommerce');?> --</option>
52
+ <?php endif; ?>
53
+
54
+ <?php
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
+ ?>
62
+ </select>
63
+ </div>
64
+ </div>
65
+
66
+ <div class="box" >
67
+ <?php $enable_auto_subscribe = (array_key_exists('mailchimp_auto_subscribe', $options) && !is_null($options['mailchimp_auto_subscribe'])) ? $options['mailchimp_auto_subscribe'] : '1'; ?>
68
+ <label>
69
+ <input
70
+ type="checkbox"
71
+ name="<?php echo $this->plugin_name; ?>[mailchimp_auto_subscribe]"
72
+ id="<?php echo $this->plugin_name; ?>[mailchimp_auto_subscribe]"
73
+ required
74
+ <?= $list_is_configured ? 'disabled': '' ?>
75
+ value=1
76
+ <?= $enable_auto_subscribe ? 'checked' : ''?>>
77
+ <strong><?php esc_html_e('During initial sync, auto subscribe the existing customers.', 'mc-woocommerce'); ?></strong>
78
+ </label>
79
+ </div>
 
80
 
81
+ <div class="box optional-settings-button" >
82
+ <span><?php esc_html_e('Optional Audience Settings', 'mc-woocommerce');?></span>
83
+ </div>
84
 
85
+ <div class="optional-settings-content">
86
+ <div class="box fieldset-header" >
87
+ <h2><?php esc_html_e('Opt-in Settings', 'mc-woocommerce');?></h2>
88
+ </div>
89
+
90
+ <div class="box box-half">
91
+ <label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label">
92
+ <h4><?php esc_html_e('Message for the opt-in checkbox', 'mc-woocommerce'); ?></h4>
93
+ <p><?php _e('Add text to go along with the other opt-in checkboxes. <br/>Customers can click a box at checkout to opt in to your newsletter.', 'mc-woocommerce');?> </p>
94
+ </label>
95
+ </div>
96
+
97
+ <div class="box box-half">
98
+ <textarea rows="3" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label" name="<?php echo $this->plugin_name; ?>[newsletter_label]"><?php echo isset($options['newsletter_label']) ? esc_html($options['newsletter_label']) : esc_html__('Subscribe to our newsletter', 'mc-woocommerce'); ?></textarea>
99
+ <p class="description"><?= esc_html(__('HTML tags allowed: <a href="" target="" title=""></a> and <br>', 'mc-woocommerce')); ?></p>
100
+ </div>
101
+
102
+ <div class="box box-half margin-large">
103
+ <label>
104
+ <h4><?php esc_html_e('Checkbox Display Options', 'mc-woocommerce');?></h4>
105
+ <p><?php _e('Add text to go along with the other opt-in checkboxes. <br/>Customers can click a box at checkout to opt in to your newsletter.', 'mc-woocommerce');?> </p>
106
+ </label>
107
+ </div>
108
+
109
+
110
+ <div class="box box-half margin-large">
111
+ <?php $checkbox_default_settings = (array_key_exists('mailchimp_checkbox_defaults', $options) && !is_null($options['mailchimp_checkbox_defaults'])) ? $options['mailchimp_checkbox_defaults'] : 'check'; ?>
112
+ <label class="radio-label">
113
+ <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="check"<?php if($checkbox_default_settings === 'check') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, checked by default', 'mc-woocommerce');?><br>
114
+ </label>
115
+ <label class="radio-label">
116
+ <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="uncheck"<?php if($checkbox_default_settings === 'uncheck') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, unchecked by default', 'mc-woocommerce');?><br/>
117
+ </label>
118
+ <label class="radio-label">
119
+ <input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="hide"<?php if($checkbox_default_settings === 'hide') echo ' checked="checked" '; ?>><?php esc_html_e('Hidden, unchecked by default', 'mc-woocommerce');?><br/>
120
+ </label>
121
+ </div>
122
+
123
+
124
+ <div class="box box-half margin-large">
125
+ <label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action">
126
+ <h4><?php esc_html_e('Advanced Checkbox Settings', 'mc-woocommerce');?></h4>
127
+ <p><?= sprintf(/* translators: %s - Woocommerce Actions documentation URL. */wp_kses( __( 'To change the location of the opt-in <br/>checkbox at checkout, input one of the <a href=%s target=_blank>available WooCommerce form actions</a>.', 'mc-woocommerce' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://docs.woocommerce.com/wc-apidocs/hook-docs.html' ) ); ?></p>
128
+ </label>
129
+ </div>
130
+
131
+ <div class="box box-half margin-large">
132
+ <input type="text" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_action]" value="<?php echo isset($options['mailchimp_checkbox_action']) ? $options['mailchimp_checkbox_action'] : 'woocommerce_after_checkout_billing_form' ?>" />
133
+ <p class="description"><?php esc_html_e('Enter a WooCommerce form action', 'mc-woocommerce'); ?></p>
134
+ </div>
135
+
136
+ <div class="box fieldset-header" >
137
+ <h2><?php esc_html_e('Subscriber Tags', 'mc-woocommerce');?></h2>
138
+ </div>
139
+
140
+ <div class="box box-half" >
141
+ <label for="<?php echo $this->plugin_name; ?>-user-tags">
142
+ <h4><?php esc_html_e('Subscriber Tags', 'mc-woocommerce');?></h4>
143
+ </label>
144
+ </div>
145
+
146
+ <div class="box box-half" >
147
+ <input type="text" id="<?php echo $this->plugin_name; ?>-user-tags" name="<?php echo $this->plugin_name; ?>[mailchimp_user_tags]" value="<?php echo isset($options['mailchimp_user_tags']) ? str_replace(',',', ',$options['mailchimp_user_tags']) : '' ?>" />
148
+ <p class="description"><?= __( 'Add a comma separated list of tags to add to the subscriber at Mailchimp', 'mc-woocommerce' ); ?></p>
149
+ </div>
150
+
151
+ <div class="box fieldset-header" >
152
+ <h2><?php esc_html_e('Product Settings', 'mc-woocommerce');?></h2>
153
+ </div>
154
+
155
+
156
+ <div class="box box-half">
157
+ <label for="<?php echo $this->plugin_name; ?>[mailchimp_product_image_key]">
158
+ <h4><?php esc_html_e('Product Image Size', 'mc-woocommerce');?></h4>
159
+ <p><?= __( 'Define the product image size used by abandoned carts, order notifications, and product recommendations.', 'mc-woocommerce' ); ?></p>
160
+ </label>
161
+ </div>
162
+
163
+ <div class="box box-half" >
164
+ <label for="<?php echo $this->plugin_name; ?>-mailchimp-product_image_key">
165
+ <span><?php esc_html_e('Size', 'mc-woocommerce'); ?></span>
166
+ </label>
167
+ <div class="mailchimp-select-wrapper">
168
+ <select name="<?php echo $this->plugin_name; ?>[mailchimp_product_image_key]">
169
+ <?php
170
+ $enable_auto_subscribe = (array_key_exists('mailchimp_product_image_key', $options) && !is_null($options['mailchimp_product_image_key'])) ? $options['mailchimp_product_image_key'] : 'medium';
171
+ foreach (mailchimp_woocommerce_get_all_image_sizes_list() as $key => $value ) {
172
+ echo '<option value="' . esc_attr( $key ) . '" ' . selected($key == $enable_auto_subscribe, true, false ) . '>' . esc_html( $value ) . '</option>';
173
+ }
174
+ ?>
175
+ </select>
176
+ </div>
177
+ </div>
178
+ </div>
179
  </fieldset>
admin/partials/tabs/store_info.php CHANGED
@@ -10,201 +10,131 @@ if (!$handler->hasValidApiKey()) {
10
  ?>
11
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_info"/>
12
 
13
- <h2 style="padding-top: 1em;"><?php _e('Store Settings', $this->plugin_name);?></h2>
14
- <p><?= __('Please provide the following information about your WooCommerce store.', $this->plugin_name); ?></p>
15
-
16
- <fieldset>
17
- <legend class="screen-reader-text">
18
- <span><?php esc_html_e('Store Name', 'mc-woocommerce');?></span>
19
- </legend>
20
- <label for="<?php echo $this->plugin_name; ?>-store-name-label">
21
- <input required style="width: 30%;" 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
- <span>
23
- <?php
24
- if (!empty($options['store_name']) ) {
25
- esc_html_e('Name', $this->plugin_name);
26
- } else {
27
- esc_html_e('Name', $this->plugin_name); echo '<span style="color:red;">*</span>';
28
- }
29
- ?>
30
- </span>
31
- </label>
32
- </fieldset>
33
-
34
- <fieldset>
35
- <legend class="screen-reader-text">
36
- <span><?php esc_html_e('Email', 'mc-woocommerce');?></span>
37
- </legend>
38
- <label for="<?php echo $this->plugin_name; ?>-admin-email-label">
39
- <input required style="width: 30%;" 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') ?>" />
40
- <span>
41
- <?php
42
- if (!empty($options['admin_email']) ) {
43
- esc_html_e('Email', $this->plugin_name);
44
- } else {
45
- esc_html_e('Email', $this->plugin_name); echo '<span style="color:red;">*</span>';
46
- }
47
- ?>
48
- </span>
49
- </label>
50
- </fieldset>
51
-
52
- <fieldset>
53
- <legend class="screen-reader-text">
54
- <span><?php esc_html_e('Street Address', 'mc-woocommerce');?></span>
55
- </legend>
56
- <label for="<?php echo $this->plugin_name; ?>-store-address-label">
57
- <input required style="width: 30%;" 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'] : '' ?>" />
58
- <span>
59
- <?php
60
- if (!empty($options['store_street']) ) {
61
- esc_html_e('Street address', $this->plugin_name);
62
- } else {
63
- esc_html_e('Street address', $this->plugin_name); echo '<span style="color:red;">*</span>';
64
- }
65
- ?>
66
- </span>
67
- </label>
68
- </fieldset>
69
-
70
- <fieldset>
71
- <legend class="screen-reader-text">
72
- <span><?php esc_html_e('City', 'mc-woocommerce');?></span>
73
- </legend>
74
- <label for="<?php echo $this->plugin_name; ?>-store-city-label">
75
- <input required style="width: 30%;" 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'] : '' ?>" />
76
- <span>
77
- <?php
78
- if (!empty($options['store_city']) ) {
79
- esc_html_e('City', $this->plugin_name);
80
- } else {
81
- esc_html_e('City', $this->plugin_name); echo '<span style="color:red;">*</span>';
82
- }
83
- ?>
84
- </span>
85
- </label>
86
- </fieldset>
87
-
88
- <fieldset>
89
  <legend class="screen-reader-text">
90
- <span><?php esc_html_e('State', 'mc-woocommerce');?></span>
91
  </legend>
92
- <label for="<?php echo $this->plugin_name; ?>-store-state-label">
93
- <input required style="width: 30%;" 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'] : '' ?>" />
94
- <span>
95
- <?php
96
- if (!empty($options['store_state']) ) {
97
- esc_html_e('State', $this->plugin_name);
98
- } else {
99
- esc_html_e('State', $this->plugin_name); echo '<span style="color:red;">*</span>';
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  ?>
102
- </span>
103
- </label>
104
- </fieldset>
105
-
106
- <fieldset>
107
- <legend class="screen-reader-text">
108
- <span><?php esc_html_e('Postal Code', 'mc-woocommerce');?></span>
109
- </legend>
110
- <label for="<?php echo $this->plugin_name; ?>-store-postal-code-label">
111
- <input required style="width: 30%;" 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'] : '' ?>" />
112
- <span>
113
- <?php
114
- if (!empty($options['store_postal_code']) ) {
115
- esc_html_e('Postal Code', $this->plugin_name);
116
- } else {
117
- esc_html_e('Postal Code', $this->plugin_name); echo '<span style="color:red;">*</span>';
118
- }
119
- ?>
120
- </span>
121
- </label>
122
- </fieldset>
123
-
124
- <fieldset>
125
- <legend class="screen-reader-text">
126
- <span><?php esc_html_e('Country', 'mc-woocommerce');?></span>
127
- </legend>
128
- <label for="<?php echo $this->plugin_name; ?>-store-country-label">
129
- <input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-country-label" name="<?php echo $this->plugin_name; ?>[store_country]" value="<?php echo isset($options['store_country']) ? $options['store_country'] : 'US' ?>" />
130
- <span>
131
- <?php
132
- if (!empty($options['store_country'])) {
133
- esc_html_e('Country', $this->plugin_name);
134
- } else {
135
- esc_html_e('Country', $this->plugin_name); echo '<span style="color:red;">*</span>';
136
- }
137
- ?>
138
- </span>
139
- </label>
140
- </fieldset>
141
-
142
- <fieldset>
143
- <legend class="screen-reader-text">
144
- <span><?php esc_html_e('Phone Number', 'mc-woocommerce');?></span>
145
- </legend>
146
- <label for="<?php echo $this->plugin_name; ?>-store-phone-label">
147
- <input style="width: 30%;" 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'] : '' ?>" />
148
- <span>
149
- <?php
150
- if (!empty($options['store_phone']) ) {
151
- esc_html_e('Phone Number', $this->plugin_name);
152
- } else {
153
- esc_html_e('Phone Number', $this->plugin_name); echo '<span style="color:red;">*</span>';
154
- }
155
- ?>
156
- </span>
157
- </label>
158
- </fieldset>
159
-
160
- <h2 style="padding-top: 1em;"><?= __('Locale Settings', $this->plugin_name);?></h2>
161
-
162
- <p><?= __('Please apply your locale settings. If you\'re unsure about these, use the defaults.', $this->plugin_name);?></p>
163
-
164
- <fieldset>
165
- <legend class="screen-reader-text">
166
- <span><?php esc_html_e('Locale', 'mc-woocommerce');?></span>
167
- </legend>
168
- <label for="<?php echo $this->plugin_name; ?>-store-locale-label">
169
- <select name="<?php echo $this->plugin_name; ?>[store_locale]" style="width:30%" required>
170
- <?php $selected_locale = isset($options['store_locale']) && !empty($options['store_locale']) ? $options['store_locale'] : 'en'; ?>
171
- <?php
172
- foreach(MailChimp_Api_Locales::simple() as $locale_key => $local_value) {
173
- echo '<option value="' . esc_attr( $locale_key ) . '" ' . selected($locale_key === $selected_locale, true, false ) . '>' . esc_html( $local_value ) . '</option>';
174
- }
175
- ?>
176
- </select>
177
- <span><?php esc_html_e('Locale', $this->plugin_name); ?></span>
178
- </label>
179
- </fieldset>
180
-
181
- <fieldset>
182
- <legend class="screen-reader-text">
183
- <span><?php esc_html_e('Currency Code', 'mc-woocommerce');?></span>
184
- </legend>
185
- <?php $all_currencies = MailChimp_WooCommerce_CurrencyCodes::lists();?>
186
-
187
- <label for="<?php echo $this->plugin_name; ?>-store-currency-code-label">
188
- <input style="width: 30%;" type="text" value="<?php echo isset($options['store_currency_code']) ? $options['store_currency_code'] . ' | ' . $all_currencies[$options['store_currency_code']]: '' ?>" disabled/>
189
- <span><?php esc_html_e('Currency', $this->plugin_name); ?> (<span class="description"><?php esc_html_e('Retrieved from Woocommerce Settings', $this->plugin_name); ?></span>)</span>
190
- </label>
191
- </fieldset>
192
-
193
- <fieldset>
194
- <legend class="screen-reader-text">
195
- <span><?php esc_html_e('Timezone', 'mc-woocommerce');?></span>
196
- </legend>
197
- <label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
198
- <select name="<?php echo $this->plugin_name; ?>[store_timezone]" style="width:30%" required>
199
- <?php $selected_timezone = isset($options['store_timezone']) && !empty($options['store_timezone']) ? $options['store_timezone'] : 'America/New_York'; ?>
200
- <?php
201
- foreach(mailchimp_get_timezone_list() as $t) {
202
- echo '<option value="' . esc_attr( $t['zone'] ) . '" ' . selected($t['zone'] === $selected_timezone, true, false ) . '>' . esc_html( $t['diff_from_GMT'] . ' - ' . $t['zone'] ) . '</option>';
203
- }
204
- ?>
205
- </select>
206
- <span><?php esc_html_e('Timezone', $this->plugin_name); ?></span>
207
- </label>
208
- </fieldset>
209
-
210
-
10
  ?>
11
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_info"/>
12
 
13
+ <fieldset class="">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  <legend class="screen-reader-text">
15
+ <span><?php esc_html_e('Store Settings', 'mc-woocommerce');?></span>
16
  </legend>
17
+ <div class="box box-half" >
18
+ <label for="<?php echo $this->plugin_name; ?>-store-name-label">
19
+ <span> <?php esc_html_e('Name', 'mc-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>
23
+
24
+ <div class="box box-half" >
25
+ <label for="<?php echo $this->plugin_name; ?>-admin-email-label">
26
+ <span> <?php esc_html_e('Email', 'mc-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>
30
+
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', 'mc-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>
37
+
38
+ <div class="box box-half" >
39
+ <label for="<?php echo $this->plugin_name; ?>-store-city-label">
40
+ <span> <?php esc_html_e('City', 'mc-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>
44
+
45
+ <div class="box box-half" >
46
+ <label for="<?php echo $this->plugin_name; ?>-store-state-label">
47
+ <span> <?php esc_html_e('State', 'mc-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>
51
+
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', 'mc-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>
58
+
59
+ <div class="box box-half" >
60
+ <label for="<?php echo $this->plugin_name; ?>-store-country-label">
61
+ <span> <?php esc_html_e('Country', 'mc-woocommerce'); ?></span>
62
+ </label>
63
+
64
+ <?php global $woocommerce;
65
+ $countries_obj = new WC_Countries();
66
+ $countries = $countries_obj->__get('countries');
67
+ ?>
68
+
69
+ <div class="mailchimp-select-wrapper">
70
+ <?php
71
+ woocommerce_form_field($this->plugin_name.'[store_country]', array(
72
+ 'type' => 'select',
73
+ 'class' => array( 'chzn-drop' ),
74
+ 'placeholder' => __('Select a Country'),
75
+ 'options' => $countries,
76
+ 'required' => true
77
+ ),
78
+ isset($options['store_country']) ? $options['store_country'] : WC()->countries->get_base_country()
79
+ );
80
+
81
  ?>
82
+ </div>
83
+ </div>
84
+
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', 'mc-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>
91
+
92
+ <div class="box fieldset-header" >
93
+ <h2 style="padding-top: 1em;"><?= __('Locale Settings', 'mc-woocommerce');?></h2>
94
+ <br/>
95
+ <p><?= __('Please apply your locale settings. If you\'re unsure about these, use the defaults.', 'mc-woocommerce');?></p>
96
+ </div>
97
+
98
+ <div class="box box-half" >
99
+ <label for="<?php echo $this->plugin_name; ?>-store-locale-label">
100
+ <span><?php esc_html_e('Locale', 'mc-woocommerce'); ?></span>
101
+ </label>
102
+ <div class="mailchimp-select-wrapper">
103
+ <select name="<?php echo $this->plugin_name; ?>[store_locale]" required>
104
+ <option disabled selected value="<?= __('','mc-woocommerce')?>"><?= __("Select store's locale",'mc-woocommerce')?></option>
105
+ <?php $selected_locale = isset($options['store_locale']) && !empty($options['store_locale']) ? $options['store_locale'] : substr(get_locale(), 0, 2); ?>
106
+ <?php foreach(MailChimp_Api_Locales::simple() as $locale_key => $local_value) : ?>
107
+ <option value="<?php echo esc_attr( $locale_key ) . '" ' . selected($locale_key === $selected_locale, true, false ); ?>"> <?php esc_html_e( $local_value ) ?> </option>;
108
+ <?php endforeach;?>
109
+ </select>
110
+ </div>
111
+ </div>
112
+
113
+ <div class="box box-half" >
114
+ <?php
115
+ $current_currency = isset($options['store_currency_code']) ? $options['store_currency_code'] : get_woocommerce_currency();
116
+ $current_currency_data = MailChimp_WooCommerce_CurrencyCodes::getCurrency($current_currency);
117
+ ?>
118
+ <label for="<?php echo $this->plugin_name; ?>-store-currency-code-label">
119
+ <span><?php esc_html_e('Woocommerce Currency', 'mc-woocommerce'); ?></span>
120
+ </label>
121
+ <input type="text" value="<?php echo isset($current_currency_data) ? $current_currency . ' | ' . $current_currency_data['name']: $current_currency ?>" disabled/>
122
+ </div>
123
+
124
+ <div class="box" >
125
+ <label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
126
+ <span><?php esc_html_e('Timezone', 'mc-woocommerce'); ?></span>
127
+ </label>
128
+ <div class="mailchimp-select-wrapper">
129
+ <select name="<?php echo $this->plugin_name; ?>[store_timezone]" required>
130
+ <option disabled selected value="<?= __('','mc-woocommerce')?>"><?= __("Select store's timezone",'mc-woocommerce')?></option>
131
+ <?php $selected_timezone = isset($options['store_timezone']) && !empty($options['store_timezone']) ? $options['store_timezone'] : get_option('timezone_string'); ?>
132
+ <?php
133
+ foreach(mailchimp_get_timezone_list() as $t) {
134
+ echo '<option value="' . esc_attr( $t['zone'] ) . '" ' . selected($t['zone'] === $selected_timezone, true, false ) . '>' . esc_html( $t['diff_from_GMT'] . ' - ' . $t['zone'] ) . '</option>';
135
+ }
136
+ ?>
137
+ </select>
138
+ </div>
139
+ </div>
140
+ </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/tabs/store_sync.php CHANGED
@@ -1,8 +1,19 @@
1
  <?php
2
- $mailchimp_total_products = $mailchimp_total_orders = 0;
3
  $store_id = mailchimp_get_store_id();
 
4
  $product_count = mailchimp_get_product_count();
5
  $order_count = mailchimp_get_order_count();
 
 
 
 
 
 
 
 
 
 
6
  $store_syncing = false;
7
  $last_updated_time = get_option('mailchimp-woocommerce-resource-last-updated');
8
  $sync_started_at = get_option('mailchimp-woocommerce-sync.started_at');
@@ -35,6 +46,11 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
35
  if (($account_details = $handler->getAccountDetails())) {
36
  $account_name = $account_details['account_name'];
37
  }
 
 
 
 
 
38
  try {
39
  $products = $mailchimp_api->products($store_id, 1, 1);
40
  $mailchimp_total_products = $products['total_items'];
@@ -45,39 +61,136 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
45
  $mailchimp_total_orders = $orders['total_items'];
46
  if ($mailchimp_total_orders > $order_count) $mailchimp_total_orders = $order_count;
47
  } catch (\Exception $e) { $mailchimp_total_orders = 0; }
 
 
 
 
 
 
 
 
 
 
48
  $mailchimp_list_name = $handler->getListName();
49
  }
50
  ?>
51
-
52
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
- <h2 style="padding-top: 1em;"><?php esc_html_e('Sync Information', 'mc-woocommerce');?></h2>
55
-
56
- <?php if ($sync_started_at && !$sync_completed_at): ?>
57
- <p><strong><?php esc_html_e('Initial Sync:', 'mc-woocommerce');?></strong> <i><?php esc_html_e('In Progress', 'mc-woocommerce');?></i></p>
58
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
- <?php if ($last_updated_time): ?>
61
- <p>
62
- <strong>
63
- <?php esc_html_e('Last Updated:', 'mc-woocommerce');?>
64
- </strong>
65
- <i id="mailchimp_last_updated">
66
- <?php echo date_i18n( __('D, M j, Y g:i A', 'mc-woocommerce'), $last_updated_time->getTimestamp())?>
67
- </i>
68
- <span class="spinner" style="float:none; background-size: 16px 16px; width: 16px; height: 16px; margin: 0px 10px"></span>
69
- </p>
70
- <?php endif; ?>
71
 
72
- <p><strong><?php esc_html_e('Account Connected:', 'mc-woocommerce');?></strong> <span id="mailchimp_account_connected"><?php echo $account_name; ?></span></p>
73
- <p><strong><?php esc_html_e('Audience Connected:', 'mc-woocommerce');?></strong> <span id="mailchimp_list_name"><?php echo $mailchimp_list_name; ?></span></p>
74
- <p><strong><?php esc_html_e('Products Synced:', 'mc-woocommerce');?></strong> <span id="mailchimp_product_count"><?php echo $mailchimp_total_products; ?></span></p>
75
- <p><strong><?php esc_html_e('Orders Synced:', 'mc-woocommerce');?></strong> <span id="mailchimp_order_count"><?php echo $mailchimp_total_orders; ?></span></p>
 
 
 
 
 
 
 
 
 
 
 
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  <?php if($mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1')): ?>
78
- <h2 style="padding-top: 1em;"><?php esc_html_e('Advanced', 'mc-woocommerce');?></h2>
79
- <p id="resync_data_help_text">
80
- <?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', 'mc-woocommerce');?>
81
- </p>
82
- <?php submit_button(__('Resync', 'mc-woocommerce'), 'primary','submit', TRUE); ?>
83
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  $store_id = mailchimp_get_store_id();
4
+
5
  $product_count = mailchimp_get_product_count();
6
  $order_count = mailchimp_get_order_count();
7
+ $promo_rules_count = mailchimp_count_posts('shop_coupon');
8
+ $subscribers_args = array(
9
+ 'meta_key' => 'mailchimp_woocommerce_is_subscribed',
10
+ 'meta_value' => true
11
+ );
12
+ $subscribers_count = get_users($subscribers_args);
13
+
14
+ $mailchimp_total_products = $mailchimp_total_orders = $mailchimp_total_promo_rules = 0;
15
+ $mailchimp_total_subscribers = $mailchimp_total_unsubscribed = $mailchimp_total_transactional = 0;
16
+
17
  $store_syncing = false;
18
  $last_updated_time = get_option('mailchimp-woocommerce-resource-last-updated');
19
  $sync_started_at = get_option('mailchimp-woocommerce-sync.started_at');
46
  if (($account_details = $handler->getAccountDetails())) {
47
  $account_name = $account_details['account_name'];
48
  }
49
+ try {
50
+ $promo_rules = $mailchimp_api->getPromoRules($store_id, 1, 1, 1);
51
+ $mailchimp_total_promo_rules = $promo_rules['total_items'];
52
+ if ($mailchimp_total_promo_rules > $promo_rules_count['publish']) $mailchimp_total_promo_rules = $promo_rules_count['publish'];
53
+ } catch (\Exception $e) { $mailchimp_total_promo_rules = 0; }
54
  try {
55
  $products = $mailchimp_api->products($store_id, 1, 1);
56
  $mailchimp_total_products = $products['total_items'];
61
  $mailchimp_total_orders = $orders['total_items'];
62
  if ($mailchimp_total_orders > $order_count) $mailchimp_total_orders = $order_count;
63
  } catch (\Exception $e) { $mailchimp_total_orders = 0; }
64
+ try {
65
+ $mailchimp_total_subscribers = $mailchimp_api->getSubscribedCount($store->getListId());
66
+ } catch (\Exception $e) { $mailchimp_total_subscribers = 0; }
67
+ try {
68
+ $mailchimp_total_transactional = $mailchimp_api->getTransactionalCount($store->getListId());
69
+ } catch (\Exception $e) { $mailchimp_total_transactional = 0; }
70
+ try {
71
+ $mailchimp_total_unsubscribed = $mailchimp_api->getUnsubscribedCount($store->getListId());
72
+ } catch (\Exception $e) { $mailchimp_total_unsubscribed = 0; }
73
+
74
  $mailchimp_list_name = $handler->getListName();
75
  }
76
  ?>
 
77
  <input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
78
+ <div class="sync-content-wrapper">
79
+ <div class="sync-stats-wrapper sync-stats-store">
80
+ <div class="box sync-stats-card promo_rules" >
81
+ <div class="sync-stats-card-content">
82
+ <span class="card_label"><strong><?php esc_html_e('Coupons', 'mc-woocommerce');?></strong></span>
83
+ <span class="card_count" id="mailchimp_promo_rules_count"><?php echo $mailchimp_total_promo_rules; ?></span>
84
+ <div class="progress-bar-wrapper">
85
+ <span class="card_count_label mailchimp_promo_rules_count_partial"></span>
86
+ <div class="progress-bar"></div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <div class="box sync-stats-card products" >
91
+ <div class="sync-stats-card-content">
92
+ <span class="card_label"><strong><?php esc_html_e('Products', 'mc-woocommerce');?></strong></span>
93
+ <span class="card_count" id="mailchimp_product_count"><?php echo $mailchimp_total_products; ?></span>
94
+ <div class="progress-bar-wrapper">
95
+ <span class="card_count_label mailchimp_product_count_partial"></span>
96
+ <div class="progress-bar"></div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ <div class="box sync-stats-card orders" >
101
+ <div class="sync-stats-card-content">
102
+ <span class="card_label"><strong><?php esc_html_e('Orders', 'mc-woocommerce');?></strong></span>
103
+ <span class="card_count" id="mailchimp_order_count"><?php echo $mailchimp_total_orders; ?></span>
104
+ <div class="progress-bar-wrapper">
105
+ <div class="progress-bar"></div>
106
+ <span class="card_count_label mailchimp_order_count_partial"></span>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
 
112
+ <div class="sync-stats-wrapper sync-stats-audience" style="margin-top: 26px;">
113
+ <div class="box sync-stats-card subscribers" >
114
+ <div class="sync-stats-card-content">
115
+ <span class="card_label"><strong><?php esc_html_e('Subscribers', 'mc-woocommerce');?></strong></span>
116
+ <span class="card_count" id="mailchimp_subscriber_count"><?php echo $mailchimp_total_subscribers; ?></span>
117
+ <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
118
+ </div>
119
+ </div>
120
+ <div class="box sync-stats-card transactional" >
121
+ <div class="sync-stats-card-content">
122
+ <span class="card_label"><strong><?php esc_html_e('Transactional', 'mc-woocommerce');?></strong></span>
123
+ <span class="card_count" id="mailchimp_transactional_count"><?php echo $mailchimp_total_transactional; ?></span>
124
+ <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
125
+ </div>
126
+ </div>
127
+ <div class="box sync-stats-card unsubscribed" >
128
+ <div class="sync-stats-card-content">
129
+ <span class="card_label"><strong><?php esc_html_e('Unsubscribed', 'mc-woocommerce');?></strong></span>
130
+ <span class="card_count" id="mailchimp_unsubscribed_count"><?php echo $mailchimp_total_unsubscribed; ?></span>
131
+ <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
132
+ </div>
133
+ </div>
134
+ </div>
135
 
136
+ <div class="sync-controls-wrapper">
137
+ <div class="box sync-controls">
138
+ <?php wp_nonce_field( '_disconnect-nonce-'.$store_id, '_disconnect-nonce' ); ?>
 
 
 
 
 
 
 
 
139
 
140
+ <button id="mailchimp_woocommerce_disconnect"
141
+ type="submit"
142
+ name="mailchimp_woocommerce_disconnect_store"
143
+ class="mc-woocommerce-disconnect-button"
144
+ value="1">
145
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
146
+ <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"/>
147
+ </svg>
148
+ <?php esc_html_e('DISCONNECT STORE', 'mc-woocommerce');?>
149
+ </button>
150
+
151
+ <p><strong><?php esc_html_e('Account Connected', 'mc-woocommerce');?></strong></p> <p id="mailchimp_account_connected"><?php echo $account_name; ?></p>
152
+ <br/>
153
+ <p><strong><?php esc_html_e('Audience Connected', 'mc-woocommerce');?></strong></p>
154
+ <p id="mailchimp_list_name"><?php echo $mailchimp_list_name; ?></p>
155
 
156
+ <div class="mc-woocommerce-last-sync">
157
+ <p>
158
+ <?php if ($last_updated_time): ?>
159
+ <?php esc_html_e('Status:', 'mc-woocommerce');?>
160
+ <?= mailchimp_is_done_syncing() ? esc_html_e('Sync Completed', 'mc-woocommerce') : esc_html_e('Syncing...', 'mc-woocommerce'); ?>
161
+ <?php elseif ($sync_started_at && !$sync_completed_at): ?>
162
+ <?php esc_html_e('Initial sync in progress', 'mc-woocommerce');?>
163
+ <?php endif;?>
164
+ </p>
165
+ <p>
166
+ <?php esc_html_e('Last Updated:', 'mc-woocommerce');?>
167
+ <i id="mailchimp_last_updated">
168
+ <?php if ($last_updated_time): ?>
169
+ <?php echo $last_updated_time->format( __('D, M j, Y g:i A', 'mc-woocommerce')); ?>
170
+ <?php else : ?>
171
+ <?php esc_html_e('Starting...', 'mc-woocommerce'); ?>
172
+ <?php endif;?>
173
+ </i>
174
+ <span class="spinner" style="float:none; background-size: 16px 16px; width: 16px; height: 16px; margin: 0px 10px"></span>
175
+ </p>
176
+ </div>
177
+ </div>
178
+
179
+ </div>
180
+ </div>
181
  <?php if($mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1')): ?>
182
+ <h2 style="padding-top: 1em;"><?php esc_html_e('Advanced', 'mc-woocommerce');?></h2>
183
+ <p id="resync_data_help_text">
184
+ <?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', 'mc-woocommerce');?>
185
+ </p>
186
+ <?php submit_button(__('Force Resync', 'mc-woocommerce'), 'primary mc-woocommerce-resync-button','submit', TRUE); ?>
187
  <?php endif; ?>
188
+
189
+ <h2 style="padding-top: 1em;"><?php esc_html_e('More Information', 'mc-woocommerce'); ?></h2>
190
+ <ul>
191
+ <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>.', 'mc-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/issues/158' ) );?></li>
192
+ <li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', 'mc-woocommerce');?></li>
193
+ <li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help to connect your store? Visit the Mailchimp <a href=%s target=_blank>Knowledge Base</a>.', 'mc-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/' ) );?></li>
194
+ <li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Want to tell us how we\'re doing? <a href=%s target=_blank>Leave a review on Wordpress.org</a>.', 'mc-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
195
+ <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>.', 'mc-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
196
+ </ul>
bootstrap.php CHANGED
@@ -91,12 +91,12 @@ function mailchimp_environment_variables() {
91
 
92
  return (object) array(
93
  'repo' => 'master',
94
- 'environment' => 'staging', // staging or production
95
- 'version' => '2.1.17',
96
  'php_version' => phpversion(),
97
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
98
  'wc_version' => function_exists('WC') ? WC()->version : null,
99
- 'logging' => ($o && is_array($o) && isset($o['mailchimp_logging'])) ? $o['mailchimp_logging'] : 'debug',
100
  );
101
  }
102
 
@@ -173,7 +173,7 @@ function mailchimp_handle_or_queue(WP_Job $job, $delay = 0, $force_now = false)
173
  if ($job instanceof \MailChimp_WooCommerce_Single_Order && isset($job->order_id)) {
174
  // if this is a order process already queued - just skip this
175
  if (get_site_transient("mailchimp_order_being_processed_{$job->order_id}") == true) {
176
- mailchimp_debug('order_sync.abort', "transient true for order {$job->order_id}. Skipping queue item addition.");
177
  return;
178
  }
179
  // tell the system the order is already queued for processing in this saving process - and we don't need to process it again.
@@ -295,6 +295,23 @@ function mailchimp_get_list_id() {
295
  */
296
  function mailchimp_get_store_id() {
297
  $store_id = mailchimp_get_data('store_id', false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  if (empty($store_id)) {
299
  mailchimp_set_data('store_id', $store_id = uniqid(), 'yes');
300
  }
@@ -906,7 +923,7 @@ function mailchimp_woocommerce_check_if_http_worker_fails() {
906
  if (!mailchimp_should_use_local_curl_for_rest_api() && !function_exists('wp_remote_post')) {
907
  mailchimp_set_data('test.can.remote_post', false);
908
  mailchimp_set_data('test.can.remote_post.error', 'function "wp_remote_post" does not exist');
909
- return __('function "wp_remote_post" does not exist', 'mailchimp-woocommerce');
910
  }
911
 
912
  // apply a blocking call to make sure we get the response back
@@ -920,7 +937,7 @@ function mailchimp_woocommerce_check_if_http_worker_fails() {
920
  } elseif (is_array($response) && isset($response['http_response']) && ($r = $response['http_response'])) {
921
  /** @var \WP_HTTP_Requests_Response $r */
922
  if ((int) $r->get_status() !== 200) {
923
- $message = __('The REST API seems to be disabled on this wordpress site. Please enable to sync data.', 'mailchimp-woocommerce');
924
  mailchimp_set_data('test.can.remote_post', false);
925
  mailchimp_set_data('test.can.remote_post.error', $message);
926
  mailchimp_error('test.rest_api', '', array(
91
 
92
  return (object) array(
93
  'repo' => 'master',
94
+ 'environment' => 'production', // staging or production
95
+ 'version' => '2.2',
96
  'php_version' => phpversion(),
97
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
98
  'wc_version' => function_exists('WC') ? WC()->version : null,
99
+ 'logging' => ($o && is_array($o) && isset($o['mailchimp_logging'])) ? $o['mailchimp_logging'] : 'standard',
100
  );
101
  }
102
 
173
  if ($job instanceof \MailChimp_WooCommerce_Single_Order && isset($job->order_id)) {
174
  // if this is a order process already queued - just skip this
175
  if (get_site_transient("mailchimp_order_being_processed_{$job->order_id}") == true) {
176
+ mailchimp_debug('order_sync.skip', "Order {$job->order_id} already added successfully to queue. Skipping.");
177
  return;
178
  }
179
  // tell the system the order is already queued for processing in this saving process - and we don't need to process it again.
295
  */
296
  function mailchimp_get_store_id() {
297
  $store_id = mailchimp_get_data('store_id', false);
298
+ $api = mailchimp_get_api();
299
+ if (mailchimp_is_configured()) {
300
+ // let's retrieve the store for this domain, through the API
301
+ $store = $api->getStore($store_id, false);
302
+ // if there's no store, try to fetch from mc a store related to the current domain
303
+ if (!$store) {
304
+ $stores = $api->stores();
305
+ //iterate thru stores, find correct store ID and save it to db
306
+ foreach ($stores as $mc_store) {
307
+ if ($mc_store->getDomain() === get_option('siteurl')) {
308
+ update_option('mailchimp-woocommerce-store_id', $mc_store->getId(), 'yes');
309
+ $store_id = $mc_store->getId();
310
+ }
311
+ }
312
+ }
313
+ }
314
+
315
  if (empty($store_id)) {
316
  mailchimp_set_data('store_id', $store_id = uniqid(), 'yes');
317
  }
923
  if (!mailchimp_should_use_local_curl_for_rest_api() && !function_exists('wp_remote_post')) {
924
  mailchimp_set_data('test.can.remote_post', false);
925
  mailchimp_set_data('test.can.remote_post.error', 'function "wp_remote_post" does not exist');
926
+ return __('function "wp_remote_post" does not exist', 'mc-woocommerce');
927
  }
928
 
929
  // apply a blocking call to make sure we get the response back
937
  } elseif (is_array($response) && isset($response['http_response']) && ($r = $response['http_response'])) {
938
  /** @var \WP_HTTP_Requests_Response $r */
939
  if ((int) $r->get_status() !== 200) {
940
+ $message = __('The REST API seems to be disabled on this wordpress site. Please enable to sync data.', 'mc-woocommerce');
941
  mailchimp_set_data('test.can.remote_post', false);
942
  mailchimp_set_data('test.can.remote_post.error', $message);
943
  mailchimp_error('test.rest_api', '', array(
includes/api/assets/class-mailchimp-order.php CHANGED
@@ -265,13 +265,23 @@ class MailChimp_WooCommerce_Order
265
  }
266
 
267
  /**
268
- * @param null $currency_code
269
  * @return MailChimp_WooCommerce_Order
270
  */
271
- public function setCurrencyCode()
272
  {
273
- $woo = new WC_Order($this->id);
274
- $this->currency_code = $woo->get_currency();
 
 
 
 
 
 
 
 
 
 
275
  return $this;
276
  }
277
 
265
  }
266
 
267
  /**
268
+ * @param null $code
269
  * @return MailChimp_WooCommerce_Order
270
  */
271
+ public function setCurrencyCode($code = null)
272
  {
273
+ if (!empty($code)) {
274
+ $this->currency_code = $code;
275
+ return $this;
276
+ }
277
+
278
+ try {
279
+ $woo = new WC_Order($this->id);
280
+ $this->currency_code = $woo->get_currency();
281
+ } catch (\Exception $e) {
282
+ $this->currency_code = get_woocommerce_currency();
283
+ }
284
+
285
  return $this;
286
  }
287
 
includes/api/class-mailchimp-api.php CHANGED
@@ -264,27 +264,73 @@ class MailChimp_WooCommerce_MailChimpApi
264
  return $this->patch("lists/$list_id/members/$hash", $data);
265
  }
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  /**
268
  * @param $list_id
269
  * @param $email
270
- * @return array|mixed|null|object
271
- * @throws Exception
272
- * @throws MailChimp_WooCommerce_Error
273
  */
274
- public function updateMemberTags($list_id, $email)
275
  {
276
  $hash = md5(strtolower(trim($email)));
277
  $tags = mailchimp_get_user_tags_to_update();
278
-
279
  if (empty($tags)) return false;
280
-
281
  $data = array(
282
  'tags' => $tags
283
  );
284
 
285
  mailchimp_debug('api.update_member_tags', "Updating {$email}", $data);
286
 
287
- return $this->post("lists/$list_id/members/$hash/tags", $data);
 
 
 
 
 
 
288
  }
289
 
290
  /**
@@ -593,7 +639,7 @@ class MailChimp_WooCommerce_MailChimpApi
593
  public function stores()
594
  {
595
  try {
596
- $data = $this->get("ecommerce/stores", array('count' => 50));
597
 
598
  if (!isset($data['stores']) || empty($data['stores'])) {
599
  return array();
@@ -902,10 +948,7 @@ class MailChimp_WooCommerce_MailChimpApi
902
  // submit the first one
903
  $data = $this->post("ecommerce/stores/$store_id/orders", $order->toArray());
904
 
905
- //update user tags
906
- $customer = $order->getCustomer();
907
- $list_id = mailchimp_get_list_id();
908
- $user = $this->updateMemberTags($list_id, $customer->getEmailAddress());
909
 
910
  // if the order is in pending status, we need to submit the order again with a paid status.
911
  if ($order->shouldConfirmAndPay() && $order->getFinancialStatus() !== 'paid') {
@@ -913,6 +956,9 @@ class MailChimp_WooCommerce_MailChimpApi
913
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order->getId()}", $order->toArray());
914
  }
915
 
 
 
 
916
  update_option('mailchimp-woocommerce-resource-last-updated', time());
917
  $order = new MailChimp_WooCommerce_Order();
918
  return $order->fromArray($data);
@@ -938,11 +984,9 @@ class MailChimp_WooCommerce_MailChimpApi
938
  }
939
  $order_id = $order->getId();
940
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order_id}", $order->toArray());
941
-
942
  //update user tags
943
- $customer = $order->getCustomer();
944
- $list_id = mailchimp_get_list_id();
945
- $user = $this->updateMemberTags($list_id, $customer->getEmailAddress());
946
 
947
  // if products list differs, we should remove the old products and add new ones
948
  $data_lines = $data['lines'];
@@ -959,6 +1003,9 @@ class MailChimp_WooCommerce_MailChimpApi
959
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order_id}", $order->toArray());
960
  }
961
 
 
 
 
962
  $order = new MailChimp_WooCommerce_Order();
963
  return $order->fromArray($data);
964
  } catch (\Exception $e) {
@@ -1624,9 +1671,13 @@ class MailChimp_WooCommerce_MailChimpApi
1624
  }
1625
 
1626
  if ($info['http_code'] >= 400 && $info['http_code'] <= 500) {
 
 
 
1627
  if ($info['http_code'] == 403) {
1628
  throw new MailChimp_WooCommerce_RateLimitError();
1629
  }
 
1630
  throw new MailChimp_WooCommerce_Error($data['title'] .' :: '.$data['detail'], $data['status']);
1631
  }
1632
 
264
  return $this->patch("lists/$list_id/members/$hash", $data);
265
  }
266
 
267
+ /**
268
+ * @param $list_id
269
+ * @return mixed
270
+ * @throws \Throwable
271
+ */
272
+ public function getSubscribedCount($list_id)
273
+ {
274
+ if (empty($list_id)) {
275
+ return 0;
276
+ }
277
+ return $this->get("lists/{$list_id}/members?status=subscribed&count=1")['total_items'];
278
+ }
279
+
280
+ /**
281
+ * @param $list_id
282
+ * @return mixed
283
+ * @throws \Throwable
284
+ */
285
+ public function getUnsubscribedCount($list_id)
286
+ {
287
+ if (empty($list_id)) {
288
+ return 0;
289
+ }
290
+ return $this->get("lists/{$list_id}/members?status=unsubscribed&count=1")['total_items'];
291
+ }
292
+
293
+ /**
294
+ * @param $list_id
295
+ * @return mixed
296
+ * @throws \Throwable
297
+ */
298
+ public function getTransactionalCount($list_id)
299
+ {
300
+ if (empty($list_id)) {
301
+ return 0;
302
+ }
303
+ return $this->get("lists/{$list_id}/members?status=transactional&count=1")['total_items'];
304
+ }
305
+
306
+
307
  /**
308
  * @param $list_id
309
  * @param $email
310
+ * @param bool $fail_silently
311
+ * @return array|bool|mixed|object|null
312
+ * @throws MailChimp_WooCommerce_Error|\Exception
313
  */
314
+ public function updateMemberTags($list_id, $email, $fail_silently = false)
315
  {
316
  $hash = md5(strtolower(trim($email)));
317
  $tags = mailchimp_get_user_tags_to_update();
318
+
319
  if (empty($tags)) return false;
320
+
321
  $data = array(
322
  'tags' => $tags
323
  );
324
 
325
  mailchimp_debug('api.update_member_tags', "Updating {$email}", $data);
326
 
327
+ try {
328
+ return $this->post("lists/$list_id/members/$hash/tags", $data);
329
+ } catch (\Exception $e) {
330
+ if (!$fail_silently) throw $e;
331
+ }
332
+
333
+ return false;
334
  }
335
 
336
  /**
639
  public function stores()
640
  {
641
  try {
642
+ $data = $this->get("ecommerce/stores", array('count' => 1000));
643
 
644
  if (!isset($data['stores']) || empty($data['stores'])) {
645
  return array();
948
  // submit the first one
949
  $data = $this->post("ecommerce/stores/$store_id/orders", $order->toArray());
950
 
951
+ $email_address = $order->getCustomer()->getEmailAddress();
 
 
 
952
 
953
  // if the order is in pending status, we need to submit the order again with a paid status.
954
  if ($order->shouldConfirmAndPay() && $order->getFinancialStatus() !== 'paid') {
956
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order->getId()}", $order->toArray());
957
  }
958
 
959
+ // update the member tags but fail silently just in case.
960
+ $this->updateMemberTags(mailchimp_get_list_id(), $email_address, true);
961
+
962
  update_option('mailchimp-woocommerce-resource-last-updated', time());
963
  $order = new MailChimp_WooCommerce_Order();
964
  return $order->fromArray($data);
984
  }
985
  $order_id = $order->getId();
986
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order_id}", $order->toArray());
987
+
988
  //update user tags
989
+ $email_address = $order->getCustomer()->getEmailAddress();
 
 
990
 
991
  // if products list differs, we should remove the old products and add new ones
992
  $data_lines = $data['lines'];
1003
  $data = $this->patch("ecommerce/stores/{$store_id}/orders/{$order_id}", $order->toArray());
1004
  }
1005
 
1006
+ // update the member tags but fail silently just in case.
1007
+ $this->updateMemberTags(mailchimp_get_list_id(), $email_address, true);
1008
+
1009
  $order = new MailChimp_WooCommerce_Order();
1010
  return $order->fromArray($data);
1011
  } catch (\Exception $e) {
1671
  }
1672
 
1673
  if ($info['http_code'] >= 400 && $info['http_code'] <= 500) {
1674
+ if ($info['http_code'] == 404) {
1675
+ mailchimp_error('api', 'processCurlResponse', array('info' => $info, 'data' => $data));
1676
+ }
1677
  if ($info['http_code'] == 403) {
1678
  throw new MailChimp_WooCommerce_RateLimitError();
1679
  }
1680
+
1681
  throw new MailChimp_WooCommerce_Error($data['title'] .' :: '.$data['detail'], $data['status']);
1682
  }
1683
 
includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php CHANGED
@@ -86,7 +86,7 @@ class MailChimp_WooCommerce_Transform_Orders
86
 
87
  $order->setProcessedAt($woo->get_date_created()->setTimezone(new \DateTimeZone('UTC')));
88
 
89
- $order->setCurrencyCode();
90
 
91
  // grab the current statuses - this will end up being custom at some point.
92
  $statuses = $this->getOrderStatuses();
86
 
87
  $order->setProcessedAt($woo->get_date_created()->setTimezone(new \DateTimeZone('UTC')));
88
 
89
+ $order->setCurrencyCode($woo->get_currency());
90
 
91
  // grab the current statuses - this will end up being custom at some point.
92
  $statuses = $this->getOrderStatuses();
includes/api/helpers/class-mailchimp-woocommerce-api-currency-codes.php CHANGED
@@ -1101,4 +1101,19 @@ class MailChimp_WooCommerce_CurrencyCodes
1101
  }
1102
  return $response;
1103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1104
  }
1101
  }
1102
  return $response;
1103
  }
1104
+
1105
+ /**
1106
+ * @return array
1107
+ */
1108
+ public static function getCurrency($alpha3)
1109
+ {
1110
+ $response = array();
1111
+ foreach (static::currencies() as $key => $data) {
1112
+ if ($data['alpha3'] == $alpha3) {
1113
+ return $data;
1114
+ }
1115
+
1116
+ }
1117
+ return null;
1118
+ }
1119
  }
includes/class-mailchimp-woocommerce-activator.php CHANGED
@@ -95,7 +95,7 @@ class MailChimp_WooCommerce_Activator {
95
 
96
  dbDelta( $sql );
97
 
98
- // set the mailchimp woocommerce version at the time of install
99
  update_site_option('mailchimp_woocommerce_version', mailchimp_environment_variables()->version);
100
  }
101
  }
95
 
96
  dbDelta( $sql );
97
 
98
+ // set the Mailchimp woocommerce version at the time of install
99
  update_site_option('mailchimp_woocommerce_version', mailchimp_environment_variables()->version);
100
  }
101
  }
includes/class-mailchimp-woocommerce-deactivation-survey.php CHANGED
@@ -176,10 +176,10 @@ if ( ! class_exists( 'Mailchimp_Woocommerce_Deactivation_Survey', false ) ) {
176
  $form.submit(function(event) {
177
  event.preventDefault();
178
  if (! $form.find('input[type=radio]:checked').val()) {
179
- $form.find('.mailchimp-woocommerce-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'mailchimp-woocommerce' ) ); ?></span>');
180
  return;
181
  }
182
- $form.find('.mailchimp-woocommerce-deactivate-survey-submit').html('<?php echo esc_js( __( 'Sending Feedback', 'mailchimp-woocommerce' ) ); ?>').attr("disabled", true).removeClass('button-primary');
183
  var submitSurvey = $.ajax(
184
  {
185
  url: "<?php echo $this->endpoint; ?>",
@@ -324,41 +324,41 @@ if ( ! class_exists( 'Mailchimp_Woocommerce_Deactivation_Survey', false ) ) {
324
 
325
  $options = array(
326
  1 => array(
327
- 'title' => esc_html__( 'I want to change the audience associated with this integration.', 'mailchimp-woocommerce' ),
328
  'reason' => 'I want to change the audience associated with this integration.'
329
  ),
330
  2 => array(
331
- 'title' => esc_html__( 'I want to change the site or store connected through this integration.', 'mailchimp-woocommerce' ),
332
  'reason' => 'I want to change the site or store connected through this integration.'
333
  ),
334
  3 => array(
335
- 'title' => esc_html__( 'The order data isn\'t syncing.', 'mailchimp-woocommerce' ),
336
  'reason' => 'The order data isn\'t syncing.'
337
  ),
338
  4 => array(
339
- 'title' => esc_html__( 'The promo codes aren\'t showing up.', 'mailchimp-woocommerce' ),
340
  'reason' => 'The promo codes aren\'t showing up.'
341
  ),
342
  5 => array(
343
- 'title' => esc_html__( 'I\'m trying to troubleshoot the integration.', 'mailchimp-woocommerce' ),
344
  'reason' => 'I\'m trying to troubleshoot the integration.'
345
  ),
346
  6 => array(
347
- 'title' => esc_html__( 'I was instructed to disconnect by Mailchimp Support.', 'mailchimp-woocommerce' ),
348
  'reason' => 'I was instructed to disconnect by Mailchimp Support.'
349
  ),
350
  7 => array(
351
- 'title' => esc_html__( 'I no longer use this integration.', 'mailchimp-woocommerce' ),
352
  'reason' => 'I no longer use this integration.'
353
  ),
354
  8 => array(
355
- 'title' => esc_html__( 'It\'s a temporary deactivation.', 'mailchimp-woocommerce' ),
356
  'reason' => 'It\'s a temporary deactivation.'
357
  ),
358
  9 => array(
359
- 'title' => esc_html__( 'Other', 'mailchimp-woocommerce' ),
360
  'reason' => 'Other',
361
- 'details' => esc_html__( 'Please share the reason', 'mailchimp-woocommerce' ),
362
  ),
363
  );
364
  ?>
@@ -367,15 +367,15 @@ if ( ! class_exists( 'Mailchimp_Woocommerce_Deactivation_Survey', false ) ) {
367
  <form class="mailchimp-woocommerce-deactivate-survey" method="post">
368
  <span class="mailchimp-woocommerce-deactivate-survey-header">
369
  <span class="dashicons dashicons-testimonial"></span>
370
- <?php echo ' ' . esc_html__( 'Quick Feedback', 'mailchimp-woocommerce' ); ?>
371
- <span title="<?php esc_attr_e( 'Close', 'mailchimp-woocommerce' );?> " class="mailchimp-woocommerce-deactivate-survey-close">✕</span>
372
  </span>
373
 
374
  <span class="mailchimp-woocommerce-deactivate-survey-desc">
375
  <?php
376
  printf(
377
  /* translators: %s - plugin name. */
378
- esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'mailchimp-woocommerce' ),
379
  esc_html__( 'Mailchimp for Woocommerce', 'mc-woocommerce')
380
  );
381
  ?>
@@ -395,8 +395,8 @@ if ( ! class_exists( 'Mailchimp_Woocommerce_Deactivation_Survey', false ) ) {
395
  <?php endforeach; ?>
396
  </div>
397
  <div class="mailchimp-woocommerce-deactivate-survey-footer">
398
- <button type="submit" class="mailchimp-woocommerce-deactivate-survey-submit button button-primary button-large"><?php echo esc_html__( 'Submit & Deactivate', 'mailchimp-woocommerce' ); ?></button>
399
- <a href="#" class="mailchimp-woocommerce-deactivate-survey-deactivate"><?php echo esc_html__( 'Skip & Deactivate', 'mailchimp-woocommerce' ); ?></a>
400
  </div>
401
  </form>
402
  </div>
176
  $form.submit(function(event) {
177
  event.preventDefault();
178
  if (! $form.find('input[type=radio]:checked').val()) {
179
+ $form.find('.mailchimp-woocommerce-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'mc-woocommerce' ) ); ?></span>');
180
  return;
181
  }
182
+ $form.find('.mailchimp-woocommerce-deactivate-survey-submit').html('<?php echo esc_js( __( 'Sending Feedback', 'mc-woocommerce' ) ); ?>').attr("disabled", true).removeClass('button-primary');
183
  var submitSurvey = $.ajax(
184
  {
185
  url: "<?php echo $this->endpoint; ?>",
324
 
325
  $options = array(
326
  1 => array(
327
+ 'title' => esc_html__( 'I want to change the audience associated with this integration.', 'mc-woocommerce' ),
328
  'reason' => 'I want to change the audience associated with this integration.'
329
  ),
330
  2 => array(
331
+ 'title' => esc_html__( 'I want to change the site or store connected through this integration.', 'mc-woocommerce' ),
332
  'reason' => 'I want to change the site or store connected through this integration.'
333
  ),
334
  3 => array(
335
+ 'title' => esc_html__( 'The order data isn\'t syncing.', 'mc-woocommerce' ),
336
  'reason' => 'The order data isn\'t syncing.'
337
  ),
338
  4 => array(
339
+ 'title' => esc_html__( 'The promo codes aren\'t showing up.', 'mc-woocommerce' ),
340
  'reason' => 'The promo codes aren\'t showing up.'
341
  ),
342
  5 => array(
343
+ 'title' => esc_html__( 'I\'m trying to troubleshoot the integration.', 'mc-woocommerce' ),
344
  'reason' => 'I\'m trying to troubleshoot the integration.'
345
  ),
346
  6 => array(
347
+ 'title' => esc_html__( 'I was instructed to disconnect by Mailchimp Support.', 'mc-woocommerce' ),
348
  'reason' => 'I was instructed to disconnect by Mailchimp Support.'
349
  ),
350
  7 => array(
351
+ 'title' => esc_html__( 'I no longer use this integration.', 'mc-woocommerce' ),
352
  'reason' => 'I no longer use this integration.'
353
  ),
354
  8 => array(
355
+ 'title' => esc_html__( 'It\'s a temporary deactivation.', 'mc-woocommerce' ),
356
  'reason' => 'It\'s a temporary deactivation.'
357
  ),
358
  9 => array(
359
+ 'title' => esc_html__( 'Other', 'mc-woocommerce' ),
360
  'reason' => 'Other',
361
+ 'details' => esc_html__( 'Please share the reason', 'mc-woocommerce' ),
362
  ),
363
  );
364
  ?>
367
  <form class="mailchimp-woocommerce-deactivate-survey" method="post">
368
  <span class="mailchimp-woocommerce-deactivate-survey-header">
369
  <span class="dashicons dashicons-testimonial"></span>
370
+ <?php echo ' ' . esc_html__( 'Quick Feedback', 'mc-woocommerce' ); ?>
371
+ <span title="<?php esc_attr_e( 'Close', 'mc-woocommerce' );?> " class="mailchimp-woocommerce-deactivate-survey-close">✕</span>
372
  </span>
373
 
374
  <span class="mailchimp-woocommerce-deactivate-survey-desc">
375
  <?php
376
  printf(
377
  /* translators: %s - plugin name. */
378
+ esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'mc-woocommerce' ),
379
  esc_html__( 'Mailchimp for Woocommerce', 'mc-woocommerce')
380
  );
381
  ?>
395
  <?php endforeach; ?>
396
  </div>
397
  <div class="mailchimp-woocommerce-deactivate-survey-footer">
398
+ <button type="submit" class="mailchimp-woocommerce-deactivate-survey-submit button button-primary button-large"><?php echo esc_html__( 'Submit & Deactivate', 'mc-woocommerce' ); ?></button>
399
+ <a href="#" class="mailchimp-woocommerce-deactivate-survey-deactivate"><?php echo esc_html__( 'Skip & Deactivate', 'mc-woocommerce' ); ?></a>
400
  </div>
401
  </form>
402
  </div>
includes/class-mailchimp-woocommerce-i18n.php CHANGED
@@ -35,7 +35,7 @@ class MailChimp_WooCommerce_i18n {
35
  public function load_plugin_textdomain() {
36
 
37
  load_plugin_textdomain(
38
- 'mailchimp-woocommerce',
39
  false,
40
  dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
41
  );
35
  public function load_plugin_textdomain() {
36
 
37
  load_plugin_textdomain(
38
+ 'mc-woocommerce',
39
  false,
40
  dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
41
  );
includes/class-mailchimp-woocommerce-privacy.php CHANGED
@@ -9,7 +9,7 @@ class MailChimp_WooCommerce_Privacy
9
  {
10
  if (function_exists( 'wp_add_privacy_policy_content')) {
11
  $content = sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */
12
- __( 'When shopping, we keep a record of your email and the cart contents for up to 30 days on our server. This record is kept to repopulate the contents of your cart if you switch devices or needed to come back another day. Read our privacy policy <a href="%s">here</a>.', 'mailchimp-woocommerce' ),
13
  'https://mailchimp.com/legal/privacy/'
14
 
15
  );
@@ -75,11 +75,11 @@ class MailChimp_WooCommerce_Privacy
75
  'data' => array(
76
  array(
77
  'group_id' => 'mailchimp_cart',
78
- 'group_label' => __( 'MailChimp Shopping Cart Data', 'mailchimp-woocommerce' ),
79
  'item_id' => 'mailing-shopping-cart-1',
80
  'data' => array(
81
  array(
82
- 'name' => __( 'User ID', 'mailchimp-woocommerce' ),
83
  'value' => $uid,
84
  ),
85
  $data, // this is already an associative array with name and value keys
9
  {
10
  if (function_exists( 'wp_add_privacy_policy_content')) {
11
  $content = sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */
12
+ __( 'When shopping, we keep a record of your email and the cart contents for up to 30 days on our server. This record is kept to repopulate the contents of your cart if you switch devices or needed to come back another day. Read our privacy policy <a href="%s">here</a>.', 'mc-woocommerce' ),
13
  'https://mailchimp.com/legal/privacy/'
14
 
15
  );
75
  'data' => array(
76
  array(
77
  'group_id' => 'mailchimp_cart',
78
+ 'group_label' => __( 'MailChimp Shopping Cart Data', 'mc-woocommerce' ),
79
  'item_id' => 'mailing-shopping-cart-1',
80
  'data' => array(
81
  array(
82
+ 'name' => __( 'User ID', 'mc-woocommerce' ),
83
  'value' => $uid,
84
  ),
85
  $data, // this is already an associative array with name and value keys
includes/class-mailchimp-woocommerce-rest-api.php CHANGED
@@ -256,9 +256,15 @@ class MailChimp_WooCommerce_Rest_Api
256
  }
257
 
258
  $store_id = mailchimp_get_store_id();
 
259
  $product_count = mailchimp_get_product_count();
260
  $order_count = mailchimp_get_order_count();
261
 
 
 
 
 
 
262
  try {
263
  $products = $api->products($store_id, 1, 1);
264
  $mailchimp_total_products = $products['total_items'];
@@ -275,11 +281,16 @@ class MailChimp_WooCommerce_Rest_Api
275
  // but we need to do it just in case.
276
  return mailchimp_rest_response(array(
277
  'success' => true,
 
 
278
  'products_in_store' => $product_count,
279
  'products_in_mailchimp' => $mailchimp_total_products,
280
  'orders_in_store' => $order_count,
281
  'orders_in_mailchimp' => $mailchimp_total_orders,
282
- 'date' => date_i18n( __('D, M j, Y g:i A', 'mc-woocommerce'), $date->getTimestamp()),
 
 
 
283
  'has_started' => mailchimp_has_started_syncing(),
284
  'has_finished' => mailchimp_is_done_syncing(),
285
  ));
256
  }
257
 
258
  $store_id = mailchimp_get_store_id();
259
+ $promo_rules_count = mailchimp_count_posts('shop_coupon');
260
  $product_count = mailchimp_get_product_count();
261
  $order_count = mailchimp_get_order_count();
262
 
263
+ try {
264
+ $promo_rules = $api->getPromoRules($store_id, 1, 1, 1);
265
+ $mailchimp_total_promo_rules = $promo_rules['total_items'];
266
+ if ($mailchimp_total_promo_rules > $promo_rules_count['publish']) $mailchimp_total_promo_rules = $promo_rules_count['publish'];
267
+ } catch (\Exception $e) { $mailchimp_total_promo_rules = 0; }
268
  try {
269
  $products = $api->products($store_id, 1, 1);
270
  $mailchimp_total_products = $products['total_items'];
281
  // but we need to do it just in case.
282
  return mailchimp_rest_response(array(
283
  'success' => true,
284
+ 'promo_rules_in_store' => (int) $promo_rules_count['publish'],
285
+ 'promo_rules_in_mailchimp' => $mailchimp_total_promo_rules,
286
  'products_in_store' => $product_count,
287
  'products_in_mailchimp' => $mailchimp_total_products,
288
  'orders_in_store' => $order_count,
289
  'orders_in_mailchimp' => $mailchimp_total_orders,
290
+ 'promo_rules_page' => get_option('mailchimp-woocommerce-sync.coupons.current_page'),
291
+ 'products_page' => get_option('mailchimp-woocommerce-sync.products.current_page'),
292
+ 'orders_page' => get_option('mailchimp-woocommerce-sync.orders.current_page'),
293
+ 'date' => $date->format( __('D, M j, Y g:i A', 'mc-woocommerce')),
294
  'has_started' => mailchimp_has_started_syncing(),
295
  'has_finished' => mailchimp_is_done_syncing(),
296
  ));
includes/class-mailchimp-woocommerce-service.php CHANGED
@@ -110,7 +110,8 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
110
  public function handleOrderStatusChanged($order_id, $old_status, $new_status)
111
  {
112
  if (!mailchimp_is_configured()) return;
113
-
 
114
  $newOrder = false;
115
 
116
  if ("pending" == $old_status && "processing" == $new_status) {
@@ -422,7 +423,7 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
422
  }
423
 
424
  /**
425
- * Set the cookie of the mailchimp campaigns if we have one.
426
  */
427
  public function handleCampaignTracking()
428
  {
110
  public function handleOrderStatusChanged($order_id, $old_status, $new_status)
111
  {
112
  if (!mailchimp_is_configured()) return;
113
+
114
+ $tracking = null;
115
  $newOrder = false;
116
 
117
  if ("pending" == $old_status && "processing" == $new_status) {
423
  }
424
 
425
  /**
426
+ * Set the cookie of the Mailchimp campaigns if we have one.
427
  */
428
  public function handleCampaignTracking()
429
  {
includes/class-mailchimp-woocommerce.php CHANGED
@@ -253,6 +253,10 @@ class MailChimp_WooCommerce
253
  if ( class_exists( 'WOOMULTI_CURRENCY_F' ) ) {
254
  $this->loader->add_action('villatheme_support_woo-multi-currency', $plugin_admin, 'mailchimp_update_woo_settings');
255
  }
 
 
 
 
256
  }
257
 
258
  /**
253
  if ( class_exists( 'WOOMULTI_CURRENCY_F' ) ) {
254
  $this->loader->add_action('villatheme_support_woo-multi-currency', $plugin_admin, 'mailchimp_update_woo_settings');
255
  }
256
+
257
+ // Mailchimp oAuth
258
+ $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_oauth_start', $plugin_admin, 'mailchimp_woocommerce_ajax_oauth_start' );
259
+ $this->loader->add_action( 'wp_ajax_mailchimp_woocommerce_oauth_finish', $plugin_admin, 'mailchimp_woocommerce_ajax_oauth_finish' );
260
  }
261
 
262
  /**
includes/processes/class-mailchimp-woocommerce-abstract-sync.php CHANGED
@@ -82,7 +82,7 @@ abstract class MailChimp_WooCommerce_Abstract_Sync extends WP_Job
82
  public function handle()
83
  {
84
  if (!mailchimp_is_configured()) {
85
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
86
  return false;
87
  }
88
 
82
  public function handle()
83
  {
84
  if (!mailchimp_is_configured()) {
85
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
86
  return false;
87
  }
88
 
includes/processes/class-mailchimp-woocommerce-cart-update.php CHANGED
@@ -79,7 +79,7 @@ class MailChimp_WooCommerce_Cart_Update extends WP_Job
79
  try {
80
 
81
  if (!mailchimp_is_configured() || !($api = mailchimp_get_api())) {
82
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
83
  return false;
84
  }
85
 
79
  try {
80
 
81
  if (!mailchimp_is_configured() || !($api = mailchimp_get_api())) {
82
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
83
  return false;
84
  }
85
 
includes/processes/class-mailchimp-woocommerce-rest-queue.php CHANGED
@@ -229,7 +229,7 @@ class MailChimp_WooCommerce_Rest_Queue
229
  public function unlock_worker()
230
  {
231
  if (!delete_site_transient('http_worker_lock')) {
232
- mailchimp_log('rest-queue', 'http_worker_lock did not delete properly - will respawn in 60 seconds.');
233
  }
234
  }
235
 
229
  public function unlock_worker()
230
  {
231
  if (!delete_site_transient('http_worker_lock')) {
232
+ mailchimp_log('rest-queue', 'http_worker_lock enabled - respawn in 60 seconds.');
233
  }
234
  }
235
 
includes/processes/class-mailchimp-woocommerce-single-coupon.php CHANGED
@@ -30,7 +30,7 @@ class MailChimp_WooCommerce_SingleCoupon extends WP_Job
30
  try {
31
 
32
  if (!mailchimp_is_configured()) {
33
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
34
  return false;
35
  }
36
 
30
  try {
31
 
32
  if (!mailchimp_is_configured()) {
33
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
34
  return false;
35
  }
36
 
includes/processes/class-mailchimp-woocommerce-single-order.php CHANGED
@@ -48,7 +48,7 @@ class MailChimp_WooCommerce_Single_Order extends WP_Job
48
  public function process()
49
  {
50
  if (!mailchimp_is_configured() || !($api = mailchimp_get_api())) {
51
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
52
  return false;
53
  }
54
 
@@ -179,6 +179,11 @@ class MailChimp_WooCommerce_Single_Order extends WP_Job
179
  $api->handleProductsMissingFromAPI($order);
180
  // make another attempt again to add the order.
181
  $api_response = $api->$call($store_id, $order, false);
 
 
 
 
 
182
  } else {
183
  throw $e;
184
  }
48
  public function process()
49
  {
50
  if (!mailchimp_is_configured() || !($api = mailchimp_get_api())) {
51
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
52
  return false;
53
  }
54
 
179
  $api->handleProductsMissingFromAPI($order);
180
  // make another attempt again to add the order.
181
  $api_response = $api->$call($store_id, $order, false);
182
+ } elseif (mailchimp_string_contains($e->getMessage(), 'campaign with the provided ID')) {
183
+ // the campaign was invalid, we need to remove it and re-submit
184
+ $order->setCampaignId(null);
185
+ // make another attempt again to add the order.
186
+ $api_response = $api->$call($store_id, $order, false);
187
  } else {
188
  throw $e;
189
  }
includes/processes/class-mailchimp-woocommerce-single-product.php CHANGED
@@ -76,7 +76,7 @@ class MailChimp_WooCommerce_Single_Product extends WP_Job
76
  }
77
 
78
  if (!mailchimp_is_configured()) {
79
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
80
  return false;
81
  }
82
 
76
  }
77
 
78
  if (!mailchimp_is_configured()) {
79
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
80
  return false;
81
  }
82
 
includes/processes/class-mailchimp-woocommerce-user-submit.php CHANGED
@@ -49,7 +49,7 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
49
  public function handle()
50
  {
51
  if (!mailchimp_is_configured()) {
52
- mailchimp_debug(get_called_class(), 'mailchimp is not configured properly');
53
  static::$handling_for = null;
54
  return false;
55
  }
49
  public function handle()
50
  {
51
  if (!mailchimp_is_configured()) {
52
+ mailchimp_debug(get_called_class(), 'Mailchimp is not configured properly');
53
  static::$handling_for = null;
54
  return false;
55
  }
languages/mailchimp-woocommerce-pt_BR.mo DELETED
Binary file
languages/mailchimp-woocommerce-pt_BR.po DELETED
@@ -1,774 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-woocommerce\n"
5
- "POT-Creation-Date: 2019-05-21T12:55:04+00:00\n"
6
- "PO-Revision-Date: 2019-05-21 14:56+0200\n"
7
- "Last-Translator: \n"
8
- "Language-Team: \n"
9
- "Language: pt_BR\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 2.0.7\n"
14
- "X-Poedit-Basepath: .\n"
15
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
16
-
17
- #. Plugin Name of the plugin
18
- msgid "Mailchimp for WooCommerce"
19
- msgstr "Mailchimp para Woocommerce"
20
-
21
- #. Plugin URI of the plugin
22
- msgid "https://mailchimp.com/connect-your-store/"
23
- msgstr ""
24
-
25
- #. Description of the plugin
26
- msgid ""
27
- "Connects WooCommerce to Mailchimp to sync your store data, send targeted "
28
- "campaigns to your customers, and sell more stuff."
29
- msgstr ""
30
- "Conecta o Woocommerce ao Mailchimp para sincronizar sua Loja, enviar "
31
- "campanhas segmentadas para seus clientes, e vender mais."
32
-
33
- #. Author of the plugin
34
- msgid "Mailchimp"
35
- msgstr "Mailchimp"
36
-
37
- #. Author URI of the plugin
38
- msgid "https://mailchimp.com"
39
- msgstr ""
40
-
41
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
42
- msgid "Please select an option"
43
- msgstr "Por favor selecione uma opção"
44
-
45
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:182
46
- msgid "Sending Feedback"
47
- msgstr "Enviando Feedback"
48
-
49
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:327
50
- msgid "I want to change the audience associated with this integration."
51
- msgstr "Gostaria de trocar a audiência associada a esta integração."
52
-
53
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:331
54
- msgid "I want to change the site or store connected through this integration."
55
- msgstr "Gostaria de trocar o Site ou Loja conectado a esta integração."
56
-
57
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:335
58
- msgid "The order data isn't syncing."
59
- msgstr "Os dados de Pedidos não estão sincronizando."
60
-
61
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:339
62
- msgid "The promo codes aren't showing up."
63
- msgstr "Os Cupons não estão sincronizando."
64
-
65
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:343
66
- msgid "I'm trying to troubleshoot the integration."
67
- msgstr "Estou tentando resolver um problema com a integração."
68
-
69
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:347
70
- msgid "I was instructed to disconnect by Mailchimp Support."
71
- msgstr "Fui instruído pelo suporte do Mailchimp a desconectar."
72
-
73
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:351
74
- msgid "I no longer use this integration."
75
- msgstr "Não utilizo mais esta integração."
76
-
77
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:355
78
- msgid "It's a temporary deactivation."
79
- msgstr "É uma desativação temporária."
80
-
81
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:359
82
- msgid "Other"
83
- msgstr "Outros"
84
-
85
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:361
86
- msgid "Please share the reason"
87
- msgstr "Por favor, compartilhe o motivo"
88
-
89
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:370
90
- msgid "Quick Feedback"
91
- msgstr "Feedback rápido"
92
-
93
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:371
94
- msgid "Close"
95
- msgstr "Fechar"
96
-
97
- #. translators: %s - plugin name.
98
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:378
99
- msgid "If you have a moment, please share why you are deactivating %s:"
100
- msgstr ""
101
- "Se você tiver um momento, por favor nos diga porque você está desativando %s:"
102
-
103
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:379
104
- msgid "Mailchimp for Woocommerce"
105
- msgstr "Mailchimp para Woocommerce"
106
-
107
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:398
108
- msgid "Submit & Deactivate"
109
- msgstr "Enviar e Desativar"
110
-
111
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:399
112
- msgid "Skip & Deactivate"
113
- msgstr "Pular e Desativar"
114
-
115
- #. translators: %s - Mailchimp Privacy Policy URL.
116
- #: includes/class-mailchimp-woocommerce-privacy.php:12
117
- msgid ""
118
- "When shopping, we keep a record of your email and the cart contents for up "
119
- "to 30 days on our server. This record is kept to repopulate the contents of "
120
- "your cart if you switch devices or needed to come back another day. Read our "
121
- "privacy policy <a href=\"%s\">here</a>."
122
- msgstr ""
123
- "Quando em compras, nós mantemos seu email e o conteúdo do carrinho de "
124
- "compras por até 30 dias em nossos servidores. Este registro é armazenado "
125
- "para popular o conteúdo do seu carrinho de compras se você trocar de "
126
- "dispositivo ou precisa voltar em um outro dia. Leia nossa Política de "
127
- "Privacidade <a href=“%s”>aqui</a>."
128
-
129
- #: includes/class-mailchimp-woocommerce-privacy.php:27
130
- #: includes/class-mailchimp-woocommerce-privacy.php:40
131
- msgid "MailChimp for WooCommerce"
132
- msgstr "Mailchimp para Woocommerce"
133
-
134
- #: includes/class-mailchimp-woocommerce-privacy.php:65
135
- msgid "Email Address"
136
- msgstr "Email"
137
-
138
- #: includes/class-mailchimp-woocommerce-privacy.php:78
139
- msgid "MailChimp Shopping Cart Data"
140
- msgstr "Dados de carrinho de compras do Mailchimp"
141
-
142
- #: includes/class-mailchimp-woocommerce-privacy.php:82
143
- msgid "User ID"
144
- msgstr "ID do Usuário"
145
-
146
- #: includes/class-mailchimp-woocommerce-newsletter.php:43
147
- #: admin/class-mailchimp-woocommerce-admin.php:564
148
- #: admin/partials/tabs/newsletter_settings.php:94
149
- msgid "Subscribe to our newsletter"
150
- msgstr "Inscreva-se em nossa newsletter"
151
-
152
- #: includes/class-mailchimp-woocommerce-rest-api.php:274
153
- #: admin/partials/tabs/store_sync.php:66
154
- msgid "D, M j, Y g:i A"
155
- msgstr "l, d\\/m\\/Y H:i"
156
-
157
- #: admin/class-mailchimp-woocommerce-admin.php:78
158
- msgid "Mailchimp - WooCommerce Setup"
159
- msgstr "Mailchimp para Woocommerce"
160
-
161
- #: admin/class-mailchimp-woocommerce-admin.php:117
162
- msgid "Settings"
163
- msgstr "Configurações"
164
-
165
- #: admin/class-mailchimp-woocommerce-admin.php:484
166
- msgid ""
167
- "As part of the Mailchimp Terms of Use, we require a contact email and a "
168
- "physical mailing address."
169
- msgstr ""
170
- "Como parte dos Termos de Uso do Mailchimp, são mandatórios um email de "
171
- "contato e um endereço físico de correspondência."
172
-
173
- #: admin/class-mailchimp-woocommerce-admin.php:492
174
- msgid ""
175
- "As part of the Mailchimp Terms of Use, we require a valid phone number for "
176
- "your store."
177
- msgstr ""
178
- "Como parte dos Termos de Uso do Mailchimp, é mandatório um número de "
179
- "telefone válido para sua Loja."
180
-
181
- #: admin/class-mailchimp-woocommerce-admin.php:500
182
- msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
183
- msgstr ""
184
- "Mailchimp para Woocommerce requer um Nome de Loja para conectar sua Loja."
185
-
186
- #. translators: %s - plugin name.
187
- #: admin/class-mailchimp-woocommerce-admin.php:518
188
- #: admin/partials/tabs/campaign_defaults.php:95
189
- msgid "You were subscribed to the newsletter from %s"
190
- msgstr "Você foi inscrito na newsletter de %s"
191
-
192
- #: admin/class-mailchimp-woocommerce-admin.php:673
193
- msgid "You must supply your Mailchimp API key to pull the audiences."
194
- msgstr ""
195
- "É necessário fornecer a sua Mailchimp API Key para recuperar as audiências."
196
-
197
- #: admin/class-mailchimp-woocommerce-admin.php:1067
198
- msgid "Starting the sync process..."
199
- msgstr "Iniciando a Sincronização…"
200
-
201
- #: admin/class-mailchimp-woocommerce-admin.php:1069
202
- msgid "Please hang tight while we work our mojo."
203
- msgstr "Por favor aguarde."
204
-
205
- #: admin/class-mailchimp-woocommerce-admin.php:1071
206
- msgid ""
207
- "Sometimes the sync can take a while, especially on sites with lots of orders "
208
- "and/or products."
209
- msgstr ""
210
- "Em alguns casos a sincronização pode levar algum tempo, especialmente em "
211
- "sites com muitos pedidos e/ou produtos."
212
-
213
- #: admin/partials/tabs/newsletter_settings.php:35
214
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:112
215
- msgid "Audience Settings"
216
- msgstr "Configurações de Audiência"
217
-
218
- #: admin/partials/tabs/newsletter_settings.php:36
219
- msgid ""
220
- "Please apply your audience settings. If you don't have an audience, you can "
221
- "choose to create one."
222
- msgstr ""
223
- "Configure sua Audiência. Se você não tem nenhuma audiência, você pode "
224
- "escolher criar uma."
225
-
226
- #: admin/partials/tabs/newsletter_settings.php:40
227
- msgid "Audience Name"
228
- msgstr "Nome da Audiência"
229
-
230
- #: admin/partials/tabs/newsletter_settings.php:46
231
- msgid "Create New Audience"
232
- msgstr "Criar nova Audiência"
233
-
234
- #: admin/partials/tabs/newsletter_settings.php:50
235
- msgid "Select Audience"
236
- msgstr "Selecione a Audiência"
237
-
238
- #: admin/partials/tabs/newsletter_settings.php:62
239
- msgid "Choose an audience to sync with your store."
240
- msgstr "Escolha uma Audiência para sincronizar com a sua Loja."
241
-
242
- #: admin/partials/tabs/newsletter_settings.php:68
243
- msgid "Auto Subscribe On Initial Sync"
244
- msgstr "Inscrição automática na Sincronização inicial"
245
-
246
- #: admin/partials/tabs/newsletter_settings.php:76
247
- msgid "No"
248
- msgstr "Não"
249
-
250
- #: admin/partials/tabs/newsletter_settings.php:76
251
- msgid "Yes"
252
- msgstr "Sim"
253
-
254
- #: admin/partials/tabs/newsletter_settings.php:82
255
- msgid "During initial sync, auto subscribe the existing customers."
256
- msgstr ""
257
- "Durante a sincronização inicial, inscreva automaticamente os clientes "
258
- "existentes."
259
-
260
- #: admin/partials/tabs/newsletter_settings.php:86
261
- msgid "Opt-in Settings"
262
- msgstr "Configurações de inscrição"
263
-
264
- #: admin/partials/tabs/newsletter_settings.php:87
265
- msgid ""
266
- "Add text to go along with the opt-in checkbox, and choose a default display "
267
- "option. Customers can click a box at checkout to opt in to your newsletter. "
268
- "Write a signup message and choose how you want this checkbox to appear."
269
- msgstr ""
270
- "Adicione um texto para exibir próximo à caixa de seleção de inscrição, e "
271
- "escolha um modo de visualização padrão. Usuários podem clicar em uma caixa "
272
- "de seleção na etapa de pagamento para se inscrever em sua newsletter. "
273
- "Escreva uma mensagem de inscrição e escolha como você quer a exibição da "
274
- "caixa de seleção."
275
-
276
- #: admin/partials/tabs/newsletter_settings.php:91
277
- msgid "Newsletter Label"
278
- msgstr "Texto da Newsletter"
279
-
280
- #: admin/partials/tabs/newsletter_settings.php:95
281
- msgid "Enter text for the opt-in checkbox"
282
- msgstr "Insira o texto para a caixa de seleção de inclusão"
283
-
284
- #: admin/partials/tabs/newsletter_settings.php:97
285
- msgid "HTML tags allowed: <a href=\"\" target=\"\" title=\"\"></a> and <br>"
286
- msgstr "Tags HTML permitidas: <a href=“” target=“” title=“”></a> e <br>"
287
-
288
- #: admin/partials/tabs/newsletter_settings.php:100
289
- #: admin/partials/tabs/newsletter_settings.php:104
290
- msgid "Checkbox Display Options"
291
- msgstr "Opções de exibição da caixa de seleção"
292
-
293
- #: admin/partials/tabs/newsletter_settings.php:108
294
- msgid "Visible, checked by default"
295
- msgstr "Visível, ativada por padrão"
296
-
297
- #: admin/partials/tabs/newsletter_settings.php:112
298
- msgid "Visible, unchecked by default"
299
- msgstr "Visível, desativada por padrão"
300
-
301
- #: admin/partials/tabs/newsletter_settings.php:116
302
- msgid "Hidden, unchecked by default"
303
- msgstr "Escondida, desativada por padrão"
304
-
305
- #: admin/partials/tabs/newsletter_settings.php:120
306
- msgid "Advanced Checkbox Settings"
307
- msgstr "Configurações avançadas para a caixa de seleção"
308
-
309
- #. translators: %s - Woocommerce Actions documentation URL.
310
- #: admin/partials/tabs/newsletter_settings.php:121
311
- msgid ""
312
- "To change the location of the opt-in checkbox at checkout, input one of the "
313
- "<a href=%s target=_blank>available WooCommerce form actions.</a>."
314
- msgstr ""
315
- "Para alterar a localização da caixa de seleção de inscrição na etapa de "
316
- "pagamento, insira uma das <a href=%s target=_blank>Actions de formulário do "
317
- "WooCommerce .</a>."
318
-
319
- #: admin/partials/tabs/newsletter_settings.php:125
320
- msgid "Newsletter Checkbox Action"
321
- msgstr "Action para a caixa de seleção de inscrição"
322
-
323
- #: admin/partials/tabs/newsletter_settings.php:129
324
- msgid "Enter a WooCommerce form action"
325
- msgstr "Insira uma action de formulário do Woocommerce"
326
-
327
- #: admin/partials/tabs/newsletter_settings.php:133
328
- #: admin/partials/tabs/newsletter_settings.php:138
329
- msgid "Audience Member Tags"
330
- msgstr "Etiquetas para Membros de Audiência"
331
-
332
- #: admin/partials/tabs/newsletter_settings.php:134
333
- msgid "Add a comma separated list of tags to add to the user at Mailchimp"
334
- msgstr ""
335
- "Adicione uma lista de etiquetas separadas por vírgulas para adicionar ao "
336
- "usuário no Mailchimp"
337
-
338
- #: admin/partials/tabs/newsletter_settings.php:145
339
- #: admin/partials/tabs/newsletter_settings.php:150
340
- msgid "Product Image Size"
341
- msgstr "Tamanho da imagem de Produto"
342
-
343
- #: admin/partials/tabs/newsletter_settings.php:146
344
- msgid ""
345
- "Define the product image size used by abandoned carts, order notifications, "
346
- "and product recommendations."
347
- msgstr ""
348
- "Defina o tamanho das imagens utilizado em carrinhos de compra abandonados, "
349
- "outras notificações, e recomendações de produtos."
350
-
351
- #: admin/partials/tabs/newsletter_settings.php:161
352
- msgid "Select an image size"
353
- msgstr "Selecione um tamanho de imagem"
354
-
355
- #: admin/partials/tabs/logs.php:35 admin/partials/tabs/logs.php:45
356
- msgid "Logging Preference"
357
- msgstr "Preferências de Log"
358
-
359
- #: admin/partials/tabs/logs.php:37
360
- msgid ""
361
- "Advanced troubleshooting can be conducted with the logging capability turned "
362
- "on.\n"
363
- "By default, it’s set to “none” and you may toggle to either “standard” or "
364
- "“debug” as needed.\n"
365
- "With standard logging, you can see basic information about the data "
366
- "submission to Mailchimp including any errors.\n"
367
- "“Debug” gives a much deeper insight that is useful to share with support if "
368
- "problems arise."
369
- msgstr ""
370
- "A resolução de problemas pode ser realizada com os Logs ativados.\n"
371
- "Por padrão, está configurado para “nenhum” e pode ser trocado para “padrão” "
372
- "ou “debug” de acordo com sua necessidade.\n"
373
- "Com o Log padrão, são registradas informações básicas sobre o envio de dados "
374
- "para o Mailchimp incluindo os erros.\n"
375
- "A opção “Debug” exibe informações mais aprofundadas e é útil para "
376
- "compartilhar com o suporte se surgirem problemas."
377
-
378
- #: admin/partials/tabs/logs.php:51
379
- msgid "None"
380
- msgstr "Nenhum"
381
-
382
- #: admin/partials/tabs/logs.php:51
383
- msgid "Debug"
384
- msgstr "Debug"
385
-
386
- #: admin/partials/tabs/logs.php:51
387
- msgid "Standard"
388
- msgstr "Padrão"
389
-
390
- #: admin/partials/tabs/logs.php:59
391
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:160
392
- msgid "Save all changes"
393
- msgstr "Salvar todas alterações"
394
-
395
- #: admin/partials/tabs/logs.php:67
396
- msgid "Delete log"
397
- msgstr "Apagar Log"
398
-
399
- #: admin/partials/tabs/logs.php:79
400
- msgid "View"
401
- msgstr "Ver"
402
-
403
- #: admin/partials/tabs/logs.php:88
404
- msgid "There are currently no logs to view."
405
- msgstr "Não há nenhum Log para ser visualizado."
406
-
407
- #: admin/partials/tabs/notices.php:6
408
- msgid "Mailchimp says: You must enter in a valid API key."
409
- msgstr "Maichimp diz: Insira uma API Key válida."
410
-
411
- #: admin/partials/tabs/notices.php:9
412
- msgid ""
413
- "Mailchimp says: Sorry you must set up your campaign defaults before you "
414
- "proceed!"
415
- msgstr ""
416
- "Maichimp diz: É necessário configurar os Padrões de Lista antes de continuar!"
417
-
418
- #: admin/partials/tabs/notices.php:12
419
- msgid "Mailchimp says: You must select a marketing audience."
420
- msgstr "Maichimp diz: É Necessário selecionar uma Audiência."
421
-
422
- #: admin/partials/tabs/notices.php:15
423
- msgid "Mailchimp says: Sorry you must set up your store before you proceed!"
424
- msgstr "Maichimp diz: É necessário configurar sua Loja antes de continuar!"
425
-
426
- #: admin/partials/tabs/notices.php:18
427
- msgid ""
428
- "Mailchimp says: You are not fully ready to run the Store Sync, please verify "
429
- "your settings before proceeding."
430
- msgstr ""
431
- "Maichimp diz: Ainda não está tudo pronto para iniciar a sincronização de sua "
432
- "Loja, verifique as configurações antes de continuar."
433
-
434
- #: admin/partials/tabs/notices.php:32
435
- msgid "Mailchimp says: Your re-sync has been started!"
436
- msgstr "Maichimp diz: A ressincronização foi iniciada!"
437
-
438
- #: admin/partials/tabs/campaign_defaults.php:16
439
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:109
440
- msgid "Audience Defaults"
441
- msgstr "Padrões de Audiência"
442
-
443
- #: admin/partials/tabs/campaign_defaults.php:17
444
- msgid "Please fill out the default campaign information."
445
- msgstr "Por favor preencha as informações padrão da Lista."
446
-
447
- #: admin/partials/tabs/campaign_defaults.php:21
448
- msgid "Contact Name"
449
- msgstr "Nome de contato"
450
-
451
- #: admin/partials/tabs/campaign_defaults.php:26
452
- msgid "Default from name"
453
- msgstr "Nome padrão do Remetente"
454
-
455
- #: admin/partials/tabs/campaign_defaults.php:36
456
- msgid "From Email"
457
- msgstr "Email do Remetente"
458
-
459
- #: admin/partials/tabs/campaign_defaults.php:41
460
- msgid "Default from email"
461
- msgstr "Email padrão do Remetente"
462
-
463
- #: admin/partials/tabs/campaign_defaults.php:51
464
- #: admin/partials/tabs/campaign_defaults.php:56
465
- msgid "Default subject"
466
- msgstr "Assunto padrão"
467
-
468
- #: admin/partials/tabs/campaign_defaults.php:66
469
- #: admin/partials/tabs/campaign_defaults.php:78
470
- msgid "Default language"
471
- msgstr "Lingua padrão"
472
-
473
- #: admin/partials/tabs/campaign_defaults.php:88
474
- msgid "Permission Reminder"
475
- msgstr "Mensagem de lembrete de inclusão"
476
-
477
- #: admin/partials/tabs/campaign_defaults.php:97
478
- msgid "Permission reminder message"
479
- msgstr "Mensagem de lembrete"
480
-
481
- #: admin/partials/tabs/store_sync.php:54
482
- msgid "Sync Information"
483
- msgstr "Informações de sincronização"
484
-
485
- #: admin/partials/tabs/store_sync.php:57
486
- msgid "Initial Sync:"
487
- msgstr "Sincronização inicial:"
488
-
489
- #: admin/partials/tabs/store_sync.php:57
490
- msgid "In Progress"
491
- msgstr "Em progresso"
492
-
493
- #: admin/partials/tabs/store_sync.php:63
494
- msgid "Last Updated:"
495
- msgstr "Última atualização:"
496
-
497
- #: admin/partials/tabs/store_sync.php:72
498
- msgid "Account Connected:"
499
- msgstr "Conta conectada:"
500
-
501
- #: admin/partials/tabs/store_sync.php:73
502
- msgid "Audience Connected:"
503
- msgstr "Audiência conectada:"
504
-
505
- #: admin/partials/tabs/store_sync.php:74
506
- msgid "Products Synced:"
507
- msgstr "Produtos sincronizados:"
508
-
509
- #: admin/partials/tabs/store_sync.php:75
510
- msgid "Orders Synced:"
511
- msgstr "Pedidos sincronizados:"
512
-
513
- #: admin/partials/tabs/store_sync.php:78
514
- msgid "Advanced"
515
- msgstr "Avançado"
516
-
517
- #: admin/partials/tabs/store_sync.php:80
518
- msgid ""
519
- "You can resync your audience at any time without losing any of your e-"
520
- "commerce data."
521
- msgstr ""
522
- "Você pode ressincronizar sua Audiência a qualquer momento, sem perder nenhum "
523
- "de seus dados."
524
-
525
- #: admin/partials/tabs/store_sync.php:82
526
- msgid "Resync"
527
- msgstr "Ressincronizar"
528
-
529
- #: admin/partials/tabs/api_key.php:3
530
- msgid "API Information"
531
- msgstr "Informações da API"
532
-
533
- #: admin/partials/tabs/api_key.php:4
534
- msgid ""
535
- "To find your Mailchimp API key, log into your account settings > Extras > "
536
- "API keys. From there, either grab an existing key or generate a new one for "
537
- "your WooCommerce store."
538
- msgstr ""
539
- "Para localizar sua Mailchimp API key, entre em sua conta no Mailchimp, abra "
540
- "“Account Settings > Extras > API Keys”. Copie a chave existente, ou crie uma "
541
- "nova para sua Loja Woocommerce."
542
-
543
- #: admin/partials/tabs/api_key.php:9
544
- msgid "Mailchimp API Key"
545
- msgstr "Insira sua API Key do Mailchimp"
546
-
547
- #: admin/partials/tabs/api_key.php:13
548
- msgid "Enter your Mailchimp API key."
549
- msgstr "Insira sua API Key do Mailchimp."
550
-
551
- #: admin/partials/tabs/store_info.php:13
552
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:106
553
- msgid "Store Settings"
554
- msgstr "Configurações de Loja"
555
-
556
- #: admin/partials/tabs/store_info.php:14
557
- msgid "Please provide the following information about your WooCommerce store."
558
- msgstr "Insira as informações relativas à sua loja WooCommerce."
559
-
560
- #: admin/partials/tabs/store_info.php:18
561
- msgid "Store Name"
562
- msgstr "Nome da Loja"
563
-
564
- #: admin/partials/tabs/store_info.php:25 admin/partials/tabs/store_info.php:27
565
- msgid "Name"
566
- msgstr "Nome"
567
-
568
- #: admin/partials/tabs/store_info.php:36 admin/partials/tabs/store_info.php:43
569
- #: admin/partials/tabs/store_info.php:45
570
- msgid "Email"
571
- msgstr "Email"
572
-
573
- #: admin/partials/tabs/store_info.php:54
574
- msgid "Street Address"
575
- msgstr "Endereço"
576
-
577
- #: admin/partials/tabs/store_info.php:61 admin/partials/tabs/store_info.php:63
578
- msgid "Street address"
579
- msgstr "Endereço"
580
-
581
- #: admin/partials/tabs/store_info.php:72 admin/partials/tabs/store_info.php:79
582
- #: admin/partials/tabs/store_info.php:81
583
- msgid "City"
584
- msgstr "Cidade"
585
-
586
- #: admin/partials/tabs/store_info.php:90 admin/partials/tabs/store_info.php:97
587
- #: admin/partials/tabs/store_info.php:99
588
- msgid "State"
589
- msgstr "Estado"
590
-
591
- #: admin/partials/tabs/store_info.php:108
592
- #: admin/partials/tabs/store_info.php:115
593
- #: admin/partials/tabs/store_info.php:117
594
- msgid "Postal Code"
595
- msgstr "CEP"
596
-
597
- #: admin/partials/tabs/store_info.php:126
598
- #: admin/partials/tabs/store_info.php:133
599
- #: admin/partials/tabs/store_info.php:135
600
- msgid "Country"
601
- msgstr "País"
602
-
603
- #: admin/partials/tabs/store_info.php:144
604
- #: admin/partials/tabs/store_info.php:151
605
- #: admin/partials/tabs/store_info.php:153
606
- msgid "Phone Number"
607
- msgstr "Telefone"
608
-
609
- #: admin/partials/tabs/store_info.php:160
610
- msgid "Locale Settings"
611
- msgstr "Configurações de Local"
612
-
613
- #: admin/partials/tabs/store_info.php:162
614
- msgid ""
615
- "Please apply your locale settings. If you're unsure about these, use the "
616
- "defaults."
617
- msgstr ""
618
- "Configure seu local. Se estive inseguro com estas informações, deixe o "
619
- "padrão."
620
-
621
- #: admin/partials/tabs/store_info.php:166
622
- #: admin/partials/tabs/store_info.php:177
623
- msgid "Locale"
624
- msgstr "Língua"
625
-
626
- #: admin/partials/tabs/store_info.php:183
627
- msgid "Currency Code"
628
- msgstr "Código da Moeda"
629
-
630
- #: admin/partials/tabs/store_info.php:189
631
- msgid "Currency"
632
- msgstr "Moeda"
633
-
634
- #: admin/partials/tabs/store_info.php:189
635
- msgid "Retrieved from Woocommerce Settings"
636
- msgstr "Configuração do Woocommerce"
637
-
638
- #: admin/partials/tabs/store_info.php:195
639
- #: admin/partials/tabs/store_info.php:206
640
- msgid "Timezone"
641
- msgstr "Fuso Horário"
642
-
643
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:86
644
- msgid "Mailchimp says: Please upgrade your PHP version to a minimum of 7.0"
645
- msgstr "Mailchimp diz: Atualize a versão do PHP para no mínimo 7.0"
646
-
647
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:92
648
- msgid "Mailchimp says: API Request Error - "
649
- msgstr "Mailchimp diz: API Request Error - "
650
-
651
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:101
652
- msgid "Mailchimp for Woocommerce Settings"
653
- msgstr "Mailchimp para Woocommerce - Configurações"
654
-
655
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:104
656
- msgid "Connect"
657
- msgstr "Conectar"
658
-
659
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:115
660
- msgid "Sync"
661
- msgstr "Sincronização"
662
-
663
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:116
664
- msgid "Logs"
665
- msgstr "Logs"
666
-
667
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:165
668
- msgid "More Information"
669
- msgstr "Mais informações"
670
-
671
- #. translators: %s - WP-CLI URL.
672
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:167
673
- msgid ""
674
- "Have a larger store or having issues syncing? Consider using <a href=%s "
675
- "target=_blank>WP-CLI</a>."
676
- msgstr ""
677
- "Tem uma loja muito grande, ou está encontrando problemas ao sincronizar? "
678
- "Considere usar o <a href=%s target=_blank>WP-CLI</a>."
679
-
680
- #. translators: %s - WP-CLI URL.
681
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:168
682
- msgid ""
683
- "Order and customer information will not sync if they contain an Amazon or "
684
- "generic email address."
685
- msgstr ""
686
- "Dados de Pedidos e Clientes não serão sincronizados se eles conterem um "
687
- "email genérico ou da Amazon."
688
-
689
- #. translators: %s - Mailchimp Support URL.
690
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:169
691
- msgid ""
692
- "Need help to connect your store? Visit the Mailchimp <a href=%s "
693
- "target=_blank>Knowledge Base</a>."
694
- msgstr ""
695
- "Precisa de ajuda para conectar sua Loja? Visite a <a href=%s "
696
- "target=_blank>Base de Conhecimento do Mailchimp</a>."
697
-
698
- #. translators: %s - Plugin review URL.
699
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:170
700
- msgid ""
701
- "Want to tell us how we're doing? <a href=%s target=_blank>Leave a review on "
702
- "Wordpress.org</a>."
703
- msgstr ""
704
- "Quer nos contar o que você acha deste plugin? <a href=%s target=_blank>Deixe "
705
- "uma classificação no Wordpress.org</a>."
706
-
707
- #. translators: %s - Mailchimp Privacy Policy URL.
708
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:171
709
- msgid ""
710
- "By using this plugin, Mailchimp will process customer information in "
711
- "accordance with their <a href=%s target=_blank>Privacy Policy</a>."
712
- msgstr ""
713
- "Ao utilizar este plugin, o Mailchimp irá processar as informações de "
714
- "clientes de acordo com sua <a href=%s target=_blank>Política de Privacidade</"
715
- "a>."
716
-
717
- #: bootstrap.php:510
718
- msgid ""
719
- "The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress."
720
- "org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
721
- msgstr ""
722
- "O plugin Mailchimp para Woocommerce requer que o plugin <a href=“http://"
723
- "wordpress.org/extend/plugins/woocommerce/“>WooCommerce</a> esteja ativo!"
724
-
725
- #: bootstrap.php:907
726
- msgid "function \"wp_remote_post\" does not exist"
727
- msgstr "a funcão “wp_remote_post” não existe"
728
-
729
- #: bootstrap.php:921
730
- msgid ""
731
- "The REST API seems to be disabled on this wordpress site. Please enable to "
732
- "sync data."
733
- msgstr ""
734
- "A REST API aparenta ester desabilitada nest site WordPress. For favor, "
735
- "habilite para sincronizar dados."
736
-
737
- #~ msgid ""
738
- #~ "Currency is currently deprecated. Please select one from the list above"
739
- #~ msgstr "Moeda obsoleta. Selecione uma da lista acima"
740
-
741
- #~ msgid "deprecated"
742
- #~ msgstr "obsoleta"
743
-
744
- #~ msgid "User Tags"
745
- #~ msgstr "Etiquetas de Usuário"
746
-
747
- #~ msgid "List Settings"
748
- #~ msgstr "Configurações de Lista"
749
-
750
- #~ msgid "List Name"
751
- #~ msgstr "Nome da Lista"
752
-
753
- #, fuzzy
754
- #~| msgid "List Defaults"
755
- #~ msgid "List Defaults"
756
- #~ msgstr "Padrões de Lista"
757
-
758
- #~ msgid "List Connected:"
759
- #~ msgstr "Lista conectada:"
760
-
761
- #~ msgid "Phone"
762
- #~ msgstr "Telefone"
763
-
764
- #~ msgid "Default Subject"
765
- #~ msgstr "Assunto padrão"
766
-
767
- #~ msgid "Default Language"
768
- #~ msgstr "Lingua padrão"
769
-
770
- #~ msgid "Mailchimp Settings"
771
- #~ msgstr "Configurações Mailchimp para Woocommerce"
772
-
773
- #~ msgid "Every %d Minutes"
774
- #~ msgstr "Cada %d minutos"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/mailchimp-woocommerce.pot CHANGED
@@ -1,626 +0,0 @@
1
- # Copyright (C) 2019 Mailchimp
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.1.17\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-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: 2019-06-03T04:04:33+00:00\n"
13
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.1.0\n"
15
-
16
- #. Plugin Name of the plugin
17
- msgid "Mailchimp for WooCommerce"
18
- msgstr ""
19
-
20
- #. Plugin URI of the plugin
21
- msgid "https://mailchimp.com/connect-your-store/"
22
- msgstr ""
23
-
24
- #. Description of the plugin
25
- msgid "Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff."
26
- msgstr ""
27
-
28
- #. Author of the plugin
29
- msgid "Mailchimp"
30
- msgstr ""
31
-
32
- #. Author URI of the plugin
33
- msgid "https://mailchimp.com"
34
- msgstr ""
35
-
36
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
37
- msgid "Please select an option"
38
- msgstr ""
39
-
40
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:182
41
- msgid "Sending Feedback"
42
- msgstr ""
43
-
44
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:327
45
- msgid "I want to change the audience associated with this integration."
46
- msgstr ""
47
-
48
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:331
49
- msgid "I want to change the site or store connected through this integration."
50
- msgstr ""
51
-
52
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:335
53
- msgid "The order data isn't syncing."
54
- msgstr ""
55
-
56
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:339
57
- msgid "The promo codes aren't showing up."
58
- msgstr ""
59
-
60
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:343
61
- msgid "I'm trying to troubleshoot the integration."
62
- msgstr ""
63
-
64
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:347
65
- msgid "I was instructed to disconnect by Mailchimp Support."
66
- msgstr ""
67
-
68
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:351
69
- msgid "I no longer use this integration."
70
- msgstr ""
71
-
72
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:355
73
- msgid "It's a temporary deactivation."
74
- msgstr ""
75
-
76
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:359
77
- msgid "Other"
78
- msgstr ""
79
-
80
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:361
81
- msgid "Please share the reason"
82
- msgstr ""
83
-
84
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:370
85
- msgid "Quick Feedback"
86
- msgstr ""
87
-
88
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:371
89
- msgid "Close"
90
- msgstr ""
91
-
92
- #. translators: %s - plugin name.
93
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:378
94
- msgid "If you have a moment, please share why you are deactivating %s:"
95
- msgstr ""
96
-
97
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:379
98
- msgid "Mailchimp for Woocommerce"
99
- msgstr ""
100
-
101
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:398
102
- msgid "Submit & Deactivate"
103
- msgstr ""
104
-
105
- #: includes/class-mailchimp-woocommerce-deactivation-survey.php:399
106
- msgid "Skip & Deactivate"
107
- msgstr ""
108
-
109
- #. translators: %s - Mailchimp Privacy Policy URL.
110
- #: includes/class-mailchimp-woocommerce-privacy.php:12
111
- msgid "When shopping, we keep a record of your email and the cart contents for up to 30 days on our server. This record is kept to repopulate the contents of your cart if you switch devices or needed to come back another day. Read our privacy policy <a href=\"%s\">here</a>."
112
- msgstr ""
113
-
114
- #: includes/class-mailchimp-woocommerce-privacy.php:27
115
- #: includes/class-mailchimp-woocommerce-privacy.php:40
116
- msgid "MailChimp for WooCommerce"
117
- msgstr ""
118
-
119
- #: includes/class-mailchimp-woocommerce-privacy.php:65
120
- msgid "Email Address"
121
- msgstr ""
122
-
123
- #: includes/class-mailchimp-woocommerce-privacy.php:78
124
- msgid "MailChimp Shopping Cart Data"
125
- msgstr ""
126
-
127
- #: includes/class-mailchimp-woocommerce-privacy.php:82
128
- msgid "User ID"
129
- msgstr ""
130
-
131
- #: includes/class-mailchimp-woocommerce-newsletter.php:43
132
- #: admin/class-mailchimp-woocommerce-admin.php:583
133
- #: admin/partials/tabs/newsletter_settings.php:94
134
- msgid "Subscribe to our newsletter"
135
- msgstr ""
136
-
137
- #: includes/class-mailchimp-woocommerce-rest-api.php:282
138
- #: admin/partials/tabs/store_sync.php:66
139
- msgid "D, M j, Y g:i A"
140
- msgstr ""
141
-
142
- #: admin/class-mailchimp-woocommerce-admin.php:78
143
- msgid "Mailchimp - WooCommerce Setup"
144
- msgstr ""
145
-
146
- #: admin/class-mailchimp-woocommerce-admin.php:117
147
- msgid "Settings"
148
- msgstr ""
149
-
150
- #: admin/class-mailchimp-woocommerce-admin.php:503
151
- msgid "As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address."
152
- msgstr ""
153
-
154
- #: admin/class-mailchimp-woocommerce-admin.php:511
155
- msgid "As part of the Mailchimp Terms of Use, we require a valid phone number for your store."
156
- msgstr ""
157
-
158
- #: admin/class-mailchimp-woocommerce-admin.php:519
159
- msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
160
- msgstr ""
161
-
162
- #. translators: %s - plugin name.
163
- #: admin/class-mailchimp-woocommerce-admin.php:537
164
- #: admin/partials/tabs/campaign_defaults.php:95
165
- msgid "You were subscribed to the newsletter from %s"
166
- msgstr ""
167
-
168
- #: admin/class-mailchimp-woocommerce-admin.php:692
169
- msgid "You must supply your Mailchimp API key to pull the audiences."
170
- msgstr ""
171
-
172
- #: admin/class-mailchimp-woocommerce-admin.php:1086
173
- msgid "Starting the sync process..."
174
- msgstr ""
175
-
176
- #: admin/class-mailchimp-woocommerce-admin.php:1088
177
- msgid "Please hang tight while we work our mojo."
178
- msgstr ""
179
-
180
- #: admin/class-mailchimp-woocommerce-admin.php:1090
181
- msgid "Sometimes the sync can take a while, especially on sites with lots of orders and/or products."
182
- msgstr ""
183
-
184
- #: admin/partials/tabs/newsletter_settings.php:35
185
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:112
186
- msgid "Audience Settings"
187
- msgstr ""
188
-
189
- #: admin/partials/tabs/newsletter_settings.php:36
190
- msgid "Please apply your audience settings. If you don't have an audience, you can choose to create one."
191
- msgstr ""
192
-
193
- #: admin/partials/tabs/newsletter_settings.php:40
194
- msgid "Audience Name"
195
- msgstr ""
196
-
197
- #: admin/partials/tabs/newsletter_settings.php:46
198
- msgid "Create New Audience"
199
- msgstr ""
200
-
201
- #: admin/partials/tabs/newsletter_settings.php:50
202
- msgid "Select Audience"
203
- msgstr ""
204
-
205
- #: admin/partials/tabs/newsletter_settings.php:62
206
- msgid "Choose an audience to sync with your store."
207
- msgstr ""
208
-
209
- #: admin/partials/tabs/newsletter_settings.php:68
210
- msgid "Auto Subscribe On Initial Sync"
211
- msgstr ""
212
-
213
- #: admin/partials/tabs/newsletter_settings.php:76
214
- msgid "No"
215
- msgstr ""
216
-
217
- #: admin/partials/tabs/newsletter_settings.php:76
218
- msgid "Yes"
219
- msgstr ""
220
-
221
- #: admin/partials/tabs/newsletter_settings.php:82
222
- msgid "During initial sync, auto subscribe the existing customers."
223
- msgstr ""
224
-
225
- #: admin/partials/tabs/newsletter_settings.php:86
226
- msgid "Opt-in Settings"
227
- msgstr ""
228
-
229
- #: admin/partials/tabs/newsletter_settings.php:87
230
- msgid "Add text to go along with the opt-in checkbox, and choose a default display option. Customers can click a box at checkout to opt in to your newsletter. Write a signup message and choose how you want this checkbox to appear."
231
- msgstr ""
232
-
233
- #: admin/partials/tabs/newsletter_settings.php:91
234
- msgid "Newsletter Label"
235
- msgstr ""
236
-
237
- #: admin/partials/tabs/newsletter_settings.php:95
238
- msgid "Enter text for the opt-in checkbox"
239
- msgstr ""
240
-
241
- #: admin/partials/tabs/newsletter_settings.php:97
242
- msgid "HTML tags allowed: <a href=\"\" target=\"\" title=\"\"></a> and <br>"
243
- msgstr ""
244
-
245
- #: admin/partials/tabs/newsletter_settings.php:100
246
- #: admin/partials/tabs/newsletter_settings.php:104
247
- msgid "Checkbox Display Options"
248
- msgstr ""
249
-
250
- #: admin/partials/tabs/newsletter_settings.php:108
251
- msgid "Visible, checked by default"
252
- msgstr ""
253
-
254
- #: admin/partials/tabs/newsletter_settings.php:112
255
- msgid "Visible, unchecked by default"
256
- msgstr ""
257
-
258
- #: admin/partials/tabs/newsletter_settings.php:116
259
- msgid "Hidden, unchecked by default"
260
- msgstr ""
261
-
262
- #: admin/partials/tabs/newsletter_settings.php:120
263
- msgid "Advanced Checkbox Settings"
264
- msgstr ""
265
-
266
- #. translators: %s - Woocommerce Actions documentation URL.
267
- #: admin/partials/tabs/newsletter_settings.php:121
268
- msgid "To change the location of the opt-in checkbox at checkout, input one of the <a href=%s target=_blank>available WooCommerce form actions.</a>."
269
- msgstr ""
270
-
271
- #: admin/partials/tabs/newsletter_settings.php:125
272
- msgid "Newsletter Checkbox Action"
273
- msgstr ""
274
-
275
- #: admin/partials/tabs/newsletter_settings.php:129
276
- msgid "Enter a WooCommerce form action"
277
- msgstr ""
278
-
279
- #: admin/partials/tabs/newsletter_settings.php:133
280
- #: admin/partials/tabs/newsletter_settings.php:138
281
- msgid "Audience Member Tags"
282
- msgstr ""
283
-
284
- #: admin/partials/tabs/newsletter_settings.php:134
285
- msgid "Add a comma separated list of tags to add to the user at Mailchimp"
286
- msgstr ""
287
-
288
- #: admin/partials/tabs/newsletter_settings.php:145
289
- #: admin/partials/tabs/newsletter_settings.php:150
290
- msgid "Product Image Size"
291
- msgstr ""
292
-
293
- #: admin/partials/tabs/newsletter_settings.php:146
294
- msgid "Define the product image size used by abandoned carts, order notifications, and product recommendations."
295
- msgstr ""
296
-
297
- #: admin/partials/tabs/newsletter_settings.php:161
298
- msgid "Select an image size"
299
- msgstr ""
300
-
301
- #: admin/partials/tabs/logs.php:35
302
- #: admin/partials/tabs/logs.php:45
303
- msgid "Logging Preference"
304
- msgstr ""
305
-
306
- #: admin/partials/tabs/logs.php:37
307
- msgid ""
308
- "Advanced troubleshooting can be conducted with the logging capability turned on.\n"
309
- "By default, it’s set to “none” and you may toggle to either “standard” or “debug” as needed.\n"
310
- "With standard logging, you can see basic information about the data submission to Mailchimp including any errors.\n"
311
- "“Debug” gives a much deeper insight that is useful to share with support if problems arise."
312
- msgstr ""
313
-
314
- #: admin/partials/tabs/logs.php:51
315
- msgid "None"
316
- msgstr ""
317
-
318
- #: admin/partials/tabs/logs.php:51
319
- msgid "Debug"
320
- msgstr ""
321
-
322
- #: admin/partials/tabs/logs.php:51
323
- msgid "Standard"
324
- msgstr ""
325
-
326
- #: admin/partials/tabs/logs.php:59
327
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:160
328
- msgid "Save all changes"
329
- msgstr ""
330
-
331
- #: admin/partials/tabs/logs.php:67
332
- msgid "Delete log"
333
- msgstr ""
334
-
335
- #: admin/partials/tabs/logs.php:79
336
- msgid "View"
337
- msgstr ""
338
-
339
- #: admin/partials/tabs/logs.php:88
340
- msgid "There are currently no logs to view."
341
- msgstr ""
342
-
343
- #: admin/partials/tabs/notices.php:6
344
- msgid "Mailchimp says: You must enter in a valid API key."
345
- msgstr ""
346
-
347
- #: admin/partials/tabs/notices.php:9
348
- msgid "Mailchimp says: Sorry you must set up your campaign defaults before you proceed!"
349
- msgstr ""
350
-
351
- #: admin/partials/tabs/notices.php:12
352
- msgid "Mailchimp says: You must select a marketing audience."
353
- msgstr ""
354
-
355
- #: admin/partials/tabs/notices.php:15
356
- msgid "Mailchimp says: Sorry you must set up your store before you proceed!"
357
- msgstr ""
358
-
359
- #: admin/partials/tabs/notices.php:18
360
- msgid "Mailchimp says: You are not fully ready to run the Store Sync, please verify your settings before proceeding."
361
- msgstr ""
362
-
363
- #: admin/partials/tabs/notices.php:32
364
- msgid "Mailchimp says: Your re-sync has been started!"
365
- msgstr ""
366
-
367
- #: admin/partials/tabs/campaign_defaults.php:16
368
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:109
369
- msgid "Audience Defaults"
370
- msgstr ""
371
-
372
- #: admin/partials/tabs/campaign_defaults.php:17
373
- msgid "Please fill out the default campaign information."
374
- msgstr ""
375
-
376
- #: admin/partials/tabs/campaign_defaults.php:21
377
- msgid "Contact Name"
378
- msgstr ""
379
-
380
- #: admin/partials/tabs/campaign_defaults.php:26
381
- msgid "Default from name"
382
- msgstr ""
383
-
384
- #: admin/partials/tabs/campaign_defaults.php:36
385
- msgid "From Email"
386
- msgstr ""
387
-
388
- #: admin/partials/tabs/campaign_defaults.php:41
389
- msgid "Default from email"
390
- msgstr ""
391
-
392
- #: admin/partials/tabs/campaign_defaults.php:51
393
- #: admin/partials/tabs/campaign_defaults.php:56
394
- msgid "Default subject"
395
- msgstr ""
396
-
397
- #: admin/partials/tabs/campaign_defaults.php:66
398
- #: admin/partials/tabs/campaign_defaults.php:78
399
- msgid "Default language"
400
- msgstr ""
401
-
402
- #: admin/partials/tabs/campaign_defaults.php:88
403
- msgid "Permission Reminder"
404
- msgstr ""
405
-
406
- #: admin/partials/tabs/campaign_defaults.php:97
407
- msgid "Permission reminder message"
408
- msgstr ""
409
-
410
- #: admin/partials/tabs/store_sync.php:54
411
- msgid "Sync Information"
412
- msgstr ""
413
-
414
- #: admin/partials/tabs/store_sync.php:57
415
- msgid "Initial Sync:"
416
- msgstr ""
417
-
418
- #: admin/partials/tabs/store_sync.php:57
419
- msgid "In Progress"
420
- msgstr ""
421
-
422
- #: admin/partials/tabs/store_sync.php:63
423
- msgid "Last Updated:"
424
- msgstr ""
425
-
426
- #: admin/partials/tabs/store_sync.php:72
427
- msgid "Account Connected:"
428
- msgstr ""
429
-
430
- #: admin/partials/tabs/store_sync.php:73
431
- msgid "Audience Connected:"
432
- msgstr ""
433
-
434
- #: admin/partials/tabs/store_sync.php:74
435
- msgid "Products Synced:"
436
- msgstr ""
437
-
438
- #: admin/partials/tabs/store_sync.php:75
439
- msgid "Orders Synced:"
440
- msgstr ""
441
-
442
- #: admin/partials/tabs/store_sync.php:78
443
- msgid "Advanced"
444
- msgstr ""
445
-
446
- #: admin/partials/tabs/store_sync.php:80
447
- msgid "You can resync your audience at any time without losing any of your e-commerce data."
448
- msgstr ""
449
-
450
- #: admin/partials/tabs/store_sync.php:82
451
- msgid "Resync"
452
- msgstr ""
453
-
454
- #: admin/partials/tabs/api_key.php:3
455
- msgid "API Information"
456
- msgstr ""
457
-
458
- #: admin/partials/tabs/api_key.php:4
459
- msgid "To find your Mailchimp API key, log into your account settings > Extras > API keys. From there, either grab an existing key or generate a new one for your WooCommerce store."
460
- msgstr ""
461
-
462
- #: admin/partials/tabs/api_key.php:9
463
- msgid "Mailchimp API Key"
464
- msgstr ""
465
-
466
- #: admin/partials/tabs/api_key.php:13
467
- msgid "Enter your Mailchimp API key."
468
- msgstr ""
469
-
470
- #: admin/partials/tabs/store_info.php:13
471
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:106
472
- msgid "Store Settings"
473
- msgstr ""
474
-
475
- #: admin/partials/tabs/store_info.php:14
476
- msgid "Please provide the following information about your WooCommerce store."
477
- msgstr ""
478
-
479
- #: admin/partials/tabs/store_info.php:18
480
- msgid "Store Name"
481
- msgstr ""
482
-
483
- #: admin/partials/tabs/store_info.php:25
484
- #: admin/partials/tabs/store_info.php:27
485
- msgid "Name"
486
- msgstr ""
487
-
488
- #: admin/partials/tabs/store_info.php:36
489
- #: admin/partials/tabs/store_info.php:43
490
- #: admin/partials/tabs/store_info.php:45
491
- msgid "Email"
492
- msgstr ""
493
-
494
- #: admin/partials/tabs/store_info.php:54
495
- msgid "Street Address"
496
- msgstr ""
497
-
498
- #: admin/partials/tabs/store_info.php:61
499
- #: admin/partials/tabs/store_info.php:63
500
- msgid "Street address"
501
- msgstr ""
502
-
503
- #: admin/partials/tabs/store_info.php:72
504
- #: admin/partials/tabs/store_info.php:79
505
- #: admin/partials/tabs/store_info.php:81
506
- msgid "City"
507
- msgstr ""
508
-
509
- #: admin/partials/tabs/store_info.php:90
510
- #: admin/partials/tabs/store_info.php:97
511
- #: admin/partials/tabs/store_info.php:99
512
- msgid "State"
513
- msgstr ""
514
-
515
- #: admin/partials/tabs/store_info.php:108
516
- #: admin/partials/tabs/store_info.php:115
517
- #: admin/partials/tabs/store_info.php:117
518
- msgid "Postal Code"
519
- msgstr ""
520
-
521
- #: admin/partials/tabs/store_info.php:126
522
- #: admin/partials/tabs/store_info.php:133
523
- #: admin/partials/tabs/store_info.php:135
524
- msgid "Country"
525
- msgstr ""
526
-
527
- #: admin/partials/tabs/store_info.php:144
528
- #: admin/partials/tabs/store_info.php:151
529
- #: admin/partials/tabs/store_info.php:153
530
- msgid "Phone Number"
531
- msgstr ""
532
-
533
- #: admin/partials/tabs/store_info.php:160
534
- msgid "Locale Settings"
535
- msgstr ""
536
-
537
- #: admin/partials/tabs/store_info.php:162
538
- msgid "Please apply your locale settings. If you're unsure about these, use the defaults."
539
- msgstr ""
540
-
541
- #: admin/partials/tabs/store_info.php:166
542
- #: admin/partials/tabs/store_info.php:177
543
- msgid "Locale"
544
- msgstr ""
545
-
546
- #: admin/partials/tabs/store_info.php:183
547
- msgid "Currency Code"
548
- msgstr ""
549
-
550
- #: admin/partials/tabs/store_info.php:189
551
- msgid "Currency"
552
- msgstr ""
553
-
554
- #: admin/partials/tabs/store_info.php:189
555
- msgid "Retrieved from Woocommerce Settings"
556
- msgstr ""
557
-
558
- #: admin/partials/tabs/store_info.php:195
559
- #: admin/partials/tabs/store_info.php:206
560
- msgid "Timezone"
561
- msgstr ""
562
-
563
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:86
564
- msgid "Mailchimp says: Please upgrade your PHP version to a minimum of 7.0"
565
- msgstr ""
566
-
567
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:92
568
- msgid "Mailchimp says: API Request Error - "
569
- msgstr ""
570
-
571
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:101
572
- msgid "Mailchimp for Woocommerce Settings"
573
- msgstr ""
574
-
575
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:104
576
- msgid "Connect"
577
- msgstr ""
578
-
579
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:115
580
- msgid "Sync"
581
- msgstr ""
582
-
583
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:116
584
- msgid "Logs"
585
- msgstr ""
586
-
587
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:165
588
- msgid "More Information"
589
- msgstr ""
590
-
591
- #. translators: %s - WP-CLI URL.
592
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:167
593
- msgid "Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>."
594
- msgstr ""
595
-
596
- #. translators: %s - WP-CLI URL.
597
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:168
598
- msgid "Order and customer information will not sync if they contain an Amazon or generic email address."
599
- msgstr ""
600
-
601
- #. translators: %s - Mailchimp Support URL.
602
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:169
603
- msgid "Need help to connect your store? Visit the Mailchimp <a href=%s target=_blank>Knowledge Base</a>."
604
- msgstr ""
605
-
606
- #. translators: %s - Plugin review URL.
607
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:170
608
- msgid "Want to tell us how we're doing? <a href=%s target=_blank>Leave a review on Wordpress.org</a>."
609
- msgstr ""
610
-
611
- #. translators: %s - Mailchimp Privacy Policy URL.
612
- #: admin/partials/mailchimp-woocommerce-admin-tabs.php:171
613
- msgid "By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>."
614
- msgstr ""
615
-
616
- #: bootstrap.php:512
617
- msgid "The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress.org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
618
- msgstr ""
619
-
620
- #: bootstrap.php:909
621
- msgid "function \"wp_remote_post\" does not exist"
622
- msgstr ""
623
-
624
- #: bootstrap.php:923
625
- msgid "The REST API seems to be disabled on this wordpress site. Please enable to sync data."
626
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mailchimp-woocommerce.php CHANGED
@@ -16,17 +16,17 @@
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.1.17
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
23
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24
- * Text Domain: mailchimp-woocommerce
25
  * Domain Path: /languages
26
- * Requires at least: 4.4
27
- * Tested up to: 5.1
28
  * WC requires at least: 3.5
29
- * WC tested up to: 3.6.4
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.2
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
23
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24
+ * Text Domain: mc-woocommerce
25
  * Domain Path: /languages
26
+ * Requires at least: 4.7
27
+ * Tested up to: 5.2.2
28
  * WC requires at least: 3.5
29
+ * WC tested up to: 3.6.5
30
  */
31
 
32
  // If this file is called directly, abort.