Mollie Payments for WooCommerce - Version 5.8.3

Version Description

  • 09-09-2020 =

  • Fix - Apple Pay button is disabled if Apple Pay gateways is disabled

  • Fix - Breaks Urls of translations plugins

  • Fix - Translations update endless loop

Download this release

Release Info

Developer carmen222
Plugin Icon wp plugin Mollie Payments for WooCommerce
Version 5.8.3
Comparing to
See all releases

Code changes from version 5.8.2 to 5.8.3

inc/utils.php CHANGED
@@ -150,14 +150,41 @@ function mollieWooCommerceGetDataHelper()
150
  }
151
 
152
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  * @return bool
154
  */
155
  function mollieWooCommerceisApplePayDirectEnabled()
156
  {
157
  $applePaySettings = get_option('mollie_wc_gateway_applepay_settings');
158
- return mollieWooCommerceStringToBoolOption(
159
- checkIndexExistOrDefault($applePaySettings, 'mollie_apple_pay_button_enabled', 'no')
 
 
 
 
 
 
 
 
160
  );
 
 
161
  }
162
 
163
  function checkIndexExistOrDefault($array, $key, $default)
150
  }
151
 
152
  /**
153
+ * Check if the Apple Pay gateway is enabled.
154
+ *
155
+ * @return bool
156
+ */
157
+ function mollieWooCommerceisApplePayEnabled()
158
+ {
159
+ $applePaySettings = get_option('mollie_wc_gateway_applepay_settings');
160
+ $applePayGatewayEnabled = mollieWooCommerceStringToBoolOption(
161
+ checkIndexExistOrDefault($applePaySettings, 'enabled', 'no')
162
+ );
163
+
164
+ return $applePayGatewayEnabled;
165
+ }
166
+
167
+ /**
168
+ * Check if the Apple Pay gateway is enabled and then if the button is enabled too.
169
+ *
170
  * @return bool
171
  */
172
  function mollieWooCommerceisApplePayDirectEnabled()
173
  {
174
  $applePaySettings = get_option('mollie_wc_gateway_applepay_settings');
175
+ $applePayGatewayEnabled = mollieWooCommerceisApplePayEnabled();
176
+ if (!$applePayGatewayEnabled) {
177
+ return false;
178
+ }
179
+ $applePayDirectEnabled = mollieWooCommerceStringToBoolOption(
180
+ checkIndexExistOrDefault(
181
+ $applePaySettings,
182
+ 'mollie_apple_pay_button_enabled',
183
+ 'no'
184
+ )
185
  );
186
+
187
+ return $applePayDirectEnabled;
188
  }
189
 
190
  function checkIndexExistOrDefault($array, $key, $default)
mollie-payments-for-woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
- * Version: 5.8.2
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
@@ -12,7 +12,7 @@
12
  * Domain Path: /languages
13
  * License: GPLv2 or later
14
  * WC requires at least: 2.2.0
15
- * WC tested up to: 4.4
16
  */
17
 
18
  use Mollie\Api\CompatibilityChecker;
@@ -240,6 +240,24 @@ $bootstrap = Closure::bind(
240
  );
241
 
242
  add_action( 'core_upgrade_preamble', 'deleteWPTranslationFiles' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
244
  );
245
  },
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
+ * Version: 5.8.3
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
12
  * Domain Path: /languages
13
  * License: GPLv2 or later
14
  * WC requires at least: 2.2.0
15
+ * WC tested up to: 4.5
16
  */
17
 
18
  use Mollie\Api\CompatibilityChecker;
240
  );
241
 
242
  add_action( 'core_upgrade_preamble', 'deleteWPTranslationFiles' );
243
+ add_filter(
244
+ 'site_transient_update_plugins',
245
+ function ($value) {
246
+ if (isset($value->translations)) {
247
+ $i = 0;
248
+ foreach ($value->translations as $translation) {
249
+ if ($translation["slug"]
250
+ == "mollie-payments-for-woocommerce"
251
+ ) {
252
+ unset($value->translations[$i]);
253
+ }
254
+ $i++;
255
+ }
256
+ }
257
+
258
+ return $value;
259
+ }
260
+ );
261
  }
262
  );
263
  },
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, inpsyde, l.vangunst, n
3
  Tags: mollie, payments, payment gateway, woocommerce, credit card, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions
4
  Requires at least: 3.8
5
  Tested up to: 5.5
6
- Stable tag: 5.8.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -181,6 +181,12 @@ Automatic updates should work like a charm; as always though, ensure you backup
181
 
182
  == Changelog ==
183
 
 
 
 
 
 
 
184
  = 5.8.2 - 19-08-2020 =
185
 
186
  * Fix - Use own plugin translation files
3
  Tags: mollie, payments, payment gateway, woocommerce, credit card, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions
4
  Requires at least: 3.8
5
  Tested up to: 5.5
6
+ Stable tag: 5.8.3
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
181
 
182
  == Changelog ==
183
 
184
+ = 5.8.3 - 09-09-2020 =
185
+
186
+ * Fix - Apple Pay button is disabled if Apple Pay gateways is disabled
187
+ * Fix - Breaks Urls of translations plugins
188
+ * Fix - Translations update endless loop
189
+
190
  = 5.8.2 - 19-08-2020 =
191
 
192
  * Fix - Use own plugin translation files
src/Mollie/WC/Gateway/Abstract.php CHANGED
@@ -1945,22 +1945,23 @@ abstract class Mollie_WC_Gateway_Abstract extends WC_Payment_Gateway
1945
  */
1946
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1947
 
