Skip to content

Commit de5a950

Browse files
authored
PES-2927: correct loading of shipping methods in case of premature payment plugin queries (#844)
2 parents f1e33cb + add5455 commit de5a950

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
== Changelog ==
2+
= 2.0.11 =
3+
Fixed: Correct loading of shipping methods in case of premature payment plugin queries.
4+
25
= 2.0.10 =
36
Fixed: Introduced carrier and shipping method caching to prevent excessive memory usage and performance problems.
47

languages/packeta.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the GNU General Public License v3.0.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Packeta 2.0.10\n"
5+
"Project-Id-Version: Packeta 2.0.11\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/packeta\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-08-14T14:49:12+02:00\n"
12+
"POT-Creation-Date: 2025-08-25T10:20:42+02:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.11.0\n"
1515
"X-Domain: packeta\n"

packeta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Plugin Name: Packeta
1010
* Description: This is the official plugin, that allows you to choose pickup points of Packeta and its external carriers in all of Europe, or utilize address delivery to 25 countries in the European Union, straight from the cart in your e-shop. Furthermore, you can also submit all your orders to Packeta with just one click.
11-
* Version: 2.0.10
11+
* Version: 2.0.11
1212
* Author: Zásilkovna s.r.o.
1313
* Author URI: https://www.zasilkovna.cz/
1414
* Text Domain: packeta

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: packeta
33
Tags: WooCommerce, shipping
44
Requires at least: 5.5
55
Tested up to: 6.8.2
6-
Stable tag: 2.0.10
6+
Stable tag: 2.0.11
77
Requires PHP: 7.2
88
WC requires at least: 5.1
99
WC tested up to: 10.0.4
@@ -63,6 +63,9 @@ We are constantly working on adding new features. If there is a feature you woul
6363
Please contact us at [email protected] .
6464

6565
== Changelog ==
66+
= 2.0.11 =
67+
Fixed: Correct loading of shipping methods in case of premature payment plugin queries.
68+
6669
= 2.0.10 =
6770
Fixed: Introduced carrier and shipping method caching to prevent excessive memory usage and performance problems.
6871

src/Packetery/Module/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class Plugin {
2020

21-
public const VERSION = '2.0.10';
21+
public const VERSION = '2.0.11';
2222
public const DOMAIN = 'packeta';
2323
public const PARAM_PACKETERY_ACTION = 'packetery_action';
2424
public const PARAM_NONCE = '_wpnonce';

src/Packetery/Module/Shipping/ShippingProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ function ( $classA, $classB ) {
250250
* @return array<string, string>
251251
*/
252252
public function getSortedCachedMethods( array $originalMethods ): array {
253+
$areClassesLoaded = in_array( BaseShippingMethod::class, get_declared_classes(), true );
254+
if ( $areClassesLoaded === false ) {
255+
return $originalMethods;
256+
}
257+
253258
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
254259
$cacheKey = crc32( serialize( $originalMethods ) );
255260

0 commit comments

Comments
 (0)