MailChimp for WooCommerce - Version 2.3.5

Version Description

  • updates to Action Scheduler
  • create new audience option
  • fixes small oauth screen layout
  • number format on sync stats
  • fix campaign tracking cookie
  • update readme description
Download this release

Release Info

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

Code changes from version 2.3.4 to 2.3.5

README.txt CHANGED
@@ -4,10 +4,10 @@ Tags: ecommerce,email,workflows,mailchimp
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.3.2
7
- Stable tag: 2.3.4
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
- WC tested up to: 3.9
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  Connect your store to your Mailchimp audience to track sales, create targeted emails, send abandoned cart emails, and more.
@@ -41,7 +41,7 @@ Here are some things to know before you begin this process.
41
  You’ll need to do a few things to connect your WooCommerce store to Mailchimp.
42
  - Download the plugin.
43
  - Install the plugin on your WordPress Admin site.
44
- - Connect the plugin with your Mailchimp API Key.
45
  - Configure your audience settings to complete the data sync process.
46
  ###Advanced Queue Setup In CLI mode
47
  To optimize the performance of your Mailchimp integration - it is recommended that you run the queue in CLI mode.
@@ -63,6 +63,13 @@ The Mailchimp for WooCommerce supports Wordpress Multi Sites and below are a few
63
  - Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
64
  Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
65
  == Changelog ==
 
 
 
 
 
 
 
66
  = 2.3.4 =
67
  * updates to Action Scheduler
68
  = 2.3.3 =
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.3.2
7
+ Stable tag: 2.3.5
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
+ WC tested up to: 4.0
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  Connect your store to your Mailchimp audience to track sales, create targeted emails, send abandoned cart emails, and more.
41
  You’ll need to do a few things to connect your WooCommerce store to Mailchimp.
42
  - Download the plugin.
43
  - Install the plugin on your WordPress Admin site.
44
+ - Connect securely to your Mailchimp account via secure OAuth pop-up window.
45
  - Configure your audience settings to complete the data sync process.
46
  ###Advanced Queue Setup In CLI mode
47
  To optimize the performance of your Mailchimp integration - it is recommended that you run the queue in CLI mode.
63
  - Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
64
  Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
65
  == Changelog ==
66
+ = 2.3.5 =
67
+ * updates to Action Scheduler
68
+ * create new audience option
69
+ * fixes small oauth screen layout
70
+ * number format on sync stats
71
+ * fix campaign tracking cookie
72
+ * update readme description
73
  = 2.3.4 =
74
  * updates to Action Scheduler
75
  = 2.3.3 =
admin/class-mailchimp-woocommerce-admin.php CHANGED
@@ -898,6 +898,11 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
898
  'mailchimp_user_tags' => isset($input['mailchimp_user_tags']) ? implode(",",$sanitized_tags) : $this->getOption('mailchimp_user_tags'),
899
  'mailchimp_product_image_key' => isset($input['mailchimp_product_image_key']) ? $input['mailchimp_product_image_key'] : 'medium',
900
  );
 
 
 
 
 
901
 
902
  // as long as we have a list set, and it's currently in MC as a valid list, let's sync the store.
903
  if (!empty($data['mailchimp_list']) && $this->api()->hasList($data['mailchimp_list'])) {
@@ -932,7 +937,9 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
932
  return $data;
933
  }
934
 
935
- $this->setData('validation.newsletter_settings', false);
 
 
936
 
937
  $data['active_tab'] = 'newsletter_settings';
938
 
898
  'mailchimp_user_tags' => isset($input['mailchimp_user_tags']) ? implode(",",$sanitized_tags) : $this->getOption('mailchimp_user_tags'),
899
  'mailchimp_product_image_key' => isset($input['mailchimp_product_image_key']) ? $input['mailchimp_product_image_key'] : 'medium',
900
  );
901
+
902
+ //if we don't have any audience on the account, create one
903
+ if ($data['mailchimp_list'] === 'create_new') {
904
+ $data['mailchimp_list'] = $this->updateMailChimpList(array_merge($this->getOptions(), $data));
905
+ }
906
 
907
  // as long as we have a list set, and it's currently in MC as a valid list, let's sync the store.