1948
- $site_url = get_home_url();
1949
- $polylang_fallback = false;
1950
 
1951
  if ( is_plugin_active( 'polylang/polylang.php' ) || is_plugin_active( 'polylang-pro/polylang.php' ) ) {
1952
 
1953
  $lang = PLL()->model->get_language( pll_current_language() );
 
 
1954
 
1955
  if ( empty ( $lang->search_url ) ) {
1956
- $polylang_fallback = true;
1957
  } else {
1958
- $polylang_url = $lang->search_url;
1959
- $site_url = str_replace( $site_url, $polylang_url, $site_url );
1960
  }
1961
  }
1962
 
1963
- if ( $polylang_fallback == true || is_plugin_active( 'mlang/mlang.php' ) || is_plugin_active( 'mlanguage/mlanguage.php' ) ) {
1964
 
1965
  $slug = get_bloginfo( 'language' );
1966
  $pos = strpos( $slug, '-' );
@@ -1968,11 +1969,10 @@ abstract class Mollie_WC_Gateway_Abstract extends WC_Payment_Gateway
1968
  $slug = substr( $slug, 0, $pos );
1969
  }
1970
  $slug = '/' . $slug;
1971
- $site_url = str_replace( $site_url, $site_url . $slug, $site_url );
1972
-
1973
  }
1974
 
1975
- return $site_url;
1976
  }
1977
 
1978
  /**
1945
  */
1946
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
1947
 
1948
+ $siteUrl = get_home_url();
1949
+ $polylangFallback = false;
1950
 
1951
  if ( is_plugin_active( 'polylang/polylang.php' ) || is_plugin_active( 'polylang-pro/polylang.php' ) ) {
1952
 
1953
  $lang = PLL()->model->get_language( pll_current_language() );
1954
+ $checkoutUrl = $this->get_return_url(null);
1955
+ $checkoutUrl = str_replace('order-received/','',$checkoutUrl);
1956
 
1957
  if ( empty ( $lang->search_url ) ) {
1958
+ $polylangFallback = true;
1959
  } else {
1960
+ $siteUrl = str_replace( $siteUrl, $checkoutUrl, $siteUrl );
 
1961
  }
1962
  }
1963
 
1964
+ if ( $polylangFallback == true || is_plugin_active( 'mlang/mlang.php' ) || is_plugin_active( 'mlanguage/mlanguage.php' ) ) {
1965
 
1966
  $slug = get_bloginfo( 'language' );
1967
  $pos = strpos( $slug, '-' );
1969
  $slug = substr( $slug, 0, $pos );
1970
  }
1971
  $slug = '/' . $slug;
1972
+ $siteUrl = str_replace( $siteUrl, $siteUrl . $slug, $siteUrl );
 
1973
  }
1974
 
1975
+ return $siteUrl;
1976
  }
1977
 
1978
  /**
src/Mollie/WC/Plugin.php CHANGED
@@ -8,7 +8,7 @@ class Mollie_WC_Plugin
8
  {
9
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
10
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
11
- const PLUGIN_VERSION = '5.8.2';
12
 
13
  const DB_VERSION = '1.0';
14
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
@@ -441,6 +441,10 @@ class Mollie_WC_Plugin
441
  return;
442
  }
443
 
 
 
 
 
444
  wp_enqueue_script('mollie_wc_gateway_applepay');
445
  }
446
 
8
  {
9
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
10
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
11
+ const PLUGIN_VERSION = '5.8.3';
12
 
13
  const DB_VERSION = '1.0';
14
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
441
  return;
442
  }
443
 
444
+ if (!mollieWooCommerceisApplePayEnabled()) {
445
+ return;
446
+ }
447
+
448
  wp_enqueue_script('mollie_wc_gateway_applepay');
449
  }
450
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitcf4c3ed11e400692c94a01b4717420ac::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8', '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\ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit2a1576148f175ec9c0194d39be3f5dc8
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire2a1576148f175ec9c0194d39be3f5dc8($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire2a1576148f175ec9c0194d39be3f5dc8($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 ComposerAutoloaderInitcf4c3ed11e400692c94a01b4717420ac
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitcf4c3ed11e400692c94a01b4717420ac', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitcf4c3ed11e400692c94a01b4717420ac', '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\ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::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\ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequirecf4c3ed11e400692c94a01b4717420ac($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequirecf4c3ed11e400692c94a01b4717420ac($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 ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
@@ -295,10 +295,10 @@ class ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8
295
  public static function getInitializer(ClassLoader $loader)
296
  {
297
  return \Closure::bind(function () use ($loader) {
298
- $loader->prefixLengthsPsr4 = ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::$prefixLengthsPsr4;
299
- $loader->prefixDirsPsr4 = ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::$prefixDirsPsr4;
300
- $loader->prefixesPsr0 = ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::$prefixesPsr0;
301
- $loader->classMap = ComposerStaticInit2a1576148f175ec9c0194d39be3f5dc8::$classMap;
302
 
303
  }, null, ClassLoader::class);
304
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
295
  public static function getInitializer(ClassLoader $loader)
296
  {
297
  return \Closure::bind(function () use ($loader) {
298
+ $loader->prefixLengthsPsr4 = ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::$prefixLengthsPsr4;
299
+ $loader->prefixDirsPsr4 = ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::$prefixDirsPsr4;
300
+ $loader->prefixesPsr0 = ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::$prefixesPsr0;
301
+ $loader->classMap = ComposerStaticInitcf4c3ed11e400692c94a01b4717420ac::$classMap;
302
 
303
  }, null, ClassLoader::class);
304
  }