Changeset 2145800
- Timestamp:
- 08/26/2019 03:49:12 PM (7 years ago)
- Location:
- woocommerce-mailchimp
- Files:
-
- 2 added
- 12 edited
- 1 copied
-
tags/2.3.1 (copied) (copied from woocommerce-mailchimp/trunk)
-
tags/2.3.1/includes/class-ss-wc-mailchimp-handler.php (modified) (1 diff)
-
tags/2.3.1/includes/class-ss-wc-mailchimp-migrator.php (modified) (5 diffs)
-
tags/2.3.1/includes/class-ss-wc-mailchimp-plugin.php (modified) (1 diff)
-
tags/2.3.1/includes/class-ss-wc-mailchimp.php (modified) (1 diff)
-
tags/2.3.1/includes/migrations/class-ss-wc-migration-from-2.3.0-to-2.3.1.php (added)
-
tags/2.3.1/readme.txt (modified) (2 diffs)
-
tags/2.3.1/woocommerce-mailchimp.php (modified) (1 diff)
-
trunk/includes/class-ss-wc-mailchimp-handler.php (modified) (1 diff)
-
trunk/includes/class-ss-wc-mailchimp-migrator.php (modified) (5 diffs)
-
trunk/includes/class-ss-wc-mailchimp-plugin.php (modified) (1 diff)
-
trunk/includes/class-ss-wc-mailchimp.php (modified) (1 diff)
-
trunk/includes/migrations/class-ss-wc-migration-from-2.3.0-to-2.3.1.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-mailchimp.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-handler.php
r2128689 r2145800 397 397 398 398 $tags = $this->sswcmc->tags(); 399 400 $mc_tags = $this->sswcmc->mailchimp()->get_tags( $list_id ); 401 402 $tags = array_map( function( $tag ) use ( $mc_tags ) { 403 return array( 404 'name' => $mc_tags[$tag], 405 'status' => 'active', 406 ); 407 }, $tags ); 399 408 400 409 // Allow hooking into tags. -
woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-migrator.php
r1820868 r2145800 1 <?php 1 <?php 2 2 3 3 /** … … 7 7 8 8 const VERSION_KEY = 'ss_wc_mailchimp_version'; 9 const API_KEY = 'ss_wc_mailchimp_api_key'; 10 const LIST_KEY = 'ss_wc_mailchimp_list'; 9 11 const OLD_SETTINGS_KEY = 'woocommerce_mailchimp_settings'; 10 12 … … 13 15 '2.0', 14 16 '2.0.15', 17 '2.3.0', 18 '2.3.1', 15 19 ); 16 20 17 21 public static function migrate( $target_version ) { 18 22 19 $old_settings = get_option( self::OLD_SETTINGS_KEY );20 23 $current_version = get_option( self::VERSION_KEY ); 24 $api_key = get_option( self::API_KEY ); 25 $list = get_option( self::LIST_KEY ); 21 26 22 if ( ! $ old_settings && ! $current_version) {27 if ( ! $current_version && ! $api_key && ! $list ) { 23 28 // This is a new install, so no need to migrate 29 update_option( self::VERSION_KEY, $target_version ); 24 30 return; 25 31 } 26 32 27 33 if ( ! $current_version ) { 28 $current_version = ' 1.3.X';34 $current_version = '2.3.0'; 29 35 } 30 36 31 37 if ( $current_version !== $target_version ) { 32 38 … … 45 51 46 52 // error_log( 'Migrating from ' . $current_version . ' to ' . $target_version ); 47 // 53 // 48 54 if ( file_exists( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" ) ) { 55 56 do_action( 'sswcmc_log', 'Migrating from ' . $current_version . ' to ' . $target_version ); 49 57 50 58 require_once( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" ); … … 56 64 // Update the current plugin version 57 65 update_option( self::VERSION_KEY, $next_version ); 66 do_action( 'sswcmc_log', 'Finished Migrating from ' . $current_version . ' to ' . $target_version ); 58 67 } 59 68 69 } else { 70 // Update the current plugin version 71 do_action( 'sswcmc_log', 'No migration found from ' . $current_version . ' to ' . $next_version . '. Setting current version to: ' . $next_version ); 72 73 update_option( self::VERSION_KEY, $next_version ); 60 74 } 61 75 } -
woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-plugin.php
r2128689 r2145800 16 16 * @var string 17 17 */ 18 private static $version = '2.3. 0';18 private static $version = '2.3.1'; 19 19 20 20 /** -
woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp.php
r2128689 r2145800 457 457 foreach ( $tags as $tag ) { 458 458 459 $results[ $tag[' name'] ] = $tag['name'];459 $results[ $tag['id'] ] = $tag['name']; 460 460 461 461 } -
woocommerce-mailchimp/tags/2.3.1/readme.txt
r2128689 r2145800 5 5 Requires at least: 4.7.0 6 6 Tested up to: 5.2.2 7 WC tested up to: 3. 6.57 WC tested up to: 3.7.0 8 8 Requires PHP: 5.6 9 Stable tag: 2.3. 09 Stable tag: 2.3.1 10 10 License: GPLv3 11 11 … … 119 119 120 120 == Changelog == 121 122 #### 2.3.1 - August 26, 2019 123 - Fix tag retrieval to return tag IDs. 124 - Fix migrations. 125 - Tested up to WooCommerce 3.7.0 121 126 122 127 #### 2.3.0 - July 25, 2019 -
woocommerce-mailchimp/tags/2.3.1/woocommerce-mailchimp.php
r2128689 r2145800 6 6 * Author: Saint Systems 7 7 * Author URI: https://www.saintsystems.com 8 * Version: 2.3. 09 * WC tested up to: 3. 6.58 * Version: 2.3.1 9 * WC tested up to: 3.7.0 10 10 * Text Domain: woocommerce-mailchimp 11 11 * Domain Path: languages -
woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-handler.php
r2128689 r2145800 397 397 398 398 $tags = $this->sswcmc->tags(); 399 400 $mc_tags = $this->sswcmc->mailchimp()->get_tags( $list_id ); 401 402 $tags = array_map( function( $tag ) use ( $mc_tags ) { 403 return array( 404 'name' => $mc_tags[$tag], 405 'status' => 'active', 406 ); 407 }, $tags ); 399 408 400 409 // Allow hooking into tags. -
woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-migrator.php
r1820868 r2145800 1 <?php 1 <?php 2 2 3 3 /** … … 7 7 8 8 const VERSION_KEY = 'ss_wc_mailchimp_version'; 9 const API_KEY = 'ss_wc_mailchimp_api_key'; 10 const LIST_KEY = 'ss_wc_mailchimp_list'; 9 11 const OLD_SETTINGS_KEY = 'woocommerce_mailchimp_settings'; 10 12 … … 13 15 '2.0', 14 16 '2.0.15', 17 '2.3.0', 18 '2.3.1', 15 19 ); 16 20 17 21 public static function migrate( $target_version ) { 18 22 19 $old_settings = get_option( self::OLD_SETTINGS_KEY );20 23 $current_version = get_option( self::VERSION_KEY ); 24 $api_key = get_option( self::API_KEY ); 25 $list = get_option( self::LIST_KEY ); 21 26 22 if ( ! $ old_settings && ! $current_version) {27 if ( ! $current_version && ! $api_key && ! $list ) { 23 28 // This is a new install, so no need to migrate 29 update_option( self::VERSION_KEY, $target_version ); 24 30 return; 25 31 } 26 32 27 33 if ( ! $current_version ) { 28 $current_version = ' 1.3.X';34 $current_version = '2.3.0'; 29 35 } 30 36 31 37 if ( $current_version !== $target_version ) { 32 38 … … 45 51 46 52 // error_log( 'Migrating from ' . $current_version . ' to ' . $target_version ); 47 // 53 // 48 54 if ( file_exists( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" ) ) { 55 56 do_action( 'sswcmc_log', 'Migrating from ' . $current_version . ' to ' . $target_version ); 49 57 50 58 require_once( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" ); … … 56 64 // Update the current plugin version 57 65 update_option( self::VERSION_KEY, $next_version ); 66 do_action( 'sswcmc_log', 'Finished Migrating from ' . $current_version . ' to ' . $target_version ); 58 67 } 59 68 69 } else { 70 // Update the current plugin version 71 do_action( 'sswcmc_log', 'No migration found from ' . $current_version . ' to ' . $next_version . '. Setting current version to: ' . $next_version ); 72 73 update_option( self::VERSION_KEY, $next_version ); 60 74 } 61 75 } -
woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-plugin.php
r2128689 r2145800 16 16 * @var string 17 17 */ 18 private static $version = '2.3. 0';18 private static $version = '2.3.1'; 19 19 20 20 /** -
woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp.php
r2128689 r2145800 457 457 foreach ( $tags as $tag ) { 458 458 459 $results[ $tag[' name'] ] = $tag['name'];459 $results[ $tag['id'] ] = $tag['name']; 460 460 461 461 } -
woocommerce-mailchimp/trunk/readme.txt
r2128689 r2145800 5 5 Requires at least: 4.7.0 6 6 Tested up to: 5.2.2 7 WC tested up to: 3. 6.57 WC tested up to: 3.7.0 8 8 Requires PHP: 5.6 9 Stable tag: 2.3. 09 Stable tag: 2.3.1 10 10 License: GPLv3 11 11 … … 119 119 120 120 == Changelog == 121 122 #### 2.3.1 - August 26, 2019 123 - Fix tag retrieval to return tag IDs. 124 - Fix migrations. 125 - Tested up to WooCommerce 3.7.0 121 126 122 127 #### 2.3.0 - July 25, 2019 -
woocommerce-mailchimp/trunk/woocommerce-mailchimp.php
r2128689 r2145800 6 6 * Author: Saint Systems 7 7 * Author URI: https://www.saintsystems.com 8 * Version: 2.3. 09 * WC tested up to: 3. 6.58 * Version: 2.3.1 9 * WC tested up to: 3.7.0 10 10 * Text Domain: woocommerce-mailchimp 11 11 * Domain Path: languages
Note: See TracChangeset
for help on using the changeset viewer.