Changeset 3361673
- Timestamp:
- 09/15/2025 10:30:16 AM (6 months ago)
- Location:
- woo-mailerlite/trunk
- Files:
-
- 9 edited
-
admin/WooMailerLiteAdmin.php (modified) (1 diff)
-
admin/controllers/WooMailerLiteAdminWizardController.php (modified) (1 diff)
-
includes/WooMailerLite.php (modified) (1 diff)
-
includes/common/traits/WooMailerLiteResources.php (modified) (1 diff)
-
includes/controllers/WooMailerLiteOrderController.php (modified) (2 diffs)
-
includes/models/WooMailerLiteCustomer.php (modified) (2 diffs)
-
public/js/woo-mailerlite-public.js (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
woo-mailerlite.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-mailerlite/trunk/admin/WooMailerLiteAdmin.php
r3339434 r3361673 53 53 if ($response->status === 401) { 54 54 $falseApi = true; 55 WooMailerLiteOptions::deleteAll();55 // WooMailerLiteOptions::deleteAll(); 56 56 } else { 57 57 WooMailerLiteCache::set('valid_api', true, 86400); -
woo-mailerlite/trunk/admin/controllers/WooMailerLiteAdminWizardController.php
r3344677 r3361673 91 91 ]); 92 92 93 if (!$this->apiClient()->isReWrite() && !$this->validateClassicConsumerKeys($this->request['consumerKey'], $this->request['consumerSecret'])) { 94 return $this->response(['message' => 'Invalid consumer key or secret'], 400); 95 } 93 // temp removing checking keys 94 // if (!$this->apiClient()->isReWrite() && !$this->validateClassicConsumerKeys($this->request['consumerKey'], $this->request['consumerSecret'])) { 95 // return $this->response(['message' => 'Invalid consumer key or secret'], 400); 96 // } 96 97 97 98 if (!WooMailerLiteOptions::get('group') || (!empty(WooMailerLiteOptions::get('group', [])) && WooMailerLiteOptions::get('group')['id'] != $this->validated['group'])) { -
woo-mailerlite/trunk/includes/WooMailerLite.php
r3339434 r3361673 71 71 $this->define_public_hooks(); 72 72 $this->setupWooMailerLite(); 73 $this->handleUpgrade();73 // $this->handleUpgrade(); 74 74 } 75 75 /** -
woo-mailerlite/trunk/includes/common/traits/WooMailerLiteResources.php
r3338878 r3361673 48 48 switch ($this->resource) { 49 49 case 'WooMailerLiteProduct': 50 if (isset($this->args['id'])) { 51 $this->args['include'] = [$this->args['id']]; 52 unset($this->args['id']); 53 } 50 54 $this->args = array_merge([ 51 55 'limit' => -1, -
woo-mailerlite/trunk/includes/controllers/WooMailerLiteOrderController.php
r3348600 r3361673 21 21 } 22 22 $cart = WooMailerLiteCart::where('email', $order->get_billing_email())->first(); 23 24 if (!$cart || !$customer) { 23 if (!$cart) { 24 $cart = WooMailerLiteCart::where('hash', WooMailerLiteSession::getMLCartHash())->first(); 25 if ($cart instanceof WooMailerLiteCart) { 26 $cart->update([ 27 'email' => $order->get_billing_email(), 28 ]); 29 } 30 } 31 if (!$cart && !$customer) { 25 32 return true; 26 33 } … … 123 130 124 131 } else { 125 $response = $this->apiClient()->syncOrder(WooMailerLiteOptions::get('shopId'), $orderId, $orderCustomer, $cartData, $order->get_status(), $order->get_total(), $order->get_date_created()->format('Y-m-d H:i:s')); 132 $date = null; 133 if ($order->get_date_created()) { 134 $date = $order->get_date_created()->format('Y-m-d H:i:s'); 135 } 136 $response = $this->apiClient()->syncOrder(WooMailerLiteOptions::get('shopId'), $orderId, $orderCustomer, $cartData, $order->get_status(), $order->get_total(), $date); 126 137 } 127 138 if (isset($response) && $response->success) { 128 139 $order->add_meta_data('_woo_ml_order_data_submitted', true); 129 if (in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing'])) { 130 $cart->delete(); 140 if (in_array($order->get_status(), ['wc-completed', 'wc-processing','completed','processing']) && !empty($cart)) { 141 if ($cart instanceof WooMailerLiteCart) { 142 $cart->delete(); 143 } 131 144 } 132 145 if ($this->apiClient()->isClassic()) { -
woo-mailerlite/trunk/includes/models/WooMailerLiteCustomer.php
r3338878 r3361673 23 23 'zip', 24 24 'last_order_id', 25 'last_order' 25 'last_order', 26 26 ]; 27 27 … … 34 34 $prefix = db()->prefix; 35 35 36 $query = static::builder()->select("wp_wc_customer_lookup.customer_id, 37 wp_wc_customer_lookup.email, 38 max(wp_wc_order_stats.order_id) AS last_order_id, 39 max(wp_wc_order_stats.date_created) AS last_order, 40 count(DISTINCT wp_wc_order_stats.order_id) AS orders_count, 41 sum(wp_wc_order_stats.total_sales) AS total_spent, 36 $query = static::builder()->select(" 37 {$prefix}wc_customer_lookup.customer_id, 38 {$prefix}wc_customer_lookup.email, 39 max({$prefix}wc_order_stats.order_id) AS last_order_id, 40 max({$prefix}wc_order_stats.date_created) AS last_order, 41 count(DISTINCT {$prefix}wc_order_stats.order_id) AS orders_count, 42 sum({$prefix}wc_order_stats.total_sales) AS total_spent, 42 43 CASE WHEN ( 43 44 SELECT -
woo-mailerlite/trunk/public/js/woo-mailerlite-public.js
r3348600 r3361673 7 7 let checkboxAdded = false; 8 8 let mailerLiteCheckoutBlockActive = null; 9 10 if (document.querySelector('[data-block-name="woocommerce/checkout"]')) { 11 window.mailerlitePublicJsCaptured = false; 12 } else { 13 window.mailerlitePublicJsCaptured = true; 14 } 9 let listeningEvents = false; 10 11 12 // temporarily forcefully picking this js not blocks one 13 window.mailerlitePublicJsCaptured = true; 14 // if (document.querySelector('[data-block-name="woocommerce/checkout"]')) { 15 // window.mailerlitePublicJsCaptured = false; 16 // } else { 17 // window.mailerlitePublicJsCaptured = true; 18 // } 15 19 16 20 if (wooMailerLitePublicData.checkboxSettings.enabled && document.body.classList.contains('woocommerce-checkout')) { … … 48 52 } 49 53 50 if ( checkboxAdded || (mailerLiteCheckoutBlockActive !== null && mailerLiteCheckoutBlockActive)) {54 if (listeningEvents && (checkboxAdded || (mailerLiteCheckoutBlockActive !== null && mailerLiteCheckoutBlockActive))) { 51 55 return false; 52 56 } … … 114 118 115 119 if (email !== null) { 120 listeningEvents = true; 116 121 email.addEventListener('change', (event) => { 117 122 validateMLSub(event); … … 180 185 signup: accept_marketing, 181 186 language: wooMailerLitePublicData.language, 182 name: firstName .value ?? '',183 last_name: lastName .value ?? '',187 name: firstName?.value ?? '', 188 last_name: lastName?.value ?? '', 184 189 cookie_mailerlite_checkout_token:getCookie('mailerlite_checkout_token') 185 190 } -
woo-mailerlite/trunk/readme.txt
r3348600 r3361673 6 6 Tested up to: 6.8.2 7 7 Requires PHP: 7.2.5 8 Stable tag: 3.0. 78 Stable tag: 3.0.8 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 85 85 == Changelog == 86 86 87 = 3.0.8 (15th September 2025) = 88 * Improved cart synchronization and updates 89 * Minor bug fixes and performance improvements 90 87 91 = 3.0.7 (22nd August 2025) = 88 92 * Bug fixes and improvements -
woo-mailerlite/trunk/woo-mailerlite.php
r3348600 r3361673 16 16 * Plugin URI: https://wordpress.org/plugins/woo-mailerlite/ 17 17 * 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.0. 718 * Version: 3.0.8 19 19 * Author: MailerLite 20 20 * Author URI: https://mailerlite.com … … 40 40 * Update when you release new versions. 41 41 */ 42 define( 'WOO_MAILERLITE_VERSION', '3.0. 7' );42 define( 'WOO_MAILERLITE_VERSION', '3.0.8' ); 43 43 44 44 define('WOO_MAILERLITE_ASYNC_JOBS', false);
Note: See TracChangeset
for help on using the changeset viewer.