Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/gptranslate/gptranslate.php
+++ b/gptranslate/gptranslate.php
@@ -4,7 +4,7 @@
Plugin URI: https://gptranslate.storejextensions.org/
Description: GPTranslate for Wordpress is the revolutionary multilanguage solution to automatically translate your Wordpress website thanks to the power of Artificial Intelligence like ChatGPT, Deepseek, Gemini, Claude, DeepL and more. ⚠️GPTranslate FREE Mode active
Author: JExtensions Store
- Version: 2.32.6
+ Version: 2.32.7
Author URI: https://storejextensions.org
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -23,7 +23,7 @@
return selected($current, $value, false);
}
- public static $pluginVersion = '2.32.6';
+ public static $pluginVersion = '2.32.7';
/**
* Class constructor and settings inizializer with register_setting
@@ -34,7 +34,7 @@
global $wpdb;
$this->table_name = $wpdb->prefix . 'gptranslate';
- $this->version = '2.32.6';
+ $this->version = '2.32.7';
$settings = get_option ( 'gptranslate_options', [ ] );
@@ -584,6 +584,7 @@
'float_switcher_open_direction' => 'top',
'flag_style' => '2d',
'flag_loading' => 'local',
+ 'hide_flags' => '0',
'show_language_titles' => '1',
'enable_dropdown' => '1',
'enable_modal' => '0',
@@ -830,6 +831,7 @@
<option value="claude-haiku-4-5" <?php selected($currentModel, 'claude-haiku-4-5'); ?>>Claude Haiku 4.5</option>
<option value="claude-opus-4-6" <?php selected($currentModel, 'claude-opus-4-6'); ?>>Claude Opus 4.6</option>
<option value="claude-opus-4-7" <?php selected($currentModel, 'claude-opus-4-7'); ?>>Claude Opus 4.7</option>
+ <option value="claude-opus-4-8" <?php selected($currentModel, 'claude-opus-4-8'); ?>>Claude Opus 4.8</option>
<option value="grok-3" <?php selected($currentModel, 'grok-3'); ?>>Grok 3</option>
<option value="grok-3-mini" <?php selected($currentModel, 'grok-3-mini'); ?>>Grok 3 Mini</option>
<option value="google-cloud-translation-api" <?php selected($currentModel, 'google-cloud-translation-api'); ?>>Google Cloud Translation API</option>
@@ -2143,6 +2145,7 @@
"flags_location": "' . esc_js($flagsPath) . '",
"flag_loading": "' . $settings['flag_loading'] . '",
"flag_style": "' . $settings['flag_style'] . '",
+ "hide_flags": ' . (int)($settings['hide_flags'] ?? 0) . ',
"widget_max_height": ' . (int)$settings['widget_max_height'] . ',
"incremental_enabled": ' . (int)($settings['incremental_enabled'] ?? 0) . ',
"incremental_show_progress_popup": ' . (int)($settings['incremental_show_progress_popup'] ?? 0) . ',
@@ -2328,6 +2331,10 @@
if (!empty($settings['disable_toast_popups']) && $settings['disable_toast_popups'] == 1) {
$dynamic_css .= '.progress.progress-gptranslate,.progress.progress-gptranslate-reading{ display: none !important; }';
}
+
+ if (!empty($settings['hide_flags']) && $settings['hide_flags'] == 1) {
+ $dynamic_css .= '.gptranslate-flag{display:none!important}';
+ }
// Opacity del background widget (solo se diverso da 1.0)
if (!empty($settings['widget_opacity']) && floatval($settings['widget_opacity']) != 1.0) {
@@ -3665,7 +3672,13 @@
return new WP_Error( 'rest_forbidden_nonce', 'Invalid or expired security token (nonce).', [ 'status' => 403 ] );
}
}
-
+
+ // 3) Admin-only tasks: require manage_options capability
+ $adminTasks = array( 'syncTranslation' );
+ if ( in_array( $task, $adminTasks, true ) && ! current_user_can( 'manage_options' ) ) {
+ return new WP_Error( 'rest_forbidden_admin', 'Admin access required.', [ 'status' => 403 ] );
+ }
+
return true;
}
@@ -3933,7 +3946,8 @@
$original = wp_unslash( $params['original'] ?? '' );
$translated = wp_unslash( $params['translated'] ?? '' );
$languageTranslated = sanitize_text_field( $params['language_translated'] ?? '' );
- $translationType = sanitize_text_field( $params['translation_type'] ?? 'translations' ); // default to 'translations'
+ $requestedType = sanitize_text_field( $params['translation_type'] ?? 'translations' );
+ $translationType = in_array( $requestedType, array( 'translations', 'alt_translations' ), true ) ? $requestedType : 'translations';
// Recupera tutti i record nella lingua target
$rows = $wpdb->get_results( $wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
--- a/gptranslate/settings.php
+++ b/gptranslate/settings.php
@@ -105,6 +105,7 @@
<option value='claude-haiku-4-5' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "claude-haiku-4-5"); ?>>Claude Haiku 4.5</option>
<option value='claude-opus-4-6' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "claude-opus-4-6"); ?>>Claude Opus 4.6</option>
<option value='claude-opus-4-7' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "claude-opus-4-7"); ?>>Claude Opus 4.7</option>
+ <option value='claude-opus-4-8' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "claude-opus-4-8"); ?>>Claude Opus 4.8</option>
<option value='grok-3' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "grok-3"); ?>>Grok 3</option>
<option value='grok-3-mini' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "grok-3-mini"); ?>>Grok 3 Mini</option>
<option value='google-cloud-translation-api' <?php selected($options["chatgpt_model"] ?? "gpt-3.5-turbo", "google-cloud-translation-api"); ?>>Google Cloud Translation API</option>
@@ -1976,6 +1977,16 @@
</td>
</tr>
<tr>
+ <th scope='row'><label for='hide_flags'><?php echo esc_html($this->loadTranslations('PLG_GPTRANSLATE_HIDE_FLAGS')); ?></label></th>
+ <td>
+ <div class="wrapper">
+ <label><input type='radio' name="gptranslate_options[hide_flags]" value='1'<?php esc_html(checked($options["hide_flags"] ?? "0", "1")); ?>> <span><?php echo esc_html($this->loadTranslations('PLG_GPTRANSLATE_YES')); ?></span></label>
+ <label><input type='radio' name="gptranslate_options[hide_flags]" value='0'<?php esc_html(checked($options["hide_flags"] ?? "0", "0")); ?>> <span><?php echo esc_html($this->loadTranslations('PLG_GPTRANSLATE_NO')); ?></span></label>
+ </div>
+ <p class='description'><?php echo esc_html($this->loadTranslations('PLG_GPTRANSLATE_HIDE_FLAGS_DESC')); ?></p>
+ </td>
+ </tr>
+ <tr>
<th scope='row'><label for='show_language_titles'><?php echo esc_html($this->loadTranslations('PLG_GPTRANSLATE_SHOW_LANGUAGE_TITLES')); ?></label></th>
<td>
<div class="wrapper">