WooCommerce MailChimp - Version 1.3.7

Version Description

  • WordPress 4.4 Compatible
  • WooCommerce 2.4.12 Compatible
  • API response not shown in debug log
  • Use only one instance of MCAPI
Download this release

Release Info

Developer anderly
Plugin Icon 128x128 WooCommerce MailChimp
Version 1.3.7
Comparing to
See all releases

Code changes from version 1.3.6 to 1.3.7

README.md CHANGED
@@ -69,6 +69,12 @@ If you need help, have problems, want to leave feedback or want to provide const
69
 
70
  ### Changelog
71
 
 
 
 
 
 
 
72
  #### 1.3.6
73
  * Backout of change to use WC_Logger due to fatal error
74
 
69
 
70
  ### Changelog
71
 
72
+ #### 1.3.7
73
+ * WordPress 4.4 Compatible
74
+ * WooCommerce 2.4.12 Compatible
75
+ * API response not shown in debug log
76
+ * Use only one instance of MCAPI
77
+
78
  #### 1.3.6
79
  * Backout of change to use WC_Logger due to fatal error
80
 
WooCommerce-MailChimp.png ADDED
Binary file
classes/class-ss-wc-integration-mailchimp.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
  *
10
  * @class SS_WC_Integration_MailChimp
11
  * @extends WC_Integration
12
- * @version 1.3.6
13
  * @package WooCommerce MailChimp
14
  * @author Saint Systems
15
  */
