Skip to content

Commit 9a8e5f9

Browse files
committedOct 31, 2019
Merge remote-tracking branch 'origin/2.3'
# Conflicts: # README.txt # bootstrap.php # mailchimp-woocommerce.php
2 parents 474103f + b452f0e commit 9a8e5f9

File tree

145 files changed

+13769
-2285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+13769
-2285
lines changed
 

‎README.txt

100755100644
+13-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Contributors: ryanhungate, Mailchimp
33
Tags: ecommerce,email,workflows,mailchimp
44
Donate link: https://mailchimp.com
55
Requires at least: 4.9
6-
Tested up to: 5.2.3
7-
Stable tag: 2.2.4
6+
Tested up to: 5.2.5
7+
Stable tag: 2.3
88
Requires PHP: 7.0
99
WC requires at least: 3.5
10-
WC tested up to: 3.7
10+
WC tested up to: 3.7.1
1111
License: GPLv2 or later
1212
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1313
Connect your store to your Mailchimp audience to track sales, create targeted emails, send abandoned cart emails, and more.
@@ -63,14 +63,22 @@ The Mailchimp for WooCommerce supports Wordpress Multi Sites and below are a few
6363
- Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
6464
Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
6565
== Changelog ==
66+
= 2.3 =
67+
* adds action scheduler queue system
68+
* documentation for Custom Merge Tags
69+
* adds more specific installation requirements
70+
* fixes PHP Error in class-mailchimp-order.php
71+
* fixes pop up blocks on connection
72+
* fixes unable to sync without accepting to auto subscribe existing customers
73+
* documentation for wp-cli class queue-command
6674
= 2.2 =
6775
* plugin reskin
6876
* support for oauth to Mailchimp
6977
* fixes sync issues with altered order IDs
7078
* fixes issues with trashed coupons
7179
= 2.1.17 =
72-
* Re add resync button to sync tab, after sync finishes
73-
* Renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
80+
* re add resync button to sync tab, after sync finishes
81+
* renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
7482
* fixes issues with cloudflare
7583
* honors woo currency settings
7684
* fix for failing custom coupon type

‎admin/class-mailchimp-woocommerce-admin.php

+49-9
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ private function disconnect_store()
6767
update_option('mailchimp-woocommerce-sync.completed_at', false);
6868
update_option('mailchimp-woocommerce-resource-last-updated', false);
6969

70+
if (($store_id = mailchimp_get_store_id()) && ($mc = mailchimp_get_api())) {
71+
if ($mc->deleteStore($store_id)) {
72+
mailchimp_log('store.disconnected', 'Store id ' . mailchimp_get_store_id() . ' has been disconnected');
73+
}
74+
}
75+
7076
return $options;
7177
}
7278

@@ -221,6 +227,47 @@ public function update_db_check() {
221227
update_option( $this->plugin_name.'_woo_currency_update', true);
222228
}
223229
}
230+
231+
if($wpdb->get_var("SHOW TABLES LIKE '{$wpdb->prefix}mailchimp_jobs';") != $wpdb->prefix.'mailchimp_jobs') {
232+
MailChimp_WooCommerce_Activator::create_queue_tables();
233+
MailChimp_WooCommerce_Activator::migrate_jobs();
234+
}
235+
236+
if (defined( 'DISABLE_WP_HTTP_WORKER' ) || defined( 'MAILCHIMP_USE_CURL' ) || defined( 'MAILCHIMP_REST_LOCALHOST' ) || defined( 'MAILCHIMP_REST_IP' ) || defined( 'MAILCHIMP_DISABLE_QUEUE') && true === MAILCHIMP_DISABLE_QUEUE) {
237+
$constants_used = array();
238+
239+
if (defined( 'DISABLE_WP_HTTP_WORKER')) {
240+
$constants_used[] = 'DISABLE_WP_HTTP_WORKER';
241+
}
242+
243+
if (defined( 'MAILCHIMP_DISABLE_QUEUE')) {
244+
$constants_used[] = 'MAILCHIMP_DISABLE_QUEUE';
245+
}
246+
247+
if (defined( 'MAILCHIMP_USE_CURL')) {
248+
$constants_used[] = 'MAILCHIMP_USE_CURL';
249+
}
250+
251+
if (defined( 'MAILCHIMP_REST_LOCALHOST')) {
252+
$constants_used[] = 'MAILCHIMP_REST_LOCALHOST';
253+
}
254+
255+
if (defined( 'MAILCHIMP_REST_IP')) {
256+
$constants_used[] = 'MAILCHIMP_REST_IP';
257+
}
258+
259+
$text = __('Mailchimp for Woocommerce','mc-woocommerce').'<br/>'.
260+
'<p id="http-worker-deprecated-message">'.__('We dectected that this site has the following constants defined, likely at wp-config.php file' ,'mc-woocommerce').': '.
261+
implode(' | ', $constants_used).'<br/>'.
262+
__('These constants are deprecated since Mailchimp for Woocommerce version 2.3. Please refer to the <a href="https://github.com/mailchimp/mc-woocommerce/wiki/">plugin official wiki</a> for further details.' ,'mc-woocommerce').'</p>';
263+
264+
add_settings_error('mailchimp-woocommerce_notice', $this->plugin_name, $text, 'notice-info');
265+
266+
if (!isset($_GET['page']) || $_GET['page'] != 'mailchimp-woocommerce') {
267+
settings_errors();
268+
}
269+
}
270+
224271
}
225272

226273
/**
@@ -400,14 +447,6 @@ protected function validatePostApiKey($input)
400447
'mailchimp_account_info_username' => null,
401448
);
402449

403-
if (($failure = mailchimp_woocommerce_check_if_http_worker_fails())) {
404-
unset($data['mailchimp_api_key']);
405-
$data['active_tab'] = 'api_key';
406-
$data['api_ping_error'] = $failure;
407-
mailchimp_error('admin@validateCanUseHttpWorker', $failure);
408-
return $data;
409-
}
410-
411450
$api = new MailChimp_WooCommerce_MailChimpApi($data['mailchimp_api_key']);
412451

413452
try {
@@ -721,6 +760,7 @@ protected function validatePostNewsletterSettings($input)
721760
$this->setData('sync.config.resync', false);
722761
$this->setData('sync.orders.current_page', 1);
723762
$this->setData('sync.products.current_page', 1);
763+
$this->setData('sync.coupons.current_page', 1);
724764
$this->setData('sync.syncing', true);
725765
$this->setData('sync.started_at', time());
726766

@@ -1251,7 +1291,7 @@ public static function startSync()
12511291
$coupon_sync->flagStartSync();
12521292

12531293
// queue up the jobs
1254-
mailchimp_handle_or_queue($coupon_sync, 0, true);
1294+
mailchimp_handle_or_queue($coupon_sync, 0);
12551295
}
12561296

12571297
/**

0 commit comments

Comments
 (0)