Plugin Directory

Changeset 3468995


Ignore:
Timestamp:
02/25/2026 01:35:01 AM (5 weeks ago)
Author:
linguise
Message:

Updating to version 2.2.26

Location:
linguise
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • linguise/tags/2.2.26/languages/linguise.pot

    r3468206 r3468995  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Linguise - AI Automatic Multilingual Translation 2.2.25\n"
     5"Project-Id-Version: Linguise - AI Automatic Multilingual Translation 2.2.26\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/linguise\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • linguise/tags/2.2.26/linguise.php

    r3468206 r3468995  
    55 * Plugin URI: https://www.linguise.com/
    66 * Description: Linguise translation plugin
    7  * Version:2.2.25
     7 * Version:2.2.26
    88 * Text Domain: linguise
    99 * Domain Path: /languages
  • linguise/tags/2.2.26/readme.txt

    r3468206 r3468995  
    44Requires at least: 4.0
    55Tested up to: 6.9
    6 Stable tag: 2.2.25
     6Stable tag: 2.2.26
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    108108
    109109== Changelog ==
     110= 2.2.26 =
     111- Fix: Try to re-hook order URL again
     112- Fix: Re-add back the site path
     113
    110114= 2.2.25 =
    111115- Fix: Make the requirement for DOMDocument more strict
  • linguise/tags/2.2.26/src/constants.php

    r3468206 r3468995  
    11<?php
    22if (!defined('LINGUISE_SCRIPT_TRANSLATION_VERSION')) {
    3     define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.25');
     3    define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.26');
    44}
    55
    66if (!defined('LINGUISE_VERSION')) {
    7     define('LINGUISE_VERSION', '2.2.25');
     7    define('LINGUISE_VERSION', '2.2.26');
    88}
  • linguise/tags/2.2.26/src/thirdparty/add-search-to-menu.php

    r3464793 r3468995  
    112112            $ajax->ajax_load_posts();
    113113        } catch (\Exception $e) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
    114             /** Stub */
     114            // Stub
    115115        }
    116116
  • linguise/tags/2.2.26/src/thirdparty/wc/woocommerce.php

    r3425738 r3468995  
    289289    public function destroy()
    290290    {
    291         remove_filter('woocommerce_ajax_get_endpoint', [$this, 'hookWCAjaxEndpoint'], 10, 2);
     291        remove_filter('woocommerce_ajax_get_endpoint', [$this, 'hookWCAjaxEndpoint'], 10);
    292292        remove_action('woocommerce_customer_reset_password', [$this, 'hookWCCustomerResetPassword'], 10);
    293293
    294294        // We skip removing the ajax methods overrides
    295         remove_action('woocommerce_new_order', [$this, 'hookWCNewOrder'], 100, 2);
    296         remove_filter('woocommerce_after_order_object_save', [$this, 'hookWCNewOrderSave'], 100, 1);
    297         remove_filter('woocommerce_update_order_review_fragments', [$this, 'hookWCFragments'], 1000, 1);
    298         remove_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000, 1);
    299 
    300         remove_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 10, 2);
    301         remove_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 10, 2);
    302         // remove_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 10, 2);
    303         remove_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000, 1);
     295        remove_action('woocommerce_new_order', [$this, 'hookWCNewOrder'], 100);
     296        remove_filter('woocommerce_after_order_object_save', [$this, 'hookWCNewOrderSave'], 100);
     297        remove_filter('woocommerce_update_order_review_fragments', [$this, 'hookWCFragments'], 1000);
     298        remove_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000);
     299
     300        remove_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 1000);
     301        remove_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 1000);
     302        remove_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 1000);
     303        remove_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000);
    304304
    305305        remove_filter('woocommerce_form_field_select', [$this, 'hookFormFieldsSelectTranslations'], 10);
     
    346346        add_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000, 1);
    347347
    348         add_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 10, 2);
    349         add_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 10, 2);
    350         // add_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 10, 2);
     348        add_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 1000, 2);
     349        add_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 1000, 2);
     350        add_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 1000, 2);
    351351        add_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000, 1);
    352352
     
    390390    protected function rewriteWooUrl($url, $language)
    391391    {
    392         $site_url = parse_url(linguiseGetSite());
    393         $url = parse_url($url);
    394         $site_path = rtrim(isset($site_url['path']) ? $site_url['path'] : '', '/');
    395 
    396         $url_path = isset($url['path']) ? $url['path'] : '';
     392        $parsed_url = parse_url($url);
     393        $site_path  = rtrim(parse_url(linguiseGetSite(), PHP_URL_PATH) ?? '', '/');
     394
     395        $url_path = $parsed_url['path'] ?? '';
     396
    397397        if (!empty($site_path) && $site_path !== '/') {
    398             // Remove the site path from the URL path
    399             $url_path = str_replace($site_path, '', $url_path); // @codeCoverageIgnore
    400         }
    401 
    402         // Check if language already exists in the URL
    403         $url_path = ltrim($url_path, '/');
    404         if (strpos($url_path, $language . '/') !== 0) {
    405             // If not, prepend the language code
    406             $url_path = $language . '/' . $url_path;
    407         }
    408 
    409         $url['path'] = '/' . $url_path;
    410         $result = WPHelper::buildUrl($url, $site_url, $language);
     398            $site_path_slug = ltrim($site_path, '/'); // e.g. 'uk'
     399
     400            $url_path = ltrim($url_path, '/');
     401
     402            // Strip language prefix if already present (language may sit before site path)
     403            if (strpos($url_path, $language . '/') === 0) {
     404                $url_path = substr($url_path, strlen($language) + 1);
     405            }
     406
     407            // Strip site path slug if present
     408            if (strpos($url_path, $site_path_slug . '/') === 0) {
     409                $url_path = substr($url_path, strlen($site_path_slug) + 1);
     410            } elseif ($url_path === $site_path_slug) {
     411                $url_path = '';
     412            }
     413
     414            $url_path = $language . '/' . $site_path_slug . '/' . $url_path;
     415        } else {
     416            // No multisite path — just ensure language prefix, no duplicates
     417            $url_path = ltrim($url_path, '/');
     418            if (strpos($url_path, $language . '/') !== 0 && $url_path !== $language) {
     419                $url_path = $language . '/' . $url_path;
     420            }
     421        }
     422
     423        $parsed_url['path'] = '/' . $url_path;
     424        $result = WPHelper::buildUrl($parsed_url);
    411425        return $result;
    412426    }
     
    488502        }
    489503
    490         if (empty($language_meta) && isset($order->id)) {
    491             $language_meta = get_post_meta($order->id, 'linguise_language', true);
     504        if (empty($language_meta) && method_exists($order, 'get_id')) {
     505            $language_meta = get_post_meta($order->get_id(), 'linguise_language', true);
    492506        }
    493507
  • linguise/tags/2.2.26/vendor/composer/installed.php

    r3468206 r3468995  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '906142f1722e640191f363558a75d4468491a6f6',
     6        'reference' => '29f3d390b3e410db90d95c368fd6c7a1e497116e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    3232            'pretty_version' => 'dev-master',
    3333            'version' => 'dev-master',
    34             'reference' => '906142f1722e640191f363558a75d4468491a6f6',
     34            'reference' => '29f3d390b3e410db90d95c368fd6c7a1e497116e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../../',
  • linguise/trunk/languages/linguise.pot

    r3468206 r3468995  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Linguise - AI Automatic Multilingual Translation 2.2.25\n"
     5"Project-Id-Version: Linguise - AI Automatic Multilingual Translation 2.2.26\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/linguise\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • linguise/trunk/linguise.php

    r3468206 r3468995  
    55 * Plugin URI: https://www.linguise.com/
    66 * Description: Linguise translation plugin
    7  * Version:2.2.25
     7 * Version:2.2.26
    88 * Text Domain: linguise
    99 * Domain Path: /languages
  • linguise/trunk/readme.txt

    r3468206 r3468995  
    44Requires at least: 4.0
    55Tested up to: 6.9
    6 Stable tag: 2.2.25
     6Stable tag: 2.2.26
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    108108
    109109== Changelog ==
     110= 2.2.26 =
     111- Fix: Try to re-hook order URL again
     112- Fix: Re-add back the site path
     113
    110114= 2.2.25 =
    111115- Fix: Make the requirement for DOMDocument more strict
  • linguise/trunk/src/constants.php

    r3468206 r3468995  
    11<?php
    22if (!defined('LINGUISE_SCRIPT_TRANSLATION_VERSION')) {
    3     define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.25');
     3    define('LINGUISE_SCRIPT_TRANSLATION_VERSION', 'wordpress_plugin/2.2.26');
    44}
    55
    66if (!defined('LINGUISE_VERSION')) {
    7     define('LINGUISE_VERSION', '2.2.25');
     7    define('LINGUISE_VERSION', '2.2.26');
    88}
  • linguise/trunk/src/thirdparty/add-search-to-menu.php

    r3464793 r3468995  
    112112            $ajax->ajax_load_posts();
    113113        } catch (\Exception $e) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
    114             /** Stub */
     114            // Stub
    115115        }
    116116
  • linguise/trunk/src/thirdparty/wc/woocommerce.php

    r3425738 r3468995  
    289289    public function destroy()
    290290    {
    291         remove_filter('woocommerce_ajax_get_endpoint', [$this, 'hookWCAjaxEndpoint'], 10, 2);
     291        remove_filter('woocommerce_ajax_get_endpoint', [$this, 'hookWCAjaxEndpoint'], 10);
    292292        remove_action('woocommerce_customer_reset_password', [$this, 'hookWCCustomerResetPassword'], 10);
    293293
    294294        // We skip removing the ajax methods overrides
    295         remove_action('woocommerce_new_order', [$this, 'hookWCNewOrder'], 100, 2);
    296         remove_filter('woocommerce_after_order_object_save', [$this, 'hookWCNewOrderSave'], 100, 1);
    297         remove_filter('woocommerce_update_order_review_fragments', [$this, 'hookWCFragments'], 1000, 1);
    298         remove_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000, 1);
    299 
    300         remove_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 10, 2);
    301         remove_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 10, 2);
    302         // remove_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 10, 2);
    303         remove_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000, 1);
     295        remove_action('woocommerce_new_order', [$this, 'hookWCNewOrder'], 100);
     296        remove_filter('woocommerce_after_order_object_save', [$this, 'hookWCNewOrderSave'], 100);
     297        remove_filter('woocommerce_update_order_review_fragments', [$this, 'hookWCFragments'], 1000);
     298        remove_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000);
     299
     300        remove_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 1000);
     301        remove_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 1000);
     302        remove_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 1000);
     303        remove_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000);
    304304
    305305        remove_filter('woocommerce_form_field_select', [$this, 'hookFormFieldsSelectTranslations'], 10);
     
    346346        add_filter('woocommerce_add_to_cart_fragments', [$this, 'hookWCFragments'], 1000, 1);
    347347
    348         add_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 10, 2);
    349         add_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 10, 2);
    350         // add_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 10, 2);
     348        add_filter('woocommerce_get_return_url', [$this, 'hookWCReturnUrl'], 1000, 2);
     349        add_filter('woocommerce_get_endpoint_url', [$this, 'hookWCEndpoint'], 1000, 2);
     350        add_filter('woocommerce_get_checkout_order_received_url', [$this, 'hookWCOrderUrl'], 1000, 2);
    351351        add_filter('woocommerce_order_button_html', [$this, 'hookOrderButtonHTML'], 1000, 1);
    352352
     
    390390    protected function rewriteWooUrl($url, $language)
    391391    {
    392         $site_url = parse_url(linguiseGetSite());
    393         $url = parse_url($url);
    394         $site_path = rtrim(isset($site_url['path']) ? $site_url['path'] : '', '/');
    395 
    396         $url_path = isset($url['path']) ? $url['path'] : '';
     392        $parsed_url = parse_url($url);
     393        $site_path  = rtrim(parse_url(linguiseGetSite(), PHP_URL_PATH) ?? '', '/');
     394
     395        $url_path = $parsed_url['path'] ?? '';
     396
    397397        if (!empty($site_path) && $site_path !== '/') {
    398             // Remove the site path from the URL path
    399             $url_path = str_replace($site_path, '', $url_path); // @codeCoverageIgnore
    400         }
    401 
    402         // Check if language already exists in the URL
    403         $url_path = ltrim($url_path, '/');
    404         if (strpos($url_path, $language . '/') !== 0) {
    405             // If not, prepend the language code
    406             $url_path = $language . '/' . $url_path;
    407         }
    408 
    409         $url['path'] = '/' . $url_path;
    410         $result = WPHelper::buildUrl($url, $site_url, $language);
     398            $site_path_slug = ltrim($site_path, '/'); // e.g. 'uk'
     399
     400            $url_path = ltrim($url_path, '/');
     401
     402            // Strip language prefix if already present (language may sit before site path)
     403            if (strpos($url_path, $language . '/') === 0) {
     404                $url_path = substr($url_path, strlen($language) + 1);
     405            }
     406
     407            // Strip site path slug if present
     408            if (strpos($url_path, $site_path_slug . '/') === 0) {
     409                $url_path = substr($url_path, strlen($site_path_slug) + 1);
     410            } elseif ($url_path === $site_path_slug) {
     411                $url_path = '';
     412            }
     413
     414            $url_path = $language . '/' . $site_path_slug . '/' . $url_path;
     415        } else {
     416            // No multisite path — just ensure language prefix, no duplicates
     417            $url_path = ltrim($url_path, '/');
     418            if (strpos($url_path, $language . '/') !== 0 && $url_path !== $language) {
     419                $url_path = $language . '/' . $url_path;
     420            }
     421        }
     422
     423        $parsed_url['path'] = '/' . $url_path;
     424        $result = WPHelper::buildUrl($parsed_url);
    411425        return $result;
    412426    }
     
    488502        }
    489503
    490         if (empty($language_meta) && isset($order->id)) {
    491             $language_meta = get_post_meta($order->id, 'linguise_language', true);
     504        if (empty($language_meta) && method_exists($order, 'get_id')) {
     505            $language_meta = get_post_meta($order->get_id(), 'linguise_language', true);
    492506        }
    493507
  • linguise/trunk/vendor/composer/installed.php

    r3468206 r3468995  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => '906142f1722e640191f363558a75d4468491a6f6',
     6        'reference' => '29f3d390b3e410db90d95c368fd6c7a1e497116e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    3232            'pretty_version' => 'dev-master',
    3333            'version' => 'dev-master',
    34             'reference' => '906142f1722e640191f363558a75d4468491a6f6',
     34            'reference' => '29f3d390b3e410db90d95c368fd6c7a1e497116e',
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.