@@ -392,11 +392,10 @@ class SS_WC_Integration_MailChimp extends WC_Integration {
392
 
393
  $interest_groupings = array();
394
  $interest_groups = array();
395
- $api = new MCAPI( $this->api_key );
396
- $retval = $api->listInterestGroupings( $listid );
397
 
398
- if ( $mailchimp->errorCode ) {
399
- echo $this->get_message( sprintf( __( 'Unable to load listInterestGroupings() from MailChimp: (%s) %s', 'ss_wc_mailchimp' ), $mailchimp->errorCode, $mailchimp->errorMessage ) );
400
 
401
  return false;
402
 
@@ -443,7 +442,6 @@ class SS_WC_Integration_MailChimp extends WC_Integration {
443
  if ( 'false' == $listid )
444
  $listid = $this->list;
445
 
446
- $api = new MCAPI( $this->api_key );
447
  $merge_vars = array(
448
  'FNAME' => $first_name,
449
  'LNAME' => $last_name
@@ -483,14 +481,14 @@ class SS_WC_Integration_MailChimp extends WC_Integration {
483
  self::log( sprintf( __( 'Calling MailChimp API listSubscribe method with the following: %s', 'ss_wc_mailchimp' ), print_r( $options, true ) ) );
484
 
485
  // Call API
486
- $api_response = $api->listSubscribe( $listid, $email, $vars, $email_type, $double_optin, $update_existing, $replace_interests, $send_welcome );
487
 
488
  // Log api response
489
- self::log( __( 'MailChimp API response: %s', $api_response ) );
490
 
491
- if ( $api->errorCode && $api->errorCode != 214 ) {
492
  // Format error message
493
- $error_response = sprintf( __( 'WooCommerce MailChimp subscription failed: %s (%s)', 'ss_wc_mailchimp' ), $api->errorMessage, $api->errorCode );
494
 
495
  // Log
496
  self::log( $error_response );
@@ -575,12 +573,13 @@ class SS_WC_Integration_MailChimp extends WC_Integration {
575
  */
576
  static function log( $message ) {
577
  if ( WP_DEBUG === true ) {
 
578
 
579
  if ( is_array( $message ) || is_object( $message ) ) {
580
- error_log( print_r( $message, true ) );
581
  }
582
  else {
583
- error_log( $message );
584
  }
585
  }
586
  }
9
  *
10
  * @class SS_WC_Integration_MailChimp
11
  * @extends WC_Integration
12
+ * @version 1.3.7
13
  * @package WooCommerce MailChimp
14
  * @author Saint Systems
15
  */
392
 
393
  $interest_groupings = array();
394
  $interest_groups = array();
395
+ $retval = $this->mailchimp->listInterestGroupings( $listid );
 
396
 
397
+ if ( $this->mailchimp->errorCode ) {
398
+ echo $this->get_message( sprintf( __( 'Unable to load listInterestGroupings() from MailChimp: (%s) %s', 'ss_wc_mailchimp' ), $this->mailchimp->errorCode, $this->mailchimp->errorMessage ) );
399
 
400
  return false;
401
 
442
  if ( 'false' == $listid )
443
  $listid = $this->list;
444
 
 
445
  $merge_vars = array(
446
  'FNAME' => $first_name,
447
  'LNAME' => $last_name
481
  self::log( sprintf( __( 'Calling MailChimp API listSubscribe method with the following: %s', 'ss_wc_mailchimp' ), print_r( $options, true ) ) );
482
 
483
  // Call API
484
+ $api_response = $this->mailchimp->listSubscribe( $listid, $email, $vars, $email_type, $double_optin, $update_existing, $replace_interests, $send_welcome );
485
 
486
  // Log api response
487
+ self::log( sprintf( __( 'MailChimp API response: %s', 'ss_wc_mailchimp' ), $api_response ) );
488
 
489
+ if ( $this->mailchimp->errorCode && $this->mailchimp->errorCode != 214 ) {
490
  // Format error message
491
+ $error_response = sprintf( __( 'WooCommerce MailChimp subscription failed: %s (%s)', 'ss_wc_mailchimp' ), $this->mailchimp->errorMessage, $this->mailchimp->errorCode );
492
 
493
  // Log
494
  self::log( $error_response );
573
  */
574
  static function log( $message ) {
575
  if ( WP_DEBUG === true ) {
576
+ $logger = new WC_Logger();
577
 
578
  if ( is_array( $message ) || is_object( $message ) ) {
579
+ $logger->add( 'mailchimp', print_r( $message, true ) );
580
  }
581
  else {
582
+ $logger->add( 'mailchimp', $message );
583
  }
584
  }
585
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: anderly, saintsystems
3
  Tags: woocommerce, mailchimp
4
  Requires at least: 3.5.1
5
- Tested up to: 4.1
6
- Stable tag: 1.3.6
7
  License: GPLv3
8
 
9
  Simple and flexible MailChimp integration for WooCommerce.
@@ -78,6 +78,12 @@ If you need help, have problems, want to leave feedback or want to provide const
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
81
  = 1.3.6 =
82
  * Backout of change to use WC_Logger due to fatal error
83
 
2
  Contributors: anderly, saintsystems
3
  Tags: woocommerce, mailchimp
4
  Requires at least: 3.5.1
5
+ Tested up to: 4.4
6
+ Stable tag: 1.3.7
7
  License: GPLv3
8
 
9
  Simple and flexible MailChimp integration for WooCommerce.
78
 
79
  == Changelog ==
80
 
81
+ = 1.3.7 =
82
+ * WordPress 4.4 Compatible
83
+ * WooCommerce 2.4.12 Compatible
84
+ * API response not shown in debug log
85
+ * Use only one instance of MCAPI
86
+
87
  = 1.3.6 =
88
  * Backout of change to use WC_Logger due to fatal error
89
 
woocommerce-mailchimp.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
6
  * Author: Adam Anderly
7
  * Author URI: http://anderly.com
8
- * Version: 1.3.6
9
  * Text Domain: ss_wc_mailchimp
10
  * Domain Path: languages
11
  *
5
  * Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
6
  * Author: Adam Anderly
7
  * Author URI: http://anderly.com
8
+ * Version: 1.3.7
9
  * Text Domain: ss_wc_mailchimp
10
  * Domain Path: languages
11
  *