Compare commits

...

6 Commits

Author SHA1 Message Date
1fa19974cf Release 3.102.1 2022-11-03 17:41:02 +03:00
0e2e2d50de Prevent enabling Woo Blocks integration for older versions
Version 8.0.0 was shipped with WooCommerce 6.8.0 which is the oldest currently supported Woo version.
[MAILPOET-4774]
2022-11-03 17:41:02 +03:00
4f16f246b8 Remove backward compatibility for Woo Blocks ExtendRestApi
The new ExtendSchema was introduced in WCBlocks 7.2 which are way older
then we currently want to support.
[MAILPOET-4774]
2022-11-03 17:41:02 +03:00
9ca1cabb67 Update php-stubs/woocommerce-stubs to the latest version
[MAILPOET-4774]
2022-11-03 17:41:02 +03:00
a990250072 Use current namespace for Woo store API checkout schema class
The new namespace is supported from WooCommerce 6.4.0 so we don't need
to support the old namespace any more.
Some users reported issues with BC class aliases provided by Woo.
[MAILPOET-4774]
2022-11-03 17:41:02 +03:00
5fbe658920 Prefix polyfilled normalizer functions
[MAILPOET-4770]
2022-11-03 17:41:02 +03:00
8 changed files with 57 additions and 53 deletions

View File

