Plugin Directory

Changeset 3265838


Ignore:
Timestamp:
04/02/2025 06:04:09 PM (12 months ago)
Author:
mvpis
Message:

Updates

Location:
fluentc-translation
Files:
79 added
22 deleted
3 edited

Legend:

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

    r3263950 r3265838  
    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.5
     9 * Version: 2.5.1
    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.5" );
     19define( 'FLUENTC_TRANSLATION_VERSION', "2.5.1" );
    2020define( 'FLUENTC_TRANSLATION_PLUGIN_DIR', plugin_dir_path(__FILE__) );
    2121define( 'FLUENTC_TRANSLATION_PLUGIN_URL', plugin_dir_url(__FILE__) );
  • fluentc-translation/trunk/readme.txt

    r3263950 r3265838  
    55Requires at least: 4.6
    66Tested up to: 6.6.2
    7 Stable tag: 2.5
     7Stable tag: 2.5.1
    88Requires PHP: 7.3
    99License: GPLv2 or later
  • fluentc-translation/trunk/src/actions/class-links.php

    r3261810 r3265838  
    9696    public function add_language_code_to_home_url($url, $path, $orig_scheme, $blog_id)
    9797    {
    98         // Assuming you have a function that returns the current language code.
    9998        $language_code = $this->fluentc_language->get_fluentc_language();
    10099   
    101         // If there's no language code, return the original URL.
    102100        if (empty($language_code)) {
    103101            return $url;
    104102        }
    105103   
    106         // Modify the home URL to add the language code.
     104        // Explicitly exclude REST API, oEmbed, XML-RPC, wp-admin and wp-login URLs
     105        if (
     106            strpos($url, '/wp-json') !== false ||
     107            strpos($url, '/xmlrpc.php') !== false ||
     108            strpos($url, '/wp-admin') !== false ||
     109            strpos($url, '/feed') !== false ||
     110            strpos($url, '/wp-login.php') !== false
     111        ) {
     112            return $url;
     113        }
     114   
     115        // Proceed with original logic
    107116        $url_parts = wp_parse_url($url);
    108    
    109         // Ensure the necessary parts exist.
    110         $scheme = isset($url_parts['scheme']) ? $url_parts['scheme'] : 'http';
    111         $host = isset($url_parts['host']) ? $url_parts['host'] : '';
    112         $existing_path = isset($url_parts['path']) ? $url_parts['path'] : '';
    113    
    114         // Ensure the path includes the leading '/'.
     117        $scheme = $url_parts['scheme'] ?? 'https';
     118        $host = $url_parts['host'] ?? '';
     119        $existing_path = $url_parts['path'] ?? '';
     120   
    115121        $modified_path = '/' . trim($language_code . '/' . ltrim($existing_path, '/'), '/');
    116122   
    117         // Rebuild the URL with the language code.
    118123        $new_url = $scheme . '://' . $host . $modified_path;
    119124        if (!empty($url_parts['query'])) {
Note: See TracChangeset for help on using the changeset viewer.