Translate WordPress with GTranslate - Version 2.8.27

Version Description

  • Fixed issue for some mobile phones related to nice looking dropdown selector staying open
  • Fixed issue related to Cloudflare 1000 error
  • Fixed caching issue with modified translations
Download this release

Release Info

Developer edo888
Plugin Icon 128x128 Translate WordPress with GTranslate
Version 2.8.27
Comparing to
See all releases

Code changes from version 2.8.26 to 2.8.27

Files changed (3) hide show
  1. gtranslate.php +3 -3
  2. readme.txt +6 -1
  3. url_addon/gtranslate.php +8 -3
gtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: GTranslate
4
  Plugin URI: https://gtranslate.io/?xyz=998
5
  Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://wordpress.org/support/plugin/gtranslate">GTranslate Support</a>.
6
- Version: 2.8.26
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
  Text Domain: gtranslate
@@ -561,7 +561,7 @@ function RefreshDoWidgetCode() {
561
  widget_preview += "function openGTPopup() {document.getElementById('gt_lightbox').style.display='block';document.getElementById('gt_fade').style.display='block';}"+new_line;
562
  widget_preview += "function closeGTPopup() {document.getElementById('gt_lightbox').style.display='none';document.getElementById('gt_fade').style.display='none';}"+new_line;
563
  widget_preview += "function changeGTLanguage(pair, a) {doGTranslate(pair);jQuery('a.switcher-popup').html(jQuery(a).html()+'<span style=\"color:#666;font-size:8px;font-weight:bold;\">&#9660;</span>');closeGTPopup();}"+new_line;
564
- widget_preview += "jQuery('#gt_fade').mousedown(function(e) {if(jQuery('#gt_lightbox').is(':visible')) {closeGTPopup()}});"+new_line;
565
  widget_preview += '<\/script>'+new_line;
566
 
567
  }
@@ -681,7 +681,7 @@ function RefreshDoWidgetCode() {
681
  widget_preview += '<script type="text/javascript">'+new_line;
682
  widget_preview += "jQuery('.switcher .selected').click(function() {if(!(jQuery('.switcher .option').is(':visible'))) {jQuery('.switcher .option').stop(true,true).delay(100).slideDown(500);jQuery('.switcher .selected a').toggleClass('open')}});"+new_line;
683
  widget_preview += "jQuery('.switcher .option').bind('mousewheel', function(e) {var options = jQuery('.switcher .option');if(options.is(':visible'))options.scrollTop(options.scrollTop() - e.originalEvent.wheelDelta);return false;});"+new_line;
684
- widget_preview += "jQuery('body').not('.switcher').mousedown(function(e) {if(jQuery('.switcher .option').is(':visible') && e.target != jQuery('.switcher .option').get(0)) {jQuery('.switcher .option').stop(true,true).delay(100).slideUp(500);jQuery('.switcher .selected a').toggleClass('open')}});"+new_line;
685
  widget_preview += '<\/script>'+new_line;
686
  }
687
 
3
  Plugin Name: GTranslate
4
  Plugin URI: https://gtranslate.io/?xyz=998
5
  Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://wordpress.org/support/plugin/gtranslate">GTranslate Support</a>.
6
+ Version: 2.8.27
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
  Text Domain: gtranslate
561
  widget_preview += "function openGTPopup() {document.getElementById('gt_lightbox').style.display='block';document.getElementById('gt_fade').style.display='block';}"+new_line;
562
  widget_preview += "function closeGTPopup() {document.getElementById('gt_lightbox').style.display='none';document.getElementById('gt_fade').style.display='none';}"+new_line;
563
  widget_preview += "function changeGTLanguage(pair, a) {doGTranslate(pair);jQuery('a.switcher-popup').html(jQuery(a).html()+'<span style=\"color:#666;font-size:8px;font-weight:bold;\">&#9660;</span>');closeGTPopup();}"+new_line;
564
+ widget_preview += "jQuery('#gt_fade').click(function(e) {if(jQuery('#gt_lightbox').is(':visible')) {closeGTPopup()}});"+new_line;
565
  widget_preview += '<\/script>'+new_line;
