Translate WordPress with GTranslate - Version 2.8.22

Version Description

  • Intercom live chat support integrated
  • Gzip compression optimizations
Download this release

Release Info

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

Code changes from version 2.8.21 to 2.8.22

Files changed (3) hide show
  1. gtranslate.php +13 -1
  2. readme.txt +6 -2
  3. url_addon/gtranslate.php +8 -2
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.21
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
  Text Domain: gtranslate
@@ -185,6 +185,7 @@ class GTranslate extends WP_Widget {
185
  GTranslate::load_defaults($data);
186
 
187
  wp_enqueue_script('jquery-ui-sortable');
 
188
 
189
  $site_url = site_url();
190
  $wp_plugin_url = plugins_url() . '/gtranslate';
@@ -1064,6 +1065,7 @@ foreach($alt_flags as $flag)
1064
  <ul style="list-style-type:square;padding-left:20px;">
1065
  <li style="margin:0;"><?php _e('Enable search engine indexing', 'gtranslate'); ?></li>
1066
  <li style="margin:0;"><?php _e('Search engine friendly (SEF) URLs', 'gtranslate'); ?></li>
 
1067
  <li style="margin:0;"><?php _e('Increase traffic and AdSense revenue', 'gtranslate'); ?></li>
1068
  <li style="margin:0;"><?php _e('Meta data translation', 'gtranslate'); ?></li>
1069
  <li style="margin:0;"><?php _e('Edit translations manually', 'gtranslate'); ?></li>
@@ -1139,6 +1141,16 @@ foreach($alt_flags as $flag)
1139
  .connectedSortable1 li label, .connectedSortable2 li label {cursor:move;}
1140
  </style>
1141
 
 
 
 
 
 
 
 
 
 
 
1142
  <?php
1143
  /*
1144
  <!-- Live Chat for GTranslate -->
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.22
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
  Text Domain: gtranslate
185
  GTranslate::load_defaults($data);
186
 
187
  wp_enqueue_script('jquery-ui-sortable');
188
+ wp_enqueue_script('jquery-effects-core');
189
 
190
  $site_url = site_url();
191
  $wp_plugin_url = plugins_url() . '/gtranslate';
1065
  <ul style="list-style-type:square;padding-left:20px;">
1066
  <li style="margin:0;"><?php _e('Enable search engine indexing', 'gtranslate'); ?></li>
1067
  <li style="margin:0;"><?php _e('Search engine friendly (SEF) URLs', 'gtranslate'); ?></li>
1068
+ <li style="margin:0;"><?php _e('Human level neural translations', 'gtranslate'); ?></li>
1069
  <li style="margin:0;"><?php _e('Increase traffic and AdSense revenue', 'gtranslate'); ?></li>
1070
  <li style="margin:0;"><?php _e('Meta data translation', 'gtranslate'); ?></li>
1071
  <li style="margin:0;"><?php _e('Edit translations manually', 'gtranslate'); ?></li>
1141
  .connectedSortable1 li label, .connectedSortable2 li label {cursor:move;}
1142
  </style>
1143
 
1144
+ <?php $user_info = wp_get_current_user(); ?>
1145
+ <script>window.intercomSettings = {app_id: "r70azrgx", 'email': '<?php echo addslashes($user_info->user_email); ?>', 'name': '<?php echo addslashes($user_info->first_name . ' ' . $user_info->last_name); ?>', 'website': '<?php echo addslashes(get_site_url()); ?>', 'translate_from': '<?php echo $default_language; ?>', 'is_sub_directory': <?php echo (empty($pro_version) ? '0' : '1'); ?>, 'is_sub_domain': <?php echo (empty($enterprise_version) ? '0' : '1'); ?>};(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/r70azrgx';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
1146
+ <script>
1147
+ var intercom_timeout = setInterval(function() {
1148
+ var intercom_box = jQuery('#intercom-container .intercom-launcher-frame');
1149
+ jQuery({bottom: 500}).animate({bottom: 20}, {duration: 1000, easing: 'easeOutBounce', step: function() {intercom_box.css('cssText', 'bottom: ' + this.bottom + 'px !important;') }});
1150
+ }, 15000);
1151
+ Intercom('onShow', function() {clearInterval(intercom_timeout);});
1152
+ </script>
1153
+
1154
  <?php
1155
  /*
1156
  <!-- Live Chat for GTranslate -->
readme.txt CHANGED
@@ -4,7 +4,7 @@ Author: Edvard Ananyan
4
  Tags: bilingual, multilingual, translate, translation, language, localization, translation proxy, i18n, l10n, localisation, multilanguage, google translate
5
  Requires at least: 2.8.1
6
  Tested up to: 4.7
7
- Stable tag: 2.8.21
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
@@ -46,7 +46,7 @@ Please check our [FAQ](https://gtranslate.io/?xyz=998#faq) to get quick answers.
46
  **Paid Features**
47
 
48
  * Multilingual SEO - Enable search engine indexing
49
- * New neural machine translations with excellent quality
50
  * Increase traffic and AdSense revenue
51
  * Search engine friendly (SEF) URLs
52
  * Yoast SEO compatible
@@ -214,6 +214,10 @@ You need to go to the language you want to edit, for instance, French: http://do
214
 
215
  == Changelog ==
216
 
 
 
 
 
217
  = 2.8.21 =
218
  * Fix for gzip compression issues on mobile phones
219
 
4
  Tags: bilingual, multilingual, translate, translation, language, localization, translation proxy, i18n, l10n, localisation, multilanguage, google translate
5
  Requires at least: 2.8.1
6
  Tested up to: 4.7
7
+ Stable tag: 2.8.22
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
46
  **Paid Features**
47
 
48
  * Multilingual SEO - Enable search engine indexing
49
+ * Neural machine translations with human level translation quality
50
  * Increase traffic and AdSense revenue
51
  * Search engine friendly (SEF) URLs
52
  * Yoast SEO compatible
214
 
215
  == Changelog ==
216
 
217
+ = 2.8.22 =
218
+ * Intercom live chat support integrated
219
+ * Gzip compression optimizations
220
+
221
  = 2.8.21 =
222
  * Fix for gzip compression issues on mobile phones
223
 
url_addon/gtranslate.php CHANGED
@@ -72,6 +72,8 @@ if(isset($request_headers['host'])) unset($request_headers['host']);
72
 
73
  if(!function_exists('gzdecode'))
74
  $request_headers['Accept-Encoding'] = '';
 
 
75
 
76
  if(isset($request_headers['accept-encoding'])) unset($request_headers['accept-encoding']);
77
 
@@ -144,7 +146,11 @@ if(function_exists('gzdecode')) {
144
  $html = $html_gunzip;
145
  unset($html_gunzip);
146
 
147
- $return_gz = true;
 
 
 
 
148
  }
149
  }
150
 
@@ -152,7 +158,7 @@ $response_headers = explode(PHP_EOL, $header);
152
  //print_r($response_headers);
153
  $headers_sent = '';
154
  foreach($response_headers as $header) {
155
- if(!empty($header) and !preg_match('/Content\-Length|Transfer\-Encoding|Link/i', $header)) {
156
 
157
  if(preg_match('/^Location:/i', $header))
158
  $header = str_ireplace($host, $_SERVER['HTTP_HOST'] . '/' . $glang, $header);
72
 
73
  if(!function_exists('gzdecode'))
74
  $request_headers['Accept-Encoding'] = '';
75
+ else
76
+ $request_headers['Accept-Encoding'] = 'gzip';
77
 
78
  if(isset($request_headers['accept-encoding'])) unset($request_headers['accept-encoding']);
79
 
146
  $html = $html_gunzip;
147
  unset($html_gunzip);
148
 
149
+ if(strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
150
+ $return_gz = true;
151
+ header('Content-Encoding: gzip');
152
+ header('Vary: Accept-Encoding');
153
+ }
154
  }
155
  }
156
 
158
  //print_r($response_headers);
159
  $headers_sent = '';
160
  foreach($response_headers as $header) {
161
+ if(!empty($header) and !preg_match('/Content\-Length|Transfer\-Encoding|Content\-Encoding|Link/i', $header)) {
162
 
163
  if(preg_match('/^Location:/i', $header))
164
  $header = str_ireplace($host, $_SERVER['HTTP_HOST'] . '/' . $glang, $header);