WooCommerce MailChimp - Version 2.0.5

Version Description

Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

includes/class-ss-wc-mailchimp-handler.php CHANGED
@@ -50,8 +50,6 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
50
  $this->namespace = 'ss_wc_' . $this->id;
51
  $this->label = __( 'MailChimp', 'woocommerce-mailchimp' );
52
 
53
- $this->init();
54
-
55
  $this->register_hooks();
56
 
57
  } //end function __construct
@@ -172,7 +170,8 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
172
  * @return boolean
173
  */
174
  public function has_api_key() {
175
- return !empty( $this->api_key() );
 
176
  }
177
 
178
  /**
@@ -222,14 +221,6 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
222
  }
223
  }
224
 
225
- public function init() {
226
-
227
- $this->api_key = $this->get_option( 'api_key' );
228
-
229
- $this->enabled = $this->get_option( 'enabled' );
230
-
231
- }
232
-
233
  public function get_option( $option_suffix ) {
234
 
235
  return get_option( $this->namespace_prefixed( $option_suffix ) );
@@ -251,8 +242,10 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
251
  // hook into woocommerce order status changed hook to handle the desired subscription event trigger
252
  add_action( 'woocommerce_order_status_changed', array( $this, 'order_status_changed' ), 10, 3 );
253
 
 
 
254
  // Maybe add an "opt-in" field to the checkout
255
- $opt_in_checkbox_display_location = !empty( $this->opt_in_checkbox_display_location() ) ? $this->opt_in_checkbox_display_location() : 'woocommerce_review_order_before_submit';
256
 
257
  // Old opt-in checkbox display locations
258
  $old_opt_in_checkbox_display_locations = array(
50
  $this->namespace = 'ss_wc_' . $this->id;
51
  $this->label = __( 'MailChimp', 'woocommerce-mailchimp' );
52
 
 
 
53
  $this->register_hooks();
54
 
55
  } //end function __construct
170
  * @return boolean
171
  */
172
  public function has_api_key() {
173
+ $api_key = $this->api_key();
174
+ return !empty( $api_key );
175
  }
176
 
177
  /**
221
  }
222
  }
223
 
 
 
 
 
 
 
 
 
224
  public function get_option( $option_suffix ) {
225
 
226
  return get_option( $this->namespace_prefixed( $option_suffix ) );
242
  // hook into woocommerce order status changed hook to handle the desired subscription event trigger
243
  add_action( 'woocommerce_order_status_changed', array( $this, 'order_status_changed' ), 10, 3 );
244
 
245
+ $opt_in_checkbox_display_location = $this->opt_in_checkbox_display_location();
246
+
247
  // Maybe add an "opt-in" field to the checkout
248
+ $opt_in_checkbox_display_location = !empty( $opt_in_checkbox_display_location ) ? $opt_in_checkbox_display_location : 'woocommerce_review_order_before_submit';
249
 
250
  // Old opt-in checkbox display locations
251
  $old_opt_in_checkbox_display_locations = array(
includes/class-ss-wc-mailchimp-plugin.php CHANGED
@@ -7,7 +7,7 @@ final class SS_WC_MailChimp_Plugin {
7
 
8
  private static $_instance;
9
 
10
- private static $version = '2.0.4';
11
 
12
  private static $text_domain = 'woocommerce-mailchimp';
13
 
7
 
8
  private static $_instance;
9
 
10
+ private static $version = '2.0.5';
11
 
12
  private static $text_domain = 'woocommerce-mailchimp';
13
 
includes/class-ss-wc-settings-mailchimp.php CHANGED
@@ -173,7 +173,8 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
173
  * @return boolean
174
  */
175
  public function has_api_key() {
176
- return !empty( $this->api_key() );
 
177
  }
178
 
179
  /**
173
  * @return boolean
174
  */
175
  public function has_api_key() {
176
+ $api_key = $this->api_key();
177
+ return !empty( $api_key );
178
  }
179
 
