Plugin Directory

Changeset 3347979


Ignore:
Timestamp:
08/21/2025 08:46:53 AM (7 months ago)
Author:
clonable
Message:

version 2.6.2

Location:
clonable/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • clonable/trunk/clonable-wp.php

    r3340235 r3347979  
    55Description: Official plugin for improving your clones made with Clonable.
    66Plugin URI: https://kb.clonable.net/en/introduction/getting-started/wordpress#de-clonable-plug-in-downloaden
    7 Version: 2.6.1
     7Version: 2.6.2
    88Author: Clonable BV
    99Author URI: https://www.clonable.net
     
    115115
    116116define('CLONABLE_NAME', 'Clonable');
    117 define('CLONABLE_VERSION', '2.6.1');
     117define('CLONABLE_VERSION', '2.6.2');
    118118
    119119if (defined('WP_CLI') && WP_CLI) {
  • clonable/trunk/readme-da_DK.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-de_DE.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-es_ES.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-fr_FR.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-it_IT.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-nb_NO.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme-nl_NL.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Extra return filter hooks toegevoegd voor WooCommerce.
     36
    3437v2.6.1
    35 Waarschuwing opgelost bij het parsen van valuta's
     38Waarschuwing opgelost bij het parsen van valuta's.
    3639
    3740v2.6.0
  • clonable/trunk/readme-sv_SE.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/readme.txt

    r3340235 r3347979  
    55Tested up to: 6.8.2
    66Requires PHP: 7.2
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88License: GPL v2 or later
    99
     
    3232
    3333== Changelog ==
     34v2.6.2
     35Added extra return filters hooks for WooCommerce.
     36
    3437v2.6.1
    3538Fixed a warning with parsing of custom currencies.
  • clonable/trunk/services/ClonableWooCommerceService.php

    r3336393 r3347979  
    3232
    3333            // 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);
    3535
    3636            // 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);
    3838
    3939            // 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);
    4150        }
    4251
     
    114123            }
    115124
    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, '/')) {
    117129                // Starts with slash, prepend domain
    118130                return 'https://' . $order_origin . $return_url;
     
    130142            return $return_url;
    131143        }
     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;
    132178    }
    133179
Note: See TracChangeset for help on using the changeset viewer.