Plugin Directory

Changeset 3484689


Ignore:
Timestamp:
03/17/2026 11:01:17 AM (10 days ago)
Author:
mailerlite
Message:

Update to version 3.1.12 from GitHub

Location:
woo-mailerlite
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • woo-mailerlite/tags/3.1.12/README.txt

    r3470352 r3484689  
    66Tested up to: 6.8.2
    77Requires PHP: 7.2.5
    8 Stable tag: 3.1.11
     8Stable tag: 3.1.12
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8484
    8585== Changelog ==
     86= 3.1.12 (17th March 2026) =
     87* Bug fixes
    8688
    8789= 3.1.11 (26th February 2026) =
  • woo-mailerlite/tags/3.1.12/includes/api/WooMailerLiteRewriteApi.php

    r3415073 r3484689  
    8989    public function syncOrder($shopId, $orderId, $customer, $cart, $status, $totalPrice, $createdAt)
    9090    {
    91         $orderStatus = 'pending';
    92         // if order status from woocommerce is wc-completed or wc-processing, set order status to completed
    93         if (in_array($status, ['wc-completed', 'wc-processing'])) {
    94             $status = 'completed';
    95         } else if (in_array($status, ['completed', 'processing'])) {
    96             $orderStatus = 'complete';
    97         }
    98 
     91        $orderStatus = WooMailerLiteOptions::isCompleteOrderStatus($status) ? 'complete' : 'pending';
    9992        if ( ! isset($cart['resource_id'])) {
    10093            $cart['resource_id'] = (string)$orderId;
  • woo-mailerlite/tags/3.1.12/includes/common/WooMailerLiteOptions.php

    r3462363 r3484689  
    66    private static $apiKey = 'apiKey';
    77    protected static $toJson = false;
     8
     9    public const COMPLETE_ORDER_STATUSES = [
     10        'wc-completed',
     11        'wc-processing',
     12        'completed',
     13        'processing',
     14        'wc-iscrizione-ok',
     15    ];
     16
     17    public const PENDING_ORDER_STATUSES = [
     18        'wc-pending',
     19    ];
    820
    921    public static function all()
     
    98110        return new self;
    99111    }
     112
     113    public static function allSupportedOrderStatuses()
     114    {
     115        return array_merge(self::COMPLETE_ORDER_STATUSES, self::PENDING_ORDER_STATUSES);
     116    }
     117
     118    public static function isCompleteOrderStatus($status)
     119    {
     120        return in_array($status, self::COMPLETE_ORDER_STATUSES);
     121    }
     122
     123    public static function isPendingOrderStatus($status)
     124    {
     125        return in_array($status, self::PENDING_ORDER_STATUSES);
     126    }
    100127}
  • woo-mailerlite/tags/3.1.12/includes/common/traits/WooMailerLiteResources.php

    r3415073 r3484689  
    8585            case 'WooMailerLiteCustomer':
    8686                    $this->args = array_merge([
    87                         'status' => ['wc-completed', 'wc-processing'],
     87                        'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES,
    8888                        'type' => 'shop_order',
    8989                        'orderby' => 'date',
     
    280280                    $orders = wc_get_orders([
    281281                        'billing_email' => $item->get_billing_email(),
    282                         'status' => ['wc-processing', 'wc-completed'],
     282                        'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES,
    283283                        'customer_id' => $item->get_customer_id(),
    284284                        'limit' => -1
  • woo-mailerlite/tags/3.1.12/includes/controllers/WooMailerLiteOrderController.php

    r3420776 r3484689  
    2626                    ->getFromOrder()
    2727                    ->where("email", $order->get_billing_email())
    28                     ->whereIn("status", ["wc-completed", "wc-processing", "wc-pending"])
     28                    ->whereIn("status", WooMailerLiteOptions::allSupportedOrderStatuses())
    2929                    ->first();
    3030            }
     
    166166            if (isset($response) && $response->success) {
    167167                $order->add_meta_data('_woo_ml_order_data_submitted', true);
    168                 if (in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing']) && !empty($cart)) {
     168                if (WooMailerLiteOptions::isCompleteOrderStatus($order->get_status()) && !empty($cart)) {
    169169                    if ($cart instanceof WooMailerLiteCart) {
    170170                        if ($this->apiClient()->isRewrite()) {
  • woo-mailerlite/tags/3.1.12/includes/models/WooMailerLiteCustomer.php

    r3377455 r3484689  
    5050        ")
    5151            ->from("wc_order_stats")
    52             ->whereIn("status", ['wc-processing','wc-completed'])
     52            ->whereIn("status", WooMailerLiteOptions::COMPLETE_ORDER_STATUSES)
    5353            ->groupBy("wc_order_stats.customer_id");
    5454
     
    9494                'wc_order_stats.status' => [
    9595                    'in' => [
    96                         'wc-processing', 'wc-completed'
     96                        WooMailerLiteOptions::COMPLETE_ORDER_STATUSES
    9797                    ]
    9898                ]
     
    126126                    sum(({$prefix}wc_order_stats.total_sales)) AS total_spent")
    127127            ->join('wc_order_stats', 'wc_order_stats.customer_id', 'wc_customer_lookup.customer_id')
    128             ->whereIn('wc_order_stats.status', ['wc-processing', 'wc-completed']);
     128            ->whereIn('wc_order_stats.status', WooMailerLiteOptions::COMPLETE_ORDER_STATUSES);
    129129        if (self::builder()->customTableEnabled() && $sync) {
    130130            $query->where('wc_order_stats.customer_id', '>', WooMailerLiteOptions::get('lastSyncedCustomer', 0));
  • woo-mailerlite/tags/3.1.12/woo-mailerlite.php

    r3470352 r3484689  
    1616 * Plugin URI:        https://mailerlite.com
    1717 * Description:       Official MailerLite integration for WooCommerce. Track sales and campaign ROI, import products details, automate emails based on purchases and seamlessly add your customers to your email marketing lists via WooCommerce's checkout process.
    18  * Version:           3.1.11
     18 * Version:           3.1.12
    1919 * Author:            MailerLite
    2020 * Author URI:        https://mailerlite.com
     
    4040 * Update when you release new versions.
    4141 */
    42 define( 'WOO_MAILERLITE_VERSION', '3.1.11' );
     42define( 'WOO_MAILERLITE_VERSION', '3.1.12' );
    4343
    4444define('WOO_MAILERLITE_ASYNC_JOBS', false);
  • woo-mailerlite/trunk/README.txt

    r3470352 r3484689  
    66Tested up to: 6.8.2
    77Requires PHP: 7.2.5
    8 Stable tag: 3.1.11
     8Stable tag: 3.1.12
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8484
    8585== Changelog ==
     86= 3.1.12 (17th March 2026) =
     87* Bug fixes
    8688
    8789= 3.1.11 (26th February 2026) =
  • woo-mailerlite/trunk/includes/api/WooMailerLiteRewriteApi.php

    r3415073 r3484689  
    8989    public function syncOrder($shopId, $orderId, $customer, $cart, $status, $totalPrice, $createdAt)
    9090    {
    91         $orderStatus = 'pending';
    92         // if order status from woocommerce is wc-completed or wc-processing, set order status to completed
    93         if (in_array($status, ['wc-completed', 'wc-processing'])) {
    94             $status = 'completed';
    95         } else if (in_array($status, ['completed', 'processing'])) {
    96             $orderStatus = 'complete';
    97         }
    98 
     91        $orderStatus = WooMailerLiteOptions::isCompleteOrderStatus($status) ? 'complete' : 'pending';
    9992        if ( ! isset($cart['resource_id'])) {
    10093            $cart['resource_id'] = (string)$orderId;
  • woo-mailerlite/trunk/includes/common/WooMailerLiteOptions.php

    r3462363 r3484689  
    66    private static $apiKey = 'apiKey';
    77    protected static $toJson = false;
     8
     9    public const COMPLETE_ORDER_STATUSES = [
     10        'wc-completed',
     11        'wc-processing',
     12        'completed',
     13        'processing',
     14        'wc-iscrizione-ok',
     15    ];
     16
     17    public const PENDING_ORDER_STATUSES = [
     18        'wc-pending',
     19    ];
    820
    921    public static function all()
     
    98110        return new self;
    99111    }
     112
     113    public static function allSupportedOrderStatuses()
     114    {
     115        return array_merge(self::COMPLETE_ORDER_STATUSES, self::PENDING_ORDER_STATUSES);
     116    }
     117
     118    public static function isCompleteOrderStatus($status)
     119    {
     120        return in_array($status, self::COMPLETE_ORDER_STATUSES);
     121    }
     122
     123    public static function isPendingOrderStatus($status)
     124    {
     125        return in_array($status, self::PENDING_ORDER_STATUSES);
     126    }
    100127}
  • woo-mailerlite/trunk/includes/common/traits/WooMailerLiteResources.php

    r3415073 r3484689  
    8585            case 'WooMailerLiteCustomer':
    8686                    $this->args = array_merge([
    87                         'status' => ['wc-completed', 'wc-processing'],
     87                        'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES,
    8888                        'type' => 'shop_order',
    8989                        'orderby' => 'date',
     
    280280                    $orders = wc_get_orders([
    281281                        'billing_email' => $item->get_billing_email(),
    282                         'status' => ['wc-processing', 'wc-completed'],
     282                        'status' => WooMailerLiteOptions::COMPLETE_ORDER_STATUSES,
    283283                        'customer_id' => $item->get_customer_id(),
    284284                        'limit' => -1
  • woo-mailerlite/trunk/includes/controllers/WooMailerLiteOrderController.php

    r3420776 r3484689  
    2626                    ->getFromOrder()
    2727                    ->where("email", $order->get_billing_email())
    28                     ->whereIn("status", ["wc-completed", "wc-processing", "wc-pending"])
     28                    ->whereIn("status", WooMailerLiteOptions::allSupportedOrderStatuses())
    2929                    ->first();
    3030            }
     
    166166            if (isset($response) && $response->success) {
    167167                $order->add_meta_data('_woo_ml_order_data_submitted', true);
    168                 if (in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing']) && !empty($cart)) {
     168                if (WooMailerLiteOptions::isCompleteOrderStatus($order->get_status()) && !empty($cart)) {
    169169                    if ($cart instanceof WooMailerLiteCart) {
    170170                        if ($this->apiClient()->isRewrite()) {
  • woo-mailerlite/trunk/includes/models/WooMailerLiteCustomer.php

    r3377455 r3484689  
    5050        ")
    5151            ->from("wc_order_stats")
    52             ->whereIn("status", ['wc-processing','wc-completed'])
     52            ->whereIn("status", WooMailerLiteOptions::COMPLETE_ORDER_STATUSES)
    5353            ->groupBy("wc_order_stats.customer_id");
    5454
     
    9494                'wc_order_stats.status' => [
    9595                    'in' => [
    96                         'wc-processing', 'wc-completed'
     96                        WooMailerLiteOptions::COMPLETE_ORDER_STATUSES
    9797                    ]
    9898                ]
     
    126126                    sum(({$prefix}wc_order_stats.total_sales)) AS total_spent")
    127127            ->join('wc_order_stats', 'wc_order_stats.customer_id', 'wc_customer_lookup.customer_id')
    128             ->whereIn('wc_order_stats.status', ['wc-processing', 'wc-completed']);
     128            ->whereIn('wc_order_stats.status', WooMailerLiteOptions::COMPLETE_ORDER_STATUSES);
    129129        if (self::builder()->customTableEnabled() && $sync) {
    130130            $query->where('wc_order_stats.customer_id', '>', WooMailerLiteOptions::get('lastSyncedCustomer', 0));
  • woo-mailerlite/trunk/woo-mailerlite.php

    r3470352 r3484689  
    1616 * Plugin URI:        https://mailerlite.com
    1717 * Description:       Official MailerLite integration for WooCommerce. Track sales and campaign ROI, import products details, automate emails based on purchases and seamlessly add your customers to your email marketing lists via WooCommerce's checkout process.
    18  * Version:           3.1.11
     18 * Version:           3.1.12
    1919 * Author:            MailerLite
    2020 * Author URI:        https://mailerlite.com
     
    4040 * Update when you release new versions.
    4141 */
    42 define( 'WOO_MAILERLITE_VERSION', '3.1.11' );
     42define( 'WOO_MAILERLITE_VERSION', '3.1.12' );
    4343
    4444define('WOO_MAILERLITE_ASYNC_JOBS', false);
Note: See TracChangeset for help on using the changeset viewer.