Changeset 3347979
- Timestamp:
- 08/21/2025 08:46:53 AM (7 months ago)
- Location:
- clonable/trunk
- Files:
-
- 11 edited
-
clonable-wp.php (modified) (2 diffs)
-
readme-da_DK.txt (modified) (2 diffs)
-
readme-de_DE.txt (modified) (2 diffs)
-
readme-es_ES.txt (modified) (2 diffs)
-
readme-fr_FR.txt (modified) (2 diffs)
-
readme-it_IT.txt (modified) (2 diffs)
-
readme-nb_NO.txt (modified) (2 diffs)
-
readme-nl_NL.txt (modified) (2 diffs)
-
readme-sv_SE.txt (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
services/ClonableWooCommerceService.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clonable/trunk/clonable-wp.php
r3340235 r3347979 5 5 Description: Official plugin for improving your clones made with Clonable. 6 6 Plugin URI: https://kb.clonable.net/en/introduction/getting-started/wordpress#de-clonable-plug-in-downloaden 7 Version: 2.6. 17 Version: 2.6.2 8 8 Author: Clonable BV 9 9 Author URI: https://www.clonable.net … … 115 115 116 116 define('CLONABLE_NAME', 'Clonable'); 117 define('CLONABLE_VERSION', '2.6. 1');117 define('CLONABLE_VERSION', '2.6.2'); 118 118 119 119 if (defined('WP_CLI') && WP_CLI) { -
clonable/trunk/readme-da_DK.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-de_DE.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-es_ES.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-fr_FR.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-it_IT.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-nb_NO.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme-nl_NL.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Extra return filter hooks toegevoegd voor WooCommerce. 36 34 37 v2.6.1 35 Waarschuwing opgelost bij het parsen van valuta's 38 Waarschuwing opgelost bij het parsen van valuta's. 36 39 37 40 v2.6.0 -
clonable/trunk/readme-sv_SE.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/readme.txt
r3340235 r3347979 5 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.2 7 Stable tag: 2.6. 17 Stable tag: 2.6.2 8 8 License: GPL v2 or later 9 9 … … 32 32 33 33 == Changelog == 34 v2.6.2 35 Added extra return filters hooks for WooCommerce. 36 34 37 v2.6.1 35 38 Fixed a warning with parsing of custom currencies. -
clonable/trunk/services/ClonableWooCommerceService.php
r3336393 r3347979 32 32 33 33 // Implement redirecting back to clone instead of original website 34 add_filter('woocommerce_get_checkout_order_received_url', array($this, 'filter_return_url'), 10, 2);34 add_filter('woocommerce_get_checkout_order_received_url', array($this, 'filter_return_url'), 999, 2); 35 35 36 36 // Also intercept checkout_url as it is also used by some gateways to handle cancellations. 37 add_filter('woocommerce_get_checkout_payment_url', array($this, 'filter_return_url'), 10, 2);37 add_filter('woocommerce_get_checkout_payment_url', array($this, 'filter_return_url'), 999 , 2); 38 38 39 39 // Add filter for Mollie's custom return url implementation 40 add_filter('mollie-payments-for-woocommerce_return_url', array($this, 'filter_return_url'), 10, 2); 40 add_filter('mollie-payments-for-woocommerce_return_url', array($this, 'filter_return_url'), 999, 2); 41 42 // Most invoice/cheque/BACS-like gateways use this: 43 add_filter( 'woocommerce_get_return_url', array( $this, 'filter_return_url'), 999, 2); 44 45 // Fallback response url handling for certain gateways 46 add_filter( 'woocommerce_payment_successful_result', [$this, 'fallback_return_url'], 999, 2 ); 47 48 // For gateways (or themes/plugins) that assemble endpoint URLs manually: 49 add_filter( 'woocommerce_get_endpoint_url', [$this, 'manual_fallback_return_url'], 999, 4); 41 50 } 42 51 … … 114 123 } 115 124 116 if (Functions::str_starts_with($return_url, '/')) { 125 if (str_contains($return_url, $order_origin)) { 126 // if the return url already contains the order origin, then is fine to return 127 return $return_url; 128 } elseif (Functions::str_starts_with($return_url, '/')) { 117 129 // Starts with slash, prepend domain 118 130 return 'https://' . $order_origin . $return_url; … … 130 142 return $return_url; 131 143 } 144 } 145 146 /** 147 * It's basically the filter_return_url function with an extra check for a redirect option 148 * @param $result 149 * @param $order_id 150 * @return mixed 151 */ 152 public function fallback_return_url($result, $order_id) { 153 if (!empty($result['redirect']) ) { 154 $order = $order_id ? wc_get_order($order_id) : null; 155 $result['redirect'] = $this->filter_return_url($result['redirect'], $order); 156 } 157 return $result; 158 } 159 160 /** 161 * Fallback for generic WooCommerce endpoint URLs. 162 * There might be some plugins that build their return URL manually. 163 * 164 * @param $url 165 * @param $endpoint 166 * @param $value 167 * @param $permalink 168 * @return array|mixed|string|string[] 169 */ 170 public function manual_fallback_return_url($url, $endpoint, $value, $permalink) { 171 $actions = ['order-received', 'thank-you']; 172 if (in_array($endpoint, $actions, true) ) { 173 // If a manual build URL contains one of the action keywords, 174 // we assume that it should be filtered for return URls. 175 $url = $this->filter_return_url( $url, null ); 176 } 177 return $url; 132 178 } 133 179
Note: See TracChangeset
for help on using the changeset viewer.