908
  if (!empty($data['mailchimp_list']) && $this->api()->hasList($data['mailchimp_list'])) {
937
  return $data;
938
  }
939
 
940
+ $this->setData('validation.newsletter_settings', false);
941
+
942
+ add_settings_error('mailchimp_newsletter_settings', '', __('One or more fields were not updated', 'mailchimp-for-woocommerce'));
943
 
944
  $data['active_tab'] = 'newsletter_settings';
945
 
admin/js/mailchimp-woocommerce-admin.js CHANGED
@@ -84,8 +84,8 @@
84
  $('input[name=_wp_http_referer]').val(query[1]);
85
  }
86
  try {
87
- me.click();
88
  mailchimp_woocommerce_disconnect_done = true;
 
89
  } catch (e) {
90
  console.error('clicking event for disconnect failed', e);
91
  }
@@ -122,6 +122,7 @@
122
  var token = '';
123
  var startData = {action:'mailchimp_woocommerce_oauth_start'};
124
  $('#mailchimp-oauth-api-key-valid').hide();
 
125
  $('#mailchimp-oauth-waiting').show();
126
 
127
  $.post(ajaxurl, startData, function(startResponse) {
@@ -140,8 +141,8 @@
140
  var options = {
141
  path: domain+'/auth/start/'+token,
142
  windowName: 'Mailchimp For WooCommerce OAuth',
143
- height: 500,
144
- width: 800,
145
  };
146
  var left = (screen.width - options.width) / 2;
147
  var top = (screen.height - options.height) / 4;
@@ -149,7 +150,7 @@
149
  'status=no, menubar=no, scrollbars=no, resizable=no, ' +
150
  'copyhistory=no, width=' + options.width +
151
  ', height=' + options.height + ', top=' + top + ', left=' + left +
152
- 'domain='+domain.replace('https://', '');
153
 
154
  // open Mailchimp OAuth popup
155
  var popup = window.open(options.path, options.windowName, window_options);
84
  $('input[name=_wp_http_referer]').val(query[1]);
85
  }
86
  try {
 
87
  mailchimp_woocommerce_disconnect_done = true;
88
+ me.click();
89
  } catch (e) {
90
  console.error('clicking event for disconnect failed', e);
91
  }
122
  var token = '';
123
  var startData = {action:'mailchimp_woocommerce_oauth_start'};
124
  $('#mailchimp-oauth-api-key-valid').hide();
125
+ $('#mailchimp-oauth-error').hide();
126
  $('#mailchimp-oauth-waiting').show();
127
 
128
  $.post(ajaxurl, startData, function(startResponse) {
141
  var options = {
142
  path: domain+'/auth/start/'+token,
143
  windowName: 'Mailchimp For WooCommerce OAuth',
144
+ height: 800,
145
+ width: 1035,
146
  };
147
  var left = (screen.width - options.width) / 2;
148
  var top = (screen.height - options.height) / 4;
150
  'status=no, menubar=no, scrollbars=no, resizable=no, ' +
151
  'copyhistory=no, width=' + options.width +
152
  ', height=' + options.height + ', top=' + top + ', left=' + left +
153
+ ', domain='+domain.replace('https://', '');
154
 
155
  // open Mailchimp OAuth popup
156
  var popup = window.open(options.path, options.windowName, window_options);
admin/partials/tabs/store_sync.php CHANGED
@@ -75,7 +75,7 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
75
  <div class="box sync-stats-card promo_rules" >
76
  <div class="sync-stats-card-content">
77
  <span class="card_label"><strong><?php esc_html_e('Coupons', 'mailchimp-for-woocommerce');?></strong></span>
78
- <span class="card_count" id="mailchimp_promo_rules_count"><?php echo $mailchimp_total_promo_rules; ?></span>
79
  <div class="progress-bar-wrapper">
80
  <span class="card_count_label mailchimp_promo_rules_count_partial"></span>
81
  <div class="progress-bar"></div>
@@ -85,7 +85,7 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
85
  <div class="box sync-stats-card products" >
86
  <div class="sync-stats-card-content">
87
  <span class="card_label"><strong><?php esc_html_e('Products', 'mailchimp-for-woocommerce');?></strong></span>
88
- <span class="card_count" id="mailchimp_product_count"><?php echo $mailchimp_total_products; ?></span>
89
  <div class="progress-bar-wrapper">
90
  <span class="card_count_label mailchimp_product_count_partial"></span>
91
  <div class="progress-bar"></div>
@@ -95,7 +95,7 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
95
  <div class="box sync-stats-card orders" >
96
  <div class="sync-stats-card-content">
97
  <span class="card_label"><strong><?php esc_html_e('Orders', 'mailchimp-for-woocommerce');?></strong></span>
98
- <span class="card_count" id="mailchimp_order_count"><?php echo $mailchimp_total_orders; ?></span>
99
  <div class="progress-bar-wrapper">
100
  <div class="progress-bar"></div>
101
  <span class="card_count_label mailchimp_order_count_partial"></span>
@@ -108,21 +108,21 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
108
  <div class="box sync-stats-card subscribers" >
109
  <div class="sync-stats-card-content">
110
  <span class="card_label"><strong><?php esc_html_e('Subscribers', 'mailchimp-for-woocommerce');?></strong></span>
111
- <span class="card_count" id="mailchimp_subscriber_count"><?php echo $mailchimp_total_subscribers; ?></span>
112
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
113
  </div>
114
  </div>
115
  <div class="box sync-stats-card transactional" >
116
  <div class="sync-stats-card-content">
117
  <span class="card_label"><strong><?php esc_html_e('Transactional', 'mailchimp-for-woocommerce');?></strong></span>
118
- <span class="card_count" id="mailchimp_transactional_count"><?php echo $mailchimp_total_transactional; ?></span>
119
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
120
  </div>
121
  </div>
122
  <div class="box sync-stats-card unsubscribed" >
123
  <div class="sync-stats-card-content">
124
  <span class="card_label"><strong><?php esc_html_e('Unsubscribed', 'mailchimp-for-woocommerce');?></strong></span>
125
- <span class="card_count" id="mailchimp_unsubscribed_count"><?php echo $mailchimp_total_unsubscribed; ?></span>
126
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
127
  </div>
128
  </div>
75
  <div class="box sync-stats-card promo_rules" >
76
  <div class="sync-stats-card-content">
77
  <span class="card_label"><strong><?php esc_html_e('Coupons', 'mailchimp-for-woocommerce');?></strong></span>
78
+ <span class="card_count" id="mailchimp_promo_rules_count"><?php echo number_format($mailchimp_total_promo_rules); ?></span>
79
  <div class="progress-bar-wrapper">
80
  <span class="card_count_label mailchimp_promo_rules_count_partial"></span>
81
  <div class="progress-bar"></div>
85
  <div class="box sync-stats-card products" >
86
  <div class="sync-stats-card-content">
87
  <span class="card_label"><strong><?php esc_html_e('Products', 'mailchimp-for-woocommerce');?></strong></span>
88
+ <span class="card_count" id="mailchimp_product_count"><?php echo number_format($mailchimp_total_products ); ?></span>
89
  <div class="progress-bar-wrapper">
90
  <span class="card_count_label mailchimp_product_count_partial"></span>
91
  <div class="progress-bar"></div>
95
  <div class="box sync-stats-card orders" >
96
  <div class="sync-stats-card-content">
97
  <span class="card_label"><strong><?php esc_html_e('Orders', 'mailchimp-for-woocommerce');?></strong></span>
98
+ <span class="card_count" id="mailchimp_order_count"><?php echo number_format($mailchimp_total_orders); ?></span>
99
  <div class="progress-bar-wrapper">
100
  <div class="progress-bar"></div>
101
  <span class="card_count_label mailchimp_order_count_partial"></span>
108
  <div class="box sync-stats-card subscribers" >
109
  <div class="sync-stats-card-content">
110
  <span class="card_label"><strong><?php esc_html_e('Subscribers', 'mailchimp-for-woocommerce');?></strong></span>
111
+ <span class="card_count" id="mailchimp_subscriber_count"><?php echo number_format($mailchimp_total_subscribers); ?></span>
112
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
113
  </div>
114
  </div>
115
  <div class="box sync-stats-card transactional" >
116
  <div class="sync-stats-card-content">
117
  <span class="card_label"><strong><?php esc_html_e('Transactional', 'mailchimp-for-woocommerce');?></strong></span>
118
+ <span class="card_count" id="mailchimp_transactional_count"><?php echo number_format($mailchimp_total_transactional); ?></span>
119
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
120
  </div>
121
  </div>
122
  <div class="box sync-stats-card unsubscribed" >
123
  <div class="sync-stats-card-content">
124
  <span class="card_label"><strong><?php esc_html_e('Unsubscribed', 'mailchimp-for-woocommerce');?></strong></span>
125
+ <span class="card_count" id="mailchimp_unsubscribed_count"><?php echo number_format($mailchimp_total_unsubscribed); ?></span>
126
  <img class="sync-loader" src="<?php echo plugin_dir_url( __FILE__ ) . "images/3dotpurple.gif"; ?>"/>
127
  </div>
128
  </div>
bootstrap.php CHANGED
@@ -74,9 +74,6 @@ spl_autoload_register(function($class) {
74
  if (array_key_exists($class, $classes) && file_exists($path.$classes[$class])) {
75
  require $path.$classes[$class];
76
  }
77
-
78
- // require Action Scheduler
79
- include_once "includes/vendor/action-scheduler/action-scheduler.php";
80
  });
81
 
82
  /**
@@ -90,7 +87,7 @@ function mailchimp_environment_variables() {
90
  return (object) array(
91
  'repo' => 'master',
92
  'environment' => 'production', // staging or production
93
- 'version' => '2.3.4',
94
  'php_version' => phpversion(),
95
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
96
  'wc_version' => function_exists('WC') ? WC()->version : null,
74
  if (array_key_exists($class, $classes) && file_exists($path.$classes[$class])) {
75
  require $path.$classes[$class];
76
  }
 
 
 
77
  });
78
 
79
  /**
87
  return (object) array(
88
  'repo' => 'master',
89
  'environment' => 'production', // staging or production
90
+ 'version' => '2.3.5',
91
  'php_version' => phpversion(),
92
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
93
  'wc_version' => function_exists('WC') ? WC()->version : null,
includes/class-mailchimp-woocommerce-service.php CHANGED
@@ -474,7 +474,7 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
474
  {
475
  $cookie = $this->cookie('mailchimp_campaign_id', false);
476
  if (empty($cookie)) {
477
- $cookie = $this->getWooSession('mailchimp_tracking_id', false);
478
  }
479
 
480
  return $cookie;
474
  {
475
  $cookie = $this->cookie('mailchimp_campaign_id', false);
476
  if (empty($cookie)) {
477
+ $cookie = $this->getWooSession('mailchimp_campaign_id', false);
478
  }
479
 
480
  return $cookie;
mailchimp-woocommerce.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Mailchimp for WooCommerce
17
  * Plugin URI: https://mailchimp.com/connect-your-store/
18
  * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff.
19
- * Version: 2.3.4
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
@@ -26,7 +26,7 @@
26
  * Requires at least: 4.9
27
  * Tested up to: 5.3.2
28
  * WC requires at least: 3.5
29
- * WC tested up to: 3.9
30
  */
31
 
32
  // If this file is called directly, abort.
@@ -35,6 +35,9 @@ if (!defined( 'WPINC')) {
35
  }
36
 
37
  if (!isset($mailchimp_woocommerce_spl_autoloader) || $mailchimp_woocommerce_spl_autoloader === false) {
 
 
 
38
  include_once "bootstrap.php";
39
  }
40
 
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.3.5
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
26
  * Requires at least: 4.9
27
  * Tested up to: 5.3.2
28
  * WC requires at least: 3.5
29
+ * WC tested up to: 4.0
30
  */
31
 
32
  // If this file is called directly, abort.
35
  }
36
 
37
  if (!isset($mailchimp_woocommerce_spl_autoloader) || $mailchimp_woocommerce_spl_autoloader === false) {
38
+ // require Action Scheduler
39
+ include_once "includes/vendor/action-scheduler/action-scheduler.php";
40
+ // bootstrapper
41
  include_once "bootstrap.php";
42
  }
43