Plugin Directory

Changeset 3441488


Ignore:
Timestamp:
01/17/2026 08:20:56 AM (4 weeks ago)
Author:
magazine3
Message:

Released version 2.4.25

Location:
wp-multilang/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-multilang/trunk/includes/admin/settings/class-wpm-settings-auto-translate-pro.php

    r3414013 r3441488  
    496496                                    if ($trabs != 'false') {
    497497                                            if(preg_match('/<[^<]+>/', $translated_source) === 1){
    498                                             $translated_source = str_replace(json_encode($text), json_encode($trabs), $translated_source);
     498                                                // Normalize escaped versions
     499                                                $original_unescaped = stripslashes($text);
     500                                                $translated_unescaped = stripslashes($trabs);
     501
     502                                                // Encode versions (JSON-safe)
     503                                                $original_json = json_encode($text, JSON_UNESCAPED_SLASHES);
     504                                                $translated_json = json_encode($trabs, JSON_UNESCAPED_SLASHES);
     505
     506                                                // Build all possible text representations
     507                                                $patterns = [
     508                                                    $text,
     509                                                    $original_unescaped,
     510                                                    $original_json,
     511                                                    json_encode($text) // full escaped JSON version
     512                                                ];
     513
     514                                                $replacements = [
     515                                                    $trabs,
     516                                                    $translated_unescaped,
     517                                                    $translated_json,
     518                                                    json_encode($trabs)
     519                                                ];
     520                                                $translated_source = str_replace($patterns, $replacements, $translated_source);
    499521                                            }else{
    500                                             $translated_source = str_replace('"'.$text.'"', '"'.$trabs.'"', $translated_source);
     522                                                $translated_source = str_replace('"'.$text.'"', '"'.$trabs.'"', $translated_source);
    501523                                            }
    502524                                    }
  • wp-multilang/trunk/includes/class-wp-multilang.php

    r3414013 r3441488  
    2222     * @var string
    2323     */
    24     public $version = '2.4.24';
     24    public $version = '2.4.25';
    2525
    2626    /**
  • wp-multilang/trunk/includes/class-wpm-options.php

    r3414013 r3441488  
    6767        add_filter( "option_{$option}", 'wpm_translate_value', 5 );
    6868        $value = wpm_set_new_value( $old_value, $value, $this->options_config[ $option ] );
    69         $value = apply_filters( "wpm_update_{$option}_option", $original_value, $option, $old_value );
     69        $value = apply_filters( "wpm_update_{$option}_option", $value, $original_value, $option, $old_value );
    7070
    7171        return $value;
  • wp-multilang/trunk/includes/integrations/class-wpm-strong-testimonials.php

    r3414013 r3441488  
    3838
    3939        foreach ($options as $option_key => $callbacks) {
    40             add_filter( "wpm_update_{$option_key}_option", array( $this, $callbacks[0] ), 10, 3 );
     40            add_filter( "wpm_update_{$option_key}_option", array( $this, $callbacks[0] ), 10, 4 );
    4141            add_filter( "option_{$option_key}", array( $this, $callbacks[1] ), 10, 2 );
    4242        }
     
    5151     * @since   2.4.23
    5252     * */
    53     public function set_option_value( $value, $key, $old_value ) {
     53    public function set_option_value( $value, $original_value, $key, $old_value ) {
    5454
    5555        global $wpdb;
     
    7070        }
    7171
    72         $db_value   =   $value;
     72        $db_value   =   $original_value;
    7373        if ( is_array( $db_value ) ) {
    7474            $db_value   =   maybe_serialize( $db_value );
  • wp-multilang/trunk/includes/integrations/class-wpm-yoast-seo.php

    r3332172 r3441488  
    442442            $option_name = 'wpseo_taxonomy_meta';
    443443            //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    444             $option_result = $wpdb->get_row($wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}yoast_indexable WHERE option_name = %s", $option_name ));
     444            $option_result = $wpdb->get_row($wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name = %s", $option_name ));
    445445
    446446            if(is_object($option_result) && isset($option_result->option_value)){
     
    490490                                // Update the title and description field values of yoast_indexable table
    491491                                //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    492                                 $wpdb->update($yoast_table_name, $update_array_values, array('object_id' => $term_id));
     492                                $wpdb->update($yoast_table_name, $update_array_values, array('object_id' => $term_id, 'object_type' => 'term'));
    493493                            }
    494494                        }
  • wp-multilang/trunk/readme.txt

    r3414013 r3441488  
    66Requires at least: 4.7
    77Tested up to: 6.9
    8 Stable tag: 2.4.24
     8Stable tag: 2.4.25
    99Requires PHP: 5.6.20
    1010License: GPL2
     
    250250== Changelog ==
    251251
     252= 2.4.25 =
     253- Fixed: Other language content is not updating in Elementor #215
     254- Fixed: Promotion Banner BFCM #221
     255- Fixed: Yoast SEO meta tags not translating #225
     256
    252257= 2.4.24 =
    253258- Added: Promotion Banner BFCM #221
     
    364369- feature Automatic translation #77
    365370
    366 = 2.4.10 =
    367 - feature Added compatibility with Divi #72
    368 - fixed issue with canonical and href URL as per the language. #85
    369 - fixed issue with Language switcher block in site editor #86
    370 - fixed Compatibility with WordPress 6.6 and updated readme.txt
    371 
    372371All changelog available on [GitHub](https://github.com/ahmedkaludi/wp-multilang/releases).
  • wp-multilang/trunk/wp-multilang.php

    r3414013 r3441488  
    1111 * Text Domain:       wp-multilang
    1212 * Domain Path:       /languages
    13  * Version:           2.4.24
     13 * Version:           2.4.25
    1414 * Copyright:         © 2017-2019 Valentyn Riaboshtan
    1515 *
     
    9595}
    9696add_action( 'admin_notices', 'wpm_activation_admin_notices' );
    97 
    98 
    99 /* * BFCM Banner Integration
    100  * Loads assets from assets/css and assets/js
    101  */
    102 add_action('admin_enqueue_scripts', 'wp_multilang_enqueue_bfcm_assets');
    103 
    104 function wp_multilang_enqueue_bfcm_assets($hook) {
    105  
    106     //var_dump($hook);
    107     if ( $hook !== 'toplevel_page_wpm-settings' ) {
    108         return;
    109     }
    110    
    111     /*if ( ! isset($_GET['page']) || $_GET['page'] !== 'setting_page_check-email-dashboard' ) {
    112         return;
    113     }*/
    114 
    115     // 2. define settings
    116     $expiry_date_str = '2025-12-25 23:59:59';
    117     $offer_link      = 'https://wp-multilang.com/bfcm-2025/';
    118 
    119     // 3. Expiry Check (Server Side)
    120     if ( current_time('timestamp') > strtotime($expiry_date_str) ) {
    121         return;
    122     }
    123 
    124     // 4. Register & Enqueue CSS   
    125     wp_enqueue_style(
    126         'wpm-bfcm-style',
    127         plugin_dir_url(__FILE__) . 'assets/styles/bfcm-style.css',
    128         array(),
    129         WPM_VERSION
    130     );
    131 
    132     // 5. Register & Enqueue JS
    133     wp_enqueue_script(
    134         'wpm-bfcm-script',
    135         plugin_dir_url(__FILE__) . 'assets/scripts/bfcm-script.js',
    136         array('jquery'), // jQuery dependency
    137         WPM_VERSION,
    138         true // Footer me load hoga
    139     );
    140 
    141     // 6. Data Pass (PHP to JS)
    142     wp_localize_script('wpm-bfcm-script', 'bfcmData', array(
    143         'targetDate' => $expiry_date_str,
    144         'offerLink'  => $offer_link
    145     ));
    146 }
Note: See TracChangeset for help on using the changeset viewer.