Google Language Translator - Version 6.0.16

Version Description

  • Converted get parameters encoding from rfc1738 to rfc3986
  • Replaced gzdecode with zlib_decode to be zlib encoding type independent
Download this release

Release Info

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

Code changes from version 6.0.15 to 6.0.16

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.15
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
@@ -158,8 +158,11 @@ class google_language_translator {
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);
 
 
 
163
  }
164
  }
165
  }
@@ -2540,8 +2543,11 @@ function glt_update_option($old_value, $value, $option_name) {
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);
 
 
 
2545
  } else {
2546
  add_settings_error(
2547
  'glt_settings_notices',
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: https://gtranslate.io/?xyz=3167
5
+ Version: 6.0.16
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
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
+ if(strpos($config, 'main_lang') !== false) {
162
+ $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.$default_language.'\'', $config);
163
+ if(is_string($config) and strlen($config) > 10)
164
+ file_put_contents($config_file, $config);
165
+ }
166
  }
167
  }
168
  }
2543
  $config_file = dirname(__FILE__) . '/url_addon/config.php';
2544
  if(is_readable($config_file) and is_writable($config_file)) {
2545
  $config = file_get_contents($config_file);
2546
+ if(strpos($config, 'main_lang') !== false) {
2547
+ $config = preg_replace('/\$main_lang = \'[a-z-]{2,5}\'/i', '$main_lang = \''.get_option('googlelanguagetranslator_language').'\'', $config);
2548
+ if(is_string($config) and strlen($config) > 10)
2549
+ file_put_contents($config_file, $config);
2550
+ }
2551
  } else {
2552
  add_settings_error(
2553
  'glt_settings_notices',
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: Translate AI Multilingual Solutions
5
  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: 6.0
9
- Stable tag: 6.0.15
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,10 @@ 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.15 =
159
  * Avoid minification of external Google Translate javascript library by WP Rocket cache plugin
160
 
5
  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: 6.1
9
+ Stable tag: 6.0.16
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.16 =
159
+ * Converted get parameters encoding from rfc1738 to rfc3986
160
+ * Replaced gzdecode with zlib_decode to be zlib encoding type independent
161
+
162
  = 6.0.15 =
163
  * Avoid minification of external Google Translate javascript library by WP Rocket cache plugin
164
 
url_addon/config.php CHANGED
@@ -111,7 +111,7 @@ fy -> Frisian
111
  xh -> Xhosa
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.
111
  xh -> Xhosa
112
  */
113
 
114
+ $servers = array('van', 'kars', 'sis', 'dvin', 'ani', 'evn', 'vagh', 'step', 'sis', 'tigr', 'ani', 'van');
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.
url_addon/gtranslate.php CHANGED
@@ -27,7 +27,7 @@ if(isset($get_params['gurl']))
27
  unset($get_params['gurl']);
28
 
29
  if(count($get_params)) {
30
- $page_url .= '?' . rtrim(str_replace('=&', '&', http_build_query($get_params)), '=');
31
  }
32
 
33
  $main_lang = isset($data['default_language']) ? $data['default_language'] : $main_lang;
@@ -75,7 +75,7 @@ $request_headers['Host'] = $host;
75
  if(isset($request_headers['HOST'])) unset($request_headers['HOST']);
76
  if(isset($request_headers['host'])) unset($request_headers['host']);
77
 
78
- if(!function_exists('gzdecode'))
79
  $request_headers['Accept-Encoding'] = '';
80
  else
81
  $request_headers['Accept-Encoding'] = 'gzip';
@@ -199,9 +199,9 @@ $header_size = $response_info['header_size'];
199
  $header = substr($response, 0, $header_size);
200
  $html = substr($response, $header_size);
201
 
202
- if(function_exists('gzdecode')) {
203
  $return_gz = false;
204
- $html_gunzip = @gzdecode($html);
205
 
206
  if($html_gunzip !== false) {
207
  $html = $html_gunzip;
27
  unset($get_params['gurl']);
28
 
29
  if(count($get_params)) {
30
+ $page_url .= '?' . rtrim(str_replace('=&', '&', http_build_query($get_params, '', '&', PHP_QUERY_RFC3986)), '=');
31
  }
32
 
33
  $main_lang = isset($data['default_language']) ? $data['default_language'] : $main_lang;
75
  if(isset($request_headers['HOST'])) unset($request_headers['HOST']);
76
  if(isset($request_headers['host'])) unset($request_headers['host']);
77
 
78
+ if(!function_exists('zlib_decode'))
79
  $request_headers['Accept-Encoding'] = '';
80
  else
81
  $request_headers['Accept-Encoding'] = 'gzip';
199
  $header = substr($response, 0, $header_size);
200
  $html = substr($response, $header_size);
201
 
202
+ if(function_exists('zlib_decode')) {
203
  $return_gz = false;
204
+ $html_gunzip = @zlib_decode($html);
205
 
206
  if($html_gunzip !== false) {
207
  $html = $html_gunzip;