Plugin Directory

Changeset 2951826


Ignore:
Timestamp:
08/10/2023 08:25:51 PM (3 years ago)
Author:
anderly
Message:

Release 2.4.12, see readme.txt for the changelog.

Location:
woocommerce-mailchimp
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-mailchimp/tags/2.4.12/includes/class-ss-wc-mailchimp-api.php

    r2692118 r2951826  
    257257    /**
    258258     * Concatenates Mailchimp API errors array into string.
    259      * @param  array  $error 
     259     * @param  array  $error
    260260     * @return string String representation of the concatenated Mailchimp API errors.
    261261     */
    262262    private function concat_errors( $error ) {
    263        
    264         if ( !is_array( $error ) || !is_array( $error['errors'] ) ) {
     263
     264        if ( !is_array( $error ) || !isset( $error['errors'] ) || !is_array( $error['errors'] ) ) {
    265265            return '';
    266266        }
    267    
    268         $fields = array_map(function($err) { 
     267
     268        $fields = array_map(function($err) {
    269269            return '{ field: ' . $err['field'] . ', message: ' . $err['message'] . ' }';
    270270        }, $error['errors'] );
  • woocommerce-mailchimp/tags/2.4.12/includes/class-ss-wc-mailchimp-handler.php

    r2538132 r2951826  
    2121        /**
    2222         *
    23          *
    24          * Plugin singleton instance
     23         * Class singleton instance
    2524         *
    2625         * @var SS_WC_MailChimp_Handler
    2726         */
    2827        private static $instance = null;
     28
     29        /**
     30         *
     31         * Main Plugin instance
     32         *
     33         * @var SS_WC_MailChimp_Plugin
     34         */
     35        private $sswcmc = null;
     36
     37        /**
     38         * Id
     39         *
     40         * @var string
     41         */
     42        private $id = null;
     43
     44        /**
     45         * Namespace
     46         *
     47         * @var string
     48         */
     49        private $namespace = null;
     50
     51        /**
     52         * Label
     53         *
     54         * @var string
     55         */
     56        private $label = null;
    2957
    3058        /**
     
    124152
    125153                // Get the ss_wc_mailchimp_opt_in value from the post meta ("order_custom_fields" was removed with WooCommerce 2.1).
    126                 $subscribe_customer = get_post_meta( $id, 'ss_wc_mailchimp_opt_in', true );
     154                $subscribe_customer = $order->get_meta( 'ss_wc_mailchimp_opt_in', true );
    127155
    128156                $order_id                 = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
     
    396424        public function maybe_subscribe( $order_id ) {
    397425
    398             // Get the ss_wc_mailchimp_opt_in value from the post meta ("order_custom_fields" was removed with WooCommerce 2.1).
    399             $subscribe_customer = get_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', true );
     426            $order = $this->wc_get_order( $order_id );
     427
     428            // Get the ss_wc_mailchimp_opt_in value from the order meta ("order_custom_fields" was removed with WooCommerce 2.1).
     429            $subscribe_customer = $order->get_meta( 'ss_wc_mailchimp_opt_in', true );
    400430
    401431            // Get the subscribe options.
     
    513543                $opt_in = isset( $_POST['ss_wc_mailchimp_opt_in'] ) ? 'yes' : 'no';
    514544
    515                 update_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', $opt_in );
     545                $order = $this->wc_get_order( $order_id );
     546
     547                // update_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', $opt_in );
     548
     549                $order->update_meta_data( 'ss_wc_mailchimp_opt_in', $opt_in );
     550                $order->save();
     551
    516552            }
    517553        }
  • woocommerce-mailchimp/tags/2.4.12/includes/class-ss-wc-mailchimp-plugin.php

    r2940592 r2951826  
    1616     * @var string
    1717     */
    18     private static $version = '2.4.10';
     18    private static $version = '2.4.12';
    1919
    2020    /**
     
    474474
    475475        }
     476
     477        // Declare compatibility with custom order tables for WooCommerce.
     478        add_action(
     479            'before_woocommerce_init',
     480            function () {
     481                if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     482                    \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', SS_WC_MAILCHIMP_FILE, true );
     483                }
     484            }
     485        );
    476486
    477487    } //end function add_hooks
  • woocommerce-mailchimp/tags/2.4.12/readme.txt

    r2940592 r2951826  
    44Tags: woocommerce, mailchimp, ecommerce, email
    55Requires at least: 4.7.0
    6 Tested up to: 6.2.2
    7 WC tested up to: 7.9.0
     6Tested up to: 6.3
     7WC tested up to: 8.0.1
    88Requires PHP: 5.6
    9 Stable tag: 2.4.10
    10 Version: 2.4.10
     9Stable tag: 2.4.12
     10Version: 2.4.12
    1111License: GPLv3
    1212
     
    120120
    121121== Changelog ==
     122
     123#### 2.4.12 - Aug 10, 2023
     124- Support for WooCommerce HPOS (High Performance Order Storage).
     125- Bump WC tested version up to 8.0.1.
     126- Bump WP tested version up to 6.3.
     127
     128#### 2.4.11 - Jul 20, 2023
     129- PHP 8+ exception bug fix - check if array key exists.
    122130
    123131#### 2.4.10 - Jul 19, 2023
  • woocommerce-mailchimp/tags/2.4.12/woocommerce-mailchimp.php

    r2940592 r2951826  
    66 * Author: Saint Systems
    77 * Author URI: https://www.saintsystems.com
    8  * Version: 2.4.10
    9  * WC tested up to: 7.9.0
     8 * Version: 2.4.12
     9 * WC tested up to: 8.0.1
    1010 * Text Domain: woocommerce-mailchimp
    1111 * Domain Path: languages
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-api.php

    r2692118 r2951826  
    257257    /**
    258258     * Concatenates Mailchimp API errors array into string.
    259      * @param  array  $error 
     259     * @param  array  $error
    260260     * @return string String representation of the concatenated Mailchimp API errors.
    261261     */
    262262    private function concat_errors( $error ) {
    263        
    264         if ( !is_array( $error ) || !is_array( $error['errors'] ) ) {
     263
     264        if ( !is_array( $error ) || !isset( $error['errors'] ) || !is_array( $error['errors'] ) ) {
    265265            return '';
    266266        }
    267    
    268         $fields = array_map(function($err) { 
     267
     268        $fields = array_map(function($err) {
    269269            return '{ field: ' . $err['field'] . ', message: ' . $err['message'] . ' }';
    270270        }, $error['errors'] );
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-handler.php

    r2538132 r2951826  
    2121        /**
    2222         *
    23          *
    24          * Plugin singleton instance
     23         * Class singleton instance
    2524         *
    2625         * @var SS_WC_MailChimp_Handler
    2726         */
    2827        private static $instance = null;
     28
     29        /**
     30         *
     31         * Main Plugin instance
     32         *
     33         * @var SS_WC_MailChimp_Plugin
     34         */
     35        private $sswcmc = null;
     36
     37        /**
     38         * Id
     39         *
     40         * @var string
     41         */
     42        private $id = null;
     43
     44        /**
     45         * Namespace
     46         *
     47         * @var string
     48         */
     49        private $namespace = null;
     50
     51        /**
     52         * Label
     53         *
     54         * @var string
     55         */
     56        private $label = null;
    2957
    3058        /**
     
    124152
    125153                // Get the ss_wc_mailchimp_opt_in value from the post meta ("order_custom_fields" was removed with WooCommerce 2.1).
    126                 $subscribe_customer = get_post_meta( $id, 'ss_wc_mailchimp_opt_in', true );
     154                $subscribe_customer = $order->get_meta( 'ss_wc_mailchimp_opt_in', true );
    127155
    128156                $order_id                 = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
     
    396424        public function maybe_subscribe( $order_id ) {
    397425
    398             // Get the ss_wc_mailchimp_opt_in value from the post meta ("order_custom_fields" was removed with WooCommerce 2.1).
    399             $subscribe_customer = get_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', true );
     426            $order = $this->wc_get_order( $order_id );
     427
     428            // Get the ss_wc_mailchimp_opt_in value from the order meta ("order_custom_fields" was removed with WooCommerce 2.1).
     429            $subscribe_customer = $order->get_meta( 'ss_wc_mailchimp_opt_in', true );
    400430
    401431            // Get the subscribe options.
     
    513543                $opt_in = isset( $_POST['ss_wc_mailchimp_opt_in'] ) ? 'yes' : 'no';
    514544
    515                 update_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', $opt_in );
     545                $order = $this->wc_get_order( $order_id );
     546
     547                // update_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', $opt_in );
     548
     549                $order->update_meta_data( 'ss_wc_mailchimp_opt_in', $opt_in );
     550                $order->save();
     551
    516552            }
    517553        }
  • woocommerce-mailchimp/trunk/includes/class-ss-wc-mailchimp-plugin.php

    r2940592 r2951826  
    1616     * @var string
    1717     */
    18     private static $version = '2.4.10';
     18    private static $version = '2.4.12';
    1919
    2020    /**
     
    474474
    475475        }
     476
     477        // Declare compatibility with custom order tables for WooCommerce.
     478        add_action(
     479            'before_woocommerce_init',
     480            function () {
     481                if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     482                    \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', SS_WC_MAILCHIMP_FILE, true );
     483                }
     484            }
     485        );
    476486
    477487    } //end function add_hooks
  • woocommerce-mailchimp/trunk/readme.txt

    r2940592 r2951826  
    44Tags: woocommerce, mailchimp, ecommerce, email
    55Requires at least: 4.7.0
    6 Tested up to: 6.2.2
    7 WC tested up to: 7.9.0
     6Tested up to: 6.3
     7WC tested up to: 8.0.1
    88Requires PHP: 5.6
    9 Stable tag: 2.4.10
    10 Version: 2.4.10
     9Stable tag: 2.4.12
     10Version: 2.4.12
    1111License: GPLv3
    1212
     
    120120
    121121== Changelog ==
     122
     123#### 2.4.12 - Aug 10, 2023
     124- Support for WooCommerce HPOS (High Performance Order Storage).
     125- Bump WC tested version up to 8.0.1.
     126- Bump WP tested version up to 6.3.
     127
     128#### 2.4.11 - Jul 20, 2023
     129- PHP 8+ exception bug fix - check if array key exists.
    122130
    123131#### 2.4.10 - Jul 19, 2023
  • woocommerce-mailchimp/trunk/woocommerce-mailchimp.php

    r2940592 r2951826  
    66 * Author: Saint Systems
    77 * Author URI: https://www.saintsystems.com
    8  * Version: 2.4.10
    9  * WC tested up to: 7.9.0
     8 * Version: 2.4.12
     9 * WC tested up to: 8.0.1
    1010 * Text Domain: woocommerce-mailchimp
    1111 * Domain Path: languages
Note: See TracChangeset for help on using the changeset viewer.