Plugin Directory

Changeset 2145800


Ignore:
Timestamp:
08/26/2019 03:49:12 PM (7 years ago)
Author:
anderly
Message:

Release 2.3.1, see readme.txt for the changelog.

Location:
woocommerce-mailchimp
Files:
2 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-handler.php

    r2128689 r2145800  
    397397
    398398            $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 );
    399408
    400409            // Allow hooking into tags.
  • woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-migrator.php

    r1820868 r2145800  
    1 <?php 
     1<?php
    22
    33/**
     
    77
    88    const VERSION_KEY = 'ss_wc_mailchimp_version';
     9    const API_KEY = 'ss_wc_mailchimp_api_key';
     10    const LIST_KEY = 'ss_wc_mailchimp_list';
    911    const OLD_SETTINGS_KEY = 'woocommerce_mailchimp_settings';
    1012
     
    1315        '2.0',
    1416        '2.0.15',
     17        '2.3.0',
     18        '2.3.1',
    1519    );
    1620
    1721    public static function migrate( $target_version ) {
    1822
    19         $old_settings = get_option( self::OLD_SETTINGS_KEY );
    2023        $current_version = get_option( self::VERSION_KEY );
     24        $api_key = get_option( self::API_KEY );
     25        $list = get_option( self::LIST_KEY );
    2126
    22         if ( ! $old_settings && ! $current_version ) {
     27        if ( ! $current_version && ! $api_key && ! $list ) {
    2328            // This is a new install, so no need to migrate
     29            update_option( self::VERSION_KEY, $target_version );
    2430            return;
    2531        }
    2632
    2733        if ( ! $current_version ) {
    28             $current_version = '1.3.X';
     34            $current_version = '2.3.0';
    2935        }
    30    
     36
    3137        if ( $current_version !== $target_version ) {
    3238
     
    4551
    4652                // error_log( 'Migrating from ' . $current_version . ' to ' . $target_version );
    47                 // 
     53                //
    4854                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 );
    4957
    5058                    require_once( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" );
     
    5664                        // Update the current plugin version
    5765                        update_option( self::VERSION_KEY, $next_version );
     66                        do_action( 'sswcmc_log', 'Finished Migrating from ' . $current_version . ' to ' . $target_version );
    5867                    }
    5968
     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 );
    6074                }
    6175            }
  • woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp-plugin.php

    r2128689 r2145800  
    1616     * @var string
    1717     */
    18     private static $version = '2.3.0';
     18    private static $version = '2.3.1';
    1919
    2020    /**
  • woocommerce-mailchimp/tags/2.3.1/includes/class-ss-wc-mailchimp.php

    r2128689 r2145800  
    457457            foreach ( $tags as $tag ) {
    458458
    459                 $results[ $tag['name'] ] = $tag['name'];
     459                $results[ $tag['id'] ] = $tag['name'];
    460460
    461461            }
  • woocommerce-mailchimp/tags/2.3.1/readme.txt

    r2128689 r2145800  
    55Requires at least: 4.7.0
    66Tested up to: 5.2.2
    7 WC tested up to: 3.6.5
     7WC tested up to: 3.7.0
    88Requires PHP: 5.6
    9 Stable tag: 2.3.0
     9Stable tag: 2.3.1
    1010License: GPLv3
    1111
     
    119119
    120120== 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
    121126
    122127#### 2.3.0 - July 25, 2019
  • woocommerce-mailchimp/tags/2.3.1/woocommerce-mailchimp.php

    r2128689 r2145800  
    66 * Author: Saint Systems
    77 * Author URI: https://www.saintsystems.com
    8  * Version: 2.3.0
    9  * WC tested up to: 3.6.5
     8 * Version: 2.3.1
     9 * WC tested up to: 3.7.0
    1010 * Text Domain: woocommerce-mailchimp
    1111 * Domain Path: languages
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-handler.php

    r2128689 r2145800  
    397397
    398398            $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 );
    399408
    400409            // Allow hooking into tags.
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-migrator.php

    r1820868 r2145800  
    1 <?php 
     1<?php
    22
    33/**
     
    77
    88    const VERSION_KEY = 'ss_wc_mailchimp_version';
     9    const API_KEY = 'ss_wc_mailchimp_api_key';
     10    const LIST_KEY = 'ss_wc_mailchimp_list';
    911    const OLD_SETTINGS_KEY = 'woocommerce_mailchimp_settings';
    1012
     
    1315        '2.0',
    1416        '2.0.15',
     17        '2.3.0',
     18        '2.3.1',
    1519    );
    1620
    1721    public static function migrate( $target_version ) {
    1822
    19         $old_settings = get_option( self::OLD_SETTINGS_KEY );
    2023        $current_version = get_option( self::VERSION_KEY );
     24        $api_key = get_option( self::API_KEY );
     25        $list = get_option( self::LIST_KEY );
    2126
    22         if ( ! $old_settings && ! $current_version ) {
     27        if ( ! $current_version && ! $api_key && ! $list ) {
    2328            // This is a new install, so no need to migrate
     29            update_option( self::VERSION_KEY, $target_version );
    2430            return;
    2531        }
    2632
    2733        if ( ! $current_version ) {
    28             $current_version = '1.3.X';
     34            $current_version = '2.3.0';
    2935        }
    30    
     36
    3137        if ( $current_version !== $target_version ) {
    3238
     
    4551
    4652                // error_log( 'Migrating from ' . $current_version . ' to ' . $target_version );
    47                 // 
     53                //
    4854                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 );
    4957
    5058                    require_once( SS_WC_MAILCHIMP_DIR . "includes/migrations/class-ss-wc-migration-from-$current_version-to-$next_version.php" );
     
    5664                        // Update the current plugin version
    5765                        update_option( self::VERSION_KEY, $next_version );
     66                        do_action( 'sswcmc_log', 'Finished Migrating from ' . $current_version . ' to ' . $target_version );
    5867                    }
    5968
     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 );
    6074                }
    6175            }
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-plugin.php

    r2128689 r2145800  
    1616     * @var string
    1717     */
    18     private static $version = '2.3.0';
     18    private static $version = '2.3.1';
    1919
    2020    /**
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp.php

    r2128689 r2145800  
    457457            foreach ( $tags as $tag ) {
    458458
    459                 $results[ $tag['name'] ] = $tag['name'];
     459                $results[ $tag['id'] ] = $tag['name'];
    460460
    461461            }
  • woocommerce-mailchimp/trunk/readme.txt

    r2128689 r2145800  
    55Requires at least: 4.7.0
    66Tested up to: 5.2.2
    7 WC tested up to: 3.6.5
     7WC tested up to: 3.7.0
    88Requires PHP: 5.6
    9 Stable tag: 2.3.0
     9Stable tag: 2.3.1
    1010License: GPLv3
    1111
     
    119119
    120120== 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
    121126
    122127#### 2.3.0 - July 25, 2019
  • woocommerce-mailchimp/trunk/woocommerce-mailchimp.php

    r2128689 r2145800  
    66 * Author: Saint Systems
    77 * Author URI: https://www.saintsystems.com
    8  * Version: 2.3.0
    9  * WC tested up to: 3.6.5
     8 * Version: 2.3.1
     9 * WC tested up to: 3.7.0
    1010 * Text Domain: woocommerce-mailchimp
    1111 * Domain Path: languages
Note: See TracChangeset for help on using the changeset viewer.