Weglot Translate – Translate your WP website - Version 3.0.1

Version Description

(17/04/2019) = * Bugfix: API key check only if it does not exist * Bugfix: prevent array_key_exists on private languages for older installations

Download this release

Release Info

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

Code changes from version 3.0.0 to 3.0.1

readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: translate, multilingual, language, translation, localization
4
  Requires at least: 4.5
5
  Tested up to: 5.1
6
  Requires PHP: 5.4
7
- Stable tag: 3.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -153,6 +153,10 @@ See changelog for upgrade changes.
153
 
154
  == Changelog ==
155
 
 
 
 
 
156
  = 3.0.0 (16/04/2019) =
157
  * New major version
158
  * Link between WordPress options and Weglot dashboard options
4
  Requires at least: 4.5
5
  Tested up to: 5.1
6
  Requires PHP: 5.4
7
+ Stable tag: 3.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
153
 
154
  == Changelog ==
155
 
156
+ = 3.0.1 (17/04/2019) =
157
+ * Bugfix: API key check only if it does not exist
158
+ * Bugfix: prevent array_key_exists on private languages for older installations
159
+
160
  = 3.0.0 (16/04/2019) =
161
  * New major version
162
  * Link between WordPress options and Weglot dashboard options
src/actions/admin/class-ajax-user-info.php CHANGED
@@ -41,7 +41,7 @@ class Ajax_User_Info implements Hooks_Interface_Weglot {
41
 
42
  $response = $this->user_services->get_user_info( $api_key );
43
 
44
- if ( ! $response['allowed'] ) {
45
  wp_send_json_error();
46
  return;
47
  }
41
 
42
  $response = $this->user_services->get_user_info( $api_key );
43
 
44
+ if ( array_key_exists( 'not_exist', $response ) && ! $response['not_exist'] ) {
45
  wp_send_json_error();
46
  return;
47
  }
src/services/class-private-language-service-weglot.php CHANGED
@@ -27,13 +27,17 @@ class Private_Language_Service_Weglot {
27
 
28
  /**
29
  * @since 2.3.0
30
- *
31
  * @param string $key_lang
32
  * @return boolean
33
  */
34
  public function is_active_private_mode_for_lang( $key_lang ) {
35
  $private_mode_languages = $this->option_services->get_option( 'private_mode' );
36
 
 
 
 
 
37
  if ( ! array_key_exists( 'active', $private_mode_languages ) || ! $private_mode_languages['active'] ) {
38
  return false;
39
  }
27
 
28
  /**
29
  * @since 2.3.0
30
+ * @version 3.0.1
31
  * @param string $key_lang
32
  * @return boolean
33
  */
34
  public function is_active_private_mode_for_lang( $key_lang ) {
35
  $private_mode_languages = $this->option_services->get_option( 'private_mode' );
36
 
37
+ if ( ! is_array( $private_mode_languages ) ) {
38
+ return false;
39
+ }
40
+
41
  if ( ! array_key_exists( 'active', $private_mode_languages ) || ! $private_mode_languages['active'] ) {
42
  return false;
43
  }
src/services/class-user-api-service-weglot.php CHANGED
@@ -72,7 +72,7 @@ class User_Api_Service_Weglot {
72
  throw new \Exception( 'Unknown error with Weglot Api (0002) : ' . $json );
73
  } catch ( \Exception $e ) {
74
  return [
75
- 'allowed' => false,
76
  ];
77
  }
78
  }
72
  throw new \Exception( 'Unknown error with Weglot Api (0002) : ' . $json );
73
  } catch ( \Exception $e ) {
74
  return [
75
+ 'not_exist' => false,
76
  ];
77
  }
78
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit865457f1d3d9514fc24c719235c2f59f::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInitb613fd1d18afcf8a668d35dbaba18ee4
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequireb613fd1d18afcf8a668d35dbaba18ee4($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequireb613fd1d18afcf8a668d35dbaba18ee4($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit865457f1d3d9514fc24c719235c2f59f
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit865457f1d3d9514fc24c719235c2f59f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit865457f1d3d9514fc24c719235c2f59f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit865457f1d3d9514fc24c719235c2f59f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit865457f1d3d9514fc24c719235c2f59f::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire865457f1d3d9514fc24c719235c2f59f($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire865457f1d3d9514fc24c719235c2f59f($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
@@ -67,9 +67,9 @@ class ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4
67
  public static function getInitializer(ClassLoader $loader)
68
  {
69
  return \Closure::bind(function () use ($loader) {
70
- $loader->prefixLengthsPsr4 = ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4::$prefixLengthsPsr4;
71
- $loader->prefixDirsPsr4 = ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4::$prefixDirsPsr4;
72
- $loader->prefixesPsr0 = ComposerStaticInitb613fd1d18afcf8a668d35dbaba18ee4::$prefixesPsr0;
73
 
74
  }, null, ClassLoader::class);
75
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit865457f1d3d9514fc24c719235c2f59f
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
67
  public static function getInitializer(ClassLoader $loader)
68
  {
69
  return \Closure::bind(function () use ($loader) {
70
+ $loader->prefixLengthsPsr4 = ComposerStaticInit865457f1d3d9514fc24c719235c2f59f::$prefixLengthsPsr4;
71
+ $loader->prefixDirsPsr4 = ComposerStaticInit865457f1d3d9514fc24c719235c2f59f::$prefixDirsPsr4;
72
+ $loader->prefixesPsr0 = ComposerStaticInit865457f1d3d9514fc24c719235c2f59f::$prefixesPsr0;
73
 
74
  }, null, ClassLoader::class);
75
  }
weglot.php CHANGED
@@ -7,7 +7,7 @@ Author: Weglot Translate team
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
- Version: 3.0.0
11
  */
12
 
13
  /**
@@ -22,7 +22,7 @@ if ( ! defined('ABSPATH')) {
22
  define('WEGLOT_NAME', 'Weglot');
23
  define('WEGLOT_SLUG', 'weglot-translate');
24
  define('WEGLOT_OPTION_GROUP', 'group-weglot-translate');
25
- define('WEGLOT_VERSION', '3.0.0');
26
  define('WEGLOT_PHP_MIN', '5.4');
27
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
28
  define('WEGLOT_DIR', __DIR__ );
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
+ Version: 3.0.1
11
  */
12
 
13
  /**
22
  define('WEGLOT_NAME', 'Weglot');
23
  define('WEGLOT_SLUG', 'weglot-translate');
24
  define('WEGLOT_OPTION_GROUP', 'group-weglot-translate');
25
+ define('WEGLOT_VERSION', '3.0.1');
26
  define('WEGLOT_PHP_MIN', '5.4');
27
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
28
  define('WEGLOT_DIR', __DIR__ );