180
  /**
includes/migrations/class-ss-wc-migration.php CHANGED
@@ -11,23 +11,25 @@ abstract class SS_WC_MailChimp_Migration_Base {
11
  protected $current_version;
12
  protected $target_version;
13
 
14
- protected $setting_keys = array(
15
- 'api_key',
16
- 'enabled',
17
- 'list',
18
- 'interest_groups',
19
- 'display_opt_in',
20
- 'occurs',
21
- 'double_opt_in',
22
- 'opt_in_label',
23
- 'opt_in_checkbox_default_status',
24
- 'opt_in_checkbox_display_location',
25
- );
26
 
27
  protected $settings_key = 'woocommerce_mailchimp_settings';
28
 
29
  public function __construct( $current_version, $target_version ) {
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  $this->settings = array();
32
 
33
  $this->current_version = $current_version;
11
  protected $current_version;
12
  protected $target_version;
13
 
14
+ protected $setting_keys;
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  protected $settings_key = 'woocommerce_mailchimp_settings';
17
 
18
  public function __construct( $current_version, $target_version ) {
19
 
20
+ $this->settings_keys = array(
21
+ 'api_key',
22
+ 'enabled',
23
+ 'list',
24
+ 'interest_groups',
25
+ 'display_opt_in',
26
+ 'occurs',
27
+ 'double_opt_in',
28
+ 'opt_in_label',
29
+ 'opt_in_checkbox_default_status',
30
+ 'opt_in_checkbox_display_location',
31
+ );
32
+
33
  $this->settings = array();
34
 
35
  $this->current_version = $current_version;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: saintsystems, anderly
3
  Tags: woocommerce, mailchimp
4
  Requires at least: 3.5.1
5
  Tested up to: 4.6.1
6
- Stable tag: 2.0.4
7
  License: GPLv3
8
 
9
  Simple and flexible MailChimp integration for WooCommerce.
@@ -97,9 +97,9 @@ Also, if you enjoy using the software [we'd love it if you could give us a revie
97
 
98
  == Changelog ==
99
 
100
- #### 2.0 - 2.0.4 - September 16, 2016
101
 
102
- **WARNING:** This release contains breaking changes to the plugins action hooks and filters. If you have custom code that hooks into the plugins action hooks and filters, please review the breaking changes below to know how to update your code appropriately.
103
 
104
  **Breaking Changes**
105
 
@@ -136,6 +136,7 @@ Also, if you enjoy using the software [we'd love it if you could give us a revie
136
 
137
  - Fixed issues with translations and text domains not loading properly.
138
  - Change `list` function to `get_list` to prevent PHP error
 
139
 
140
  #### 1.3.9 - September 13, 2016
141
 
3
  Tags: woocommerce, mailchimp
4
  Requires at least: 3.5.1
5
  Tested up to: 4.6.1
6
+ Stable tag: 2.0.5
7
  License: GPLv3
8
 
9
  Simple and flexible MailChimp integration for WooCommerce.
97
 
98
  == Changelog ==
99
 
100
+ #### 2.0 - 2.0.5 - September 16, 2016
101
 
102
+ **WARNING:** This release contains breaking changes to the plugins action hooks and filters. If you have custom code that hooks into the plugins action hooks and filters, please review the breaking changes below to know how to update your code appropriately. You must upgrade to version 2.X by December 31, 2016 because prior versions of the MailChimp API will stop working at that point.
103
 
104
  **Breaking Changes**
105
 
136
 
137
  - Fixed issues with translations and text domains not loading properly.
138
  - Change `list` function to `get_list` to prevent PHP error
139
+ - Fix issues with PHP version < 5.5
140
 
141
  #### 1.3.9 - September 13, 2016
142
 
woocommerce-mailchimp.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
6
  * Author: Saint Systems
7
  * Author URI: https://www.saintsystems.com
8
- * Version: 2.0.4
9
  * Text Domain: woocommerce-mailchimp
10
  * Domain Path: languages
11
  *
5
  * Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
6
  * Author: Saint Systems
7
  * Author URI: https://www.saintsystems.com
8
+ * Version: 2.0.5
9
  * Text Domain: woocommerce-mailchimp
10
  * Domain Path: languages
11
  *