Plugin Directory

Changeset 3253696


Ignore:
Timestamp:
03/11/2025 04:26:07 AM (13 months ago)
Author:
mvpis
Message:

Bug fix based on great feedback from a great WordPress person

Location:
fluentc-translation
Files:
79 added
3 edited

Legend:

Unmodified
Added
Removed
  • fluentc-translation/trunk/fluentc_wordpress_plugin.php

    r3253494 r3253696  
    77 * Plugin URI: https://www.fluentc.ai
    88 * Description: A plugin that enables website owners to easily install the FluentC Translation on their WordPress site.
    9  * Version: 2.4.2
     9 * Version: 2.4.3
    1010 * Author: FluentC
    1111 * Author URI: https://www.fluentc.ai
     
    1717define( 'FLUENTC_DIR', __DIR__ );
    1818define( 'FLUENTC_SLUG', 'fluentc_translation' );
    19 define( 'FLUENTC_TRANSLATION_VERSION', "2.4.2" );
     19define( 'FLUENTC_TRANSLATION_VERSION', "2.4.3" );
    2020define( 'FLUENTC_TRANSLATION_PLUGIN_DIR', plugin_dir_path(__FILE__) );
    2121define( 'FLUENTC_TRANSLATION_PLUGIN_URL', plugin_dir_url(__FILE__) );
  • fluentc-translation/trunk/readme.txt

    r3253494 r3253696  
    55Requires at least: 4.6
    66Tested up to: 6.6.2
    7 Stable tag: 2.4.2
     7Stable tag: 2.4.3
    88Requires PHP: 7.3
    99License: GPLv2 or later
  • fluentc-translation/trunk/src/actions/class-wordpress.php

    r3249935 r3253696  
    505505        }
    506506       
    507         // Get WordPress language
    508         $wp_locale = get_locale();
    509         $wp_language = substr($wp_locale, 0, 2);
    510 
     507        // Get default language
     508        $default_language = $this->fluentc_language->fluentc_site_language();
     509       
    511510        // Get browser language
    512511        $user_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : '';
     
    514513            return;
    515514        }
    516 
     515   
    517516        // Get available languages
    518517        $available_languages = $this->fluentc_connect->get_display_language_list($widgetapikey);
     
    520519            return;
    521520        }
    522 
     521   
    523522        // Find matching language
    524523        $matching_language = null;
     
    529528            }
    530529        }
    531 
    532         // If matching language found and different from site language, redirect
    533         if ($matching_language && strtolower($matching_language) !== strtolower($wp_language)) {
     530   
     531        // FIXED: Only redirect if matching language is NOT the default language
     532        if ($matching_language && strtolower($matching_language) !== strtolower($default_language)) {
    534533            // Get current URL
    535534            $current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") .
    536535                "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    537 
     536   
    538537            // Use helper function if available
    539538            if (function_exists('fluentc_add_language_to_url')) {
Note: See TracChangeset for help on using the changeset viewer.