Google Language Translator - Version 6.0.14

Version Description

  • Fixed information disclosure security issue through url_addon/debug.txt
  • Added admin notification when translation debug mode is on
  • Added is_readable check for config.php file before modifying it
  • Added conflict notice for Advanced Google Translate, My WP Translate and WPML Multilingual CMS plugins
Download this release

Release Info

Developer edo888
Plugin Icon wp plugin Google Language Translator
Version 6.0.14
Comparing to
See all releases

Code changes from version 6.0.13 to 6.0.14

google-language-translator.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: https://gtranslate.io/?xyz=3167
5
- Version: 6.0.13
6
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
  Author: Translate AI Multilingual Solutions
8
  Author URI: https://gtranslate.io
@@ -156,7 +156,7 @@ class google_language_translator {
156
  $default_language = get_option('googlelanguagetranslator_language');
157
  if($main_lang != $default_language) { // update main_lang in config.php
158
  $config_file = dirname(__FILE__) . '/url_addon/config.php';
159
- if(is_writable($config_file)) {
160
  $config = file_get_contents($config_file);
161
  $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.$default_language.'\'', $config);
162
  file_put_contents($config_file, $config);
@@ -1808,7 +1808,7 @@ $('.languages').find('input:checkbox').prop('checked', false); }); }); </script>
1808
  <li style="list-style:square outside"><?php _e('Priority Live Chat support', 'glt'); ?></li>
1809
  </ul>
1810
 
1811
- <p><?php _e('Prices starting from <b>$7.99/month</b>!', 'glt'); ?></p>
1812
 
1813
  <a href="https://gtranslate.io/?xyz=3167#pricing" target="_blank" class="button-primary"><?php _e('Try Now (15 days free)', 'glt'); ?></a> <a href="https://gtranslate.io/?xyz=3167#faq" target="_blank" class="button-primary"><?php _e('FAQ', 'glt'); ?></a> <a href="https://gtranslate.io/?xyz=3167#contact" target="_blank" class="button-primary"><?php _e('Live Chat', 'glt'); ?></a>
1814
  </div> <!-- .inside -->
@@ -2054,7 +2054,7 @@ class GLT_Notices {
2054
 
2055
  public function glt_admin_notices() {
2056
 
2057
- $deactivate_plugins= array('WP Translator' => 'wptranslator/WPTranslator.php', 'TranslatePress' => 'translatepress-multilingual/index.php', 'Google Website Translator' => 'google-website-translator/google-website-translator.php', 'Weglot' => 'weglot/weglot.php', 'TransPosh' => 'transposh-translation-filter-for-wordpress/transposh.php');
2058
  foreach($deactivate_plugins as $name => $plugin_file) {
2059
  if(is_plugin_active($plugin_file)) {
2060
  $deactivate_link = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.urlencode($plugin_file ).'&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $plugin_file);
@@ -2068,6 +2068,21 @@ class GLT_Notices {
2068
  }
2069
  }
2070
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2071
  $glt_announcement_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'glt_announcement')));
2072
  $glt_announcement_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'glt_announcement', 'gt_int' => 2)));
2073
 
@@ -2523,7 +2538,7 @@ function glt_update_option($old_value, $value, $option_name) {
2523
 
2524
  // update main_lang in config.php
2525
  $config_file = dirname(__FILE__) . '/url_addon/config.php';
2526
- if(is_writable($config_file)) {
2527
  $config = file_get_contents($config_file);
2528
  $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.get_option('googlelanguagetranslator_language').'\'', $config);
2529
  file_put_contents($config_file, $config);
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: https://gtranslate.io/?xyz=3167
5
+ Version: 6.0.14
6
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
  Author: Translate AI Multilingual Solutions
8
  Author URI: https://gtranslate.io
156
  $default_language = get_option('googlelanguagetranslator_language');
157
  if($main_lang != $default_language) { // update main_lang in config.php
158
  $config_file = dirname(__FILE__) . '/url_addon/config.php';
159
+ if(is_readable($config_file) and is_writable($config_file)) {
160
  $config = file_get_contents($config_file);
161
  $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.$default_language.'\'', $config);
162
  file_put_contents($config_file, $config);
1808
  <li style="list-style:square outside"><?php _e('Priority Live Chat support', 'glt'); ?></li>
1809
  </ul>
1810
 
1811
+ <p><?php _e('Prices starting from <b>$9.99/month</b>!', 'glt'); ?></p>
1812
 
1813
  <a href="https://gtranslate.io/?xyz=3167#pricing" target="_blank" class="button-primary"><?php _e('Try Now (15 days free)', 'glt'); ?></a> <a href="https://gtranslate.io/?xyz=3167#faq" target="_blank" class="button-primary"><?php _e('FAQ', 'glt'); ?></a> <a href="https://gtranslate.io/?xyz=3167#contact" target="_blank" class="button-primary"><?php _e('Live Chat', 'glt'); ?></a>
1814
  </div> <!-- .inside -->
2054
 
2055
  public function glt_admin_notices() {
2056
 
2057
+ $deactivate_plugins= array('WP Translator' => 'wptranslator/WPTranslator.php', 'TranslatePress' => 'translatepress-multilingual/index.php', 'Google Website Translator' => 'google-website-translator/google-website-translator.php', 'Weglot' => 'weglot/weglot.php', 'TransPosh' => 'transposh-translation-filter-for-wordpress/transposh.php', 'Advanced Google Translate' => 'advanced-google-translate/advanced-google-translate.php', 'My WP Translate' => 'my-wp-translate/my-wp-translate.php', 'WPML Multilingual CMS' => 'sitepress-multilingual-cms/sitepress.php');
2058
  foreach($deactivate_plugins as $name => $plugin_file) {
2059
  if(is_plugin_active($plugin_file)) {
2060
  $deactivate_link = wp_nonce_url('plugins.php?action=deactivate&amp;plugin='.urlencode($plugin_file ).'&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $plugin_file);
2068
  }
2069
  }
2070
 
2071
+ // check if translation debug is on and add a notice
2072
+ include dirname(__FILE__) . '/url_addon/config.php';
2073
+ if($debug) {
2074
+ $edit_file_link = admin_url('plugin-editor.php?file=google-language-translator%2Furl_addon%2Fconfig.php&plugin=google-language-translator%2Fgoogle-language-translator.php');
2075
+ $view_debug_link = admin_url('plugin-editor.php?file=google-language-translator%2Furl_addon%2Fdebug.txt&plugin=google-language-translator%2Fgoogle-language-translator.php');
2076
+ $notices['glt_debug_notice'] = array(
2077
+ 'title' => __('Translation debug mode is ON.', 'glt'),
2078
+ 'msg' => __('Please note that sensitive information can be written into google-language-translator/url_addon/debug.txt file, which can be accessed publicly. It is your responsibility to deny public access to it and clean debug information after you are done.', 'glt'),
2079
+ 'link' => '<li><span class="dashicons dashicons-edit"></span><a href="'.$edit_file_link.'">' . __('Edit config.php', 'glt') . '</a></li>' .
2080
+ '<li><span class="dashicons dashicons-visibility"></span><a href="'.$view_debug_link.'">' . __('View debug.txt', 'glt') . '</a></li>',
2081
+ 'dismissible' => false,
2082
+ 'int' => 0
2083
+ );
2084
+ }
2085
+
2086
  $glt_announcement_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'glt_announcement')));
2087
  $glt_announcement_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'glt_announcement', 'gt_int' => 2)));