566
 
567
  }
681
  widget_preview += '<script type="text/javascript">'+new_line;
682
  widget_preview += "jQuery('.switcher .selected').click(function() {if(!(jQuery('.switcher .option').is(':visible'))) {jQuery('.switcher .option').stop(true,true).delay(100).slideDown(500);jQuery('.switcher .selected a').toggleClass('open')}});"+new_line;
683
  widget_preview += "jQuery('.switcher .option').bind('mousewheel', function(e) {var options = jQuery('.switcher .option');if(options.is(':visible'))options.scrollTop(options.scrollTop() - e.originalEvent.wheelDelta);return false;});"+new_line;
684
+ widget_preview += "jQuery('body').not('.switcher').click(function(e) {if(jQuery('.switcher .option').is(':visible') && e.target != jQuery('.switcher .option').get(0)) {jQuery('.switcher .option').stop(true,true).delay(100).slideUp(500);jQuery('.switcher .selected a').toggleClass('open')}});"+new_line;
685
  widget_preview += '<\/script>'+new_line;
686
  }
687
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Author: Edvard Ananyan
4
  Tags: translate wordpress, multilingual, translate, translation, language, bilingual, localization, translation proxy, i18n, l10n, localisation, multilanguage, google translate
5
  Requires at least: 2.8.1
6
  Tested up to: 4.8
7
- Stable tag: 2.8.26
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Donate link: https://gtranslate.io/?xyz=998#pricing
@@ -218,6 +218,11 @@ You need to go to the language you want to edit, for instance, French: http://do
218
 
219
  == Changelog ==
220
 
 
 
 
 
 
221
  = 2.8.26 =
222
  * Fixed relative path issue in .htaccess file for some websites which use mixed https and http
223
  * Fixed IE javascript error on GTranslate Settings page preventing correct rendering of options
4
  Tags: translate wordpress, multilingual, translate, translation, language, bilingual, localization, translation proxy, i18n, l10n, localisation, multilanguage, google translate
5
  Requires at least: 2.8.1
6
  Tested up to: 4.8
7
+ Stable tag: 2.8.27
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Donate link: https://gtranslate.io/?xyz=998#pricing
218
 
219
  == Changelog ==
220
 
221
+ = 2.8.27 =
222
+ * Fixed issue for some mobile phones related to nice looking dropdown selector staying open
223
+ * Fixed issue related to Cloudflare 1000 error
224
+ * Fixed caching issue with modified translations
225
+
226
  = 2.8.26 =
227
  * Fixed relative path issue in .htaccess file for some websites which use mixed https and http
228
  * Fixed IE javascript error on GTranslate Settings page preventing correct rendering of options
url_addon/gtranslate.php CHANGED
@@ -6,8 +6,9 @@ if(!isset($_GET['glang']) or !isset($_GET['gurl']))
6
 
7
  $glang = $_GET['glang'];
8
 
9
- shuffle($servers);
10
- $server = $servers[1];
 
11
 
12
  $page_url = '/'.$_GET['gurl'];
13
 
@@ -89,7 +90,11 @@ if(isset($request_headers['Content-Type']) and strpos($request_headers['Content-
89
 
90
  $headers = array();
91
  foreach($request_headers as $key => $val) {
92
- $headers[] = $key . ': ' . $val;
 
 
 
 
93
  }
94
 
95
  //print_r($headers);
6
 
7
  $glang = $_GET['glang'];
8
 
9
+ // pick a server based on hostname
10
+ $server_id = intval(substr(md5(preg_replace('/^www\./', '', $_SERVER['HTTP_HOST'])), 0, 5), 16) % count($servers);
11
+ $server = $servers[$server_id];
12
 
13
  $page_url = '/'.$_GET['gurl'];
14
 
90
 
91
  $headers = array();
92
  foreach($request_headers as $key => $val) {
93
+ // remove cloudflare CF headers: CF-IPCountry, CF-Ray, etc...
94
+ if(preg_match('/^CF-/i', $key))
95
+ continue;
96
+ else
97
+ $headers[] = $key . ': ' . $val;
98
  }
99
 
100
  //print_r($headers);