@ -473,7 +473,7 @@ class Initializer {
private function setupWoocommerceBlocksIntegration() {
$wcEnabled = $this->wcHelper->isWooCommerceActive();
$wcBlocksEnabled = $this->wcHelper->isWooCommerceBlocksActive('6.3.0-dev');
$wcBlocksEnabled = $this->wcHelper->isWooCommerceBlocksActive('8.0.0');
if ($wcEnabled && $wcBlocksEnabled) {
$this->woocommerceBlocksIntegration->init();
}

View File

@ -2,10 +2,8 @@
namespace MailPoet\PostEditorBlocks;
use Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi;
use Automattic\WooCommerce\Blocks\Package;
use Automattic\WooCommerce\Blocks\StoreApi\Schemas\CheckoutSchema;
use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
use Automattic\WooCommerce\StoreApi\Schemas\V1\CheckoutSchema;
use Automattic\WooCommerce\StoreApi\StoreApi;
use MailPoet\Config\Env;
use MailPoet\Entities\SubscriberEntity;
@ -113,9 +111,7 @@ class WooCommerceBlocksIntegration {
return;
}
$extend = $this->wooHelper->isWooCommerceBlocksActive('7.2') ?
StoreApi::container()->get(ExtendSchema::class) :
Package::container()->get(ExtendRestApi::class);
$extend = StoreApi::container()->get(ExtendSchema::class);
$extend->register_endpoint_data(
[
'endpoint' => CheckoutSchema::IDENTIFIER,

View File

@ -2,7 +2,7 @@
/*
* Plugin Name: MailPoet
* Version: 3.102.0
* Version: 3.102.1
* Plugin URI: http://www.mailpoet.com
* Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
* Author: MailPoet
@ -17,7 +17,7 @@
*/
$mailpoetPlugin = [
'version' => '3.102.0',
'version' => '3.102.1',
'filename' => __FILE__,
'path' => dirname(__FILE__),
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',

View File

@ -17,6 +17,13 @@ $data = str_replace('\\Normalizer::', '\\MailPoetVendor\\Normalizer::', $data);
$data = str_replace('\'Normalizer::', '\'\\MailPoetVendor\\Normalizer::', $data); // for use in strings like defined('...')
file_put_contents($file, $data);
$file = __DIR__ . '/../vendor-prefixed/symfony/polyfill-intl-normalizer/bootstrap.php';
$data = file_get_contents($file);
// These unprefixed functions break WP 6.1 compatibility, we don't seem to use them, let's prefix them.
$data = str_replace('function normalizer_is_normalized', 'function mailpoet_normalizer_is_normalized', $data);
$data = str_replace('function normalizer_normalize', 'function mailpoet_normalizer_normalize', $data);
file_put_contents($file, $data);
$file = __DIR__ . '/../vendor-prefixed/symfony/polyfill-iconv/Iconv.php';
$data = file_get_contents($file);
$data = str_replace('\\Normalizer::', '\\MailPoetVendor\\Normalizer::', $data);

View File

@ -3,7 +3,7 @@ Contributors: mailpoet
Tags: email, email marketing, post notification, woocommerce emails, email automation, newsletter, newsletter builder, newsletter subscribers
Requires at least: 5.6
Tested up to: 6.0
Stable tag: 3.102.0
Stable tag: 3.102.1
Requires PHP: 7.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@ -219,6 +219,10 @@ Check our [Knowledge Base](https://kb.mailpoet.com) or contact us through our [s
== Changelog ==
= 3.102.1 - 2022-11-03 =
* Fixed: missing 'CheckoutSchema' class error in WooCommerce blocks integration;
* Fixed: "Class 'Normalizer' not found" error in WP 6.1 when intl extension is missing.
= 3.102.0 - 2022-11-01 =
* Added: new subscribers hooks (https://github.com/mailpoet/mailpoet/pull/4443);
* Improved: limit cron runs when execution limit exception is thrown;

View File

@ -1,28 +1,27 @@
{
"require": {
"php-stubs/woocommerce-stubs": "^6.0",
"phpstan/phpstan": "1.4.10",
"phpstan/phpstan-doctrine": "1.2.11",
"phpstan/phpstan-phpunit": "1.0.0",
"szepeviktor/phpstan-wordpress": "1.0.3"
},
"autoload": {
"psr-4": {
"MailPoet\\PHPStan\\Extensions\\": "extensions"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"post-install-cmd": [
"php prefix-phpstan-doctrine.php",
"php fix-WPStubs-for-PHP-8_1.php"
],
"post-update-cmd": [
"php prefix-phpstan-doctrine.php",
"php fix-WPStubs-for-PHP-8_1.php"
]
"require": {
"php-stubs/woocommerce-stubs": "^7.0",
"phpstan/phpstan": "1.4.10",
"phpstan/phpstan-doctrine": "1.2.11",
"phpstan/phpstan-phpunit": "1.0.0",
"szepeviktor/phpstan-wordpress": "1.0.3"
},
"autoload": {
"psr-4": {
"MailPoet\\PHPStan\\Extensions\\": "extensions"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"post-install-cmd": [
"php prefix-phpstan-doctrine.php",
"php fix-WPStubs-for-PHP-8_1.php"
],
"post-update-cmd": [
"php prefix-phpstan-doctrine.php",
"php fix-WPStubs-for-PHP-8_1.php"
]
}
}

View File

@ -4,28 +4,28 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ff830b6e9cbe937699c148d8d53b907b",
"content-hash": "f4ffe233f34ce17c0d21212db84abf08",
"packages": [
{
"name": "php-stubs/woocommerce-stubs",
"version": "v6.0.0",
"version": "v7.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-stubs/woocommerce-stubs.git",
"reference": "65e6be8a1b74b7be5d0d5591262342ff116f93db"
"reference": "2bbe0ba67081cfad17d33ac503883fdc6e68a386"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/65e6be8a1b74b7be5d0d5591262342ff116f93db",
"reference": "65e6be8a1b74b7be5d0d5591262342ff116f93db",
"url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/2bbe0ba67081cfad17d33ac503883fdc6e68a386",
"reference": "2bbe0ba67081cfad17d33ac503883fdc6e68a386",
"shasum": ""
},
"require": {
"php-stubs/wordpress-stubs": "^5.3.0"
"php-stubs/wordpress-stubs": "^5.3 || ^6.0"
},
"require-dev": {
"giacocorsiglia/stubs-generator": "^0.5.0",
"php": "~7.1"
"php": "~7.1 || ~8.0",
"php-stubs/generator": "^0.8.0"
},
"suggest": {
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
@ -46,9 +46,9 @@
],
"support": {
"issues": "https://github.com/php-stubs/woocommerce-stubs/issues",
"source": "https://github.com/php-stubs/woocommerce-stubs/tree/v6.0.0"
"source": "https://github.com/php-stubs/woocommerce-stubs/tree/v7.0.0"
},
"time": "2022-01-04T22:00:24+00:00"
"time": "2022-10-12T08:25:57+00:00"
},
{
"name": "php-stubs/wordpress-stubs",
@ -435,5 +435,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}

View File

@ -42,8 +42,6 @@ parameters:
- '/Parameter #1 \$cssOrXPath of method AcceptanceTester::moveMouseOver\(\) expects string\|null, array<string, string> given./'
- '/Function expect invoked with 1 parameter, 0 required\./'
- '/Call to method getName\(\) on an unknown class _generated\\([a-zA-Z])*Cookie/' # codeception generate incorrect return type in ../../tests/_support/_generated
- '/Call to static method container\(\) on an unknown class/'
- '/Class Automattic\\WooCommerce\\StoreApi\\Schemas\\ExtendSchema not found./'
-
message: "#^Cannot cast string|void to string\\.$#"
count: 5
@ -52,10 +50,6 @@ parameters:
message: "#^Cannot cast string|void to string\\.$#"
count: 5
path: ../../lib/Automation/Engine/Storage/WorkflowStorage.php
-
message: '/^Call to static method custom_orders_table_usage_is_enabled\(\) on an unknown class Automattic\\WooCommerce\\Utilities\\OrderUtil\.$/'
count: 1
path: ../../lib/WooCommerce/Helper.php
-
message: '/^Call to static method get_orders_table_name\(\) on an unknown class Automattic\\WooCommerce\\Internal\\DataStores\\Orders\\OrdersTableDataStore\.$/'
count: 1
@ -66,7 +60,7 @@ parameters:
path: ../../lib/WooCommerce/Helper.php
-
message: '/^Call to function method_exists\(\) with/'
count: 3
count: 2
path: ../../lib/WooCommerce/Helper.php
- # WooCommerce stubs contains stubs for older ActionScheduler version
message: '/^Function as_schedule_recurring_action invoked with 6 parameters, 3-5 required.$/'
@ -76,6 +70,10 @@ parameters:
message: '/^Function as_schedule_single_action invoked with 5 parameters, 2-4 required.$/'
count: 1
path: ../../lib/Cron/ActionScheduler/ActionScheduler.php
-
message: '/^Cannot call method get\(\) on mixed.$/'
count: 1
path: ../../lib/PostEditorBlocks/WooCommerceBlocksIntegration.php
reportUnmatchedIgnoredErrors: true
dynamicConstantNames:
- MAILPOET_PREMIUM_INITIALIZED