Weglot Translate – Translate your WP website - Version 1.6.1

Version Description

  • Fix url when non standard characters
  • change freemius image
Download this release

Release Info

Developer remyb92
Plugin Icon 128x128 Weglot Translate – Translate your WP website
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6 to 1.6.1

Files changed (3) hide show
  1. freemius/assets/img/plugin-icon.png +0 -0
  2. readme.txt +6 -2
  3. weglot.php +11 -11
freemius/assets/img/plugin-icon.png CHANGED
Binary file
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Weglot Translate - Translate your WP website ===
2
  Contributors: remyb92
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
- Requires at least: 4.0
5
  Tested up to: 4.8
6
- Stable tag: 1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -143,6 +143,10 @@ See changelog for upgrade changes.
143
 
144
  == Changelog ==
145
 
 
 
 
 
146
  = 1.6 =
147
  * Add Freemius
148
  * Refactor code
1
  === Weglot Translate - Translate your WP website ===
2
  Contributors: remyb92
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
+ Requires at least: 4.5
5
  Tested up to: 4.8
6
+ Stable tag: 1.6.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
143
 
144
  == Changelog ==
145
 
146
+ = 1.6.1 =
147
+ * Fix url when non standard characters
148
+ * change freemius image
149
+
150
  = 1.6 =
151
  * Add Freemius
152
  * Refactor code
weglot.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Weglot
4
- * @version 1.6
5
  */
6
 
7
  /*
@@ -12,7 +12,7 @@ Author: Remy B
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
- Version: 1.6
16
  */
17
 
18
  /*
@@ -83,7 +83,7 @@ do_action( 'weg_fs_loaded' );
83
 
84
 
85
 
86
- define( 'WEGLOT_VERSION', '1.6' );
87
  define( 'WEGLOT_DIR', dirname( __FILE__ ) );
88
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
89
  define( 'WEGLOT_DIRURL', plugin_dir_url( __FILE__ ) );
@@ -152,7 +152,7 @@ class Weglot {
152
  if ( isset( $_SERVER['REQUEST_URI'] ) ) {
153
  $_SERVER['REQUEST_URI'] = str_replace(
154
  '?no_lredirect=true','',
155
- sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) )
156
  );
157
  }
158
  }
@@ -164,7 +164,7 @@ class Weglot {
164
  if ( $this->currentlang != $this->original_l ) {
165
  $_SERVER['REQUEST_URI'] = str_replace(
166
  '/' . $this->currentlang .
167
- '/','/',sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) )
168
  );
169
  }
170
 
@@ -314,7 +314,7 @@ class Weglot {
314
  if ( $this->request_uri == '/' && ! $this->noredirect && ! WGUtils::is_bot() ) { // front_page
315
  if ( get_option( 'wg_auto_switch' ) == 'on' && isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) {
316
  /* Redirects to browser L */
317
- $lang = substr( sanitize_text_field( wp_unslash( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ), 0, 2 );
318
  // exit(print_r($dest));
319
  if ( in_array( $lang,$dest ) ) {
320
  wp_safe_redirect( $this->home_dir . "/$lang/" );
@@ -416,7 +416,7 @@ class Weglot {
416
  // add_action('load-'.$hook,array(&$this, 'updateRewriteRule'));
417
  if ( isset( $this->request_uri_no_language )
418
  // && isset( $_POST['settings-updated-nonce'] )
419
- && sanitize_text_field( wp_unslash( $this->request_uri_no_language ) )
420
  && strpos( $this->request_uri_no_language, 'page=Weglot' ) !== false
421
  && strpos( $this->request_uri_no_language, 'settings-updated=true' ) !==
422
  false) {
@@ -524,11 +524,11 @@ class Weglot {
524
  } elseif ( (strpos( $request_uri,'ajax' ) !== false ) &&
525
  $this->destination_l != '' && $this->original_l != '' && isset(
526
  $_SERVER['HTTP_REFERER']
527
- ) && strpos( sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ),'admin' ) === false ) {
528
 
529
  $thisL = $this->getLangFromUrl(
530
  $this->URLToRelative(
531
- sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) )
532
  )
533
  );
534
  if ( isset( $thisL ) && $thisL != '' ) {
@@ -810,9 +810,9 @@ class Weglot {
810
  }
811
  public function getRequestUri( $home_dir ) {
812
  if ( $home_dir ) {
813
- return str_replace( $home_dir,'',sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
814
  } else {
815
- return sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
816
  }
817
  }
818
  public function getLangFromUrl( $request_uri ) {
1
  <?php
2
  /**
3
  * @package Weglot
4
+ * @version 1.6.1
5
  */
6
 
7
  /*
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
+ Version: 1.6.1
16
  */
17
 
18
  /*
83
 
84
 
85
 
86
+ define( 'WEGLOT_VERSION', '1.6.1' );
87
  define( 'WEGLOT_DIR', dirname( __FILE__ ) );
88
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
89
  define( 'WEGLOT_DIRURL', plugin_dir_url( __FILE__ ) );
152
  if ( isset( $_SERVER['REQUEST_URI'] ) ) {
153
  $_SERVER['REQUEST_URI'] = str_replace(
154
  '?no_lredirect=true','',
155
+ $_SERVER['REQUEST_URI']
156
  );
157
  }
158
  }
164
  if ( $this->currentlang != $this->original_l ) {
165
  $_SERVER['REQUEST_URI'] = str_replace(
166
  '/' . $this->currentlang .
167
+ '/','/', $_SERVER['REQUEST_URI']
168
  );
169
  }
170
 
314
  if ( $this->request_uri == '/' && ! $this->noredirect && ! WGUtils::is_bot() ) { // front_page
315
  if ( get_option( 'wg_auto_switch' ) == 'on' && isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) {
316
  /* Redirects to browser L */
317
+ $lang = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 );
318
  // exit(print_r($dest));
319
  if ( in_array( $lang,$dest ) ) {
320
  wp_safe_redirect( $this->home_dir . "/$lang/" );
416
  // add_action('load-'.$hook,array(&$this, 'updateRewriteRule'));
417
  if ( isset( $this->request_uri_no_language )
418
  // && isset( $_POST['settings-updated-nonce'] )
419
+ && $this->request_uri_no_language
420
  && strpos( $this->request_uri_no_language, 'page=Weglot' ) !== false
421
  && strpos( $this->request_uri_no_language, 'settings-updated=true' ) !==
422
  false) {
524
  } elseif ( (strpos( $request_uri,'ajax' ) !== false ) &&
525
  $this->destination_l != '' && $this->original_l != '' && isset(
526
  $_SERVER['HTTP_REFERER']
527
+ ) && strpos( $_SERVER['HTTP_REFERER'] ,'admin' ) === false ) {
528
 
529
  $thisL = $this->getLangFromUrl(
530
  $this->URLToRelative(
531
+ $_SERVER['HTTP_REFERER']
532
  )
533
  );
534
  if ( isset( $thisL ) && $thisL != '' ) {
810
  }
811
  public function getRequestUri( $home_dir ) {
812
  if ( $home_dir ) {
813
+ return str_replace( $home_dir,'', $_SERVER['REQUEST_URI'] );
814
  } else {
815
+ return $_SERVER['REQUEST_URI'];
816
  }
817
  }
818
  public function getLangFromUrl( $request_uri ) {