2088
 
2538
 
2539
  // update main_lang in config.php
2540
  $config_file = dirname(__FILE__) . '/url_addon/config.php';
2541
+ if(is_readable($config_file) and is_writable($config_file)) {
2542
  $config = file_get_contents($config_file);
2543
  $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.get_option('googlelanguagetranslator_language').'\'', $config);
2544
  file_put_contents($config_file, $config);
readme.txt CHANGED
@@ -6,7 +6,7 @@ Author URI: https://gtranslate.io/?xyz=3167
6
  Tags: translate wordpress, translate, translator, translation, language, multi language
7
  Requires at least: 2.9
8
  Tested up to: 5.9
9
- Stable tag: 6.0.13
10
 
11
  Translate WordPress with Google Language Translator multilanguage plugin which allows to insert Google Translate widget anywhere on your website.
12
 
@@ -155,6 +155,12 @@ If you want us to translate your website professionally or provide you a proofre
155
  Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
156
 
157
  == Changelog ==
 
 
 
 
 
 
158
  = 6.0.13 =
159
  * Fix for PHP 8
160
  * CSS added to hide Google Translate popup on text hover
6
  Tags: translate wordpress, translate, translator, translation, language, multi language
7
  Requires at least: 2.9
8
  Tested up to: 5.9
9
+ Stable tag: 6.0.14
10
 
11
  Translate WordPress with Google Language Translator multilanguage plugin which allows to insert Google Translate widget anywhere on your website.
12
 
155
  Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
156
 
157
  == Changelog ==
158
+ = 6.0.14 =
159
+ * Fixed information disclosure security issue through url_addon/debug.txt
160
+ * Added admin notification when translation debug mode is on
161
+ * Added is_readable check for config.php file before modifying it
162
+ * Added conflict notice for Advanced Google Translate, My WP Translate and WPML Multilingual CMS plugins
163
+
164
  = 6.0.13 =
165
  * Fix for PHP 8
166
  * CSS added to hide Google Translate popup on text hover
url_addon/config.php CHANGED
@@ -112,4 +112,7 @@ xh -> Xhosa
112
  */
113
 
114
  $servers = array('van', 'kars', 'sis', 'dvin', 'ani', 'evn', 'vagh', 'step', 'sis', 'tigr', 'ani', 'tigr');
 
 
 
115
  $debug = false;
112
  */
113
 
114
  $servers = array('van', 'kars', 'sis', 'dvin', 'ani', 'evn', 'vagh', 'step', 'sis', 'tigr', 'ani', 'tigr');
115
+
116
+ // IMPORTANT: If you turn debugging on, then sensitive information will be written into debug.txt file.
117
+ // It is your responsibility to turn the debugging off and clear the debug.txt file.
118
  $debug = false;
url_addon/gtranslate.php CHANGED
@@ -183,7 +183,7 @@ switch($_SERVER['REQUEST_METHOD']) {
183
  }
184
 
185
  // Debug
186
- if($debug or isset($_GET['enable_debug'])) {
187
  $fh = fopen(dirname(__FILE__).'/debug.txt', 'a');
188
  curl_setopt($ch, CURLOPT_VERBOSE, true);
189
  curl_setopt($ch, CURLOPT_STDERR, $fh);
183
  }
184
 
185
  // Debug
186
+ if($debug) {
187
  $fh = fopen(dirname(__FILE__).'/debug.txt', 'a');
188
  curl_setopt($ch, CURLOPT_VERBOSE, true);
189
  curl_setopt($ch, CURLOPT_STDERR, $fh);