From 8cff9c51d65bff0ede1fad440bd5f9dc7f1dec39 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Wed, 10 Apr 2024 10:33:19 +0200
Subject: [PATCH 01/17] update modularity
it fails with php7.2
---
.idea/WooCommerce.iml | 114 ++-
.idea/php.xml | 4 +-
composer.json | 7 +-
composer.lock | 845 ++++++++++++------
.../Container/ContainerConfigurator.php | 24 +-
.../Container/PackageProxyContainer.php | 17 +-
.../Container/ReadOnlyContainer.php | 8 +-
lib/packages/Inpsyde/Modularity/Package.php | 354 ++++++--
.../Properties/PluginProperties.php | 43 +-
.../Modularity/Properties/ThemeProperties.php | 16 +-
.../Container/ContainerExceptionInterface.php | 3 -
.../Psr/Container/ContainerInterface.php | 9 +-
.../Container/NotFoundExceptionInterface.php | 3 -
.../Constraints/PluginConstraint.php | 2 +-
14 files changed, 949 insertions(+), 500 deletions(-)
diff --git a/.idea/WooCommerce.iml b/.idea/WooCommerce.iml
index 9aa75e6b5..2dee15c74 100644
--- a/.idea/WooCommerce.iml
+++ b/.idea/WooCommerce.iml
@@ -9,76 +9,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
+
+
+
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/php.xml b/.idea/php.xml
index 34031bf4e..46d61f7a2 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -95,8 +95,6 @@
-
-
@@ -261,4 +259,4 @@
-
+
\ No newline at end of file
diff --git a/composer.json b/composer.json
index b1558fb33..792da2255 100644
--- a/composer.json
+++ b/composer.json
@@ -23,8 +23,8 @@
"psr/log":"^1.1.4"
},
"require-dev": {
- "inpsyde/modularity": "^1.3.0",
- "psr/container": "1.0.0",
+ "inpsyde/modularity": "^1.7.4",
+ "psr/container": "^1.1.0",
"phpunit/phpunit": "^8",
"brain/monkey": "^2.3",
"ptrofimov/xpmock": "^1",
@@ -34,7 +34,8 @@
"inpsyde/composer-assets-compiler": "^2.5",
"php-stubs/wordpress-stubs": "^5.0@stable",
"php-stubs/woocommerce-stubs": "7.9.0",
- "vimeo/psalm": "^4.8 || ^5.13.0"
+ "vimeo/psalm": "^4.8 || ^5.13.0",
+ "coenjacobs/mozart": "^0.6.0"
},
"autoload": {
"psr-4": {
diff --git a/composer.lock b/composer.lock
index f905d204a..e64244ff3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,32 +4,32 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "99dd93462bdd098a3d12154b8e71b543",
+ "content-hash": "7ef59c6774630f802cf820169b9ca74a",
"packages": [
{
"name": "composer/ca-bundle",
- "version": "1.3.6",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "90d087e988ff194065333d16bc5cf649872d9cdb"
+ "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb",
- "reference": "90d087e988ff194065333d16bc5cf649872d9cdb",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99",
+ "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-pcre": "*",
- "php": "^5.3.2 || ^7.0 || ^8.0"
+ "php": "^7.2 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^0.12.55",
+ "phpstan/phpstan": "^1.10",
"psr/log": "^1.0",
"symfony/phpunit-bridge": "^4.2 || ^5",
- "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0"
+ "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"type": "library",
"extra": {
@@ -64,7 +64,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/ca-bundle/issues",
- "source": "https://github.com/composer/ca-bundle/tree/1.3.6"
+ "source": "https://github.com/composer/ca-bundle/tree/1.5.0"
},
"funding": [
{
@@ -80,20 +80,20 @@
"type": "tidelift"
}
],
- "time": "2023-06-06T12:02:59+00:00"
+ "time": "2024-03-15T14:00:32+00:00"
},
{
"name": "mollie/mollie-api-php",
- "version": "v2.61.0",
+ "version": "v2.66.0",
"source": {
"type": "git",
"url": "https://github.com/mollie/mollie-api-php.git",
- "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a"
+ "reference": "d7d09ac62a565e818bf49d04acb2f0432da758a9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d3ec7a191985aa57bec9b4425a665e95b4ba346a",
- "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a",
+ "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d7d09ac62a565e818bf49d04acb2f0432da758a9",
+ "reference": "d7d09ac62a565e818bf49d04acb2f0432da758a9",
"shasum": ""
},
"require": {
@@ -170,9 +170,9 @@
],
"support": {
"issues": "https://github.com/mollie/mollie-api-php/issues",
- "source": "https://github.com/mollie/mollie-api-php/tree/v2.61.0"
+ "source": "https://github.com/mollie/mollie-api-php/tree/v2.66.0"
},
- "time": "2023-07-31T15:37:46+00:00"
+ "time": "2024-03-19T13:33:42+00:00"
},
{
"name": "psr/log",
@@ -228,16 +228,16 @@
"packages-dev": [
{
"name": "amphp/amp",
- "version": "v2.6.2",
+ "version": "v2.6.4",
"source": {
"type": "git",
"url": "https://github.com/amphp/amp.git",
- "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
+ "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
- "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
+ "url": "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d",
+ "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d",
"shasum": ""
},
"require": {
@@ -249,8 +249,8 @@
"ext-json": "*",
"jetbrains/phpstorm-stubs": "^2019.3",
"phpunit/phpunit": "^7 | ^8 | ^9",
- "psalm/phar": "^3.11@dev",
- "react/promise": "^2"
+ "react/promise": "^2",
+ "vimeo/psalm": "^3.12"
},
"type": "library",
"extra": {
@@ -305,7 +305,7 @@
"support": {
"irc": "irc://irc.freenode.org/amphp",
"issues": "https://github.com/amphp/amp/issues",
- "source": "https://github.com/amphp/amp/tree/v2.6.2"
+ "source": "https://github.com/amphp/amp/tree/v2.6.4"
},
"funding": [
{
@@ -313,7 +313,7 @@
"type": "github"
}
],
- "time": "2022-02-20T17:52:18+00:00"
+ "time": "2024-03-21T18:52:26+00:00"
},
{
"name": "amphp/byte-stream",
@@ -394,16 +394,16 @@
},
{
"name": "antecedent/patchwork",
- "version": "2.1.25",
+ "version": "2.1.28",
"source": {
"type": "git",
"url": "https://github.com/antecedent/patchwork.git",
- "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a"
+ "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/antecedent/patchwork/zipball/17314e042d45e0dacb0a494c2d1ef50e7621136a",
- "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a",
+ "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d",
+ "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d",
"shasum": ""
},
"require": {
@@ -424,7 +424,7 @@
}
],
"description": "Method redefinition (monkey-patching) functionality for PHP.",
- "homepage": "http://patchwork2.org/",
+ "homepage": "https://antecedent.github.io/patchwork/",
"keywords": [
"aop",
"aspect",
@@ -436,9 +436,9 @@
],
"support": {
"issues": "https://github.com/antecedent/patchwork/issues",
- "source": "https://github.com/antecedent/patchwork/tree/2.1.25"
+ "source": "https://github.com/antecedent/patchwork/tree/2.1.28"
},
- "time": "2023-02-19T12:51:24+00:00"
+ "time": "2024-02-06T09:26:11+00:00"
},
{
"name": "automattic/phpcs-neutron-standard",
@@ -609,6 +609,63 @@
},
"time": "2021-11-11T15:53:55+00:00"
},
+ {
+ "name": "coenjacobs/mozart",
+ "version": "0.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/coenjacobs/mozart.git",
+ "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/ac3ff9ed253a575e4e7309379f74424da9a56bd8",
+ "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8",
+ "shasum": ""
+ },
+ "require": {
+ "league/flysystem": "^1.0",
+ "php": "^7.2",
+ "symfony/console": "^4|^5",
+ "symfony/finder": "^4|^5"
+ },
+ "require-dev": {
+ "mheap/phpunit-github-actions-printer": "^1.4",
+ "phpunit/phpunit": "^8.5",
+ "squizlabs/php_codesniffer": "^3.5"
+ },
+ "bin": [
+ "bin/mozart"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "CoenJacobs\\Mozart\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Coen Jacobs",
+ "email": "coenjacobs@gmail.com"
+ }
+ ],
+ "description": "Composes all dependencies as a package inside a WordPress plugin",
+ "support": {
+ "issues": "https://github.com/coenjacobs/mozart/issues",
+ "source": "https://github.com/coenjacobs/mozart/tree/0.6.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/coenjacobs",
+ "type": "github"
+ }
+ ],
+ "time": "2021-01-17T15:41:04+00:00"
+ },
{
"name": "composer/package-versions-deprecated",
"version": "1.11.99.5",
@@ -684,16 +741,16 @@
},
{
"name": "composer/pcre",
- "version": "2.1.0",
+ "version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
- "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717"
+ "reference": "540af382c97b83c628227d5f87cf56466d476191"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/pcre/zipball/3fdb2807b31a78a40ad89570e30ec77466c98717",
- "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/540af382c97b83c628227d5f87cf56466d476191",
+ "reference": "540af382c97b83c628227d5f87cf56466d476191",
"shasum": ""
},
"require": {
@@ -735,7 +792,7 @@
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
- "source": "https://github.com/composer/pcre/tree/2.1.0"
+ "source": "https://github.com/composer/pcre/tree/2.1.3"
},
"funding": [
{
@@ -751,20 +808,20 @@
"type": "tidelift"
}
],
- "time": "2022-11-16T18:32:04+00:00"
+ "time": "2024-03-19T09:03:05+00:00"
},
{
"name": "composer/semver",
- "version": "3.3.2",
+ "version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9"
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9",
- "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9",
+ "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
"shasum": ""
},
"require": {
@@ -814,9 +871,9 @@
"versioning"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.3.2"
+ "source": "https://github.com/composer/semver/tree/3.4.0"
},
"funding": [
{
@@ -832,20 +889,20 @@
"type": "tidelift"
}
],
- "time": "2022-04-01T19:23:25+00:00"
+ "time": "2023-08-31T09:50:34+00:00"
},
{
"name": "composer/xdebug-handler",
- "version": "3.0.3",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "ced299686f41dce890debac69273b47ffe98a40c"
+ "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c",
- "reference": "ced299686f41dce890debac69273b47ffe98a40c",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
+ "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
"shasum": ""
},
"require": {
@@ -856,7 +913,7 @@
"require-dev": {
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-strict-rules": "^1.1",
- "symfony/phpunit-bridge": "^6.0"
+ "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5"
},
"type": "library",
"autoload": {
@@ -880,9 +937,9 @@
"performance"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
- "source": "https://github.com/composer/xdebug-handler/tree/3.0.3"
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.4"
},
"funding": [
{
@@ -898,7 +955,7 @@
"type": "tidelift"
}
],
- "time": "2022-02-25T21:32:43+00:00"
+ "time": "2024-03-26T18:29:49+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -1291,16 +1348,16 @@
},
{
"name": "inpsyde/composer-assets-compiler",
- "version": "2.5.2",
+ "version": "2.5.3",
"source": {
"type": "git",
"url": "https://github.com/inpsyde/composer-asset-compiler.git",
- "reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6"
+ "reference": "3db3bea66088421377b725d110bd16ee23716c05"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/26a4062c2171ac09492e684eb3e4462ec69cf3a6",
- "reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6",
+ "url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/3db3bea66088421377b725d110bd16ee23716c05",
+ "reference": "3db3bea66088421377b725d110bd16ee23716c05",
"shasum": ""
},
"require": {
@@ -1314,7 +1371,7 @@
"mikey179/vfsstream": "^1.6.10",
"mockery/mockery": "^1.3.5",
"phpunit/phpunit": "^8.5.21",
- "vimeo/psalm": ">=4.11.2@stable"
+ "vimeo/psalm": "^4.16.1"
},
"type": "composer-plugin",
"extra": {
@@ -1350,28 +1407,28 @@
"description": "Composer plugin that installs and compile frontend dependencies for installed Composer packages based on configuration.",
"support": {
"issues": "https://github.com/inpsyde/composer-asset-compiler/issues",
- "source": "https://github.com/inpsyde/composer-asset-compiler/tree/2.5.2"
+ "source": "https://github.com/inpsyde/composer-asset-compiler/tree/2.5.3"
},
- "time": "2022-03-07T13:50:29+00:00"
+ "time": "2024-03-07T12:11:10+00:00"
},
{
"name": "inpsyde/modularity",
- "version": "1.5.1",
+ "version": "1.7.4",
"source": {
"type": "git",
"url": "https://github.com/inpsyde/modularity.git",
- "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e"
+ "reference": "ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/inpsyde/modularity/zipball/3bbff6197aabbc4df25b5f386f521bedc71aff2e",
- "reference": "3bbff6197aabbc4df25b5f386f521bedc71aff2e",
+ "url": "https://api.github.com/repos/inpsyde/modularity/zipball/ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d",
+ "reference": "ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.2",
- "psr/container": "~1.0"
+ "psr/container": "^1.1.0 || ^2"
},
"require-dev": {
"brain/monkey": "^2.6.1",
@@ -1379,7 +1436,7 @@
"johnpbloch/wordpress-core": ">=5.8",
"mikey179/vfsstream": "^v1.6.10",
"php-stubs/wordpress-stubs": ">=5.8@stable",
- "phpunit/phpunit": "^8.5.21",
+ "phpunit/phpunit": "^8.5.21 || ^9.6.7",
"vimeo/psalm": "^4.13.1"
},
"type": "library",
@@ -1409,11 +1466,6 @@
"email": "c.leucht@inpsyde.com",
"role": "Developer"
},
- {
- "name": "Pablo Kauffman",
- "email": "p.kauffman@inpsyde.com",
- "role": "Developer"
- },
{
"name": "Giuseppe Mazzapica",
"email": "g.mazzapica@inpsyde.com",
@@ -1423,9 +1475,9 @@
"description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.",
"support": {
"issues": "https://github.com/inpsyde/modularity/issues",
- "source": "https://github.com/inpsyde/modularity/tree/1.5.1"
+ "source": "https://github.com/inpsyde/modularity/tree/1.7.4"
},
- "time": "2022-03-09T13:59:27+00:00"
+ "time": "2024-03-22T07:01:53+00:00"
},
{
"name": "inpsyde/php-coding-standards",
@@ -1496,16 +1548,16 @@
},
{
"name": "johnpbloch/wordpress-core",
- "version": "5.9.7",
+ "version": "5.9.9",
"source": {
"type": "git",
"url": "https://github.com/johnpbloch/wordpress-core.git",
- "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb"
+ "reference": "9e7760b44a132a6b0040e13ce0c600d58f21d41f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/5fdd25a8f28f480bf58e6e75b141e7d428fa19bb",
- "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb",
+ "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/9e7760b44a132a6b0040e13ce0c600d58f21d41f",
+ "reference": "9e7760b44a132a6b0040e13ce0c600d58f21d41f",
"shasum": ""
},
"require": {
@@ -1513,7 +1565,7 @@
"php": ">=5.6.20"
},
"provide": {
- "wordpress/core-implementation": "5.9.7"
+ "wordpress/core-implementation": "5.9.9"
},
"type": "wordpress-core",
"notification-url": "https://packagist.org/downloads/",
@@ -1540,7 +1592,157 @@
"source": "https://core.trac.wordpress.org/browser",
"wiki": "https://codex.wordpress.org/"
},
- "time": "2023-05-20T04:40:18+00:00"
+ "time": "2024-01-30T20:46:37+00:00"
+ },
+ {
+ "name": "league/flysystem",
+ "version": "1.1.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/flysystem.git",
+ "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
+ "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-fileinfo": "*",
+ "league/mime-type-detection": "^1.3",
+ "php": "^7.2.5 || ^8.0"
+ },
+ "conflict": {
+ "league/flysystem-sftp": "<1.0.6"
+ },
+ "require-dev": {
+ "phpspec/prophecy": "^1.11.1",
+ "phpunit/phpunit": "^8.5.8"
+ },
+ "suggest": {
+ "ext-ftp": "Allows you to use FTP server storage",
+ "ext-openssl": "Allows you to use FTPS server storage",
+ "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
+ "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
+ "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
+ "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
+ "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
+ "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
+ "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
+ "league/flysystem-webdav": "Allows you to use WebDAV storage",
+ "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
+ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
+ "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Flysystem\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Frank de Jonge",
+ "email": "info@frenky.net"
+ }
+ ],
+ "description": "Filesystem abstraction: Many filesystems, one API.",
+ "keywords": [
+ "Cloud Files",
+ "WebDAV",
+ "abstraction",
+ "aws",
+ "cloud",
+ "copy.com",
+ "dropbox",
+ "file systems",
+ "files",
+ "filesystem",
+ "filesystems",
+ "ftp",
+ "rackspace",
+ "remote",
+ "s3",
+ "sftp",
+ "storage"
+ ],
+ "support": {
+ "issues": "https://github.com/thephpleague/flysystem/issues",
+ "source": "https://github.com/thephpleague/flysystem/tree/1.1.10"
+ },
+ "funding": [
+ {
+ "url": "https://offset.earth/frankdejonge",
+ "type": "other"
+ }
+ ],
+ "time": "2022-10-04T09:16:37+00:00"
+ },
+ {
+ "name": "league/mime-type-detection",
+ "version": "1.12.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/mime-type-detection.git",
+ "reference": "c7f2872fb273bf493811473dafc88d60ae829f48"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48",
+ "reference": "c7f2872fb273bf493811473dafc88d60ae829f48",
+ "shasum": ""
+ },
+ "require": {
+ "ext-fileinfo": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "phpstan/phpstan": "^0.12.68",
+ "phpunit/phpunit": "^8.5.8 || ^9.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "League\\MimeTypeDetection\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Frank de Jonge",
+ "email": "info@frankdejonge.nl"
+ }
+ ],
+ "description": "Mime-type detection for Flysystem",
+ "support": {
+ "issues": "https://github.com/thephpleague/mime-type-detection/issues",
+ "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/frankdejonge",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-08-03T07:14:11+00:00"
},
{
"name": "mockery/mockery",
@@ -1672,16 +1874,16 @@
},
{
"name": "netresearch/jsonmapper",
- "version": "v4.2.0",
+ "version": "v4.4.1",
"source": {
"type": "git",
"url": "https://github.com/cweiske/jsonmapper.git",
- "reference": "f60565f8c0566a31acf06884cdaa591867ecc956"
+ "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956",
- "reference": "f60565f8c0566a31acf06884cdaa591867ecc956",
+ "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0",
+ "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0",
"shasum": ""
},
"require": {
@@ -1692,7 +1894,7 @@
"php": ">=7.1"
},
"require-dev": {
- "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0",
+ "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0",
"squizlabs/php_codesniffer": "~3.5"
},
"type": "library",
@@ -1717,27 +1919,27 @@
"support": {
"email": "cweiske@cweiske.de",
"issues": "https://github.com/cweiske/jsonmapper/issues",
- "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0"
+ "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1"
},
- "time": "2023-04-09T17:37:40+00:00"
+ "time": "2024-01-31T06:18:54+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.17.1",
+ "version": "v4.19.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d"
+ "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
- "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b",
+ "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": ">=7.0"
+ "php": ">=7.1"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
@@ -1773,9 +1975,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1"
},
- "time": "2023-08-13T19:53:39+00:00"
+ "time": "2024-03-17T08:10:35+00:00"
},
{
"name": "openlss/lib-array2xml",
@@ -1832,20 +2034,21 @@
},
{
"name": "phar-io/manifest",
- "version": "2.0.3",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phar-io/manifest.git",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
"shasum": ""
},
"require": {
"ext-dom": "*",
+ "ext-libxml": "*",
"ext-phar": "*",
"ext-xmlwriter": "*",
"phar-io/version": "^3.0.1",
@@ -1886,9 +2089,15 @@
"description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
"support": {
"issues": "https://github.com/phar-io/manifest/issues",
- "source": "https://github.com/phar-io/manifest/tree/2.0.3"
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
},
- "time": "2021-07-20T11:28:43+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:33:53+00:00"
},
{
"name": "phar-io/version",
@@ -2254,16 +2463,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "7.0.15",
+ "version": "7.0.17",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "819f92bba8b001d4363065928088de22f25a3a48"
+ "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48",
- "reference": "819f92bba8b001d4363065928088de22f25a3a48",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/40a4ed114a4aea5afd6df8d0f0c9cd3033097f66",
+ "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66",
"shasum": ""
},
"require": {
@@ -2315,7 +2524,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.17"
},
"funding": [
{
@@ -2323,20 +2532,20 @@
"type": "github"
}
],
- "time": "2021-07-26T12:20:09+00:00"
+ "time": "2024-03-02T06:09:37+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "2.0.5",
+ "version": "2.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5"
+ "reference": "69deeb8664f611f156a924154985fbd4911eb36b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5",
- "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/69deeb8664f611f156a924154985fbd4911eb36b",
+ "reference": "69deeb8664f611f156a924154985fbd4911eb36b",
"shasum": ""
},
"require": {
@@ -2375,7 +2584,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5"
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.6"
},
"funding": [
{
@@ -2383,7 +2592,7 @@
"type": "github"
}
],
- "time": "2021-12-02T12:42:26+00:00"
+ "time": "2024-03-01T13:39:50+00:00"
},
{
"name": "phpunit/php-text-template",
@@ -2432,16 +2641,16 @@
},
{
"name": "phpunit/php-timer",
- "version": "2.1.3",
+ "version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662"
+ "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662",
- "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a691211e94ff39a34811abd521c31bd5b305b0bb",
+ "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb",
"shasum": ""
},
"require": {
@@ -2479,7 +2688,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
- "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3"
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.4"
},
"funding": [
{
@@ -2487,7 +2696,7 @@
"type": "github"
}
],
- "time": "2020-11-30T08:20:02+00:00"
+ "time": "2024-03-01T13:42:41+00:00"
},
{
"name": "phpunit/php-token-stream",
@@ -2551,16 +2760,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "8.5.33",
+ "version": "8.5.38",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e"
+ "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e",
- "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ecad678646c817a29e55a32c930f3601c3f5a8c",
+ "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c",
"shasum": ""
},
"require": {
@@ -2590,9 +2799,9 @@
"sebastian/version": "^2.0.1"
},
"suggest": {
- "ext-soap": "*",
- "ext-xdebug": "*",
- "phpunit/php-invoker": "^2.0.0"
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage",
+ "phpunit/php-invoker": "To allow enforcing time limits"
},
"bin": [
"phpunit"
@@ -2628,7 +2837,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.33"
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.38"
},
"funding": [
{
@@ -2644,31 +2854,26 @@
"type": "tidelift"
}
],
- "time": "2023-02-27T13:04:50+00:00"
+ "time": "2024-04-05T04:31:23+00:00"
},
{
"name": "psr/container",
- "version": "1.0.0",
+ "version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
+ "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.2.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
@@ -2681,7 +2886,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
@@ -2695,9 +2900,9 @@
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/master"
+ "source": "https://github.com/php-fig/container/tree/1.1.1"
},
- "time": "2017-02-14T16:28:37+00:00"
+ "time": "2021-03-05T17:36:06+00:00"
},
{
"name": "ptrofimov/xpmock",
@@ -2738,16 +2943,16 @@
},
{
"name": "sebastian/code-unit-reverse-lookup",
- "version": "1.0.2",
+ "version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619"
+ "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619",
- "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54",
+ "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54",
"shasum": ""
},
"require": {
@@ -2781,7 +2986,7 @@
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
- "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2"
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3"
},
"funding": [
{
@@ -2789,7 +2994,7 @@
"type": "github"
}
],
- "time": "2020-11-30T08:15:22+00:00"
+ "time": "2024-03-01T13:45:45+00:00"
},
{
"name": "sebastian/comparator",
@@ -2867,16 +3072,16 @@
},
{
"name": "sebastian/diff",
- "version": "3.0.4",
+ "version": "3.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae"
+ "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6296a0c086dd0117c1b78b059374d7fcbe7545ae",
- "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6",
+ "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6",
"shasum": ""
},
"require": {
@@ -2921,7 +3126,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/3.0.4"
+ "source": "https://github.com/sebastianbergmann/diff/tree/3.0.6"
},
"funding": [
{
@@ -2929,20 +3134,20 @@
"type": "github"
}
],
- "time": "2023-05-07T05:30:20+00:00"
+ "time": "2024-03-02T06:16:36+00:00"
},
{
"name": "sebastian/environment",
- "version": "4.2.4",
+ "version": "4.2.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0"
+ "reference": "56932f6049a0482853056ffd617c91ffcc754205"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0",
- "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205",
+ "reference": "56932f6049a0482853056ffd617c91ffcc754205",
"shasum": ""
},
"require": {
@@ -2984,7 +3189,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4"
+ "source": "https://github.com/sebastianbergmann/environment/tree/4.2.5"
},
"funding": [
{
@@ -2992,24 +3197,24 @@
"type": "github"
}
],
- "time": "2020-11-30T07:53:42+00:00"
+ "time": "2024-03-01T13:49:59+00:00"
},
{
"name": "sebastian/exporter",
- "version": "3.1.5",
+ "version": "3.1.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6"
+ "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6",
- "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1939bc8fd1d39adcfa88c5b35335910869214c56",
+ "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56",
"shasum": ""
},
"require": {
- "php": ">=7.0",
+ "php": ">=7.2",
"sebastian/recursion-context": "^3.0"
},
"require-dev": {
@@ -3061,7 +3266,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.6"
},
"funding": [
{
@@ -3069,20 +3274,20 @@
"type": "github"
}
],
- "time": "2022-09-14T06:00:17+00:00"
+ "time": "2024-03-02T06:21:38+00:00"
},
{
"name": "sebastian/global-state",
- "version": "3.0.3",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0"
+ "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/66783ce213de415b451b904bfef9dda0cf9aeae0",
- "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/91c7c47047a971f02de57ed6f040087ef110c5d9",
+ "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9",
"shasum": ""
},
"require": {
@@ -3125,7 +3330,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.3"
+ "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.5"
},
"funding": [
{
@@ -3133,20 +3338,20 @@
"type": "github"
}
],
- "time": "2023-08-02T09:23:32+00:00"
+ "time": "2024-03-02T06:13:16+00:00"
},
{
"name": "sebastian/object-enumerator",
- "version": "3.0.4",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2"
+ "reference": "ac5b293dba925751b808e02923399fb44ff0d541"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2",
- "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541",
+ "reference": "ac5b293dba925751b808e02923399fb44ff0d541",
"shasum": ""
},
"require": {
@@ -3182,7 +3387,7 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
- "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4"
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.5"
},
"funding": [
{
@@ -3190,20 +3395,20 @@
"type": "github"
}
],
- "time": "2020-11-30T07:40:27+00:00"
+ "time": "2024-03-01T13:54:02+00:00"
},
{
"name": "sebastian/object-reflector",
- "version": "1.1.2",
+ "version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d"
+ "reference": "1d439c229e61f244ff1f211e5c99737f90c67def"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d",
- "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def",
+ "reference": "1d439c229e61f244ff1f211e5c99737f90c67def",
"shasum": ""
},
"require": {
@@ -3237,7 +3442,7 @@
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
- "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2"
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.3"
},
"funding": [
{
@@ -3245,20 +3450,20 @@
"type": "github"
}
],
- "time": "2020-11-30T07:37:18+00:00"
+ "time": "2024-03-01T13:56:04+00:00"
},
{
"name": "sebastian/recursion-context",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb"
+ "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb",
- "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c",
+ "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c",
"shasum": ""
},
"require": {
@@ -3300,7 +3505,7 @@
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1"
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.2"
},
"funding": [
{
@@ -3308,20 +3513,20 @@
"type": "github"
}
],
- "time": "2020-11-30T07:34:24+00:00"
+ "time": "2024-03-01T14:07:30+00:00"
},
{
"name": "sebastian/resource-operations",
- "version": "2.0.2",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3"
+ "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3",
- "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/72a7f7674d053d548003b16ff5a106e7e0e06eee",
+ "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee",
"shasum": ""
},
"require": {
@@ -3351,8 +3556,7 @@
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"support": {
- "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
- "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2"
+ "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.3"
},
"funding": [
{
@@ -3360,20 +3564,20 @@
"type": "github"
}
],
- "time": "2020-11-30T07:30:19+00:00"
+ "time": "2024-03-01T13:59:09+00:00"
},
{
"name": "sebastian/type",
- "version": "1.1.4",
+ "version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4"
+ "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4",
- "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/18f071c3a29892b037d35e6b20ddf3ea39b42874",
+ "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874",
"shasum": ""
},
"require": {
@@ -3408,7 +3612,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/1.1.4"
+ "source": "https://github.com/sebastianbergmann/type/tree/1.1.5"
},
"funding": [
{
@@ -3416,7 +3620,7 @@
"type": "github"
}
],
- "time": "2020-11-30T07:25:11+00:00"
+ "time": "2024-03-01T14:04:07+00:00"
},
{
"name": "sebastian/version",
@@ -3528,12 +3732,12 @@
"version": "3.6.2",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "5e4e71592f69da17871dba6e80dd51bce74a351a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
"reference": "5e4e71592f69da17871dba6e80dd51bce74a351a",
"shasum": ""
},
@@ -3577,20 +3781,34 @@
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ }
+ ],
"time": "2021-12-12T21:44:58+00:00"
},
{
"name": "symfony/console",
- "version": "v5.4.28",
+ "version": "v5.4.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827"
+ "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827",
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827",
+ "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e",
+ "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e",
"shasum": ""
},
"require": {
@@ -3660,7 +3878,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.28"
+ "source": "https://github.com/symfony/console/tree/v5.4.36"
},
"funding": [
{
@@ -3676,20 +3894,20 @@
"type": "tidelift"
}
],
- "time": "2023-08-07T06:12:30+00:00"
+ "time": "2024-02-20T16:33:57+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v2.5.2",
+ "version": "v2.5.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
+ "reference": "80d075412b557d41002320b96a096ca65aa2c98d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d",
+ "reference": "80d075412b557d41002320b96a096ca65aa2c98d",
"shasum": ""
},
"require": {
@@ -3727,7 +3945,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3"
},
"funding": [
{
@@ -3743,20 +3961,83 @@
"type": "tidelift"
}
],
- "time": "2022-01-02T09:53:40+00:00"
+ "time": "2023-01-24T14:02:46+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v5.4.35",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "abe6d6f77d9465fed3cd2d029b29d03b56b56435"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/abe6d6f77d9465fed3cd2d029b29d03b56b56435",
+ "reference": "abe6d6f77d9465fed3cd2d029b29d03b56b56435",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Finds files and directories via an intuitive fluent interface",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/finder/tree/v5.4.35"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-23T13:51:25+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
- "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
"shasum": ""
},
"require": {
@@ -3770,9 +4051,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -3809,7 +4087,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
},
"funding": [
{
@@ -3825,20 +4103,20 @@
"type": "tidelift"
}
],
- "time": "2023-01-26T09:26:14+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "875e90aeea2777b6f135677f618529449334a612"
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612",
- "reference": "875e90aeea2777b6f135677f618529449334a612",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f",
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f",
"shasum": ""
},
"require": {
@@ -3849,9 +4127,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -3890,7 +4165,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0"
},
"funding": [
{
@@ -3906,20 +4181,20 @@
"type": "tidelift"
}
],
- "time": "2023-01-26T09:26:14+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92"
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
- "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
"shasum": ""
},
"require": {
@@ -3930,9 +4205,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -3974,7 +4246,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
},
"funding": [
{
@@ -3990,20 +4262,20 @@
"type": "tidelift"
}
],
- "time": "2023-01-26T09:26:14+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "42292d99c55abe617799667f454222c54c60e229"
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
- "reference": "42292d99c55abe617799667f454222c54c60e229",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": ""
},
"require": {
@@ -4017,9 +4289,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -4057,7 +4326,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
},
"funding": [
{
@@ -4073,20 +4342,20 @@
"type": "tidelift"
}
],
- "time": "2023-07-28T09:04:16+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5"
+ "reference": "21bd091060673a1177ae842c0ef8fe30893114d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5",
- "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2",
+ "reference": "21bd091060673a1177ae842c0ef8fe30893114d2",
"shasum": ""
},
"require": {
@@ -4094,9 +4363,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -4136,7 +4402,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0"
},
"funding": [
{
@@ -4152,20 +4418,20 @@
"type": "tidelift"
}
],
- "time": "2023-01-26T09:26:14+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.28.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
- "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
"shasum": ""
},
"require": {
@@ -4173,9 +4439,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.28-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -4219,7 +4482,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
},
"funding": [
{
@@ -4235,25 +4498,29 @@
"type": "tidelift"
}
],
- "time": "2023-01-26T09:26:14+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v2.2.0",
+ "version": "v2.5.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
+ "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
- "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3",
+ "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
- "psr/container": "^1.0"
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
},
"suggest": {
"symfony/service-implementation": ""
@@ -4261,7 +4528,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -4298,7 +4565,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/master"
+ "source": "https://github.com/symfony/service-contracts/tree/v2.5.3"
},
"funding": [
{
@@ -4314,20 +4581,20 @@
"type": "tidelift"
}
],
- "time": "2020-09-07T11:33:47+00:00"
+ "time": "2023-04-21T15:04:16+00:00"
},
{
"name": "symfony/string",
- "version": "v5.4.26",
+ "version": "v5.4.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "1181fe9270e373537475e826873b5867b863883c"
+ "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c",
- "reference": "1181fe9270e373537475e826873b5867b863883c",
+ "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b",
+ "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b",
"shasum": ""
},
"require": {
@@ -4384,7 +4651,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.4.26"
+ "source": "https://github.com/symfony/string/tree/v5.4.36"
},
"funding": [
{
@@ -4400,20 +4667,20 @@
"type": "tidelift"
}
],
- "time": "2023-06-28T12:46:07+00:00"
+ "time": "2024-02-01T08:49:30+00:00"
},
{
"name": "theseer/tokenizer",
- "version": "1.2.1",
+ "version": "1.2.3",
"source": {
"type": "git",
"url": "https://github.com/theseer/tokenizer.git",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
"shasum": ""
},
"require": {
@@ -4442,7 +4709,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": {
"issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
},
"funding": [
{
@@ -4450,7 +4717,7 @@
"type": "github"
}
],
- "time": "2021-07-28T10:34:58+00:00"
+ "time": "2024-03-03T12:36:25+00:00"
},
{
"name": "vimeo/psalm",
@@ -4735,5 +5002,5 @@
"ext-json": "*"
},
"platform-dev": [],
- "plugin-api-version": "2.3.0"
+ "plugin-api-version": "2.6.0"
}
diff --git a/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php b/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php
index c7722af4f..8e2a1346b 100644
--- a/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php
+++ b/lib/packages/Inpsyde/Modularity/Container/ContainerConfigurator.php
@@ -73,20 +73,16 @@ public function addFactory(string $id, callable $factory): void
*/
public function addService(string $id, callable $service): void
{
- if ($this->hasService($id)) {
- /*
- * We are being intentionally permissive here,
- * allowing a simple workflow for *intentional* overrides
- * while accepting the (small?) risk of *accidental* overrides
- * that could be hard to notice and debug.
- */
-
- /*
- * Clear a factory flag in case it was a factory.
- * If needs be, it will get re-added after this function completes.
- */
- unset($this->factoryIds[$id]);
- }
+ /*
+ * We are being intentionally permissive here,
+ * allowing a simple workflow for *intentional* overrides
+ * while accepting the (small?) risk of *accidental* overrides
+ * that could be hard to notice and debug.
+ *
+ * Clear a factory flag in case it was a factory.
+ * If needs be, it will get re-added after this function completes.
+ */
+ unset($this->factoryIds[$id]);
$this->services[$id] = $service;
}
diff --git a/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php b/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php
index 143b030db..f07f1fa69 100644
--- a/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php
+++ b/lib/packages/Inpsyde/Modularity/Container/PackageProxyContainer.php
@@ -34,9 +34,8 @@ public function __construct(Package $package)
*
* @throws \Exception
*/
- public function get($id)
+ public function get(string $id)
{
- assert(is_string($id));
$this->assertPackageBooted($id);
return $this->container->get($id);
@@ -48,10 +47,8 @@ public function get($id)
*
* @throws \Exception
*/
- public function has($id)
+ public function has(string $id): bool
{
- assert(is_string($id));
-
return $this->tryContainer() && $this->container->has($id);
}
@@ -67,7 +64,11 @@ private function tryContainer(): bool
return true;
}
- if ($this->package->statusIs(Package::STATUS_BOOTED)) {
+ /** TODO: We need a better way to deal with status checking besides equality */
+ if (
+ $this->package->statusIs(Package::STATUS_READY)
+ || $this->package->statusIs(Package::STATUS_BOOTED)
+ ) {
$this->container = $this->package->container();
}
@@ -90,8 +91,8 @@ private function assertPackageBooted(string $id): void
$name = $this->package->name();
$status = $this->package->statusIs(Package::STATUS_FAILED)
- ? 'failed booting'
- : 'is not booted yet';
+ ? 'is errored'
+ : 'is not ready yet';
throw new class ("Error retrieving service {$id} because package {$name} {$status}.")
extends \Exception
diff --git a/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php b/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php
index ee082fa0c..83008ceb3 100644
--- a/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php
+++ b/lib/packages/Inpsyde/Modularity/Container/ReadOnlyContainer.php
@@ -61,10 +61,8 @@ public function __construct(
*
* @return mixed
*/
- public function get($id)
+ public function get(string $id)
{
- assert(is_string($id));
-
if (array_key_exists($id, $this->resolvedServices)) {
return $this->resolvedServices[$id];
}
@@ -100,10 +98,8 @@ public function get($id)
*
* @return bool
*/
- public function has($id)
+ public function has(string $id): bool
{
- assert(is_string($id));
-
if (array_key_exists($id, $this->services)) {
return true;
}
diff --git a/lib/packages/Inpsyde/Modularity/Package.php b/lib/packages/Inpsyde/Modularity/Package.php
index 72b24d7ee..94f0b5089 100644
--- a/lib/packages/Inpsyde/Modularity/Package.php
+++ b/lib/packages/Inpsyde/Modularity/Package.php
@@ -72,7 +72,22 @@ class Package
public const ACTION_READY = 'ready';
/**
- * Custom action which is triggered when application failed to boot.
+ * Custom action which is triggered when a failure happens during the building stage.
+ *
+ * @example
+ *
+ * $package = Package::new();
+ *
+ * add_action(
+ * $package->hookName(Package::ACTION_FAILED_BUILD),
+ * $callback
+ * );
+ *
+ */
+ public const ACTION_FAILED_BUILD = 'failed-build';
+
+ /**
+ * Custom action which is triggered when a failure happens during the booting stage.
*
* @example
*
@@ -103,7 +118,7 @@ class Package
*
* $package = Package::new();
* $package->moduleIs(SomeModule::class, Package::MODULE_ADDED); // false
- * $package->boot(new SomeModule());
+ * $package->addModule(new SomeModule());
* $package->moduleIs(SomeModule::class, Package::MODULE_ADDED); // true
*
*/
@@ -129,6 +144,8 @@ class Package
*/
public const STATUS_IDLE = 2;
public const STATUS_INITIALIZED = 4;
+ public const STATUS_MODULES_ADDED = 5;
+ public const STATUS_READY = 7;
public const STATUS_BOOTED = 8;
public const STATUS_FAILED = -8;
@@ -175,6 +192,21 @@ class Package
*/
private $containerConfigurator;
+ /**
+ * @var bool
+ */
+ private $built = false;
+
+ /**
+ * @var bool
+ */
+ private $hasContainer = false;
+
+ /**
+ * @var \Throwable|null
+ */
+ private $lastError = null;
+
/**
* @param Properties $properties
* @param ContainerInterface[] $containers
@@ -211,23 +243,36 @@ static function () use ($properties) {
*/
public function addModule(Module $module): Package
{
- $this->assertStatus(self::STATUS_IDLE, 'access Container');
-
- $registeredServices = $this->addModuleServices($module, self::MODULE_REGISTERED);
- $registeredFactories = $this->addModuleServices($module, self::MODULE_REGISTERED_FACTORIES);
- $extended = $this->addModuleServices($module, self::MODULE_EXTENDED);
- $isExecutable = $module instanceof ExecutableModule;
-
- // ExecutableModules are collected and executed on Package::boot()
- // when the Container is being compiled.
- if ($isExecutable) {
- /** @var ExecutableModule $module */
- $this->executables[] = $module;
- }
+ try {
+ $this->assertStatus(self::STATUS_IDLE, sprintf('add module %s', $module->id()));
+
+ $registeredServices = $this->addModuleServices(
+ $module,
+ self::MODULE_REGISTERED
+ );
+ $registeredFactories = $this->addModuleServices(
+ $module,
+ self::MODULE_REGISTERED_FACTORIES
+ );
+ $extended = $this->addModuleServices(
+ $module,
+ self::MODULE_EXTENDED
+ );
+ $isExecutable = $module instanceof ExecutableModule;
+
+ // ExecutableModules are collected and executed on Package::boot()
+ // when the Container is being compiled.
+ if ($isExecutable) {
+ /** @var ExecutableModule $module */
+ $this->executables[] = $module;
+ }
- $added = $registeredServices || $registeredFactories || $extended || $isExecutable;
- $status = $added ? self::MODULE_ADDED : self::MODULE_NOT_ADDED;
- $this->moduleProgress($module->id(), $status);
+ $added = $registeredServices || $registeredFactories || $extended || $isExecutable;
+ $status = $added ? self::MODULE_ADDED : self::MODULE_NOT_ADDED;
+ $this->moduleProgress($module->id(), $status);
+ } catch (\Throwable $throwable) {
+ $this->handleFailure($throwable, self::ACTION_FAILED_BUILD);
+ }
return $this;
}
@@ -239,68 +284,107 @@ public function addModule(Module $module): Package
*/
public function connect(Package $package): bool
{
- if (($package === $this)) {
- return false;
- }
+ try {
+ if ($package === $this) {
+ return false;
+ }
- $packageName = $package->name();
- $errorData = ['package' => $packageName, 'status' => $this->status];
+ $packageName = $package->name();
+ $errorData = ['package' => $packageName, 'status' => $this->status];
+ $errorMessage = "Failed connecting package {$packageName}";
- // Don't connect, if already connected
- if (array_key_exists($packageName, $this->connectedPackages)) {
- do_action(
- $this->hookName(self::ACTION_FAILED_CONNECTION),
- $packageName,
- new \WP_Error('already_connected', 'already connected', $errorData)
+ // Don't connect, if already connected
+ if (array_key_exists($packageName, $this->connectedPackages)) {
+ $error = "{$errorMessage} because it was already connected.";
+ do_action(
+ $this->hookName(self::ACTION_FAILED_CONNECTION),
+ $packageName,
+ new \WP_Error('already_connected', $error, $errorData)
+ );
+
+ throw new \Exception($error, 0, $this->lastError);
+ }
+
+ // Don't connect, if already booted or boot failed
+ $failed = $this->statusIs(self::STATUS_FAILED);
+ if ($failed || $this->statusIs(self::STATUS_BOOTED)) {
+ $status = $failed ? 'errored' : 'booted';
+ $error = "{$errorMessage} to a {$status} package.";
+ do_action(
+ $this->hookName(self::ACTION_FAILED_CONNECTION),
+ $packageName,
+ new \WP_Error("no_connect_on_{$status}", $error, $errorData)
+ );
+
+ throw new \Exception($error, 0, $this->lastError);
+ }
+
+ $this->connectedPackages[$packageName] = true;
+
+ // We put connected package's properties in this package's container, so that in modules
+ // "run" method we can access them if we need to.
+ $this->containerConfigurator->addService(
+ sprintf('%s.%s', $package->name(), self::PROPERTIES),
+ static function () use ($package): Properties {
+ return $package->properties();
+ }
);
- return false;
- }
+ // If the other package is booted, we can obtain a container, otherwise
+ // we build a proxy container
+ $container = $package->statusIs(self::STATUS_BOOTED)
+ ? $package->container()
+ : new PackageProxyContainer($package);
+
+ $this->containerConfigurator->addContainer($container);
- // Don't connect, if already booted or boot failed
- if (in_array($this->status, [self::STATUS_BOOTED, self::STATUS_FAILED], true)) {
- $this->connectedPackages[$packageName] = false;
do_action(
- $this->hookName(self::ACTION_FAILED_CONNECTION),
+ $this->hookName(self::ACTION_PACKAGE_CONNECTED),
$packageName,
- new \WP_Error('no_connect_status', 'no connect status', $errorData)
+ $this->status,
+ $container instanceof PackageProxyContainer
);
- return false;
- }
-
- $this->connectedPackages[$packageName] = true;
-
- // We put connected package's properties in this package's container, so that in modules
- // "run" method we can access them if we need to.
- $this->containerConfigurator->addService(
- sprintf('%s.%s', $package->name(), self::PROPERTIES),
- static function () use ($package): Properties {
- return $package->properties();
+ return true;
+ } catch (\Throwable $throwable) {
+ if (isset($packageName)) {
+ $this->connectedPackages[$packageName] = false;
}
- );
+ $this->handleFailure($throwable, self::ACTION_FAILED_BUILD);
- // If the other package is booted, we can obtain a container, otherwise
- // we build a proxy container
- $container = $package->statusIs(self::STATUS_BOOTED)
- ? $package->container()
- : new PackageProxyContainer($package);
+ return false;
+ }
+ }
- $this->containerConfigurator->addContainer($container);
+ /**
+ * @return static
+ */
+ public function build(): Package
+ {
+ try {
+ // Don't allow building the application multiple times.
+ $this->assertStatus(self::STATUS_IDLE, 'build package');
- do_action(
- $this->hookName(self::ACTION_PACKAGE_CONNECTED),
- $packageName,
- $this->status,
- $container instanceof PackageProxyContainer
- );
+ do_action(
+ $this->hookName(self::ACTION_INIT),
+ $this
+ );
+ // Changing the status here ensures we can not call this method again, and also we can not
+ // add new modules, because both this and `addModule()` methods check for idle status.
+ // For backward compatibility, adding new modules via `boot()` will still be possible, even
+ // if deprecated, at the condition that the container was not yet accessed at that point.
+ $this->progress(self::STATUS_INITIALIZED);
+ } catch (\Throwable $throwable) {
+ $this->handleFailure($throwable, self::ACTION_FAILED_BUILD);
+ } finally {
+ $this->built = true;
+ }
- return true;
+ return $this;
}
/**
- * @param Module ...$defaultModules
- *
+ * @param Module ...$defaultModules Deprecated, use `addModule()` to add default modules.
* @return bool
*
* @throws \Throwable
@@ -308,35 +392,26 @@ static function () use ($package): Properties {
public function boot(Module ...$defaultModules): bool
{
try {
- // don't allow to boot the application multiple times.
- $this->assertStatus(self::STATUS_IDLE, 'execute boot');
+ // Call build() if not called yet, and ensure any new module passed here is added
+ // as well, throwing if the container was already built.
+ $this->doBuild(...$defaultModules);
- // Add default Modules to the Application.
- array_map([$this, 'addModule'], $defaultModules);
+ // Don't allow booting the application multiple times.
+ $this->assertStatus(self::STATUS_MODULES_ADDED, 'boot application', '<');
+ $this->assertStatus(self::STATUS_FAILED, 'boot application', '!=');
- do_action(
- $this->hookName(self::ACTION_INIT),
- $this
- );
- // we want to lock adding new Modules and Containers now
- // to process everything and be able to compile the container.
- $this->progress(self::STATUS_INITIALIZED);
+ $this->progress(self::STATUS_MODULES_ADDED);
- if (count($this->executables) > 0) {
- $this->doExecute();
- }
+ $this->doExecute();
+
+ $this->progress(self::STATUS_READY);
do_action(
$this->hookName(self::ACTION_READY),
$this
);
} catch (\Throwable $throwable) {
- $this->progress(self::STATUS_FAILED);
- do_action($this->hookName(self::ACTION_FAILED_BOOT), $throwable);
-
- if ($this->properties->isDebug()) {
- throw $throwable;
- }
+ $this->handleFailure($throwable, self::ACTION_FAILED_BOOT);
return false;
}
@@ -346,6 +421,60 @@ public function boot(Module ...$defaultModules): bool
return true;
}
+ /**
+ * @param Module ...$defaultModules
+ * @return void
+ */
+ private function doBuild(Module ...$defaultModules): void
+ {
+ if ($defaultModules) {
+ $this->deprecatedArgument(
+ sprintf(
+ 'Passing default modules to %1$s::boot() is deprecated since version 1.7.0.'
+ . ' Please add modules via %1$s::addModule().',
+ __CLASS__
+ ),
+ __METHOD__,
+ '1.7.0'
+ );
+ }
+
+ if (!$this->built) {
+ array_map([$this, 'addModule'], $defaultModules);
+ $this->build();
+
+ return;
+ }
+
+ if (
+ !$defaultModules
+ || ($this->status >= self::STATUS_MODULES_ADDED)
+ || ($this->statusIs(self::STATUS_FAILED))
+ ) {
+ // if we don't have default modules, there's nothing to do, and if the status is beyond
+ // "modules added" or is failed, we do nothing as well and let `boot()` throw.
+ return;
+ }
+
+ $backup = $this->status;
+
+ try {
+ // simulate idle status to prevent `addModule()` from throwing
+ // only if we don't have a container yet
+ $this->hasContainer or $this->status = self::STATUS_IDLE;
+
+ foreach ($defaultModules as $defaultModule) {
+ // If a module was added by `build()` or `addModule()` we can skip it, a
+ // deprecation was trigger to make it noticeable without breakage
+ if (!$this->moduleIs($defaultModule->id(), self::MODULE_ADDED)) {
+ $this->addModule($defaultModule);
+ }
+ }
+ } finally {
+ $this->status = $backup;
+ }
+ }
+
/**
* @param Module $module
* @param string $status
@@ -410,23 +539,23 @@ private function doExecute(): void
/**
* @param string $moduleId
- * @param string $type
+ * @param string $status
* @param list|null $serviceIds
*
* @return void
*/
- private function moduleProgress(string $moduleId, string $type, ?array $serviceIds = null)
+ private function moduleProgress(string $moduleId, string $status, ?array $serviceIds = null)
{
- isset($this->moduleStatus[$type]) or $this->moduleStatus[$type] = [];
- $this->moduleStatus[$type][] = $moduleId;
+ isset($this->moduleStatus[$status]) or $this->moduleStatus[$status] = [];
+ $this->moduleStatus[$status][] = $moduleId;
if (!$serviceIds || !$this->properties->isDebug()) {
- $this->moduleStatus[self::MODULES_ALL][] = "{$moduleId} {$type}";
+ $this->moduleStatus[self::MODULES_ALL][] = "{$moduleId} {$status}";
return;
}
- $description = sprintf('%s %s (%s)', $moduleId, $type, implode(', ', $serviceIds));
+ $description = sprintf('%s %s (%s)', $moduleId, $status, implode(', ', $serviceIds));
$this->moduleStatus[self::MODULES_ALL][] = $description;
}
@@ -507,7 +636,8 @@ public function properties(): Properties
*/
public function container(): ContainerInterface
{
- $this->assertStatus(self::STATUS_INITIALIZED, 'access Container', '>=');
+ $this->assertStatus(self::STATUS_INITIALIZED, 'obtain the container instance', '>=');
+ $this->hasContainer = true;
return $this->containerConfigurator->createReadOnlyContainer();
}
@@ -538,6 +668,25 @@ public function statusIs(int $status): bool
return $this->status === $status;
}
+ /**
+ * @param \Throwable $throwable
+ * @param Package::ACTION_FAILED_* $action
+ * @return void
+ * @throws \Throwable
+ */
+ private function handleFailure(\Throwable $throwable, string $action): void
+ {
+ $this->progress(self::STATUS_FAILED);
+ $hook = $this->hookName($action);
+ did_action($hook) or do_action($hook, $throwable);
+
+ if ($this->properties->isDebug()) {
+ throw $throwable;
+ }
+
+ $this->lastError = $throwable;
+ }
+
/**
* @param int $status
* @param string $action
@@ -549,7 +698,30 @@ public function statusIs(int $status): bool
private function assertStatus(int $status, string $action, string $operator = '=='): void
{
if (!version_compare((string) $this->status, (string) $status, $operator)) {
- throw new \Exception(sprintf("Can't %s at this point of application.", $action));
+ throw new \Exception(
+ sprintf("Can't %s at this point of application.", $action),
+ 0,
+ $this->lastError
+ );
+ }
+ }
+
+ /**
+ * Similar to WP's `_deprecated_argument()`, but executes regardless of WP_DEBUG and without
+ * translated message (so without attempting loading translation files).
+ *
+ * @param string $message
+ * @param string $function
+ * @param string $version
+ *
+ * @return void
+ */
+ private function deprecatedArgument(string $message, string $function, string $version): void
+ {
+ do_action('deprecated_argument_run', $function, $message, $version);
+
+ if (apply_filters('deprecated_argument_trigger_error', true)) {
+ trigger_error($message, \E_USER_DEPRECATED);
}
}
}
diff --git a/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php b/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php
index 3c4a7d97f..57fda2beb 100644
--- a/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php
+++ b/lib/packages/Inpsyde/Modularity/Properties/PluginProperties.php
@@ -17,6 +17,7 @@ class PluginProperties extends BaseProperties
* Custom properties for Plugins.
*/
public const PROP_NETWORK = 'network';
+ public const PROP_REQUIRES_PLUGINS = 'requiresPlugins';
/**
* Available methods of Properties::__call()
* from plugin headers.
@@ -37,12 +38,18 @@ class PluginProperties extends BaseProperties
// additional headers
self::PROP_NETWORK => 'Network',
+ self::PROP_REQUIRES_PLUGINS => 'RequiresPlugins',
];
/**
* @var string
*/
- private $pluginFile;
+ private $pluginMainFile;
+
+ /**
+ * @var string
+ */
+ private $pluginBaseName;
/**
* @var bool|null
@@ -80,7 +87,9 @@ protected function __construct(string $pluginMainFile)
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
- $pluginData = get_plugin_data($pluginMainFile);
+ // $markup = false, to avoid an incorrect early wptexturize call. Also we probably don't want HTML here anyway
+ // @see https://core.trac.wordpress.org/ticket/49965
+ $pluginData = get_plugin_data($pluginMainFile, false);
$properties = Properties::DEFAULT_PROPERTIES;
// Map pluginData to internal structure.
@@ -90,20 +99,28 @@ protected function __construct(string $pluginMainFile)
}
$properties = array_merge($properties, $pluginData);
- $this->pluginFile = $pluginMainFile;
+ $this->pluginMainFile = wp_normalize_path($pluginMainFile);
- $baseName = plugin_basename($pluginMainFile);
+ $this->pluginBaseName = plugin_basename($pluginMainFile);
$basePath = plugin_dir_path($pluginMainFile);
$baseUrl = plugins_url('/', $pluginMainFile);
parent::__construct(
- $baseName,
+ $this->pluginBaseName,
$basePath,
$baseUrl,
$properties
);
}
+ /**
+ * @return string
+ */
+ public function pluginMainFile(): string
+ {
+ return $this->pluginMainFile;
+ }
+
/**
* @return bool
*
@@ -114,6 +131,16 @@ public function network(): bool
return (bool) $this->get(self::PROP_NETWORK, false);
}
+ /**
+ * @return array
+ */
+ public function requiresPlugins(): array
+ {
+ $value = $this->get(self::PROP_REQUIRES_PLUGINS);
+
+ return $value && is_string($value) ? explode(',', $value) : [];
+ }
+
/**
* @return bool
*/
@@ -123,7 +150,7 @@ public function isActive(): bool
if (!function_exists('is_plugin_active')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
- $this->isActive = is_plugin_active($this->pluginFile);
+ $this->isActive = is_plugin_active($this->pluginBaseName);
}
return $this->isActive;
@@ -138,7 +165,7 @@ public function isNetworkActive(): bool
if (!function_exists('is_plugin_active_for_network')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
- $this->isNetworkActive = is_plugin_active_for_network($this->pluginFile);
+ $this->isNetworkActive = is_plugin_active_for_network($this->pluginBaseName);
}
return $this->isNetworkActive;
@@ -155,7 +182,7 @@ public function isMuPlugin(): bool
* @psalm-suppress MixedArgument
*/
$muPluginDir = wp_normalize_path(WPMU_PLUGIN_DIR);
- $this->isMu = strpos($this->pluginFile, $muPluginDir) === 0;
+ $this->isMu = strpos($this->pluginMainFile, $muPluginDir) === 0;
}
return $this->isMu;
diff --git a/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php b/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
index 3535c391e..7f0f9af32 100644
--- a/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
+++ b/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
@@ -26,15 +26,15 @@ class ThemeProperties extends BaseProperties
*/
protected const HEADERS = [
self::PROP_AUTHOR => 'Author',
- self::PROP_AUTHOR_URI => 'Author URI',
+ self::PROP_AUTHOR_URI => 'AuthorURI',
self::PROP_DESCRIPTION => 'Description',
- self::PROP_DOMAIN_PATH => 'Domain Path',
- self::PROP_NAME => 'Theme Name',
- self::PROP_TEXTDOMAIN => 'Text Domain',
- self::PROP_URI => 'Theme URI',
+ self::PROP_DOMAIN_PATH => 'DomainPath',
+ self::PROP_NAME => 'Name',
+ self::PROP_TEXTDOMAIN => 'TextDomain',
+ self::PROP_URI => 'ThemeURI',
self::PROP_VERSION => 'Version',
- self::PROP_REQUIRES_WP => 'Requires at least',
- self::PROP_REQUIRES_PHP => 'Requires PHP',
+ self::PROP_REQUIRES_WP => 'RequiresWP',
+ self::PROP_REQUIRES_PHP => 'RequiresPHP',
// additional headers
self::PROP_STATUS => 'Status',
@@ -72,7 +72,7 @@ protected function __construct(string $themeDirectory)
}
$baseName = $theme->get_stylesheet();
- $basePath = $theme->get_template_directory();
+ $basePath = $theme->get_stylesheet_directory();
$baseUrl = (string) trailingslashit($theme->get_stylesheet_directory_uri());
parent::__construct(
diff --git a/lib/packages/Psr/Container/ContainerExceptionInterface.php b/lib/packages/Psr/Container/ContainerExceptionInterface.php
index 0cc7d5e86..013ff19fd 100644
--- a/lib/packages/Psr/Container/ContainerExceptionInterface.php
+++ b/lib/packages/Psr/Container/ContainerExceptionInterface.php
@@ -1,7 +1,4 @@
message = "The {$this->pluginDisplayName} plugin has to be version "
. $this->requiredVersion
From 670bc80f6ae5a6f804f267af49bed26ab8ded971 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Tue, 15 Oct 2024 12:11:27 +0200
Subject: [PATCH 02/17] Remove languages from release package
---
.distignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.distignore b/.distignore
index d0c5bdb8b..eca30b739 100644
--- a/.distignore
+++ b/.distignore
@@ -6,7 +6,7 @@ resources/
!vendor/mollie/mollie-api-php/Resources
vendor/**/test*
vendor/mollie/mollie-api-php/examples/
-languages/*.po
+languages/
bin/
*.lock
composer.json
From 42472455282703d04fb8fd7abd4442f02d1a4cf7 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Tue, 15 Oct 2024 12:22:47 +0200
Subject: [PATCH 03/17] Remove language handling functionality
---
.psalm/stubs.php | 1 -
inc/utils.php | 44 -----------------------------
mollie-payments-for-woocommerce.php | 16 -----------
src/Activation/ActivationModule.php | 15 ----------
4 files changed, 76 deletions(-)
diff --git a/.psalm/stubs.php b/.psalm/stubs.php
index b0916a8fc..dc6613dff 100644
--- a/.psalm/stubs.php
+++ b/.psalm/stubs.php
@@ -4,7 +4,6 @@ function as_unschedule_action($string) {}
function mollieWooCommerceIsCheckoutContext() {}
function wcs_get_subscriptions($subs) {}
function mollieWooCommerceFormatCurrencyValue($value, $currency){}
-function mollieDeleteWPTranslationFiles(){}
function mollieWooCommerceIsPayPalButtonEnabled($page){}
function mollieWooCommerceIsApplePayDirectEnabled($page){}
function mollieWooCommerceCheckIfNeedShipping($product){}
diff --git a/inc/utils.php b/inc/utils.php
index 75427b863..2acee663a 100644
--- a/inc/utils.php
+++ b/inc/utils.php
@@ -190,50 +190,6 @@ function mollieWooCommerceFormatCurrencyValue($value, $currency)
return number_format($value, 2, '.', '');
}
-function mollieUpdateCompleted($upgrader_object, $options)
-{
- //whenever something gets updated they update the languages, we need to delete them
- mollieDeleteWPTranslationFiles();
-}
-
-function mollieDeleteWPTranslationFiles()
-{
- if (!function_exists('WP_Filesystem')) {
- require_once ABSPATH . '/wp-admin/includes/file.php';
- }
- WP_Filesystem();
- global $wp_filesystem;
- if (!$wp_filesystem) {
- return;
- }
- $remote_destination = $wp_filesystem->find_folder(WP_LANG_DIR);
- if (!$wp_filesystem->exists($remote_destination)) {
- return;
- }
- $languageExtensions = [
- 'de_DE',
- 'de_DE_formal',
- 'es_ES',
- 'fr_FR',
- 'it_IT',
- 'nl_BE',
- 'nl_NL',
- 'nl_NL_formal',
- 'en_GB',
- 'nl_BE_formal',
- ];
- $translationExtensions = ['.mo', '.po', '.l10n.php'];
- $destination = WP_LANG_DIR
- . '/plugins/mollie-payments-for-woocommerce-';
- foreach ($languageExtensions as $languageExtension) {
- foreach ($translationExtensions as $translationExtension) {
- $file = $destination . $languageExtension
- . $translationExtension;
- $wp_filesystem->delete($file, false);
- }
- }
-}
-
function transformPhoneToNLFormat($phone)
{
$startsWith06 = preg_match('/^06/', $phone);
diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php
index 2085bf537..fbafd7de6 100644
--- a/mollie-payments-for-woocommerce.php
+++ b/mollie-payments-for-woocommerce.php
@@ -47,20 +47,6 @@
define('M4W_PLUGIN_URL', plugin_dir_url(M4W_FILE));
}
-/**
- * Called when plugin is activated
- */
-function mollie_wc_plugin_activation_hook()
-{
- require_once __DIR__ . '/inc/functions.php';
-
- if (!mollie_wc_plugin_autoload()) {
- return;
- }
-
- mollieDeleteWPTranslationFiles();
-}
-
function mollie_wc_plugin_autoload()
{
@@ -174,5 +160,3 @@ function initialize()
}
add_action('plugins_loaded', __NAMESPACE__ . '\\initialize');
-
-register_activation_hook(M4W_FILE, __NAMESPACE__ . '\mollie_wc_plugin_activation_hook');
diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php
index 598bcef29..cfab7d182 100644
--- a/src/Activation/ActivationModule.php
+++ b/src/Activation/ActivationModule.php
@@ -41,7 +41,6 @@ public function run(ContainerInterface $container): bool
[$this, 'pluginInit']
);
$this->declareCompatibleWithHPOS();
- $this->handleTranslations();
$this->mollieWcNoticeApiKeyMissing();
$this->appleValidationFileRewriteRules();
return true;
@@ -77,20 +76,6 @@ public function initDb()
}
}
- /**
- *
- */
- public function handleTranslations(): void
- {
- add_action('upgrader_process_complete', 'mollieUpdateCompleted', 10, 2);
- // we need to handle this version specifically, we can remove this on the next
- $translationFlag = get_option('mollie_plugin_update_translation');
- if ($translationFlag !== 'yes') {
- mollieDeleteWPTranslationFiles();
- update_option('mollie_plugin_update_translation', 'yes');
- }
- }
-
/**
*
*/
From 73eb2bed7d77bd9b6c9fd003f667d5d84a9fb300 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Tue, 15 Oct 2024 12:40:07 +0200
Subject: [PATCH 04/17] Delete old scoped lib file
---
.../Modularity/Properties/ThemeProperties.php | 131 ------------------
1 file changed, 131 deletions(-)
delete mode 100644 lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
diff --git a/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php b/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
deleted file mode 100644
index 7f0f9af32..000000000
--- a/lib/packages/Inpsyde/Modularity/Properties/ThemeProperties.php
+++ /dev/null
@@ -1,131 +0,0 @@
- 'Author',
- self::PROP_AUTHOR_URI => 'AuthorURI',
- self::PROP_DESCRIPTION => 'Description',
- self::PROP_DOMAIN_PATH => 'DomainPath',
- self::PROP_NAME => 'Name',
- self::PROP_TEXTDOMAIN => 'TextDomain',
- self::PROP_URI => 'ThemeURI',
- self::PROP_VERSION => 'Version',
- self::PROP_REQUIRES_WP => 'RequiresWP',
- self::PROP_REQUIRES_PHP => 'RequiresPHP',
-
- // additional headers
- self::PROP_STATUS => 'Status',
- self::PROP_TAGS => 'Tags',
- self::PROP_TEMPLATE => 'Template',
- ];
-
- /**
- * @param string $themeDirectory
- *
- * @return ThemeProperties
- */
- public static function new(string $themeDirectory): ThemeProperties
- {
- return new self($themeDirectory);
- }
-
- /**
- * ThemeProperties constructor.
- *
- * @param string $themeDirectory
- */
- protected function __construct(string $themeDirectory)
- {
- if (!function_exists('wp_get_theme')) {
- require_once ABSPATH . 'wp-includes/theme.php';
- }
-
- $theme = wp_get_theme($themeDirectory);
- $properties = Properties::DEFAULT_PROPERTIES;
-
- foreach (self::HEADERS as $key => $themeKey) {
- /** @psalm-suppress DocblockTypeContradiction */
- $properties[$key] = $theme->get($themeKey) ?? '';
- }
-
- $baseName = $theme->get_stylesheet();
- $basePath = $theme->get_stylesheet_directory();
- $baseUrl = (string) trailingslashit($theme->get_stylesheet_directory_uri());
-
- parent::__construct(
- $baseName,
- $basePath,
- $baseUrl,
- $properties
- );
- }
-
- /**
- * If the theme is published.
- *
- * @return string
- */
- public function status(): string
- {
- return (string) $this->get(self::PROP_STATUS);
- }
-
- public function template(): string
- {
- return (string) $this->get(self::PROP_TEMPLATE);
- }
-
- /**
- * @return bool
- */
- public function isChildTheme(): bool
- {
- return (bool) $this->template();
- }
-
- /**
- * @return bool
- */
- public function isCurrentTheme(): bool
- {
- return get_stylesheet() === $this->baseName();
- }
-
- /**
- * @return ThemeProperties|null
- */
- public function parentThemeProperties(): ?ThemeProperties
- {
- $template = $this->template();
- if (!$template) {
- return null;
- }
-
- $parent = wp_get_theme($template, get_theme_root($template));
-
- return static::new($parent->get_template_directory());
- }
-}
From a03a19a3cdead5ef71014e626b1990085401c747 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Tue, 15 Oct 2024 12:45:31 +0200
Subject: [PATCH 05/17] Update composer lock
---
composer.lock | 1132 ++++++++++++++++++++++---------------------------
1 file changed, 516 insertions(+), 616 deletions(-)
diff --git a/composer.lock b/composer.lock
index e64244ff3..2243f5e96 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "7ef59c6774630f802cf820169b9ca74a",
+ "content-hash": "afd1fef3a31e6c8742cf9df94a0ca170",
"packages": [
{
"name": "composer/ca-bundle",
- "version": "1.5.0",
+ "version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99"
+ "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99",
- "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137",
+ "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137",
"shasum": ""
},
"require": {
@@ -27,8 +27,8 @@
},
"require-dev": {
"phpstan/phpstan": "^1.10",
- "psr/log": "^1.0",
- "symfony/phpunit-bridge": "^4.2 || ^5",
+ "phpunit/phpunit": "^8 || ^9",
+ "psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"type": "library",
@@ -64,7 +64,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/ca-bundle/issues",
- "source": "https://github.com/composer/ca-bundle/tree/1.5.0"
+ "source": "https://github.com/composer/ca-bundle/tree/1.5.2"
},
"funding": [
{
@@ -80,20 +80,78 @@
"type": "tidelift"
}
],
- "time": "2024-03-15T14:00:32+00:00"
+ "time": "2024-09-25T07:49:53+00:00"
+ },
+ {
+ "name": "inpsyde/modularity",
+ "version": "1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/inpsyde/modularity.git",
+ "reference": "2119d0e32706741a3c6dc0a85d908ec19ebf142e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/inpsyde/modularity/zipball/2119d0e32706741a3c6dc0a85d908ec19ebf142e",
+ "reference": "2119d0e32706741a3c6dc0a85d908ec19ebf142e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": ">=7.4 <8.4",
+ "psr/container": "^1.1.0 || ^2"
+ },
+ "require-dev": {
+ "brain/monkey": "^2.6.1",
+ "inpsyde/php-coding-standards": "^2@dev",
+ "inpsyde/wp-stubs-versions": "dev-latest",
+ "mikey179/vfsstream": "^v1.6.11",
+ "phpunit/phpunit": "^9.6.19",
+ "roots/wordpress-no-content": "@dev",
+ "vimeo/psalm": "^5.24.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Inpsyde\\Modularity\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Inpsyde GmbH",
+ "email": "hello@inpsyde.com",
+ "homepage": "https://inpsyde.com/",
+ "role": "Company"
+ }
+ ],
+ "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.",
+ "support": {
+ "issues": "https://github.com/inpsyde/modularity/issues",
+ "source": "https://github.com/inpsyde/modularity/tree/1.10.0"
+ },
+ "time": "2024-09-03T10:42:50+00:00"
},
{
"name": "mollie/mollie-api-php",
- "version": "v2.66.0",
+ "version": "v2.73.0",
"source": {
"type": "git",
"url": "https://github.com/mollie/mollie-api-php.git",
- "reference": "d7d09ac62a565e818bf49d04acb2f0432da758a9"
+ "reference": "0a26175492d4c55bb461e44fe3e63546539b81c1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d7d09ac62a565e818bf49d04acb2f0432da758a9",
- "reference": "d7d09ac62a565e818bf49d04acb2f0432da758a9",
+ "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/0a26175492d4c55bb461e44fe3e63546539b81c1",
+ "reference": "0a26175492d4c55bb461e44fe3e63546539b81c1",
"shasum": ""
},
"require": {
@@ -107,7 +165,7 @@
"eloquent/liberator": "^2.0||^3.0",
"friendsofphp/php-cs-fixer": "^3.0",
"guzzlehttp/guzzle": "^6.3 || ^7.0",
- "phpstan/phpstan": "^1.4",
+ "phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^8.5 || ^9.5"
},
"suggest": {
@@ -170,9 +228,62 @@
],
"support": {
"issues": "https://github.com/mollie/mollie-api-php/issues",
- "source": "https://github.com/mollie/mollie-api-php/tree/v2.66.0"
+ "source": "https://github.com/mollie/mollie-api-php/tree/v2.73.0"
+ },
+ "time": "2024-09-30T13:16:57+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "9fc7aab7a78057a124384358ebae8a1711b6f6fc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/9fc7aab7a78057a124384358ebae8a1711b6f6fc",
+ "reference": "9fc7aab7a78057a124384358ebae8a1711b6f6fc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
},
- "time": "2024-03-19T13:33:42+00:00"
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/1.1.0"
+ },
+ "time": "2021-03-05T15:48:30+00:00"
},
{
"name": "psr/log",
@@ -223,6 +334,53 @@
"source": "https://github.com/php-fig/log/tree/1.1.4"
},
"time": "2021-05-03T11:20:27+00:00"
+ },
+ {
+ "name": "sniccowp/php-scoper-wordpress-excludes",
+ "version": "6.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/snicco/php-scoper-wordpress-excludes.git",
+ "reference": "b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/snicco/php-scoper-wordpress-excludes/zipball/b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15",
+ "reference": "b87d7455bdf05c25f9a688fc3862bb3f2b7c8b15",
+ "shasum": ""
+ },
+ "require-dev": {
+ "php": "^7.4",
+ "php-stubs/wordpress-globals": "0.2.0",
+ "php-stubs/wordpress-stubs": "6.6.2",
+ "sniccowp/php-scoper-excludes": "dev-master"
+ },
+ "type": "library",
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Calvin Alkan",
+ "email": "calvin@snicco.de"
+ },
+ {
+ "name": "Marlon Alkan",
+ "email": "marlon@snicco.de"
+ }
+ ],
+ "description": "A list of all WordPress core classes, functions and constants. Meant to be used with the PHP-Scoper exclusion functionality.",
+ "keywords": [
+ "php-scoper",
+ "scoping WordPress",
+ "wordpress"
+ ],
+ "support": {
+ "issues": "https://github.com/snicco/php-scoper-wordpress-excludes/issues",
+ "source": "https://github.com/snicco/php-scoper-wordpress-excludes/tree/6.6.2"
+ },
+ "time": "2024-10-01T00:32:14+00:00"
}
],
"packages-dev": [
@@ -317,16 +475,16 @@
},
{
"name": "amphp/byte-stream",
- "version": "v1.8.1",
+ "version": "v1.8.2",
"source": {
"type": "git",
"url": "https://github.com/amphp/byte-stream.git",
- "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd"
+ "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd",
- "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd",
+ "url": "https://api.github.com/repos/amphp/byte-stream/zipball/4f0e968ba3798a423730f567b1b50d3441c16ddc",
+ "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc",
"shasum": ""
},
"require": {
@@ -342,11 +500,6 @@
"psalm/phar": "^3.11.4"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
"autoload": {
"files": [
"lib/functions.php"
@@ -370,7 +523,7 @@
}
],
"description": "A stream abstraction to make working with non-blocking I/O simple.",
- "homepage": "http://amphp.org/byte-stream",
+ "homepage": "https://amphp.org/byte-stream",
"keywords": [
"amp",
"amphp",
@@ -380,9 +533,8 @@
"stream"
],
"support": {
- "irc": "irc://irc.freenode.org/amphp",
"issues": "https://github.com/amphp/byte-stream/issues",
- "source": "https://github.com/amphp/byte-stream/tree/v1.8.1"
+ "source": "https://github.com/amphp/byte-stream/tree/v1.8.2"
},
"funding": [
{
@@ -390,24 +542,24 @@
"type": "github"
}
],
- "time": "2021-03-30T17:13:30+00:00"
+ "time": "2024-04-13T18:00:56+00:00"
},
{
"name": "antecedent/patchwork",
- "version": "2.1.28",
+ "version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/antecedent/patchwork.git",
- "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d"
+ "reference": "b07d4fb37c3c723c8755122160c089e077d5de65"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d",
- "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d",
+ "url": "https://api.github.com/repos/antecedent/patchwork/zipball/b07d4fb37c3c723c8755122160c089e077d5de65",
+ "reference": "b07d4fb37c3c723c8755122160c089e077d5de65",
"shasum": ""
},
"require": {
- "php": ">=5.4.0"
+ "php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": ">=4"
@@ -436,9 +588,9 @@
],
"support": {
"issues": "https://github.com/antecedent/patchwork/issues",
- "source": "https://github.com/antecedent/patchwork/tree/2.1.28"
+ "source": "https://github.com/antecedent/patchwork/tree/2.2.0"
},
- "time": "2024-02-06T09:26:11+00:00"
+ "time": "2024-09-27T16:59:55+00:00"
},
{
"name": "automattic/phpcs-neutron-standard",
@@ -609,63 +761,6 @@
},
"time": "2021-11-11T15:53:55+00:00"
},
- {
- "name": "coenjacobs/mozart",
- "version": "0.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/coenjacobs/mozart.git",
- "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/ac3ff9ed253a575e4e7309379f74424da9a56bd8",
- "reference": "ac3ff9ed253a575e4e7309379f74424da9a56bd8",
- "shasum": ""
- },
- "require": {
- "league/flysystem": "^1.0",
- "php": "^7.2",
- "symfony/console": "^4|^5",
- "symfony/finder": "^4|^5"
- },
- "require-dev": {
- "mheap/phpunit-github-actions-printer": "^1.4",
- "phpunit/phpunit": "^8.5",
- "squizlabs/php_codesniffer": "^3.5"
- },
- "bin": [
- "bin/mozart"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "CoenJacobs\\Mozart\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Coen Jacobs",
- "email": "coenjacobs@gmail.com"
- }
- ],
- "description": "Composes all dependencies as a package inside a WordPress plugin",
- "support": {
- "issues": "https://github.com/coenjacobs/mozart/issues",
- "source": "https://github.com/coenjacobs/mozart/tree/0.6.0"
- },
- "funding": [
- {
- "url": "https://github.com/coenjacobs",
- "type": "github"
- }
- ],
- "time": "2021-01-17T15:41:04+00:00"
- },
{
"name": "composer/package-versions-deprecated",
"version": "1.11.99.5",
@@ -741,30 +836,38 @@
},
{
"name": "composer/pcre",
- "version": "2.1.3",
+ "version": "3.3.1",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
- "reference": "540af382c97b83c628227d5f87cf56466d476191"
+ "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/pcre/zipball/540af382c97b83c628227d5f87cf56466d476191",
- "reference": "540af382c97b83c628227d5f87cf56466d476191",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4",
+ "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0"
+ "php": "^7.4 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
},
"require-dev": {
- "phpstan/phpstan": "^1.3",
+ "phpstan/phpstan": "^1.11.10",
"phpstan/phpstan-strict-rules": "^1.1",
- "symfony/phpunit-bridge": "^5"
+ "phpunit/phpunit": "^8 || ^9"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.x-dev"
+ "dev-main": "3.x-dev"
+ },
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
}
},
"autoload": {
@@ -792,7 +895,7 @@
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
- "source": "https://github.com/composer/pcre/tree/2.1.3"
+ "source": "https://github.com/composer/pcre/tree/3.3.1"
},
"funding": [
{
@@ -808,28 +911,28 @@
"type": "tidelift"
}
],
- "time": "2024-03-19T09:03:05+00:00"
+ "time": "2024-08-27T18:44:43+00:00"
},
{
"name": "composer/semver",
- "version": "3.4.0",
+ "version": "3.4.3",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
- "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^1.4",
- "symfony/phpunit-bridge": "^4.2 || ^5"
+ "phpstan/phpstan": "^1.11",
+ "symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
@@ -873,7 +976,7 @@
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.4.0"
+ "source": "https://github.com/composer/semver/tree/3.4.3"
},
"funding": [
{
@@ -889,20 +992,20 @@
"type": "tidelift"
}
],
- "time": "2023-08-31T09:50:34+00:00"
+ "time": "2024-09-19T14:15:21+00:00"
},
{
"name": "composer/xdebug-handler",
- "version": "3.0.4",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255"
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
- "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef",
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef",
"shasum": ""
},
"require": {
@@ -939,7 +1042,7 @@
"support": {
"irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
- "source": "https://github.com/composer/xdebug-handler/tree/3.0.4"
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.5"
},
"funding": [
{
@@ -955,7 +1058,7 @@
"type": "tidelift"
}
],
- "time": "2024-03-26T18:29:49+00:00"
+ "time": "2024-05-06T16:37:16+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -1069,6 +1172,53 @@
},
"time": "2019-12-04T15:06:13+00:00"
},
+ {
+ "name": "doctrine/deprecations",
+ "version": "1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/deprecations.git",
+ "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^9",
+ "phpstan/phpstan": "1.4.10 || 1.10.15",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "psalm/plugin-phpunit": "0.18.4",
+ "psr/log": "^1 || ^2 || ^3",
+ "vimeo/psalm": "4.30.0 || 5.12.0"
+ },
+ "suggest": {
+ "psr/log": "Allows logging deprecations via PSR-3 logger implementation"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
+ "homepage": "https://www.doctrine-project.org/",
+ "support": {
+ "issues": "https://github.com/doctrine/deprecations/issues",
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.3"
+ },
+ "time": "2024-01-30T19:34:25+00:00"
+ },
{
"name": "doctrine/instantiator",
"version": "1.5.0",
@@ -1186,16 +1336,16 @@
},
{
"name": "felixfbecker/language-server-protocol",
- "version": "v1.5.2",
+ "version": "v1.5.3",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-language-server-protocol.git",
- "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842"
+ "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842",
- "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842",
+ "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/a9e113dbc7d849e35b8776da39edaf4313b7b6c9",
+ "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9",
"shasum": ""
},
"require": {
@@ -1236,9 +1386,9 @@
],
"support": {
"issues": "https://github.com/felixfbecker/php-language-server-protocol/issues",
- "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2"
+ "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.3"
},
- "time": "2022-03-02T22:36:06+00:00"
+ "time": "2024-04-30T00:40:11+00:00"
},
{
"name": "fzaninotto/faker",
@@ -1411,74 +1561,6 @@
},
"time": "2024-03-07T12:11:10+00:00"
},
- {
- "name": "inpsyde/modularity",
- "version": "1.7.4",
- "source": {
- "type": "git",
- "url": "https://github.com/inpsyde/modularity.git",
- "reference": "ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/inpsyde/modularity/zipball/ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d",
- "reference": "ef0143d58e4dd358f7cc3c8d917b18d07cf6e13d",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "php": ">=7.2",
- "psr/container": "^1.1.0 || ^2"
- },
- "require-dev": {
- "brain/monkey": "^2.6.1",
- "inpsyde/php-coding-standards": "^1",
- "johnpbloch/wordpress-core": ">=5.8",
- "mikey179/vfsstream": "^v1.6.10",
- "php-stubs/wordpress-stubs": ">=5.8@stable",
- "phpunit/phpunit": "^8.5.21 || ^9.6.7",
- "vimeo/psalm": "^4.13.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Inpsyde\\Modularity\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "GPL-2.0-or-later"
- ],
- "authors": [
- {
- "name": "Inpsyde GmbH",
- "email": "hello@inpsyde.com",
- "homepage": "https://inpsyde.com/",
- "role": "Company"
- },
- {
- "name": "Christian Leucht",
- "email": "c.leucht@inpsyde.com",
- "role": "Developer"
- },
- {
- "name": "Giuseppe Mazzapica",
- "email": "g.mazzapica@inpsyde.com",
- "role": "Developer"
- }
- ],
- "description": "Modular PSR-11 implementation for WordPress plugins, themes or libraries.",
- "support": {
- "issues": "https://github.com/inpsyde/modularity/issues",
- "source": "https://github.com/inpsyde/modularity/tree/1.7.4"
- },
- "time": "2024-03-22T07:01:53+00:00"
- },
{
"name": "inpsyde/php-coding-standards",
"version": "1.0.0",
@@ -1548,16 +1630,16 @@
},
{
"name": "johnpbloch/wordpress-core",
- "version": "5.9.9",
+ "version": "5.9.10",
"source": {
"type": "git",
"url": "https://github.com/johnpbloch/wordpress-core.git",
- "reference": "9e7760b44a132a6b0040e13ce0c600d58f21d41f"
+ "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/9e7760b44a132a6b0040e13ce0c600d58f21d41f",
- "reference": "9e7760b44a132a6b0040e13ce0c600d58f21d41f",
+ "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/5ca1365f22e0c57e8362ce0dbc735281e304130a",
+ "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a",
"shasum": ""
},
"require": {
@@ -1565,7 +1647,7 @@
"php": ">=5.6.20"
},
"provide": {
- "wordpress/core-implementation": "5.9.9"
+ "wordpress/core-implementation": "5.9.10"
},
"type": "wordpress-core",
"notification-url": "https://packagist.org/downloads/",
@@ -1592,189 +1674,42 @@
"source": "https://core.trac.wordpress.org/browser",
"wiki": "https://codex.wordpress.org/"
},
- "time": "2024-01-30T20:46:37+00:00"
- },
- {
- "name": "league/flysystem",
- "version": "1.1.10",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/flysystem.git",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
- "shasum": ""
- },
- "require": {
- "ext-fileinfo": "*",
- "league/mime-type-detection": "^1.3",
- "php": "^7.2.5 || ^8.0"
- },
- "conflict": {
- "league/flysystem-sftp": "<1.0.6"
- },
- "require-dev": {
- "phpspec/prophecy": "^1.11.1",
- "phpunit/phpunit": "^8.5.8"
- },
- "suggest": {
- "ext-ftp": "Allows you to use FTP server storage",
- "ext-openssl": "Allows you to use FTPS server storage",
- "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
- "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
- "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
- "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
- "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
- "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
- "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
- "league/flysystem-webdav": "Allows you to use WebDAV storage",
- "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
- "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
- "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "League\\Flysystem\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frenky.net"
- }
- ],
- "description": "Filesystem abstraction: Many filesystems, one API.",
- "keywords": [
- "Cloud Files",
- "WebDAV",
- "abstraction",
- "aws",
- "cloud",
- "copy.com",
- "dropbox",
- "file systems",
- "files",
- "filesystem",
- "filesystems",
- "ftp",
- "rackspace",
- "remote",
- "s3",
- "sftp",
- "storage"
- ],
- "support": {
- "issues": "https://github.com/thephpleague/flysystem/issues",
- "source": "https://github.com/thephpleague/flysystem/tree/1.1.10"
- },
- "funding": [
- {
- "url": "https://offset.earth/frankdejonge",
- "type": "other"
- }
- ],
- "time": "2022-10-04T09:16:37+00:00"
- },
- {
- "name": "league/mime-type-detection",
- "version": "1.12.0",
- "source": {
- "type": "git",
- "url": "https://github.com/thephpleague/mime-type-detection.git",
- "reference": "c7f2872fb273bf493811473dafc88d60ae829f48"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48",
- "reference": "c7f2872fb273bf493811473dafc88d60ae829f48",
- "shasum": ""
- },
- "require": {
- "ext-fileinfo": "*",
- "php": "^7.2 || ^8.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^3.2",
- "phpstan/phpstan": "^0.12.68",
- "phpunit/phpunit": "^8.5.8 || ^9.3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "League\\MimeTypeDetection\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frank de Jonge",
- "email": "info@frankdejonge.nl"
- }
- ],
- "description": "Mime-type detection for Flysystem",
- "support": {
- "issues": "https://github.com/thephpleague/mime-type-detection/issues",
- "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0"
- },
- "funding": [
- {
- "url": "https://github.com/frankdejonge",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
- "type": "tidelift"
- }
- ],
- "time": "2023-08-03T07:14:11+00:00"
+ "time": "2024-06-24T17:31:05+00:00"
},
{
"name": "mockery/mockery",
- "version": "1.3.6",
+ "version": "1.6.12",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
- "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0"
+ "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mockery/mockery/zipball/dc206df4fa314a50bbb81cf72239a305c5bbd5c0",
- "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0",
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699",
+ "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699",
"shasum": ""
},
"require": {
"hamcrest/hamcrest-php": "^2.0.1",
"lib-pcre": ">=7.0",
- "php": ">=5.6.0"
+ "php": ">=7.3"
+ },
+ "conflict": {
+ "phpunit/phpunit": "<8.0"
},
"require-dev": {
- "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3"
+ "phpunit/phpunit": "^8.5 || ^9.6.17",
+ "symplify/easy-coding-standard": "^12.1.14"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3.x-dev"
- }
- },
"autoload": {
- "psr-0": {
- "Mockery": "library/"
+ "files": [
+ "library/helpers.php",
+ "library/Mockery.php"
+ ],
+ "psr-4": {
+ "Mockery\\": "library/Mockery"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1785,12 +1720,20 @@
{
"name": "Pádraic Brady",
"email": "padraic.brady@gmail.com",
- "homepage": "http://blog.astrumfutura.com"
+ "homepage": "https://github.com/padraic",
+ "role": "Author"
},
{
"name": "Dave Marshall",
"email": "dave.marshall@atstsolutions.co.uk",
- "homepage": "http://davedevelopment.co.uk"
+ "homepage": "https://davedevelopment.co.uk",
+ "role": "Developer"
+ },
+ {
+ "name": "Nathanael Esayeas",
+ "email": "nathanael.esayeas@protonmail.com",
+ "homepage": "https://github.com/ghostwriter",
+ "role": "Lead Developer"
}
],
"description": "Mockery is a simple yet flexible PHP mock object framework",
@@ -1808,23 +1751,26 @@
"testing"
],
"support": {
+ "docs": "https://docs.mockery.io/",
"issues": "https://github.com/mockery/mockery/issues",
- "source": "https://github.com/mockery/mockery/tree/1.3.6"
+ "rss": "https://github.com/mockery/mockery/releases.atom",
+ "security": "https://github.com/mockery/mockery/security/advisories",
+ "source": "https://github.com/mockery/mockery"
},
- "time": "2022-09-07T15:05:49+00:00"
+ "time": "2024-05-16T03:13:13+00:00"
},
{
"name": "myclabs/deep-copy",
- "version": "1.11.1",
+ "version": "1.12.0",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
+ "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
- "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
+ "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
"shasum": ""
},
"require": {
@@ -1832,11 +1778,12 @@
},
"conflict": {
"doctrine/collections": "<1.6.8",
- "doctrine/common": "<2.13.3 || >=3,<3.2.2"
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
},
"require-dev": {
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"type": "library",
@@ -1862,7 +1809,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0"
},
"funding": [
{
@@ -1870,20 +1817,20 @@
"type": "tidelift"
}
],
- "time": "2023-03-08T13:26:56+00:00"
+ "time": "2024-06-12T14:39:25+00:00"
},
{
"name": "netresearch/jsonmapper",
- "version": "v4.4.1",
+ "version": "v4.5.0",
"source": {
"type": "git",
"url": "https://github.com/cweiske/jsonmapper.git",
- "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0"
+ "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0",
- "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0",
+ "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8e76efb98ee8b6afc54687045e1b8dba55ac76e5",
+ "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5",
"shasum": ""
},
"require": {
@@ -1919,22 +1866,22 @@
"support": {
"email": "cweiske@cweiske.de",
"issues": "https://github.com/cweiske/jsonmapper/issues",
- "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1"
+ "source": "https://github.com/cweiske/jsonmapper/tree/v4.5.0"
},
- "time": "2024-01-31T06:18:54+00:00"
+ "time": "2024-09-08T10:13:13+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.19.1",
+ "version": "v4.19.4",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b"
+ "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b",
- "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2",
+ "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2",
"shasum": ""
},
"require": {
@@ -1943,7 +1890,7 @@
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
- "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"bin": [
"bin/php-parse"
@@ -1975,9 +1922,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4"
},
- "time": "2024-03-17T08:10:35+00:00"
+ "time": "2024-09-29T15:01:53+00:00"
},
{
"name": "openlss/lib-array2xml",
@@ -2196,29 +2143,31 @@
},
{
"name": "php-stubs/wordpress-stubs",
- "version": "v5.9.6",
+ "version": "v5.9.9",
"source": {
"type": "git",
"url": "https://github.com/php-stubs/wordpress-stubs.git",
- "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098"
+ "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6a18d938d0aef39d091505a4a35b025fb6c10098",
- "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098",
+ "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/06c51c4863659ea9e9f4c2a23293728a677cb059",
+ "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059",
"shasum": ""
},
"require-dev": {
- "nikic/php-parser": "< 4.12.0",
- "php": "~7.3 || ~8.0",
+ "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
+ "nikic/php-parser": "^4.13",
+ "php": "^7.4 || ~8.0.0",
"php-stubs/generator": "^0.8.3",
- "phpdocumentor/reflection-docblock": "^5.3",
- "phpstan/phpstan": "^1.10.12",
- "phpunit/phpunit": "^9.5"
+ "phpdocumentor/reflection-docblock": "5.3",
+ "phpstan/phpstan": "^1.10.49",
+ "phpunit/phpunit": "^9.5",
+ "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11"
},
"suggest": {
"paragonie/sodium_compat": "Pure PHP implementation of libsodium",
- "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan"
},
"type": "library",
@@ -2235,9 +2184,9 @@
],
"support": {
"issues": "https://github.com/php-stubs/wordpress-stubs/issues",
- "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.6"
+ "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.9"
},
- "time": "2023-05-18T04:34:27+00:00"
+ "time": "2024-04-14T17:16:00+00:00"
},
{
"name": "phpcompatibility/php-compatibility",
@@ -2356,28 +2305,35 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.3.0",
+ "version": "5.4.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
+ "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
+ "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
"shasum": ""
},
"require": {
+ "doctrine/deprecations": "^1.1",
"ext-filter": "*",
- "php": "^7.2 || ^8.0",
+ "php": "^7.4 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
- "phpdocumentor/type-resolver": "^1.3",
+ "phpdocumentor/type-resolver": "^1.7",
+ "phpstan/phpdoc-parser": "^1.7",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.2",
- "psalm/phar": "^4.8"
+ "mockery/mockery": "~1.3.5",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-mockery": "^1.1",
+ "phpstan/phpstan-webmozart-assert": "^1.2",
+ "phpunit/phpunit": "^9.5",
+ "vimeo/psalm": "^5.13"
},
"type": "library",
"extra": {
@@ -2401,37 +2357,45 @@
},
{
"name": "Jaap van Otterdijk",
- "email": "account@ijaap.nl"
+ "email": "opensource@ijaap.nl"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1"
},
- "time": "2021-10-19T17:43:47+00:00"
+ "time": "2024-05-21T05:55:05+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.6.1",
+ "version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "77a32518733312af16a44300404e945338981de3"
+ "reference": "153ae662783729388a584b4361f2545e4d841e3c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3",
- "reference": "77a32518733312af16a44300404e945338981de3",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c",
+ "reference": "153ae662783729388a584b4361f2545e4d841e3c",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0",
- "phpdocumentor/reflection-common": "^2.0"
+ "doctrine/deprecations": "^1.0",
+ "php": "^7.3 || ^8.0",
+ "phpdocumentor/reflection-common": "^2.0",
+ "phpstan/phpdoc-parser": "^1.13"
},
"require-dev": {
"ext-tokenizer": "*",
- "psalm/phar": "^4.8"
+ "phpbench/phpbench": "^1.2",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpunit/phpunit": "^9.5",
+ "rector/rector": "^0.13.9",
+ "vimeo/psalm": "^4.25"
},
"type": "library",
"extra": {
@@ -2457,9 +2421,56 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1"
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2"
},
- "time": "2022-03-15T21:29:03+00:00"
+ "time": "2024-02-23T11:10:43+00:00"
+ },
+ {
+ "name": "phpstan/phpdoc-parser",
+ "version": "1.33.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140",
+ "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/annotations": "^2.0",
+ "nikic/php-parser": "^4.15",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^1.5",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpstan/phpstan-strict-rules": "^1.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/process": "^5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
+ "support": {
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0"
+ },
+ "time": "2024-10-13T11:25:22+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -2700,29 +2711,29 @@
},
{
"name": "phpunit/php-token-stream",
- "version": "3.1.3",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "9c1da83261628cb24b6a6df371b6e312b3954768"
+ "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768",
- "reference": "9c1da83261628cb24b6a6df371b6e312b3954768",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3",
+ "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": ">=7.1"
+ "php": "^7.3 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^7.0"
+ "phpunit/phpunit": "^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -2747,7 +2758,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
- "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3"
+ "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
},
"funding": [
{
@@ -2756,46 +2767,46 @@
}
],
"abandoned": true,
- "time": "2021-07-26T12:15:06+00:00"
+ "time": "2020-08-04T08:28:15+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "8.5.38",
+ "version": "8.5.40",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c"
+ "reference": "48ed828b72c35b38cdddcd9059339734cb06b3a7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ecad678646c817a29e55a32c930f3601c3f5a8c",
- "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/48ed828b72c35b38cdddcd9059339734cb06b3a7",
+ "reference": "48ed828b72c35b38cdddcd9059339734cb06b3a7",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.3.1",
+ "doctrine/instantiator": "^1.5.0",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.10.0",
- "phar-io/manifest": "^2.0.3",
- "phar-io/version": "^3.0.2",
+ "myclabs/deep-copy": "^1.12.0",
+ "phar-io/manifest": "^2.0.4",
+ "phar-io/version": "^3.2.1",
"php": ">=7.2",
- "phpunit/php-code-coverage": "^7.0.12",
- "phpunit/php-file-iterator": "^2.0.4",
+ "phpunit/php-code-coverage": "^7.0.17",
+ "phpunit/php-file-iterator": "^2.0.6",
"phpunit/php-text-template": "^1.2.1",
- "phpunit/php-timer": "^2.1.2",
+ "phpunit/php-timer": "^2.1.4",
"sebastian/comparator": "^3.0.5",
- "sebastian/diff": "^3.0.2",
- "sebastian/environment": "^4.2.3",
- "sebastian/exporter": "^3.1.5",
- "sebastian/global-state": "^3.0.0",
- "sebastian/object-enumerator": "^3.0.3",
- "sebastian/resource-operations": "^2.0.1",
- "sebastian/type": "^1.1.3",
+ "sebastian/diff": "^3.0.6",
+ "sebastian/environment": "^4.2.5",
+ "sebastian/exporter": "^3.1.6",
+ "sebastian/global-state": "^3.0.5",
+ "sebastian/object-enumerator": "^3.0.5",
+ "sebastian/resource-operations": "^2.0.3",
+ "sebastian/type": "^1.1.5",
"sebastian/version": "^2.0.1"
},
"suggest": {
@@ -2838,7 +2849,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.38"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.40"
},
"funding": [
{
@@ -2854,55 +2865,7 @@
"type": "tidelift"
}
],
- "time": "2024-04-05T04:31:23+00:00"
- },
- {
- "name": "psr/container",
- "version": "1.1.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/container.git",
- "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
- "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Psr\\Container\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common Container Interface (PHP FIG PSR-11)",
- "homepage": "https://github.com/php-fig/container",
- "keywords": [
- "PSR-11",
- "container",
- "container-interface",
- "container-interop",
- "psr"
- ],
- "support": {
- "issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.1"
- },
- "time": "2021-03-05T17:36:06+00:00"
+ "time": "2024-09-19T10:47:04+00:00"
},
{
"name": "ptrofimov/xpmock",
@@ -3671,16 +3634,16 @@
},
{
"name": "sirbrillig/phpcs-variable-analysis",
- "version": "v2.11.17",
+ "version": "v2.11.19",
"source": {
"type": "git",
"url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
- "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049"
+ "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049",
- "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049",
+ "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1",
+ "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1",
"shasum": ""
},
"require": {
@@ -3725,7 +3688,7 @@
"source": "https://github.com/sirbrillig/phpcs-variable-analysis",
"wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki"
},
- "time": "2023-08-05T23:46:11+00:00"
+ "time": "2024-06-26T20:08:34+00:00"
},
{
"name": "squizlabs/php_codesniffer",
@@ -3799,16 +3762,16 @@
},
{
"name": "symfony/console",
- "version": "v5.4.36",
+ "version": "v5.4.44",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e"
+ "reference": "5b5a0aa66e3296e303e22490f90f521551835a83"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e",
- "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e",
+ "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83",
+ "reference": "5b5a0aa66e3296e303e22490f90f521551835a83",
"shasum": ""
},
"require": {
@@ -3878,7 +3841,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.36"
+ "source": "https://github.com/symfony/console/tree/v5.4.44"
},
"funding": [
{
@@ -3894,7 +3857,7 @@
"type": "tidelift"
}
],
- "time": "2024-02-20T16:33:57+00:00"
+ "time": "2024-09-20T07:56:40+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -3963,85 +3926,22 @@
],
"time": "2023-01-24T14:02:46+00:00"
},
- {
- "name": "symfony/finder",
- "version": "v5.4.35",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/finder.git",
- "reference": "abe6d6f77d9465fed3cd2d029b29d03b56b56435"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/abe6d6f77d9465fed3cd2d029b29d03b56b56435",
- "reference": "abe6d6f77d9465fed3cd2d029b29d03b56b56435",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-php80": "^1.16"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Finder\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Finds files and directories via an intuitive fluent interface",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/finder/tree/v5.4.35"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2024-01-23T13:51:25+00:00"
- },
{
"name": "symfony/polyfill-ctype",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
- "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
@@ -4087,7 +3987,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
},
"funding": [
{
@@ -4103,24 +4003,24 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f"
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f",
- "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"suggest": {
"ext-intl": "For best performance"
@@ -4165,7 +4065,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
},
"funding": [
{
@@ -4181,24 +4081,24 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
- "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"suggest": {
"ext-intl": "For best performance"
@@ -4246,7 +4146,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
},
"funding": [
{
@@ -4262,24 +4162,24 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
- "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
@@ -4326,7 +4226,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
},
"funding": [
{
@@ -4342,24 +4242,24 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "21bd091060673a1177ae842c0ef8fe30893114d2"
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2",
- "reference": "21bd091060673a1177ae842c0ef8fe30893114d2",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
@@ -4402,7 +4302,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
},
"funding": [
{
@@ -4418,24 +4318,24 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.29.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
- "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
@@ -4482,7 +4382,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
},
"funding": [
{
@@ -4498,7 +4398,7 @@
"type": "tidelift"
}
],
- "time": "2024-01-29T20:11:03+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/service-contracts",
@@ -4585,16 +4485,16 @@
},
{
"name": "symfony/string",
- "version": "v5.4.36",
+ "version": "v5.4.44",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b"
+ "reference": "832caa16b6d9aac6bf11747315225f5aba384c24"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b",
- "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b",
+ "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24",
+ "reference": "832caa16b6d9aac6bf11747315225f5aba384c24",
"shasum": ""
},
"require": {
@@ -4651,7 +4551,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.4.36"
+ "source": "https://github.com/symfony/string/tree/v5.4.44"
},
"funding": [
{
@@ -4667,7 +4567,7 @@
"type": "tidelift"
}
],
- "time": "2024-02-01T08:49:30+00:00"
+ "time": "2024-09-20T07:56:40+00:00"
},
{
"name": "theseer/tokenizer",
@@ -4997,7 +4897,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": ">=7.2",
+ "php": ">=7.4",
"ext-intl": "*",
"ext-json": "*"
},
From 419bf9bee2b20b3bf6e022e5c208683bdc0041d5 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Wed, 16 Oct 2024 13:59:12 +0200
Subject: [PATCH 06/17] Add sepa enabled on trustly
---
src/PaymentMethods/Trustly.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PaymentMethods/Trustly.php b/src/PaymentMethods/Trustly.php
index 05179fbbb..e256a9750 100644
--- a/src/PaymentMethods/Trustly.php
+++ b/src/PaymentMethods/Trustly.php
@@ -21,7 +21,7 @@ protected function getConfig(): array
],
'filtersOnBuild' => false,
'confirmationDelayed' => true,
- 'SEPA' => false,
+ 'SEPA' => true,
];
}
From 78a0ade25fe957677136f578a81828a93a75eb66 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Fri, 25 Oct 2024 10:42:23 +0200
Subject: [PATCH 07/17] Add br to wp_kses instructions
---
src/Gateway/MolliePaymentGateway.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php
index e880f4836..e74f85cac 100644
--- a/src/Gateway/MolliePaymentGateway.php
+++ b/src/Gateway/MolliePaymentGateway.php
@@ -857,7 +857,7 @@ public function displayInstructions(
echo esc_html($instructions) . PHP_EOL;
} else {
echo '';
- echo wp_kses(wpautop($instructions), ['p' => [], 'strong' => []]) . PHP_EOL;
+ echo wp_kses(wpautop($instructions), ['p' => [], 'strong' => [], 'br' => []]) . PHP_EOL;
echo ' ';
}
}
From 61ff5956305b8d78f1152adb8f20d27bc87b8c34 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 28 Oct 2024 14:29:18 +0100
Subject: [PATCH 08/17] Add ideal notice
---
src/PaymentMethods/Ideal.php | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/PaymentMethods/Ideal.php b/src/PaymentMethods/Ideal.php
index c7638b054..bc2e67139 100644
--- a/src/PaymentMethods/Ideal.php
+++ b/src/PaymentMethods/Ideal.php
@@ -29,6 +29,32 @@ public function getConfig(): array
public function getFormFields($generalFormFields): array
{
- return $generalFormFields;
+ $notice = [
+ 'notice' => [
+ 'title' =>
+ sprintf(
+ /* translators: Placeholder 1: paragraph opening tag Placeholder 2: link url Placeholder 3: link closing tag 4: link url Placeholder 5: closing tags */
+ __(
+ '%1$s Note: In June 2024, Mollie upgraded its iDEAL implementation to iDEAL 2.0.
+ As a result, the bank selector dropdown is no longer displayed on the checkout page when using the Mollie plugin.
+ Buyers will now select their bank directly on the iDEAL website.
+ The only action required from you is to update your iDEAL gateway description to remove any prompts for buyers to select a bank during checkout.
+ No further manual action is needed. For more details about the iDEAL 2.0 migration, please visit the
+ %2$s Mollie Help Center %3$s or read this
+ %4$s this blog post. %5$s',
+ 'mollie-payments-for-woocommerce'
+ ),
+ '',
+ '',
+ ' ',
+ '',
+ '
'
+ ),
+ 'type' => 'title',
+ 'class' => 'notice notice-warning',
+ 'css' => 'padding:20px;',
+ ],
+ ];
+ return array_merge($notice, $generalFormFields);
}
}
From 8ba7ebdd31bf42651772ad39e2fbf8effd5b00db Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Tue, 29 Oct 2024 11:04:58 +0100
Subject: [PATCH 09/17] Fix Cs
---
src/Gateway/MolliePaymentGateway.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php
index e74f85cac..18ef627a6 100644
--- a/src/Gateway/MolliePaymentGateway.php
+++ b/src/Gateway/MolliePaymentGateway.php
@@ -857,7 +857,7 @@ public function displayInstructions(
echo esc_html($instructions) . PHP_EOL;
} else {
echo '';
- echo wp_kses(wpautop($instructions), ['p' => [], 'strong' => [], 'br' => []]) . PHP_EOL;
+ echo wp_kses(wpautop($instructions), ['p' => [], 'strong' => [], 'br' => []]) . PHP_EOL;
echo ' ';
}
}
From a2821498ea4ba3c9c24a1db0b6dcee959d294bd9 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:16:38 +0100
Subject: [PATCH 10/17] Squash and merge PIWOO-289
This PR adds the new settings UI
---
inc/settings/mollie_advanced_settings.php | 207 -----
inc/settings/mollie_applepay_settings.php | 122 ---
inc/settings/mollie_components.php | 170 ----
phpcs.xml.dist | 2 +-
public/images/logo/black.svg | 18 +
resources/js/mollie-settings-2024.js | 11 +
resources/js/settings.js | 11 -
src/Activation/ActivationModule.php | 3 +-
src/Assets/AssetsModule.php | 25 +-
src/Gateway/GatewayModule.php | 1 +
src/PaymentMethods/Alma.php | 1 +
src/PaymentMethods/Applepay.php | 1 +
src/PaymentMethods/Bancomatpay.php | 1 +
src/PaymentMethods/Bancontact.php | 1 +
src/PaymentMethods/Banktransfer.php | 1 +
src/PaymentMethods/Belfius.php | 1 +
src/PaymentMethods/Billie.php | 1 +
src/PaymentMethods/Blik.php | 1 +
src/PaymentMethods/Creditcard.php | 1 +
src/PaymentMethods/Directdebit.php | 1 +
src/PaymentMethods/Eps.php | 1 +
src/PaymentMethods/Giftcard.php | 1 +
src/PaymentMethods/Giropay.php | 1 +
src/PaymentMethods/Ideal.php | 1 +
src/PaymentMethods/In3.php | 1 +
src/PaymentMethods/Kbc.php | 1 +
src/PaymentMethods/Klarna.php | 1 +
src/PaymentMethods/Klarnapaylater.php | 1 +
src/PaymentMethods/Klarnapaynow.php | 1 +
src/PaymentMethods/Klarnasliceit.php | 1 +
src/PaymentMethods/Mybank.php | 1 +
src/PaymentMethods/Payconiq.php | 1 +
src/PaymentMethods/PaymentMethodsIconUrl.php | 2 +-
src/PaymentMethods/Paypal.php | 1 +
src/PaymentMethods/Paysafecard.php | 1 +
src/PaymentMethods/Przelewy24.php | 1 +
src/PaymentMethods/Riverty.php | 1 +
src/PaymentMethods/Satispay.php | 1 +
src/PaymentMethods/Sofort.php | 1 +
src/PaymentMethods/Trustly.php | 1 +
src/PaymentMethods/Twint.php | 1 +
src/PaymentMethods/Voucher.php | 1 +
src/Settings/MollieSettingsPage.php | 266 ++++++
src/Settings/Page/AbstractPage.php | 90 ++
src/Settings/Page/Components.php | 68 --
src/Settings/Page/MollieSettingsPage.php | 789 ------------------
src/Settings/Page/PageAdvancedSettings.php | 39 +
src/Settings/Page/PageApiKeys.php | 41 +
src/Settings/Page/PageNoApiKey.php | 33 +
src/Settings/Page/PagePaymentMethods.php | 40 +
src/Settings/Page/Section/AbstractSection.php | 56 ++
src/Settings/Page/Section/Advanced.php | 248 ++++++
.../Page/Section/ConnectionFields.php | 80 ++
.../Page/Section/ConnectionStatusFields.php | 46 +
.../Page/Section/ConnectionStatusTrait.php | 36 +
src/Settings/Page/Section/Header.php | 84 ++
.../Page/Section/InstructionsConnected.php | 52 ++
.../Page/Section/InstructionsNotConnected.php | 90 ++
src/Settings/Page/Section/Notices.php | 190 +++++
src/Settings/Page/Section/PaymentMethods.php | 261 ++++++
src/Settings/Page/Section/Tabs.php | 45 +
src/Settings/Settings.php | 24 +-
src/Settings/SettingsModule.php | 19 +-
webpack.config.js | 3 +-
64 files changed, 1822 insertions(+), 1381 deletions(-)
delete mode 100644 inc/settings/mollie_advanced_settings.php
delete mode 100644 inc/settings/mollie_applepay_settings.php
delete mode 100644 inc/settings/mollie_components.php
create mode 100644 public/images/logo/black.svg
create mode 100644 resources/js/mollie-settings-2024.js
create mode 100644 src/Settings/MollieSettingsPage.php
create mode 100644 src/Settings/Page/AbstractPage.php
delete mode 100644 src/Settings/Page/Components.php
delete mode 100644 src/Settings/Page/MollieSettingsPage.php
create mode 100644 src/Settings/Page/PageAdvancedSettings.php
create mode 100644 src/Settings/Page/PageApiKeys.php
create mode 100644 src/Settings/Page/PageNoApiKey.php
create mode 100644 src/Settings/Page/PagePaymentMethods.php
create mode 100644 src/Settings/Page/Section/AbstractSection.php
create mode 100644 src/Settings/Page/Section/Advanced.php
create mode 100644 src/Settings/Page/Section/ConnectionFields.php
create mode 100644 src/Settings/Page/Section/ConnectionStatusFields.php
create mode 100644 src/Settings/Page/Section/ConnectionStatusTrait.php
create mode 100644 src/Settings/Page/Section/Header.php
create mode 100644 src/Settings/Page/Section/InstructionsConnected.php
create mode 100644 src/Settings/Page/Section/InstructionsNotConnected.php
create mode 100644 src/Settings/Page/Section/Notices.php
create mode 100644 src/Settings/Page/Section/PaymentMethods.php
create mode 100644 src/Settings/Page/Section/Tabs.php
diff --git a/inc/settings/mollie_advanced_settings.php b/inc/settings/mollie_advanced_settings.php
deleted file mode 100644
index e108e62d9..000000000
--- a/inc/settings/mollie_advanced_settings.php
+++ /dev/null
@@ -1,207 +0,0 @@
- 1, 'nonce_mollie_cleanDb' => $nonce_mollie_cleanDb]
-);
-$api_payment_description_labels = [
- '{orderNumber}' => _x('Order number', 'Label {orderNumber} description for payment description options', 'mollie-payments-for-woocommerce'),
- '{storeName}' => _x('Site Title', 'Label {storeName} description for payment description options', 'mollie-payments-for-woocommerce'),
- '{customer.firstname}' => _x('Customer\'s first name', 'Label {customer.firstname} description for payment description options', 'mollie-payments-for-woocommerce'),
- '{customer.lastname}' => _x('Customer\'s last name', 'Label {customer.lastname} description for payment description options', 'mollie-payments-for-woocommerce'),
- '{customer.company}' => _x('Customer\'s company name', 'Label {customer.company} description for payment description options', 'mollie-payments-for-woocommerce'),
-];
-
-$mollieAdvancedSettings = [
- [
- 'id' => $pluginName . '_title',
- 'title' => __('Mollie advanced settings', 'mollie-payments-for-woocommerce'),
- 'type' => 'title',
- 'desc' => '' . __('The following options are required to use the plugin and are used by all Mollie payment methods', 'mollie-payments-for-woocommerce') . '
',
- ],
- [
- 'id' => $pluginName . '_order_status_cancelled_payments',
- 'title' => __('Order status after cancelled payment', 'mollie-payments-for-woocommerce'),
- 'type' => 'select',
- 'options' => [
- 'pending' => __('Pending', 'woocommerce'),
- 'cancelled' => __('Cancelled', 'woocommerce'),
- ],
- 'desc' => __('Status for orders when a payment (not a Mollie order via the Orders API) is cancelled. Default: pending. Orders with status Pending can be paid with another payment method, customers can try again. Cancelled orders are final. Set this to Cancelled if you only have one payment method or don\'t want customers to re-try paying with a different payment method. This doesn\'t apply to payments for orders via the new Orders API and Klarna payments.', 'mollie-payments-for-woocommerce'),
- 'default' => 'pending',
- ],
- [
- 'id' => $pluginName . '_' . SharedDataDictionary::SETTING_NAME_PAYMENT_LOCALE,
- 'title' => __('Payment screen language', 'mollie-payments-for-woocommerce'),
- 'type' => 'select',
- 'options' => [
- SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE => __(
- 'Automatically send WordPress language',
- 'mollie-payments-for-woocommerce'
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
- SharedDataDictionary::SETTING_LOCALE_DETECT_BY_BROWSER => __(
- 'Detect using browser language',
- 'mollie-payments-for-woocommerce'
- ),
- 'en_US' => __('English', 'mollie-payments-for-woocommerce'),
- 'nl_NL' => __('Dutch', 'mollie-payments-for-woocommerce'),
- 'nl_BE' => __('Flemish (Belgium)', 'mollie-payments-for-woocommerce'),
- 'fr_FR' => __('French', 'mollie-payments-for-woocommerce'),
- 'fr_BE' => __('French (Belgium)', 'mollie-payments-for-woocommerce'),
- 'de_DE' => __('German', 'mollie-payments-for-woocommerce'),
- 'de_AT' => __('Austrian German', 'mollie-payments-for-woocommerce'),
- 'de_CH' => __('Swiss German', 'mollie-payments-for-woocommerce'),
- 'es_ES' => __('Spanish', 'mollie-payments-for-woocommerce'),
- 'ca_ES' => __('Catalan', 'mollie-payments-for-woocommerce'),
- 'pt_PT' => __('Portuguese', 'mollie-payments-for-woocommerce'),
- 'it_IT' => __('Italian', 'mollie-payments-for-woocommerce'),
- 'nb_NO' => __('Norwegian', 'mollie-payments-for-woocommerce'),
- 'sv_SE' => __('Swedish', 'mollie-payments-for-woocommerce'),
- 'fi_FI' => __('Finnish', 'mollie-payments-for-woocommerce'),
- 'da_DK' => __('Danish', 'mollie-payments-for-woocommerce'),
- 'is_IS' => __('Icelandic', 'mollie-payments-for-woocommerce'),
- 'hu_HU' => __('Hungarian', 'mollie-payments-for-woocommerce'),
- 'pl_PL' => __('Polish', 'mollie-payments-for-woocommerce'),
- 'lv_LV' => __('Latvian', 'mollie-payments-for-woocommerce'),
- 'lt_LT' => __('Lithuanian', 'mollie-payments-for-woocommerce'),
- ],
- 'desc' => sprintf(
- /* translators: Placeholder 1: link tag Placeholder 2: closing tag */
- __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'),
- '',
- ' '
- ),
- 'default' => SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE,
- ],
- [
- 'id' => $pluginName . '_customer_details',
- 'title' => __('Store customer details at Mollie', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: enabled or disabled Placeholder 2: translated string */
- __(
- 'Should Mollie store customers name and email address for Single Click Payments? Default %1$s
. Required if WooCommerce Subscriptions is being used! Read more about %2$s and how it improves your conversion.',
- 'mollie-payments-for-woocommerce'
- ),
- strtolower(__('Enabled', 'mollie-payments-for-woocommerce')),
- __('Single Click Payments', 'mollie-payments-for-woocommerce')
- ),
- 'type' => 'checkbox',
- 'default' => 'yes',
-
- ],
- [
- 'id' => $pluginName . '_api_switch',
- 'title' => __(
- 'Select API Method',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'select',
- 'options' => [
- PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_ORDER
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
- . ')',
- PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_PAYMENT
- ),
- ],
- 'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER,
- 'desc' => sprintf(
- /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */
- __(
- 'Click %1$shere%2$s to read more about the differences between the Payments and Orders API',
- 'mollie-payments-for-woocommerce'
- ),
- '',
- ' '
- ),
- ],
- [
- 'id' => $pluginName . '_api_payment_description',
- 'title' => __(
- 'API Payment Description',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'text',
- 'default' => '{orderNumber}',
- 'desc' => sprintf(
- '
-
-
- %3$s',
- _x('Available variables', 'Payment description options', 'mollie-payments-for-woocommerce'),
- implode('', array_map(
- static function ($label, $label_description) {
- return sprintf(
- '
-
- %1$s
-
- ',
- $label,
- substr($label, 1, -1),
- $label_description
- );
- },
- array_keys($api_payment_description_labels),
- $api_payment_description_labels
- )),
- sprintf(
- /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */
- __(
- 'Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s',
- 'mollie-payments-for-woocommerce'
- ),
- '',
- '
'
- )
- ),
- ],
- [
- 'id' => $pluginName . '_gatewayFeeLabel',
- 'title' => __(
- 'Surcharge gateway fee label',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'text',
- 'custom_attributes' => ['maxlength' => '30'],
- 'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'),
- 'desc' => __(
- 'This is the label will appear in frontend when the surcharge applies',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- [
- 'id' => $pluginName . '_removeOptionsAndTransients',
- 'title' => __(
- 'Remove Mollie data from Database on uninstall',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'checkbox',
- 'default' => 'no',
- 'desc' => __("Remove options and scheduled actions from database when uninstalling the plugin.", "mollie-payments-for-woocommerce") . ' (' . strtolower(
- __('Clear now', 'mollie-payments-for-woocommerce')
- ) . ' )',
- ],
- [
- 'id' => $pluginName . '_sectionend',
- 'type' => 'sectionend',
- ],
-];
-
-return apply_filters('inpsyde.mollie-advanced-settings', $mollieAdvancedSettings, $pluginName);
diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php
deleted file mode 100644
index 2ef1c3fa0..000000000
--- a/inc/settings/mollie_applepay_settings.php
+++ /dev/null
@@ -1,122 +0,0 @@
- $title . '_' . 'title',
- 'title' => __('Apple Pay', 'mollie-payments-for-woocommerce'),
- 'type' => 'title',
- 'desc' => '' . __('The following options are required to use the Apple Pay gateway', 'mollie-payments-for-woocommerce') . '
',
- ],
-
- [
- 'id' => 'enabled',
- 'title' => __('Enable/Disable', 'mollie-payments-for-woocommerce'),
- /* translators: Placeholder 1: Gateway title */
- 'desc' => sprintf(__('Enable %s', 'mollie-payments-for-woocommerce'), $title),
- 'type' => 'checkbox',
- 'default' => 'yes',
- 'value' => isset($applePayOption['enabled']) ? $applePayOption['enabled'] : 'yes',
-
- ],
- [
- 'id' => 'title',
- 'title' => __('Title', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: Gateway title */
- __(
- 'This controls the title which the user sees during checkout. Default %s
',
- 'mollie-payments-for-woocommerce'
- ),
- $title
- ),
- 'desc_tip' => true,
- 'type' => 'text',
- 'default' => $title,
- 'value' => isset($applePayOption['title']) ? $applePayOption['title'] : $title,
-
- ],
- [
- 'id' => 'display_logo',
- 'title' => __('Display logo', 'mollie-payments-for-woocommerce'),
- 'desc' => __(
- 'Display logo',
- 'mollie-payments-for-woocommerce'
- ),
- 'desc_tip' => true,
- 'type' => 'checkbox',
- 'default' => 'yes',
- 'value' => isset($applePayOption['display_logo']) ? $applePayOption['display_logo'] : 'yes',
-
- ],
- [
- 'id' => 'description',
- 'title' => __('Description', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: Gateway description */
- __(
- 'Payment method description that the customer will see on your checkout. Default %s
',
- 'mollie-payments-for-woocommerce'
- ),
- $description
- ),
- 'desc_tip' => true,
- 'type' => 'text',
- 'default' => $description,
- 'value' => isset($applePayOption['description']) ? $applePayOption['description'] : $description,
- ],
- [
- 'id' => $pluginId . '_' . 'sectionend',
- 'type' => 'sectionend',
- ],
- [
- 'id' => $title . '_' . 'title_button',
- 'title' => __(
- 'Apple Pay button settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'type' => 'title',
- 'desc' => '' . __('The following options are required to use the Apple Pay Direct Button', 'mollie-payments-for-woocommerce') . '
',
- ],
- [
- 'id' => 'mollie_apple_pay_button_enabled_cart',
- 'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: enabled or disabled */
- __(
- 'Enable the Apple Pay direct buy button on the Cart page',
- 'mollie-payments-for-woocommerce'
- ),
- $description
- ),
- 'type' => 'checkbox',
- 'default' => 'no',
- 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_cart']) ? $applePayOption['mollie_apple_pay_button_enabled_cart'] : 'no',
-
- ],
- [
- 'id' => 'mollie_apple_pay_button_enabled_product',
- 'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'),
- 'desc' => sprintf(
- /* translators: Placeholder 1: enabled or disabled */
- __(
- 'Enable the Apple Pay direct buy button on the Product page',
- 'mollie-payments-for-woocommerce'
- ),
- $description
- ),
- 'type' => 'checkbox',
- 'default' => 'no',
- 'value' => isset($applePayOption['mollie_apple_pay_button_enabled_product']) ? $applePayOption['mollie_apple_pay_button_enabled_product'] : 'no',
-
- ],
- [
- 'id' => $pluginName . '_' . 'sectionend',
- 'type' => 'sectionend',
- ],
-];
diff --git a/inc/settings/mollie_components.php b/inc/settings/mollie_components.php
deleted file mode 100644
index ac81476d9..000000000
--- a/inc/settings/mollie_components.php
+++ /dev/null
@@ -1,170 +0,0 @@
- 'title',
- 'id' => 'mollie_components_styles',
- 'title' => _x(
- 'Base Styles',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- StylesPropertiesDictionary::BACKGROUND_COLOR => [
- 'type' => 'color',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::BACKGROUND_COLOR,
- 'title' => _x('Background Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => '#ffffff',
- ],
- StylesPropertiesDictionary::TEXT_COLOR => [
- 'type' => 'color',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_COLOR,
- 'title' => _x('Text Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => '#000000',
- ],
- StylesPropertiesDictionary::INPUT_PLACEHOLDER => [
- 'type' => 'color',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::INPUT_PLACEHOLDER,
- 'title' => _x('Placeholder Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => '#cccccc',
- ],
- StylesPropertiesDictionary::FONT_SIZE => [
- 'type' => 'text',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::FONT_SIZE,
- 'title' => _x('Font Size', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'desc_tip' => _x(
- 'Defines the component font size. Allowed units: \'em\', \'px\', \'rem\'.',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'default' => '16px',
- ],
- StylesPropertiesDictionary::FONT_WEIGHT => [
- 'type' => 'select',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::FONT_WEIGHT,
- 'title' => _x('Font Weight', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => 'normal',
- 'options' => [
- 'lighter' => _x('Lighter', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'normal' => _x('Regular', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'bolder' => _x('Bold', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- ],
- ],
- StylesPropertiesDictionary::LETTER_SPACING => [
- 'type' => 'number',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::LETTER_SPACING,
- 'title' => _x('Letter Spacing', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => '0',
- ],
- StylesPropertiesDictionary::LINE_HEIGHT => [
- 'type' => 'number',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::LINE_HEIGHT,
- 'title' => _x('Line Height', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => '1.2',
- 'custom_attributes' => [
- 'step' => '.1',
- ],
- ],
- StylesPropertiesDictionary::PADDING => [
- 'type' => 'text',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::PADDING,
- 'title' => _x('Padding', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'desc_tip' => _x(
- 'Add padding to the components. Allowed units include `16px 16px 16px 16px` and `em`, `px`, `rem`.',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'default' => '.63em',
- ],
- StylesPropertiesDictionary::TEXT_ALIGN => [
- 'type' => 'select',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_ALIGN,
- 'title' => _x('Align Text', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => 'left',
- 'options' => [
- 'left' => _x('Left', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'right' => _x('Right', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'center' => _x('Center', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'justify' => _x('Justify', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- ],
- ],
- StylesPropertiesDictionary::TEXT_TRANSFORM => [
- 'type' => 'select',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::TEXT_TRANSFORM,
- 'title' => _x('Transform Text ', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'default' => 'none',
- 'options' => [
- 'none' => _x(
- 'None',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'capitalize' => _x(
- 'Capitalize',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'uppercase' => _x(
- 'Uppercase',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'lowercase' => _x(
- 'Lowercase',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'full-width' => _x(
- 'Full Width',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'full-size-kana' => _x(
- 'Full Size Kana',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- ],
- [
- 'type' => 'sectionend',
- 'id' => 'mollie_components_styles',
- ],
- [
- 'type' => 'title',
- 'id' => 'mollie_components_invalid_styles',
- 'title' => _x(
- 'Invalid Status Styles',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- StylesPropertiesDictionary::INVALID_TEXT_COLOR => [
- 'type' => 'color',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::INVALID_TEXT_COLOR,
- 'title' => _x('Text Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'desc_tip' => _x(
- 'Text Color for invalid input.',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'default' => '#000000',
- ],
- StylesPropertiesDictionary::INVALID_BACKGROUND_COLOR => [
- 'type' => 'color',
- 'id' => 'mollie_components_' . StylesPropertiesDictionary::INVALID_BACKGROUND_COLOR,
- 'title' => _x('Background Color', 'Mollie Components Settings', 'mollie-payments-for-woocommerce'),
- 'desc_tip' => _x(
- 'Background Color for invalid input.',
- 'Mollie Components Settings',
- 'mollie-payments-for-woocommerce'
- ),
- 'default' => '#FFF0F0',
- ],
- [
- 'type' => 'sectionend',
- 'id' => 'mollie_components_invalid_styles',
- ],
-];
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 3f6cd5194..33e29a680 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -7,7 +7,7 @@
./src
./tests/
-
+
diff --git a/public/images/logo/black.svg b/public/images/logo/black.svg
new file mode 100644
index 000000000..76e679294
--- /dev/null
+++ b/public/images/logo/black.svg
@@ -0,0 +1,18 @@
+
+
+
+
+
+
diff --git a/resources/js/mollie-settings-2024.js b/resources/js/mollie-settings-2024.js
new file mode 100644
index 000000000..659f2f5d2
--- /dev/null
+++ b/resources/js/mollie-settings-2024.js
@@ -0,0 +1,11 @@
+document.addEventListener('DOMContentLoaded', function () {
+ const noticeCancelButtons = document.querySelectorAll('.mollie-notice button');
+ if (noticeCancelButtons.length === 0) {
+ return;
+ }
+ noticeCancelButtons.forEach((button) => {
+ button.addEventListener('click', function(){
+ button.parentNode.remove();
+ });
+ })
+});
diff --git a/resources/js/settings.js b/resources/js/settings.js
index 0cd19c22a..54eb4515c 100644
--- a/resources/js/settings.js
+++ b/resources/js/settings.js
@@ -4,17 +4,6 @@
const {current_section = false} = mollieSettingsData
jQuery(function($) {
- $('#mollie-payments-for-woocommerce_test_mode_enabled').change(function() {
- if ($(this).is(':checked'))
- {
- $('#mollie-payments-for-woocommerce_test_api_key').attr('required', true).closest('tr').show();
- }
- else
- {
- $('#mollie-payments-for-woocommerce_test_api_key').removeAttr('required').closest('tr').hide();
- }
- }).change();
-
if(_.isEmpty(mollieSettingsData)){
return
}
diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php
index cfab7d182..5a92e7104 100644
--- a/src/Activation/ActivationModule.php
+++ b/src/Activation/ActivationModule.php
@@ -40,8 +40,9 @@ public function run(ContainerInterface $container): bool
'init',
[$this, 'pluginInit']
);
+
+ add_action('admin_init', [$this, 'mollieWcNoticeApiKeyMissing']);
$this->declareCompatibleWithHPOS();
- $this->mollieWcNoticeApiKeyMissing();
$this->appleValidationFileRewriteRules();
return true;
}
diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php
index eeb8cd882..b4312bad7 100644
--- a/src/Assets/AssetsModule.php
+++ b/src/Assets/AssetsModule.php
@@ -490,7 +490,7 @@ public function enqueueAdvancedSettingsJS($ar)
if (
$current_screen->id !== 'woocommerce_page_wc-settings'
|| $current_tab !== 'mollie_settings'
- || $current_section !== 'advanced'
+ || $current_section !== 'mollie_advanced'
) {
return;
}
@@ -640,9 +640,32 @@ function () use ($container, $hasBlocksEnabled, $pluginVersion, $dataService, $p
true
);
+ wp_register_script(
+ 'mollie_wc_settings_2024',
+ $this->getPluginUrl(
+ $pluginUrl,
+ '/public/js/mollie-settings-2024.min.js'
+ ),
+ ['underscore', 'jquery'],
+ $pluginVersion,
+ true
+ );
+ $this->enqueueMollieSettings();
$this->enqueueIconSettings($current_section);
}
}
);
}
+
+ protected function enqueueMollieSettings()
+ {
+
+ $uri = isset($_SERVER['REQUEST_URI']) ? wc_clean(
+ // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ wp_unslash($_SERVER['REQUEST_URI'])
+ ) : '';
+ if (is_string($uri) && strpos($uri, 'tab=mollie_settings')) {
+ wp_enqueue_script('mollie_wc_settings_2024');
+ }
+ }
}
diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php
index 72cade0d9..b8987f101 100644
--- a/src/Gateway/GatewayModule.php
+++ b/src/Gateway/GatewayModule.php
@@ -707,6 +707,7 @@ public function buildPaymentMethod(
Surcharge $surchargeService,
array $apiMethod
) {
+
$transformedId = ucfirst($id);
$paymentMethodClassName = 'Mollie\\WooCommerce\\PaymentMethods\\' . $transformedId;
$paymentMethod = new $paymentMethodClassName(
diff --git a/src/PaymentMethods/Alma.php b/src/PaymentMethods/Alma.php
index 57ac08fa4..d127a9864 100644
--- a/src/PaymentMethods/Alma.php
+++ b/src/PaymentMethods/Alma.php
@@ -26,6 +26,7 @@ protected function getConfig(): array
'billingAddress',
'shippingAddress',
],
+ 'docs' => 'https://www.mollie.com/gb/payments/alma',
];
}
diff --git a/src/PaymentMethods/Applepay.php b/src/PaymentMethods/Applepay.php
index 63a32c9ab..b1ae1f9eb 100644
--- a/src/PaymentMethods/Applepay.php
+++ b/src/PaymentMethods/Applepay.php
@@ -24,6 +24,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'Subscription' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/apple-pay',
];
}
diff --git a/src/PaymentMethods/Bancomatpay.php b/src/PaymentMethods/Bancomatpay.php
index 054ef951d..7f9600fa1 100644
--- a/src/PaymentMethods/Bancomatpay.php
+++ b/src/PaymentMethods/Bancomatpay.php
@@ -21,6 +21,7 @@ public function getConfig(): array
],
'filtersOnBuild' => false,
'confirmationDelayed' => false,
+ 'docs' => 'https://www.mollie.com/gb/payments/bancomat-pay',
];
}
diff --git a/src/PaymentMethods/Bancontact.php b/src/PaymentMethods/Bancontact.php
index 9d01c9d93..14ac3832d 100644
--- a/src/PaymentMethods/Bancontact.php
+++ b/src/PaymentMethods/Bancontact.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/bancontact',
];
}
diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php
index 93a6f3f10..6abc75866 100644
--- a/src/PaymentMethods/Banktransfer.php
+++ b/src/PaymentMethods/Banktransfer.php
@@ -42,6 +42,7 @@ protected function getConfig(): array
'confirmationDelayed' => true,
'SEPA' => false,
'customRedirect' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/bank-transfer',
];
}
diff --git a/src/PaymentMethods/Belfius.php b/src/PaymentMethods/Belfius.php
index ea98768f9..c8876451b 100644
--- a/src/PaymentMethods/Belfius.php
+++ b/src/PaymentMethods/Belfius.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/belfius',
];
}
diff --git a/src/PaymentMethods/Billie.php b/src/PaymentMethods/Billie.php
index 369f49521..0269b9da0 100644
--- a/src/PaymentMethods/Billie.php
+++ b/src/PaymentMethods/Billie.php
@@ -31,6 +31,7 @@ protected function getConfig(): array
'mollie-payments-for-woocommerce'
),
'companyPlaceholder' => __('Please enter your company name here.', 'mollie-payments-for-woocommerce'),
+ 'docs' => 'https://www.mollie.com/gb/payments/billie',
];
}
diff --git a/src/PaymentMethods/Blik.php b/src/PaymentMethods/Blik.php
index 83e05ef2c..c0590dcd6 100644
--- a/src/PaymentMethods/Blik.php
+++ b/src/PaymentMethods/Blik.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => false,
'SEPA' => false,
+ 'docs' => 'https://www.mollie.com/gb/payments/blik',
];
}
diff --git a/src/PaymentMethods/Creditcard.php b/src/PaymentMethods/Creditcard.php
index 237ad4ce7..85e26b432 100644
--- a/src/PaymentMethods/Creditcard.php
+++ b/src/PaymentMethods/Creditcard.php
@@ -27,6 +27,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'Subscription' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/credit-card',
];
}
diff --git a/src/PaymentMethods/Directdebit.php b/src/PaymentMethods/Directdebit.php
index 5b4b91d34..0b7bf94fa 100644
--- a/src/PaymentMethods/Directdebit.php
+++ b/src/PaymentMethods/Directdebit.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => false,
+ 'docs' => 'https://www.mollie.com/gb/payments/direct-debit',
];
}
diff --git a/src/PaymentMethods/Eps.php b/src/PaymentMethods/Eps.php
index 15bd8eb5d..327a53acd 100644
--- a/src/PaymentMethods/Eps.php
+++ b/src/PaymentMethods/Eps.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/eps',
];
}
diff --git a/src/PaymentMethods/Giftcard.php b/src/PaymentMethods/Giftcard.php
index 812e3cd7f..b5154541a 100644
--- a/src/PaymentMethods/Giftcard.php
+++ b/src/PaymentMethods/Giftcard.php
@@ -70,6 +70,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => false,
'SEPA' => false,
+ 'docs' => 'https://www.mollie.com/gb/payments/gift-cards',
];
}
diff --git a/src/PaymentMethods/Giropay.php b/src/PaymentMethods/Giropay.php
index 440b8f0b8..8939ce56c 100644
--- a/src/PaymentMethods/Giropay.php
+++ b/src/PaymentMethods/Giropay.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://help.mollie.com/hc/en-gb/articles/19745480480786-Giropay-Depreciation-FAQ',
];
}
diff --git a/src/PaymentMethods/Ideal.php b/src/PaymentMethods/Ideal.php
index bc2e67139..08b28c0b3 100644
--- a/src/PaymentMethods/Ideal.php
+++ b/src/PaymentMethods/Ideal.php
@@ -24,6 +24,7 @@ public function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/ideal-2-0',
];
}
diff --git a/src/PaymentMethods/In3.php b/src/PaymentMethods/In3.php
index d86beb12d..f839c6e71 100644
--- a/src/PaymentMethods/In3.php
+++ b/src/PaymentMethods/In3.php
@@ -29,6 +29,7 @@ public function getConfig(): array
),
'phonePlaceholder' => __('Please enter your phone here. +316xxxxxxxx', 'mollie-payments-for-woocommerce'),
'birthdatePlaceholder' => __('Please enter your birthdate here.', 'mollie-payments-for-woocommerce'),
+ 'docs' => 'https://www.mollie.com/gb/payments/ideal-in3',
];
}
diff --git a/src/PaymentMethods/Kbc.php b/src/PaymentMethods/Kbc.php
index 4005b83fd..99de76e93 100644
--- a/src/PaymentMethods/Kbc.php
+++ b/src/PaymentMethods/Kbc.php
@@ -23,6 +23,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/kbc-cbc',
];
}
diff --git a/src/PaymentMethods/Klarna.php b/src/PaymentMethods/Klarna.php
index bdad1b516..0c0b3ccc8 100644
--- a/src/PaymentMethods/Klarna.php
+++ b/src/PaymentMethods/Klarna.php
@@ -26,6 +26,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'orderMandatory' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/klarna',
];
}
diff --git a/src/PaymentMethods/Klarnapaylater.php b/src/PaymentMethods/Klarnapaylater.php
index 99140ba4a..edd6f6c99 100644
--- a/src/PaymentMethods/Klarnapaylater.php
+++ b/src/PaymentMethods/Klarnapaylater.php
@@ -26,6 +26,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'orderMandatory' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/klarna',
];
}
diff --git a/src/PaymentMethods/Klarnapaynow.php b/src/PaymentMethods/Klarnapaynow.php
index 32cd04a98..5cdddfeb3 100644
--- a/src/PaymentMethods/Klarnapaynow.php
+++ b/src/PaymentMethods/Klarnapaynow.php
@@ -26,6 +26,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'orderMandatory' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/klarna',
];
}
diff --git a/src/PaymentMethods/Klarnasliceit.php b/src/PaymentMethods/Klarnasliceit.php
index 9b97b3db3..dd8e31c21 100644
--- a/src/PaymentMethods/Klarnasliceit.php
+++ b/src/PaymentMethods/Klarnasliceit.php
@@ -26,6 +26,7 @@ protected function getConfig(): array
'confirmationDelayed' => false,
'SEPA' => false,
'orderMandatory' => true,
+ 'docs' => 'https://www.mollie.com/gb/payments/klarna',
];
}
diff --git a/src/PaymentMethods/Mybank.php b/src/PaymentMethods/Mybank.php
index a2f38ba23..e656d23ee 100644
--- a/src/PaymentMethods/Mybank.php
+++ b/src/PaymentMethods/Mybank.php
@@ -22,6 +22,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => false,
'SEPA' => false,
+ 'docs' => '',
];
}
diff --git a/src/PaymentMethods/Payconiq.php b/src/PaymentMethods/Payconiq.php
index 59f9899af..b89696c97 100644
--- a/src/PaymentMethods/Payconiq.php
+++ b/src/PaymentMethods/Payconiq.php
@@ -19,6 +19,7 @@ protected function getConfig(): array
'filtersOnBuild' => false,
'confirmationDelayed' => false,
'SEPA' => false,
+ 'docs' => '',
];
}
diff --git a/src/PaymentMethods/PaymentMethodsIconUrl.php b/src/PaymentMethods/PaymentMethodsIconUrl.php
index a1189ff8d..ed4c09a73 100644
--- a/src/PaymentMethods/PaymentMethodsIconUrl.php
+++ b/src/PaymentMethods/PaymentMethodsIconUrl.php
@@ -87,7 +87,7 @@ public function svgUrlForPaymentMethod($paymentMethodName)
return $this->generateIconHtml($svgUrl);
}
- public function generateIconHtml($svgUrl)
+ public function generateIconHtml(string $svgUrl): string
{
return '
+
+
+
+
+
+ = $value['value']; // WPCS: XSS ok. ?>
+
+
+
+ = $value['desc']; // WPCS: XSS ok. ?>
+
+
+
+ id,
+ [$this, 'output_sections']
+ );
+ }
+
+ protected function pages(): array
+ {
+ return [
+ PageNoApiKey::class,
+ PageApiKeys::class,
+ PagePaymentMethods::class,
+ PageAdvancedSettings::class,
+ ];
+ }
+
+ public function get_settings($currentSection = '')
+ {
+ $defaultSection = $currentSection;
+ $connectionStatus = $this->settings->getConnectionStatus();
+
+ if (!$connectionStatus) {
+ $defaultSection = PageNoApiKey::slug();
+ }
+
+ if ($connectionStatus && $defaultSection === PageNoApiKey::slug()) {
+ $defaultSection = PageApiKeys::slug();
+ }
+
+ if ($defaultSection === '') {
+ $defaultSection = PageApiKeys::slug();
+ }
+
+ $mollieSettings = null;
+ foreach ($this->pages() as $pageClass) {
+ /** @var AbstractPage $page */
+ $page = new $pageClass(
+ $this->settings,
+ $this->pluginUrl,
+ $this->pages(),
+ $defaultSection,
+ $connectionStatus,
+ $this->isTestModeEnabled,
+ $this->mollieGateways,
+ $this->paymentMethods,
+ $this->dataHelper
+ );
+ if ($page::slug() === $defaultSection) {
+ $mollieSettings = $this->hideKeysIntoStars($page->settings());
+ break;
+ }
+ }
+
+ return apply_filters(
+ 'woocommerce_get_settings_' . $this->id,
+ $mollieSettings,
+ $currentSection
+ );
+ }
+
+ /**
+ * @param $settings
+ *
+ * @return array
+ */
+ protected function hideKeysIntoStars($settings): array
+ {
+ $liveKeyName = 'mollie-payments-for-woocommerce_live_api_key';
+ $testKeyName = 'mollie-payments-for-woocommerce_test_api_key';
+ $liveValue = get_option($liveKeyName);
+ $testValue = get_option($testKeyName);
+
+ foreach ($settings as $key => $setting) {
+ if (
+ ($setting['id']
+ === $liveKeyName
+ && $liveValue)
+ || ($setting['id']
+ === $testKeyName
+ && $testValue)
+ ) {
+ $settings[$key]['value'] = '**********';
+ }
+ }
+ return $settings;
+ }
+
+ /**
+ * Save settings
+ *
+ * @since 1.0
+ */
+ public function save()
+ {
+ global $current_section;
+
+ $settings = $this->get_settings($current_section);
+ $settings = $this->saveApiKeys($settings);
+ WC_Admin_Settings::save_fields($settings);
+ }
+
+ /**
+ * @param $settings
+ *
+ * @return array
+ */
+ protected function saveApiKeys($settings)
+ {
+ $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS);
+ $isNonceValid = wp_verify_nonce(
+ $nonce,
+ 'woocommerce-settings'
+ );
+ if (!$isNonceValid) {
+ return $settings;
+ }
+ $liveKeyName = 'mollie-payments-for-woocommerce_live_api_key';
+ $testKeyName = 'mollie-payments-for-woocommerce_test_api_key';
+ $liveValueInDb = get_option($liveKeyName);
+ $testValueInDb = get_option($testKeyName);
+ $postedLiveValue = isset($_POST[$liveKeyName]) ? sanitize_text_field(wp_unslash($_POST[$liveKeyName])) : '';
+ $postedTestValue = isset($_POST[$testKeyName]) ? sanitize_text_field(wp_unslash($_POST[$testKeyName])) : '';
+
+ foreach ($settings as $setting) {
+ if (
+ $setting['id']
+ === $liveKeyName
+ && $liveValueInDb
+ ) {
+ if ($postedLiveValue === '**********') {
+ $_POST[$liveKeyName] = $liveValueInDb;
+ } else {
+ $pattern = '/^live_\w{30,}$/';
+ $this->validateApiKeyOrRemove(
+ $pattern,
+ $postedLiveValue,
+ $liveKeyName
+ );
+ }
+ } elseif (
+ $setting['id']
+ === $testKeyName
+ && $testValueInDb
+ ) {
+ if ($postedTestValue === '**********') {
+ $_POST[$testKeyName] = $testValueInDb;
+ } else {
+ $pattern = '/^test_\w{30,}$/';
+ $this->validateApiKeyOrRemove(
+ $pattern,
+ $postedTestValue,
+ $testKeyName
+ );
+ }
+ }
+ }
+ return $settings;
+ }
+
+ /**
+ * @param $pattern
+ * @param $value
+ * @param $keyName
+ *
+ */
+ protected function validateApiKeyOrRemove($pattern, $value, $keyName)
+ {
+ $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS);
+ $isNonceValid = wp_verify_nonce(
+ $nonce,
+ 'woocommerce-settings'
+ );
+ if (!$isNonceValid) {
+ return;
+ }
+ $hasApiFormat = preg_match($pattern, $value);
+ if (!$hasApiFormat) {
+ unset($_POST[$keyName]);
+ }
+ }
+}
diff --git a/src/Settings/Page/AbstractPage.php b/src/Settings/Page/AbstractPage.php
new file mode 100644
index 000000000..86ce33627
--- /dev/null
+++ b/src/Settings/Page/AbstractPage.php
@@ -0,0 +1,90 @@
+settings = $settings;
+ $this->pluginUrl = $pluginUrl;
+ $this->currentSection = $currentSection;
+ $this->connectionStatus = $connectionStatus;
+ $this->testModeEnabled = $testModeEnabled;
+ $this->pages = $pages;
+ $this->mollieGateways = $mollieGateways;
+ $this->paymentMethods = $paymentMethods;
+ $this->dataHelper = $dataHelper;
+ }
+
+ abstract public static function isTab(): bool;
+
+ abstract public static function slug(): string;
+
+ public static function tabName(): string
+ {
+ return 'tabName';
+ }
+
+ protected function sections(): array
+ {
+ return [];
+ }
+
+ public function settings(): array
+ {
+ $settings = [];
+ $styles = [];
+
+ foreach ($this->sections() as $sectionClass) {
+ /** @var AbstractSection $section */
+ $section = new $sectionClass(
+ $this->settings,
+ $this->pluginUrl,
+ $this->pages,
+ $this->currentSection,
+ $this->connectionStatus,
+ $this->testModeEnabled,
+ $this->mollieGateways,
+ $this->paymentMethods,
+ $this->dataHelper
+ );
+ foreach ($section->config() as $field) {
+ $settings[] = $field;
+ }
+ $styles[$sectionClass] = $section->styles();
+ }
+ array_unshift($settings, [
+ 'id' => $this->settings->getSettingId('styles'),
+ 'type' => 'mollie_content',
+ 'value' => implode($styles),
+ ]);
+ return $settings;
+ }
+}
diff --git a/src/Settings/Page/Components.php b/src/Settings/Page/Components.php
deleted file mode 100644
index 59548e33f..000000000
--- a/src/Settings/Page/Components.php
+++ /dev/null
@@ -1,68 +0,0 @@
-id = 'mollie_components';
- $this->label = __('Mollie Components', 'mollie-payments-for-woocommerce');
- $this->pluginPath = $pluginPath;
-
- parent::__construct();
- }
-
- public function output()
- {
- $settings = $this->get_settings();
- WC_Admin_Settings::output_fields($settings);
- }
-
- public function get_settings()
- {
- $componentsSettings = $this->componentsSettings();
-
- /**
- * Filter Component Settings
- *
- * @param array $componentSettings Default components settings for the Credit Card Gateway
- */
- $componentsSettings = apply_filters(self::FILTER_COMPONENTS_SETTINGS, $componentsSettings);
-
- return $componentsSettings;
- }
-
- protected function componentsSettings()
- {
- $componentSettingsFilePath = $this->componentsFilePath();
-
- if (!file_exists($componentSettingsFilePath)) {
- return [];
- }
-
- $components = include $componentSettingsFilePath;
-
- if (!is_array($components)) {
- $components = [];
- }
-
- return $components;
- }
-
- protected function componentsFilePath()
- {
- return $this->pluginPath . '/inc/settings/mollie_components.php';
- }
-}
diff --git a/src/Settings/Page/MollieSettingsPage.php b/src/Settings/Page/MollieSettingsPage.php
deleted file mode 100644
index fd265b692..000000000
--- a/src/Settings/Page/MollieSettingsPage.php
+++ /dev/null
@@ -1,789 +0,0 @@
-id = 'mollie_settings';
- $this->label = __('Mollie Settings', 'mollie-payments-for-woocommerce');
- $this->settingsHelper = $settingsHelper;
- $this->pluginPath = $pluginPath;
- $this->registeredGateways = $gateways;
- $this->isTestModeEnabled = $isTestModeEnabled;
- $this->dataHelper = $dataHelper;
- $this->paymentMethods = $paymentMethods;
- add_action(
- 'woocommerce_sections_' . $this->id,
- [$this, 'output_sections']
- );
- parent::__construct();
- }
-
- public function output()
- {
- global $current_section;
- $settings = $this->get_settings($current_section);
- $settings = $this->hideKeysIntoStars($settings);
-
- WC_Admin_Settings::output_fields($settings);
- }
-
- public function get_settings($currentSection = '')
- {
- $mollieSettings = $this->addGlobalSettingsFields([]);
-
- if ('mollie_components' === $currentSection) {
- $mollieSettings = $this->sectionSettings(
- $this->componentsFilePath()
- );
- }
- if ('applepay_button' === $currentSection) {
- $mollieSettings = $this->sectionSettings($this->applePaySection());
- }
- if ('advanced' === $currentSection) {
- $mollieSettings = $this->sectionSettings($this->advancedSectionFilePath());
- }
-
- /**
- * Filter Component Settings
- *
- * @param array $componentSettings Default components settings for the Credit Card Gateway
- */
- $mollieSettings = apply_filters(
- self::FILTER_COMPONENTS_SETTINGS,
- $mollieSettings
- );
-
- return apply_filters(
- 'woocommerce_get_settings_' . $this->id,
- $mollieSettings,
- $currentSection
- );
- }
-
- /**
- * @param array $settings
- * @return array
- */
- public function addGlobalSettingsFields(array $settings): array
- {
- $presentationText = __(
- 'Quickly integrate all major payment methods in WooCommerce, wherever you need them.',
- 'mollie-payments-for-woocommerce'
- );
- $presentationText .= __(
- ' Simply drop them ready-made into your WooCommerce webshop with this powerful plugin by Mollie.',
- 'mollie-payments-for-woocommerce'
- );
- $presentationText .= __(
- ' Mollie is dedicated to making payments better for WooCommerce. ',
- 'mollie-payments-for-woocommerce'
- );
- $presentationText .= '' . __(
- 'Please go to',
- 'mollie-payments-for-woocommerce'
- ) . '' . __(
- ' the signup page',
- 'mollie-payments-for-woocommerce'
- ) . ' ';
- $presentationText .= __(
- ' to create a new Mollie account and start receiving payments in a couple of minutes. ',
- 'mollie-payments-for-woocommerce'
- );
- $presentationText .= __(
- 'Contact ',
- 'mollie-payments-for-woocommerce'
- ) . 'info@mollie.com ';
- $presentationText .= __(
- ' if you have any questions or comments about this plugin.',
- 'mollie-payments-for-woocommerce'
- ) . '
';
- $presentationText .= '' . __(
- 'Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period.',
- 'mollie-payments-for-woocommerce'
- ) . '
';
-
- $presentation = ''
- . ''
- . ' '
- . '' . $presentationText . '
';
-
- $content = ''
- . $presentation
- . $this->settingsHelper->getPluginStatus()
- . $this->getMollieMethods();
-
- $debugDesc = __('Log plugin events.', 'mollie-payments-for-woocommerce');
-
- // Display location of log files
-
-
- $debugDesc .= ' ' . sprintf(
- /* translators: Placeholder 1: Location of the log files */
- __(
- 'Log files are saved to %s
',
- 'mollie-payments-for-woocommerce'
- ),
- defined('WC_LOG_DIR') ? WC_LOG_DIR
- : WC()->plugin_path() . '/logs/'
- );
-
- // Global Mollie settings
- $mollieSettings = [
- [
- 'id' => $this->settingsHelper->getSettingId('title'),
- 'title' => __('Mollie Settings', 'mollie-payments-for-woocommerce'),
- 'type' => 'title',
- 'desc' => '' . $content . '
'
- . '' . __(
- 'The following options are required to use the plugin and are used by all Mollie payment methods',
- 'mollie-payments-for-woocommerce'
- ) . '
',
- ],
- [
- 'id' => $this->settingsHelper->getSettingId('live_api_key'),
- 'title' => __('Live API key', 'mollie-payments-for-woocommerce'),
- 'default' => '',
- 'type' => 'text',
- 'desc' => sprintf(
- /* translators: Placeholder 1: API key mode (live or test). The surrounding %s's Will be replaced by a link to the Mollie profile */
- __(
- 'The API key is used to connect to Mollie. You can find your %1$s API key in your %2$sMollie account%3$s',
- 'mollie-payments-for-woocommerce'
- ),
- 'live',
- '',
- ' '
- ),
- 'css' => 'width: 350px',
- 'placeholder' => __(
- 'Live API key should start with live_',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- [
- 'id' => $this->settingsHelper->getSettingId('test_mode_enabled'),
- 'title' => __('Enable test mode', 'mollie-payments-for-woocommerce'),
- 'default' => 'no',
- 'type' => 'checkbox',
- 'desc_tip' => __(
- 'Enable test mode if you want to test the plugin without using real payments.',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- [
- 'id' => $this->settingsHelper->getSettingId('test_api_key'),
- 'title' => __('Test API key', 'mollie-payments-for-woocommerce'),
- 'default' => '',
- 'type' => 'text',
- 'desc' => sprintf(
- /* translators: Placeholder 1: API key mode (live or test). The surrounding %s's Will be replaced by a link to the Mollie profile */
- __(
- 'The API key is used to connect to Mollie. You can find your %1$s API key in your %2$sMollie account%3$s',
- 'mollie-payments-for-woocommerce'
- ),
- 'test',
- '',
- ' '
- ),
- 'css' => 'width: 350px',
- 'placeholder' => __(
- 'Test API key should start with test_',
- 'mollie-payments-for-woocommerce'
- ),
- ],
- [
- 'id' => $this->settingsHelper->getSettingId('debug'),
- 'title' => __('Debug Log', 'mollie-payments-for-woocommerce'),
- 'type' => 'checkbox',
- 'desc' => $debugDesc,
- 'default' => 'yes',
- ],
- [
- 'id' => $this->settingsHelper->getSettingId('sectionend'),
- 'type' => 'sectionend',
- ],
- ];
-
- return $this->mergeSettings($settings, $mollieSettings);
- }
- /**
- * @return string
- */
- public function getMollieMethods(): string
- {
- $content = '';
-
- $dataHelper = $this->dataHelper;
-
- // Is Test mode enabled?
- $testMode = $this->isTestModeEnabled;
- $apiKey = $this->settingsHelper->getApiKey();
-
- if (
- isset($_GET['refresh-methods']) &&
- isset($_GET['nonce_mollie_refresh_methods']) &&
- wp_verify_nonce(
- filter_input(INPUT_GET, 'nonce_mollie_refresh_methods', FILTER_SANITIZE_SPECIAL_CHARS),
- 'nonce_mollie_refresh_methods'
- )
- ) {
- /* Reload active Mollie methods */
- $methods = $dataHelper->getAllPaymentMethods($apiKey, $testMode, false);
- foreach ($methods as $key => $method) {
- $methods['mollie_wc_gateway_' . $method['id']] = $method;
- unset($methods[$key]);
- }
- $this->registeredGateways = $methods;
- }
- if (
- isset($_GET['cleanDB-mollie']) && wp_verify_nonce(
- filter_input(INPUT_GET, 'nonce_mollie_cleanDb', FILTER_SANITIZE_SPECIAL_CHARS),
- 'nonce_mollie_cleanDb'
- )
- ) {
- $cleaner = $this->settingsHelper->cleanDb();
- $cleaner->cleanAll();
- //set default settings
- foreach ($this->paymentMethods as $paymentMethod) {
- $paymentMethod->getSettings();
- }
- }
-
- $iconAvailable = ' ' . strtolower(__('Enabled', 'mollie-payments-for-woocommerce')) . ' ';
- $iconNoAvailable = ' ' . strtolower(__('Disabled', 'mollie-payments-for-woocommerce')) . ' ';
-
- $content .= ' ';
- $content .= '';
-
- if ($testMode) {
- $content .= '
' . __('Test mode enabled.', 'mollie-payments-for-woocommerce') . ' ';
- }
-
- $content .= sprintf(
- /* translators: The surrounding %s's Will be replaced by a link to the Mollie profile */
- __(
- 'The following payment methods are activated in your %1$sMollie profile%2$s:',
- 'mollie-payments-for-woocommerce'
- ),
- '
',
- ' '
- );
-
- // Set a "refresh" link so payment method status can be refreshed from Mollie API
- $nonce_mollie_refresh_methods = wp_create_nonce('nonce_mollie_refresh_methods');
- $refresh_methods_url = add_query_arg(
- ['refresh-methods' => 1, 'nonce_mollie_refresh_methods' => $nonce_mollie_refresh_methods]
- );
-
- $content .= ' (
' . strtolower(
- __('Refresh', 'mollie-payments-for-woocommerce')
- ) . ' )';
-
- $content .= '
';
-
- $mollieGateways = $this->registeredGateways;//this are the gateways enabled
- $paymentMethods = $this->paymentMethods;
- if (empty($mollieGateways)) {
- $content .= '';
- $content .= __("No payment methods available", "mollie-payments-for-woocommerce");
- $content .= ' ';
- $content .= '
';
- return $content;
- }
- foreach ($paymentMethods as $paymentMethod) {
- $paymentMethodId = $paymentMethod->getProperty('id');
- $gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId;
- $paymentMethodEnabledAtMollie = array_key_exists($gatewayKey, $mollieGateways);
- $content .= '';
- $content .= $paymentMethod->getIconUrl();
- $content .= ' ' . esc_html($paymentMethod->title());
- if ($paymentMethodEnabledAtMollie) {
- $content .= $iconAvailable;
- $content .= ' ' . strtolower(
- __('Edit', 'mollie-payments-for-woocommerce')
- ) . ' ';
-
- $content .= ' ';
- continue;
- }
- $content .= $iconNoAvailable;
- $content .= ' ' . strtolower(
- __('Activate', 'mollie-payments-for-woocommerce')
- ) . ' ';
-
- $content .= '';
- }
-
- $content .= '';
- $content .= '
';
-
- // Make sure users also enable iDEAL when they enable SEPA Direct Debit
- // iDEAL is needed for the first payment of subscriptions with SEPA Direct Debit
- $content = $this->checkDirectDebitStatus($content);
-
- // Advice users to use bank transfer via Mollie, not
- // WooCommerce default BACS method
- $content = $this->checkMollieBankTransferNotBACS($content);
-
- // Warn users that all default WooCommerce checkout fields
- // are required to accept Klarna as payment method
- $content = $this->warnAboutRequiredCheckoutFieldForKlarna($content);
-
- // Warn users that all default WooCommerce checkout fields
- // and billing company name
- // are required to accept Billie as payment method
- $content = $this->warnAboutRequiredCheckoutFieldForBillie($content);
-
- return $content;
- }
-
- /**
- * @param string $gateway_class_name
- * @return string
- */
- protected function getGatewaySettingsUrl(string $gateway_class_name): string
- {
- return admin_url(
- 'admin.php?page=wc-settings&tab=checkout§ion=' . sanitize_title(strtolower($gateway_class_name))
- );
- }
-
- /**
- * @param $content
- *
- * @return string
- */
- protected function checkDirectDebitStatus($content): string
- {
- $hasCustomSepaSettings = $this->paymentMethods["directdebit"]->getProperty('enabled') !== false;
- $isSepaEnabled = !$hasCustomSepaSettings || $this->paymentMethods["directdebit"]->getProperty('enabled') === 'yes';
- $sepaGatewayAllowed = !empty($this->registeredGateways["mollie_wc_gateway_directdebit"]);
- if ($sepaGatewayAllowed && !$isSepaEnabled) {
- $warning_message = __(
- "You have WooCommerce Subscriptions activated, but not SEPA Direct Debit. Enable SEPA Direct Debit if you want to allow customers to pay subscriptions with iDEAL and/or other 'first' payment methods.",
- 'mollie-payments-for-woocommerce'
- );
-
- $content .= '';
- $content .= $warning_message;
- $content .= '
';
-
- return $content;
- }
-
- return $content;
- }
-
- /**
- * @param $content
- *
- * @return string
- */
- protected function checkMollieBankTransferNotBACS($content): string
- {
- $woocommerce_banktransfer_gateway = new WC_Gateway_BACS();
-
- if ($woocommerce_banktransfer_gateway->is_available()) {
- $content .= '';
- $content .= __(
- 'You have the WooCommerce default Direct Bank Transfer (BACS) payment gateway enabled in WooCommerce. Mollie strongly advices only using Bank Transfer via Mollie and disabling the default WooCommerce BACS payment gateway to prevent possible conflicts.',
- 'mollie-payments-for-woocommerce'
- );
- $content .= '
';
-
- return $content;
- }
-
- return $content;
- }
-
- /**
- * @param $content
- *
- * @return string
- */
- protected function warnAboutRequiredCheckoutFieldForKlarna($content): string
- {
- $isKlarnaEnabled = $this->isKlarnaEnabled();
- if ($isKlarnaEnabled) {
- $content .= '';
- $content .= sprintf(
- /* translators: Placeholder 1: Opening link tag. Placeholder 2: Closing link tag. Placeholder 3: Opening link tag. Placeholder 4: Closing link tag. */
- __(
- 'You have activated Klarna. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. For more information, go to %1$sKlarna Pay Later documentation%2$s or %3$sKlarna Slice it documentation%4$s',
- 'mollie-payments-for-woocommerce'
- ),
- '',
- ' ',
- '',
- ' '
- );
- $content .= '
';
-
- return $content;
- }
-
- return $content;
- }
-
- /**
- * @param array $settings
- * @param array $mollie_settings
- * @return array
- */
- protected function mergeSettings(array $settings, array $mollie_settings): array
- {
- $new_settings = [];
- $mollie_settings_merged = false;
-
- // Find payment gateway options index
- foreach ($settings as $index => $setting) {
- if (
- isset($setting['id']) && $setting['id'] === 'payment_gateways_options'
- && (!isset($setting['type']) || $setting['type'] !== 'sectionend')
- ) {
- $new_settings = array_merge($new_settings, $mollie_settings);
- $mollie_settings_merged = true;
- }
-
- $new_settings[] = $setting;
- }
-
- // Mollie settings not merged yet, payment_gateways_options not found
- if (!$mollie_settings_merged) {
- // Append Mollie settings
- $new_settings = array_merge($new_settings, $mollie_settings);
- }
-
- return $new_settings;
- }
-
- /**
- * @param $filePath
- *
- * @return array|mixed
- */
- protected function sectionSettings($filePath)
- {
- if (!file_exists($filePath)) {
- return [];
- }
-
- $section = include $filePath;
-
- if (!is_array($section)) {
- $section = [];
- }
-
- return $section;
- }
-
- /**
- * @return string
- */
- protected function componentsFilePath(): string
- {
- return $this->pluginPath . '/inc/settings/mollie_components.php';
- }
-
- /**
- * @return string
- */
- protected function applePaySection(): string
- {
- return $this->pluginPath . '/inc/settings/mollie_applepay_settings.php';
- }
-
- /**
- * @return string
- */
- protected function advancedSectionFilePath(): string
- {
- return $this->pluginPath . '/inc/settings/mollie_advanced_settings.php';
- }
-
- /**
- * @param $settings
- *
- * @return array
- */
- protected function hideKeysIntoStars($settings): array
- {
- $liveKeyName = 'mollie-payments-for-woocommerce_live_api_key';
- $testKeyName = 'mollie-payments-for-woocommerce_test_api_key';
- $liveValue = get_option($liveKeyName);
- $testValue = get_option($testKeyName);
-
- foreach ($settings as $key => $setting) {
- if (
- ($setting['id']
- === $liveKeyName
- && $liveValue)
- || ($setting['id']
- === $testKeyName
- && $testValue)
- ) {
- $settings[$key]['value'] = '**********';
- }
- }
- return $settings;
- }
-
- /**
- * Save settings
- *
- * @since 1.0
- */
- public function save()
- {
- global $current_section;
-
- $settings = $this->get_settings($current_section);
- if ('applepay_button' === $current_section) {
- $this->saveApplePaySettings();
- } else {
- $settings = $this->saveApiKeys($settings);
- WC_Admin_Settings::save_fields($settings);
- }
- }
-
- protected function saveApplePaySettings()
- {
- $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS);
- $isNonceValid = wp_verify_nonce(
- $nonce,
- 'woocommerce-settings'
- );
- if (!$isNonceValid) {
- return;
- }
- $data = filter_var_array($_POST, FILTER_SANITIZE_SPECIAL_CHARS);
-
- $applepaySettings = [];
- isset($data['enabled']) && ($data['enabled'] === '1') ?
- $applepaySettings['enabled'] = 'yes'
- : $applepaySettings['enabled'] = 'no';
- isset($data['display_logo']) && ($data['display_logo'] === '1') ?
- $applepaySettings['display_logo'] = 'yes'
- : $applepaySettings['display_logo'] = 'no';
- isset($data['mollie_apple_pay_button_enabled_cart'])
- && ($data['mollie_apple_pay_button_enabled_cart'] === '1') ?
- $applepaySettings['mollie_apple_pay_button_enabled_cart'] = 'yes'
- : $applepaySettings['mollie_apple_pay_button_enabled_cart'] = 'no';
- isset($data['mollie_apple_pay_button_enabled_product'])
- && ($data['mollie_apple_pay_button_enabled_product'] === '1')
- ?
- $applepaySettings['mollie_apple_pay_button_enabled_product'] = 'yes'
- :
- $applepaySettings['mollie_apple_pay_button_enabled_product'] = 'no';
- isset($data['title']) ? $applepaySettings['title'] = $data['title']
- : $applepaySettings['title'] = '';
- isset($data['description']) ?
- $applepaySettings['description'] = $data['description']
- : $applepaySettings['description'] = '';
- update_option(
- 'mollie_wc_gateway_applepay_settings',
- $applepaySettings
- );
- }
-
- /**
- * @param $settings
- *
- * @return array
- */
- protected function saveApiKeys($settings)
- {
- $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS);
- $isNonceValid = wp_verify_nonce(
- $nonce,
- 'woocommerce-settings'
- );
- if (!$isNonceValid) {
- return $settings;
- }
- $liveKeyName = 'mollie-payments-for-woocommerce_live_api_key';
- $testKeyName = 'mollie-payments-for-woocommerce_test_api_key';
- $liveValueInDb = get_option($liveKeyName);
- $testValueInDb = get_option($testKeyName);
- $postedLiveValue = isset($_POST[$liveKeyName]) ? sanitize_text_field(wp_unslash($_POST[$liveKeyName])) : '';
- $postedTestValue = isset($_POST[$testKeyName]) ? sanitize_text_field(wp_unslash($_POST[$testKeyName])) : '';
-
- foreach ($settings as $setting) {
- if (
- $setting['id']
- === $liveKeyName
- && $liveValueInDb
- ) {
- if ($postedLiveValue === '**********') {
- $_POST[$liveKeyName] = $liveValueInDb;
- } else {
- $pattern = '/^live_\w{30,}$/';
- $this->validateApiKeyOrRemove(
- $pattern,
- $postedLiveValue,
- $liveKeyName
- );
- }
- } elseif (
- $setting['id']
- === $testKeyName
- && $testValueInDb
- ) {
- if ($postedTestValue === '**********') {
- $_POST[$testKeyName] = $testValueInDb;
- } else {
- $pattern = '/^test_\w{30,}$/';
- $this->validateApiKeyOrRemove(
- $pattern,
- $postedTestValue,
- $testKeyName
- );
- }
- }
- }
- return $settings;
- }
-
- /**
- * @param $pattern
- * @param $value
- * @param $keyName
- *
- */
- protected function validateApiKeyOrRemove($pattern, $value, $keyName)
- {
- $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS);
- $isNonceValid = wp_verify_nonce(
- $nonce,
- 'woocommerce-settings'
- );
- if (!$isNonceValid) {
- return;
- }
- $hasApiFormat = preg_match($pattern, $value);
- if (!$hasApiFormat) {
- unset($_POST[$keyName]);
- }
- }
-
- /**
- * @return array|mixed|void|null
- */
- public function get_sections()
- {
- $isAppleEnabled = array_key_exists('mollie_wc_gateway_applepay', $this->registeredGateways);
- $sections = [
- '' => __('General', 'mollie-payments-for-woocommerce'),
- 'mollie_components' => __(
- 'Mollie Components',
- 'mollie-payments-for-woocommerce'
- ),
- 'advanced' => __('Advanced', 'mollie-payments-for-woocommerce'),
- ];
- if ($isAppleEnabled) {
- $sections['applepay_button'] = __(
- 'Apple Pay Button',
- 'mollie-payments-for-woocommerce'
- );
- }
-
- return apply_filters(
- 'woocommerce_get_sections_' . $this->id,
- $sections
- );
- }
-
- /**
- * @return bool
- */
- protected function isKlarnaEnabled(): bool
- {
- $klarnaGateways = [Constants::KLARNAPAYLATER, Constants::KLARNASLICEIT, Constants::KLARNAPAYNOW, Constants::KLARNA];
- $isKlarnaEnabled = false;
- foreach ($klarnaGateways as $klarnaGateway) {
- if (
- array_key_exists('mollie_wc_gateway_' . $klarnaGateway, $this->registeredGateways)
- && array_key_exists($klarnaGateway, $this->paymentMethods)
- && $this->paymentMethods[$klarnaGateway]->getProperty('enabled') === 'yes'
- ) {
- $isKlarnaEnabled = true;
- break;
- }
- }
- return $isKlarnaEnabled;
- }
-
- private function warnAboutRequiredCheckoutFieldForBillie(string $content)
- {
- $isBillieEnabled = array_key_exists('mollie_wc_gateway_billie', $this->registeredGateways)
- && array_key_exists('billie', $this->paymentMethods)
- && $this->paymentMethods['billie']->getProperty('enabled') === 'yes';
- if ($isBillieEnabled) {
- $content .= '';
- $content .= '
';
- $content .= __(
- 'You have activated Billie. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. The billing company field is required as well. Make sure to enable the billing company field in the WooCommerce settings if you are using Woocommerce blocks.',
- 'mollie-payments-for-woocommerce'
- );
- $content .= '
';
- $content .= '
';
- }
- return $content;
- }
-}
diff --git a/src/Settings/Page/PageAdvancedSettings.php b/src/Settings/Page/PageAdvancedSettings.php
new file mode 100644
index 000000000..8325a6e1a
--- /dev/null
+++ b/src/Settings/Page/PageAdvancedSettings.php
@@ -0,0 +1,39 @@
+settings = $settings;
+ $this->pluginUrl = $pluginUrl;
+ $this->currentSection = $currentSection;
+ $this->connectionStatus = $connectionStatus;
+ $this->testModeEnabled = $testModeEnabled;
+ $this->pages = $pages;
+ $this->mollieGateways = $mollieGateways;
+ $this->paymentMethods = $paymentMethods;
+ $this->dataHelper = $dataHelper;
+ }
+
+ abstract public function config(): array;
+
+ public function styles(): string
+ {
+ return '';
+ }
+
+ public function images(): string
+ {
+ return $this->pluginUrl . '/public/images/';
+ }
+}
diff --git a/src/Settings/Page/Section/Advanced.php b/src/Settings/Page/Section/Advanced.php
new file mode 100644
index 000000000..8b3c8967e
--- /dev/null
+++ b/src/Settings/Page/Section/Advanced.php
@@ -0,0 +1,248 @@
+ $this->settings->getSettingId('title'),
+ 'title' => __('Mollie advanced settings', 'mollie-payments-for-woocommerce'),
+ 'type' => 'title',
+ 'desc' => '' . __('The following options are required to use the plugin and are used by all Mollie payment methods', 'mollie-payments-for-woocommerce') . '
',
+ ],
+ [
+ 'id' => $this->settings->getSettingId('debug'),
+ 'title' => __('Debug Log', 'mollie-payments-for-woocommerce'),
+ 'type' => 'checkbox',
+ 'desc' => sprintf(
+ __(
+ "Log plugin events. View logs ",
+ 'mollie-payments-for-woocommerce'
+ ),
+ $this->settings->getLogsUrl()
+ ),
+ 'default' => 'yes',
+ ],
+ [
+ 'id' => $this->settings->getSettingId('order_status_cancelled_payments'),
+ 'title' => __('Order status after cancelled payment', 'mollie-payments-for-woocommerce'),
+ 'type' => 'select',
+ 'options' => [
+ 'pending' => __('Pending', 'woocommerce'),
+ 'cancelled' => __('Cancelled', 'woocommerce'),
+ ],
+ 'desc' => __('Status for orders when a payment (not a Mollie order via the Orders API) is cancelled. Default: pending. Orders with status Pending can be paid with another payment method, customers can try again. Cancelled orders are final. Set this to Cancelled if you only have one payment method or don\'t want customers to re-try paying with a different payment method. This doesn\'t apply to payments for orders via the new Orders API and Klarna payments.', 'mollie-payments-for-woocommerce'),
+ 'default' => 'pending',
+ ],
+ [
+ 'id' => $this->settings->getSettingId(SharedDataDictionary::SETTING_NAME_PAYMENT_LOCALE),
+ 'title' => __('Payment screen language', 'mollie-payments-for-woocommerce'),
+ 'type' => 'select',
+ 'options' => [
+ SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE => __(
+ 'Automatically send WordPress language',
+ 'mollie-payments-for-woocommerce'
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
+ SharedDataDictionary::SETTING_LOCALE_DETECT_BY_BROWSER => __(
+ 'Detect using browser language',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'en_US' => __('English', 'mollie-payments-for-woocommerce'),
+ 'nl_NL' => __('Dutch', 'mollie-payments-for-woocommerce'),
+ 'nl_BE' => __('Flemish (Belgium)', 'mollie-payments-for-woocommerce'),
+ 'fr_FR' => __('French', 'mollie-payments-for-woocommerce'),
+ 'fr_BE' => __('French (Belgium)', 'mollie-payments-for-woocommerce'),
+ 'de_DE' => __('German', 'mollie-payments-for-woocommerce'),
+ 'de_AT' => __('Austrian German', 'mollie-payments-for-woocommerce'),
+ 'de_CH' => __('Swiss German', 'mollie-payments-for-woocommerce'),
+ 'es_ES' => __('Spanish', 'mollie-payments-for-woocommerce'),
+ 'ca_ES' => __('Catalan', 'mollie-payments-for-woocommerce'),
+ 'pt_PT' => __('Portuguese', 'mollie-payments-for-woocommerce'),
+ 'it_IT' => __('Italian', 'mollie-payments-for-woocommerce'),
+ 'nb_NO' => __('Norwegian', 'mollie-payments-for-woocommerce'),
+ 'sv_SE' => __('Swedish', 'mollie-payments-for-woocommerce'),
+ 'fi_FI' => __('Finnish', 'mollie-payments-for-woocommerce'),
+ 'da_DK' => __('Danish', 'mollie-payments-for-woocommerce'),
+ 'is_IS' => __('Icelandic', 'mollie-payments-for-woocommerce'),
+ 'hu_HU' => __('Hungarian', 'mollie-payments-for-woocommerce'),
+ 'pl_PL' => __('Polish', 'mollie-payments-for-woocommerce'),
+ 'lv_LV' => __('Latvian', 'mollie-payments-for-woocommerce'),
+ 'lt_LT' => __('Lithuanian', 'mollie-payments-for-woocommerce'),
+ ],
+ 'desc' => sprintf(
+ /* translators: Placeholder 1: link tag Placeholder 2: closing tag */
+ __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'),
+ '',
+ ' '
+ ),
+ 'default' => SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE,
+ ],
+ [
+ 'id' => $this->settings->getSettingId('customer_details'),
+ 'title' => __('Store customer details at Mollie', 'mollie-payments-for-woocommerce'),
+ 'desc' => sprintf(
+ /* translators: Placeholder 1: enabled or disabled Placeholder 2: translated string */
+ __(
+ 'Should Mollie store customers name and email address for Single Click Payments? Default %1$s
. Required if WooCommerce Subscriptions is being used! Read more about %2$s and how it improves your conversion.',
+ 'mollie-payments-for-woocommerce'
+ ),
+ strtolower(__('Enabled', 'mollie-payments-for-woocommerce')),
+ __('Single Click Payments', 'mollie-payments-for-woocommerce')
+ ),
+ 'type' => 'checkbox',
+ 'default' => 'yes',
+
+ ],
+ [
+ 'id' => $this->settings->getSettingId('api_switch'),
+ 'title' => __(
+ 'Select API Method',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'type' => 'select',
+ 'options' => [
+ PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst(
+ PaymentService::PAYMENT_METHOD_TYPE_ORDER
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
+ . ')',
+ PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst(
+ PaymentService::PAYMENT_METHOD_TYPE_PAYMENT
+ ),
+ ],
+ 'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER,
+ 'desc' => sprintf(
+ /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */
+ __(
+ 'Click %1$shere%2$s to read more about the differences between the Payments and Orders API',
+ 'mollie-payments-for-woocommerce'
+ ),
+ '',
+ ' '
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('api_payment_description'),
+ 'title' => __(
+ 'API Payment Description',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'type' => 'text',
+ 'default' => '{orderNumber}',
+ 'desc' => sprintf(
+ '
+
+
+ %3$s',
+ _x('Available variables', 'Payment description options', 'mollie-payments-for-woocommerce'),
+ implode('', array_map(
+ static function ($label, $labelDescription) {
+ return sprintf(
+ '
+
+ %1$s
+
+ ',
+ $label,
+ substr($label, 1, -1),
+ $labelDescription
+ );
+ },
+ array_keys($this->paymentDescriptionLabels()),
+ $this->paymentDescriptionLabels()
+ )),
+ sprintf(
+ /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */
+ __(
+ 'Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s',
+ 'mollie-payments-for-woocommerce'
+ ),
+ '',
+ '
'
+ )
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('gatewayFeeLabel'),
+ 'title' => __(
+ 'Surcharge gateway fee label',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'type' => 'text',
+ 'custom_attributes' => ['maxlength' => '30'],
+ 'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'),
+ 'desc' => __(
+ 'This is the label will appear in frontend when the surcharge applies',
+ 'mollie-payments-for-woocommerce'
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('removeOptionsAndTransients'),
+ 'title' => __(
+ 'Remove Mollie data from Database on uninstall',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'type' => 'checkbox',
+ 'default' => 'no',
+ 'desc' => __("Remove options and scheduled actions from database when uninstalling the plugin.", "mollie-payments-for-woocommerce") . ' (' . strtolower(
+ __('Clear now', 'mollie-payments-for-woocommerce')
+ ) . ' )',
+ ],
+ [
+ 'id' => $this->settings->getSettingId('sectionend'),
+ 'type' => 'sectionend',
+ ],
+ ];
+
+ return apply_filters(
+ 'inpsyde.mollie-advanced-settings',
+ $config,
+ $this->settings->getPluginId()
+ );
+ }
+
+ protected function paymentDescriptionLabels(): array
+ {
+
+ return [
+ '{orderNumber}' => _x('Order number', 'Label {orderNumber} description for payment description options', 'mollie-payments-for-woocommerce'),
+ '{storeName}' => _x('Site Title', 'Label {storeName} description for payment description options', 'mollie-payments-for-woocommerce'),
+ '{customer.firstname}' => _x('Customer\'s first name', 'Label {customer.firstname} description for payment description options', 'mollie-payments-for-woocommerce'),
+ '{customer.lastname}' => _x('Customer\'s last name', 'Label {customer.lastname} description for payment description options', 'mollie-payments-for-woocommerce'),
+ '{customer.company}' => _x('Customer\'s company name', 'Label {customer.company} description for payment description options', 'mollie-payments-for-woocommerce'),
+ ];
+ }
+
+ protected function cleanDbUrl(): string
+ {
+
+ return add_query_arg(
+ ['cleanDB-mollie' => 1, 'nonce_mollie_cleanDb' => wp_create_nonce('nonce_mollie_cleanDb')]
+ );
+ }
+
+ protected function content(): string
+ {
+ ob_start();
+ ?>
+ $this->settings->getSettingId('title'),
+ 'title' => '',
+ 'type' => 'title',
+ ],
+ $this->connectionStatusField($this->settings, $this->connectionStatus),
+ [
+ 'id' => $this->settings->getSettingId('test_mode_enabled'),
+ 'title' => __('Mollie Payment Mode', 'mollie-payments-for-woocommerce'),
+ 'default' => 'no',
+ 'type' => 'select',
+ 'options' => [
+ 'no' => 'Live API',
+ 'yes' => 'Test API',
+ ],
+ 'desc' => __(
+ 'Select Live API to receive real payments and Test API to test transactions without a fee.',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'desc_tip' => __(
+ 'Enable test mode if you want to test the plugin without using real payments.',
+ 'mollie-payments-for-woocommerce'
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('live_api_key'),
+ 'title' => __('Live API key', 'mollie-payments-for-woocommerce'),
+ 'default' => '',
+ 'type' => 'text',
+ 'desc' => sprintf(
+ __(
+ "Use your Live API key when you're ready to receive real payments.",
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'https://my.mollie.com/dashboard/developers/api-keys?utm_source=woocommerce&utm_medium=plugin&utm_campaign=partner'
+ ),
+ 'css' => 'width: 350px',
+ 'placeholder' => __(
+ 'Live API key should start with live_',
+ 'mollie-payments-for-woocommerce'
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('test_api_key'),
+ 'title' => __('Test API key', 'mollie-payments-for-woocommerce'),
+ 'default' => '',
+ 'type' => 'text',
+ 'desc' => sprintf(
+ __(
+ "Use your Test APl key to check the connection and test transactions without a fee.",
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'https://my.mollie.com/dashboard/developers/api-keys?utm_source=woocommerce&utm_medium=plugin&utm_campaign=partner'
+ ),
+ 'css' => 'width: 350px',
+ 'placeholder' => __(
+ 'Test API key should start with test_',
+ 'mollie-payments-for-woocommerce'
+ ),
+ ],
+ [
+ 'id' => $this->settings->getSettingId('sectionend'),
+ 'type' => 'sectionend',
+ ],
+ ];
+ }
+}
diff --git a/src/Settings/Page/Section/ConnectionStatusFields.php b/src/Settings/Page/Section/ConnectionStatusFields.php
new file mode 100644
index 000000000..68312324d
--- /dev/null
+++ b/src/Settings/Page/Section/ConnectionStatusFields.php
@@ -0,0 +1,46 @@
+ $this->settings->getSettingId('title'),
+ 'title' => '',
+ 'type' => 'title',
+ ],
+ $this->connectionStatusField($this->settings, $this->connectionStatus),
+ $this->refreshStatusField(),
+ [
+ 'id' => $this->settings->getSettingId('sectionend'),
+ 'type' => 'sectionend',
+ ],
+ ];
+ }
+
+ public function refreshStatusField(): array
+ {
+ $refreshNonce = wp_create_nonce('nonce_mollie_refresh_methods');
+ $refreshUrl = add_query_arg(
+ ['refresh-methods' => 1, 'nonce_mollie_refresh_methods' => $refreshNonce]
+ );
+
+ return [
+ 'id' => $this->settings->getSettingId('refresh_status'),
+ 'title' => __('Payment method availability', 'mollie-payments-for-woocommerce'),
+ 'value' => '' . __('Refresh Mollie payment methods', 'mollie-payments-for-woocommerce') . ' ',
+ 'desc' => __(
+ 'Click this button to refresh your payment methods, e.g. if you recently enabled new payment methods in your Mollie profile',
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'type' => 'mollie_custom_input',
+ ];
+ }
+}
diff --git a/src/Settings/Page/Section/ConnectionStatusTrait.php b/src/Settings/Page/Section/ConnectionStatusTrait.php
new file mode 100644
index 000000000..2639fd9b5
--- /dev/null
+++ b/src/Settings/Page/Section/ConnectionStatusTrait.php
@@ -0,0 +1,36 @@
+ $settings->getSettingId('connection_status'),
+ 'title' => __('Mollie Connection Status', 'mollie-payments-for-woocommerce'),
+ 'value' => $this->connectionStatus($settings, $connectionStatus),
+ 'type' => 'mollie_custom_input',
+ ];
+ }
+
+ protected function connectionStatus(Settings $settings, bool $connectionStatus): ?string
+ {
+ $testMode = $settings->isTestModeEnabled();
+ if (!$connectionStatus) {
+ return __(
+ 'Failed to connect to Mollie API - check your API keys ✖',
+ 'mollie-payments-for-woocommerce'
+ );
+ }
+ if ($testMode) {
+ return __('Successfully connected with Test API ✓', 'mollie-payments-for-woocommerce');
+ }
+ return __('Successfully connected with Live API ✓', 'mollie-payments-for-woocommerce');
+ }
+}
diff --git a/src/Settings/Page/Section/Header.php b/src/Settings/Page/Section/Header.php
new file mode 100644
index 000000000..abfe91c8f
--- /dev/null
+++ b/src/Settings/Page/Section/Header.php
@@ -0,0 +1,84 @@
+ $this->settings->getSettingId('header'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ public function styles(): string
+ {
+ ob_start();
+ ?>
+
+
+
+ $this->settings->getSettingId('instructions'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ protected function content(): string
+ {
+ ob_start();
+ ?>
+ = esc_html(__("Mollie API Keys", 'mollie-payments-for-woocommerce')); ?>
+
+ = wp_kses(sprintf(
+ __(
+ "To start receiving payments through the Mollie plugin in your WooCommerce store,
+ you'll need to connect it to your Mollie account using an API key. ",
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'https://my.mollie.com/dashboard/developers/api-keys?utm_source=woocommerce&utm_medium=plugin&utm_campaign=partner'
+ ), [
+ 'a' => [
+ 'target' => [],
+ 'href' => [],
+ ],
+ ]); ?>
+
+
+ =
+ esc_html(__(
+ 'Please note that your API keys are unique to your Mollie account and should be kept private
+ to ensure the security of your transactions.',
+ 'mollie-payments-for-woocommerce'
+ ));
+ ?>
+
+ $this->settings->getSettingId('instructions'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ protected function content(): string
+ {
+ ob_start();
+ ?>
+ = esc_html(__("Mollie API Keys", 'mollie-payments-for-woocommerce')); ?>
+
+ = esc_html(__(
+ "To start receiving payments through the Mollie plugin in your WooCommerce store,
+ you'll need to connect it to your Mollie account using an API key.",
+ 'mollie-payments-for-woocommerce'
+ )); ?>
+
+
+
+ = esc_html(__("How to find your API keys:", 'mollie-payments-for-woocommerce')); ?>
+
+
+
+
+ = wp_kses(sprintf(
+ __(
+ "Log in to your Mollie Dashboard ",
+ 'mollie-payments-for-woocommerce'
+ ),
+ 'https://my.mollie.com/dashboard/login?lang=en'
+ ), [
+ 'a' => [
+ 'href' => [],
+ 'target' => [],
+ ],
+ ]); ?>
+
+
+ = wp_kses(
+ __("Navigate to Developers > API keys. ", 'mollie-payments-for-woocommerce'),
+ [
+ 'strong' => [],
+ ]
+ ); ?>
+
+
+ = wp_kses(
+ __("Click on Copy next to your API key.", 'mollie-payments-for-woocommerce'),
+ [
+ 'strong' => [],
+ ]
+ ); ?>
+
+
+ = wp_kses(
+ __(
+ "Paste the copied API key into the Live API key or Test API key fields below.",
+ 'mollie-payments-for-woocommerce'
+ ),
+ [
+ 'strong' => [],
+ ]
+ ); ?>
+
+
+
+ = esc_html(__(
+ "Please note that your API keys are unique to your Mollie account and should be kept
+ private to ensure the security of your transactions.",
+ 'mollie-payments-for-woocommerce'
+ )); ?>
+
+ $this->settings->getSettingId('notices'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ protected function content(): string
+ {
+ ob_start();
+ ?>
+
+ = $this->warnAboutRequiredCheckoutFieldForBillie(); // WPCS: XSS ok. ?>
+ = $this->warnAboutRequiredCheckoutFieldForKlarna(); // WPCS: XSS ok. ?>
+ = $this->warnMollieBankTransferNotBACS(); // WPCS: XSS ok. ?>
+ = $this->warnDirectDebitStatus(); // WPCS: XSS ok. ?>
+
+ paymentMethods["directdebit"]->getProperty('enabled') !== false;
+ $isSepaEnabled = !$hasCustomSepaSettings || $this->paymentMethods["directdebit"]->getProperty(
+ 'enabled'
+ ) === 'yes';
+ $sepaGatewayAllowed = !empty($this->mollieGateways["mollie_wc_gateway_directdebit"]);
+
+ if (!($sepaGatewayAllowed && !$isSepaEnabled)) {
+ return '';
+ }
+ return $this->notice(
+ __(
+ "You have WooCommerce Subscriptions activated, but not SEPA Direct Debit. Enable SEPA Direct Debit if you want to allow customers to pay subscriptions with iDEAL and/or other 'first' payment methods.",
+ 'mollie-payments-for-woocommerce'
+ )
+ );
+ }
+
+ protected function warnAboutRequiredCheckoutFieldForBillie(): string
+ {
+ $isBillieEnabled = array_key_exists('mollie_wc_gateway_billie', $this->mollieGateways)
+ && array_key_exists('billie', $this->paymentMethods)
+ && $this->paymentMethods['billie']->getProperty('enabled') === 'yes';
+
+ if (!$isBillieEnabled) {
+ return '';
+ }
+ return $this->notice(
+ __(
+ 'You have activated Billie. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. The billing company field is required as well. Make sure to enable the billing company field in the WooCommerce settings if you are using Woocommerce blocks.',
+ 'mollie-payments-for-woocommerce'
+ )
+ );
+ }
+
+ protected function warnAboutRequiredCheckoutFieldForKlarna(): string
+ {
+ if (!$this->isKlarnaEnabled()) {
+ return '';
+ }
+ return $this->notice(
+ sprintf(
+ /* translators: Placeholder 1: Opening link tag. Placeholder 2: Closing link tag. Placeholder 3: Opening link tag. Placeholder 4: Closing link tag. */
+ __(
+ 'You have activated Klarna. To accept payments, please make sure all default WooCommerce checkout fields are enabled and required. For more information, go to %1$sKlarna Pay Later documentation%2$s or %3$sKlarna Slice it documentation%4$s',
+ 'mollie-payments-for-woocommerce'
+ ),
+ '',
+ ' ',
+ '',
+ ' '
+ )
+ );
+ }
+
+ protected function warnMollieBankTransferNotBACS(): string
+ {
+ $woocommerceBanktransferGateway = new WC_Gateway_BACS();
+ if (!$woocommerceBanktransferGateway->is_available()) {
+ return '';
+ }
+
+ return $this->notice(
+ __(
+ 'You have the WooCommerce default Direct Bank Transfer (BACS) payment gateway enabled in WooCommerce. Mollie strongly advices only using Bank Transfer via Mollie and disabling the default WooCommerce BACS payment gateway to prevent possible conflicts.',
+ 'mollie-payments-for-woocommerce'
+ )
+ );
+ }
+
+ protected function isKlarnaEnabled(): bool
+ {
+ $klarnaGateways = [
+ Constants::KLARNAPAYLATER,
+ Constants::KLARNASLICEIT,
+ Constants::KLARNAPAYNOW,
+ Constants::KLARNA,
+ ];
+ $isKlarnaEnabled = false;
+ foreach ($klarnaGateways as $klarnaGateway) {
+ if (
+ array_key_exists('mollie_wc_gateway_' . $klarnaGateway, $this->mollieGateways)
+ && array_key_exists($klarnaGateway, $this->paymentMethods)
+ && $this->paymentMethods[$klarnaGateway]->getProperty('enabled') === 'yes'
+ ) {
+ $isKlarnaEnabled = true;
+ break;
+ }
+ }
+ return $isKlarnaEnabled;
+ }
+
+ protected function notice(string $message)
+ {
+ //notice-warning is-dismissible
+ ob_start();
+ ?>
+
+
+ = wp_kses($message, [
+ 'a' => [
+ 'href' => [],
+ 'target' => [],
+ ],
+ ]); ?>
+
+
+ Dismiss this notice.
+
+
+
+
+ $this->settings->getSettingId('notices'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ protected function content(): string
+ {
+ ob_start();
+ ?>
+
+
+ = $this->renderGateways(); // WPCS: XSS ok. ?>
+
+
+ refreshIfRequested();
+ $this->cleanDbIfRequested();
+
+ $titleActivePaymentMethods = __(
+ 'Currently Active Payment Methods',
+ 'mollie-payments-for-woocommerce'
+ );
+ $descriptionActivePaymentMethods = __(
+ 'These payment methods are active in your Mollie profile.
+ You can enable these payment methods in their settings to make them available for your customers.',
+ 'mollie-payments-for-woocommerce'
+ );
+ $titleInactivePaymentMethods = __('Inactive Payment Methods', 'mollie-payments-for-woocommerce');
+ $descriptionInactivePaymentMethods = __(
+ 'These payment methods are available in your Mollie profile but are
+ not currently active. Activate them to offer more payment options to your customers.',
+ 'mollie-payments-for-woocommerce'
+ );
+
+ $activatedGateways = '';
+ $deactivatedGateways = '';
+
+ /** @var AbstractPaymentMethod $paymentMethod */
+ foreach ($this->paymentMethods as $paymentMethod) {
+ $paymentMethodId = $paymentMethod->getProperty('id');
+ $gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId;
+ $enabledInMollie = array_key_exists($gatewayKey, $this->mollieGateways);
+
+ $paymentGatewayButton = $this->paymentGatewayButton($paymentMethod, $enabledInMollie);
+ if ($enabledInMollie) {
+ $activatedGateways .= $paymentGatewayButton;
+ } else {
+ $deactivatedGateways .= $paymentGatewayButton;
+ }
+ }
+
+ return $this->paymentGatewaysBlock(
+ $titleActivePaymentMethods,
+ $descriptionActivePaymentMethods,
+ $activatedGateways
+ ) . $this->paymentGatewaysBlock(
+ $titleInactivePaymentMethods,
+ $descriptionInactivePaymentMethods,
+ $deactivatedGateways
+ );
+ }
+
+ protected function paymentGatewaysBlock(string $title, string $description, string $html): string
+ {
+ ob_start();
+ ?>
+
+
= esc_html($title); ?>
+
= esc_html($description); ?>
+
+ = $html; // WPCS: XSS ok. ?>
+
+
+
+
+
+ testModeEnabled;
+ $apiKey = $this->settings->getApiKey();
+ /* Reload active Mollie methods */
+ $methods = $this->dataHelper->getAllPaymentMethods($apiKey, $testMode, false);
+ foreach ($methods as $key => $method) {
+ $methods['mollie_wc_gateway_' . $method['id']] = $method;
+ unset($methods[$key]);
+ }
+ $this->mollieGateways = $methods;
+ }
+ }
+
+ protected function cleanDbIfRequested()
+ {
+ if (
+ isset($_GET['cleanDB-mollie']) && wp_verify_nonce(
+ filter_input(INPUT_GET, 'nonce_mollie_cleanDb', FILTER_SANITIZE_SPECIAL_CHARS),
+ 'nonce_mollie_cleanDb'
+ )
+ ) {
+ $cleaner = $this->settings->cleanDb();
+ $cleaner->cleanAll();
+ //set default settings
+ foreach ($this->paymentMethods as $paymentMethod) {
+ $paymentMethod->getSettings();
+ }
+ }
+ }
+
+ protected function paymentGatewayButton(AbstractPaymentMethod $paymentMethod, $enabledInMollie): string
+ {
+ $documentationLink = $paymentMethod->getProperty('docs');
+ $paymentMethodId = $paymentMethod->getProperty('id');
+ $gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId;
+ $button = '' . esc_html(__(
+ 'Manage Payment Method',
+ 'mollie-payments-for-woocommerce'
+ )) . ' ';
+ $messageOrLink = '';
+ $enabledInWoo = ($paymentMethod->getSettings())['enabled'] === 'yes';
+
+ if ($enabledInMollie && $enabledInWoo) {
+ $messageOrLink = '' . esc_html(__(
+ 'enabled',
+ 'mollie-payments-for-woocommerce'
+ )) . ' ';
+ } elseif ($enabledInMollie && !$enabledInWoo) {
+ $messageOrLink = '' . esc_html(__(
+ 'disabled',
+ 'mollie-payments-for-woocommerce'
+ )) . ' ';
+ } else {
+ if ($documentationLink) {
+ $messageOrLink = "" . esc_html(__(
+ 'More information',
+ 'mollie-payments-for-woocommerce'
+ )) . ' ';
+ }
+ $button = '' .
+ esc_html(__('Activate Payment Method', 'mollie-payments-for-woocommerce'))
+ . ' ';
+ }
+
+ ob_start();
+ ?>
+
+ = $paymentMethod->getIconUrl(); // WPCS: XSS ok.?>
+ = esc_html($paymentMethod->title());?>
+ = $messageOrLink; // WPCS: XSS ok.?>
+ = $button; // WPCS: XSS ok.?>
+
+ $this->settings->getSettingId('notices'),
+ 'type' => 'mollie_content',
+ 'value' => $this->content(),
+ ],
+ ];
+ }
+
+ protected function content(): string
+ {
+
+ $content = '';
+
+ foreach ($this->pages as $pageClassName) {
+ if ($pageClassName::isTab()) {
+ $currentTabClass = '';
+ if ($pageClassName::slug() === $this->currentSection) {
+ $currentTabClass = 'nav-tab-active';
+ }
+ $content .= '';
+ $content .= $pageClassName::tabName();
+ $content .= ' ';
+ }
+ }
+ $content .= ' ';
+
+ return $content;
+ }
+
+ protected function pageUrl(string $sectionId): string
+ {
+ return admin_url('admin.php?page=wc-settings&tab=mollie_settings§ion=' . sanitize_title($sectionId));
+ }
+}
diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php
index c93589641..2d03aa453 100644
--- a/src/Settings/Settings.php
+++ b/src/Settings/Settings.php
@@ -332,7 +332,7 @@ public function isDebugEnabled()
/**
* @return string
*/
- public function getLogsUrl()
+ public function getLogsUrl(): string
{
return admin_url('admin.php?page=wc-status&tab=logs');
}
@@ -384,6 +384,24 @@ public function updateMerchantIdAfterApiKeyChanges($oldValue, $value, $optionNam
$this->updateMerchantIdOnApiKeyChanges($value, $option);
}
+ public function getConnectionStatus(): bool
+ {
+
+ $status = $this->statusHelper;
+ if (!$status->isCompatible()) {
+ return false;
+ }
+
+ try {
+ $apiKey = $this->getApiKey();
+ $apiClient = $this->apiHelper->getApiClient($apiKey);
+ $status->getMollieApiStatus($apiClient);
+ return true;
+ } catch (\Mollie\Api\Exceptions\ApiException $e) {
+ return false;
+ }
+ }
+
/**
* Get plugin status
*
@@ -447,6 +465,10 @@ public function getPaymentConfirmationCheckTime()
return $date->getTimestamp();
}
+ public function getPluginId()
+ {
+ return $this->pluginId;
+ }
/**
* @param string $setting
*
diff --git a/src/Settings/SettingsModule.php b/src/Settings/SettingsModule.php
index 5cac11b53..61ecb6632 100644
--- a/src/Settings/SettingsModule.php
+++ b/src/Settings/SettingsModule.php
@@ -6,15 +6,14 @@
namespace Mollie\WooCommerce\Settings;
-use Inpsyde\Modularity\Module\ExecutableModule;
-use Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
-use Inpsyde\Modularity\Module\ServiceModule;
use Mollie\WooCommerce\Notice\AdminNotice;
use Mollie\WooCommerce\SDK\Api;
-use Mollie\WooCommerce\Settings\Page\MollieSettingsPage;
use Mollie\WooCommerce\Shared\Data;
use Mollie\WooCommerce\Shared\Status;
use Mollie\WooCommerce\Uninstall\CleanDb;
+use Inpsyde\Modularity\Module\ExecutableModule;
+use Inpsyde\Modularity\Module\ModuleClassNameIdTrait;
+use Inpsyde\Modularity\Module\ServiceModule;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface as Logger;
@@ -113,6 +112,7 @@ public function run(ContainerInterface $container): bool
$this->dataHelper = $container->get('settings.data_helper');
assert($this->dataHelper instanceof Data);
$pluginPath = $container->get('shared.plugin_path');
+ $pluginUrl = $container->get('shared.plugin_url');
$paymentMethods = $container->get('gateway.paymentMethods');
// Add settings link to plugins page
@@ -148,7 +148,7 @@ function () use ($optionName, $defaultAdvancedOptions, $defaultComponentsOptions
$gateways = $container->get('gateway.instances');
$isSDDGatewayEnabled = $container->get('gateway.isSDDGatewayEnabled');
- $this->initMollieSettingsPage($isSDDGatewayEnabled, $gateways, $pluginPath, $paymentMethods);
+ $this->initMollieSettingsPage($isSDDGatewayEnabled, $gateways, $pluginPath, $pluginUrl, $paymentMethods);
add_action(
'woocommerce_admin_settings_sanitize_option',
[$this->settingsHelper, 'updateMerchantIdOnApiKeyChanges'],
@@ -194,7 +194,8 @@ public function addPluginActionLinks(array $links): array
public function maybeTestModeNotice(): bool
{
$testModeEnabled = get_option('mollie-payments-for-woocommerce_test_mode_enabled', true);
- $shouldShowNotice = $testModeEnabled === 'yes';
+ $testKeyEntered = get_option('mollie-payments-for-woocommerce_test_api_key', true);
+ $shouldShowNotice = $testModeEnabled === 'yes' && !empty($testKeyEntered);
if (!$shouldShowNotice) {
return false;
}
@@ -247,10 +248,11 @@ public function maybeSaveDefaultSettings($optionName, $testOption, $defaultOptio
* @param $isSDDGatewayEnabled
* @param $gateways
* @param $pluginPath
+ * @param $pluginUrl
* @param $paymentMethods
* @return void
*/
- protected function initMollieSettingsPage($isSDDGatewayEnabled, $gateways, $pluginPath, $paymentMethods): void
+ protected function initMollieSettingsPage($isSDDGatewayEnabled, $gateways, $pluginPath, $pluginUrl, $paymentMethods): void
{
if (!$isSDDGatewayEnabled) {
//remove directdebit gateway from gateways list
@@ -258,10 +260,11 @@ protected function initMollieSettingsPage($isSDDGatewayEnabled, $gateways, $plug
}
add_filter(
'woocommerce_get_settings_pages',
- function ($settings) use ($pluginPath, $gateways, $paymentMethods) {
+ function ($settings) use ($pluginPath, $pluginUrl, $gateways, $paymentMethods) {
$settings[] = new MollieSettingsPage(
$this->settingsHelper,
$pluginPath,
+ $pluginUrl,
$gateways,
$paymentMethods,
$this->isTestModeEnabled,
diff --git a/webpack.config.js b/webpack.config.js
index fbd545086..19805a960 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -31,7 +31,8 @@ function configJavaScript ({ basePath })
.addEntry('paypalButtonBlockComponent.min', './resources/js/paypalButtonBlockComponent.js')
.addEntry('applepayButtonBlockComponent.min', './resources/js/applepayButtonBlockComponent.js')
.addEntry('rivertyCountryPlaceholder.min', './resources/js/rivertyCountryPlaceholder.js')
- .enableSourceMaps(!Encore.isProduction())
+ .addEntry('mollie-settings-2024.min', './resources/js/mollie-settings-2024.js')
+ .enableSourceMaps(!Encore.isProduction())
return extractEncoreConfig('javascript-configuration')
}
From e5969a9577e550adfbcf145ea307a7bb997fa6a0 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:21:04 +0100
Subject: [PATCH 11/17] Squash and merge PIWOO-319
This PR adds Apple express button
---
inc/settings/mollie_applepay_settings.php | 0
package.json | 2 +-
resources/js/applepayButtonBlock.js | 30 +++
resources/js/applepayButtonBlockComponent.js | 194 ------------------
.../js/blocks/ApplePayButtonComponent.js | 185 +++++++++++++++++
resources/js/mollieBlockIndex.js | 18 ++
resources/scss/mollie-applepaydirect.scss | 25 +++
src/Assets/AssetsModule.php | 4 +-
src/Assets/MollieCheckoutBlocksSupport.php | 38 ++--
.../ApplePayButton/AppleAjaxRequests.php | 4 +-
.../DataToAppleButtonScripts.php | 3 +
.../ApplePayButton/ResponsesToApple.php | 30 ++-
src/PaymentMethods/Applepay.php | 8 +-
src/Shared/Data.php | 7 +
.../DataToAppleButtonScriptsTest.php | 2 +
.../ApplePayButton/ResponsesToAppleTest.php | 9 +-
webpack.config.js | 2 +-
17 files changed, 336 insertions(+), 225 deletions(-)
create mode 100644 inc/settings/mollie_applepay_settings.php
create mode 100644 resources/js/applepayButtonBlock.js
delete mode 100644 resources/js/applepayButtonBlockComponent.js
create mode 100644 resources/js/blocks/ApplePayButtonComponent.js
diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php
new file mode 100644
index 000000000..e69de29bb
diff --git a/package.json b/package.json
index d5429a333..a97339a4a 100644
--- a/package.json
+++ b/package.json
@@ -53,7 +53,7 @@
"webpack": "^5.89.0"
},
"scripts": {
- "watch": "webpack --watch",
+ "watch": "BASE_PATH=. node_modules/.bin/encore dev --watch",
"build": "BASE_PATH=. node_modules/.bin/encore dev",
"setup": "gulp setup",
"e2e-activation": "npx playwright test --project=activation",
diff --git a/resources/js/applepayButtonBlock.js b/resources/js/applepayButtonBlock.js
new file mode 100644
index 000000000..058da50c7
--- /dev/null
+++ b/resources/js/applepayButtonBlock.js
@@ -0,0 +1,30 @@
+import {ApplePayButtonComponent} from "./blocks/ApplePayButtonComponent";
+
+(
+ function ({mollieApplePayBlockDataCart}) {
+ if (mollieApplePayBlockDataCart.length === 0) {
+ return
+ }
+ const {ApplePaySession} = window;
+ if (!(ApplePaySession && ApplePaySession.canMakePayments())) {
+ return null;
+ }
+
+ const {registerExpressPaymentMethod} = wc.wcBlocksRegistry;
+
+ registerExpressPaymentMethod({
+ name: 'mollie_wc_gateway_applepay_express',
+ content: < ApplePayButtonComponent/>,
+ edit: < ApplePayButtonComponent/>,
+ ariaLabel: 'Apple Pay',
+ canMakePayment: () => true,
+ paymentMethodId: 'mollie_wc_gateway_applepay',
+ supports: {
+ features: ['products'],
+ },
+ });
+ }
+)
+(
+ window
+)
diff --git a/resources/js/applepayButtonBlockComponent.js b/resources/js/applepayButtonBlockComponent.js
deleted file mode 100644
index 7c0215c6e..000000000
--- a/resources/js/applepayButtonBlockComponent.js
+++ /dev/null
@@ -1,194 +0,0 @@
-import {maybeShowButton} from './maybeShowApplePayButton.js';
-import {request} from "./applePayRequest";
-import {createAppleErrors} from "./applePayError";
-
-(
- function ({mollieApplePayBlockDataCart})
- {
- if (mollieApplePayBlockDataCart.length === 0 ) {
- return
- }
- const {product: {needShipping = true, subtotal}, shop: {countryCode, currencyCode = 'EUR', totalLabel = ''}, buttonMarkup, ajaxUrl} = mollieApplePayBlockDataCart
-
- const { registerPlugin } = wp.plugins;
- const { ExperimentalOrderMeta } = wc.blocksCheckout;
- const ApplePayButtonComponent = ( { cart, extensions } ) => {
- return
- }
- const MollieApplePayButtonCart = () => {
- return
-
-
- };
-
- registerPlugin( 'mollie-applepay-block-button', {
- render: () => {
- return ;
- },
- scope: 'woocommerce-checkout'
- } );
-
- setTimeout(function(){
- if(!maybeShowButton()){
- return
- }
- const nonce = document.getElementById("woocommerce-process-checkout-nonce").value
- let updatedContactInfo = []
- let selectedShippingMethod = []
- let redirectionUrl = ''
- let applePaySession = () => {
- const session = new ApplePaySession(3, request(countryCode, currencyCode, totalLabel, subtotal))
- session.begin()
- session.onshippingmethodselected = function (event) {
- jQuery.ajax({
- url: ajaxUrl,
- method: 'POST',
- data: {
- action: 'mollie_apple_pay_update_shipping_method',
- shippingMethod: event.shippingMethod,
- callerPage: 'cart',
- simplifiedContact: updatedContactInfo,
- 'woocommerce-process-checkout-nonce': nonce,
- },
- complete: (jqXHR, textStatus) => {
- },
- success: (applePayShippingMethodUpdate, textStatus, jqXHR) => {
- let response = applePayShippingMethodUpdate.data
- selectedShippingMethod = event.shippingMethod
- if (applePayShippingMethodUpdate.success === false) {
- response.errors = createAppleErrors(response.errors)
- }
- this.completeShippingMethodSelection(response)
- },
- error: (jqXHR, textStatus, errorThrown) => {
- console.warn(textStatus, errorThrown)
- session.abort()
- },
- })
- }
- session.onshippingcontactselected = function (event) {
- jQuery.ajax({
- url: ajaxUrl,
- method: 'POST',
- data: {
- action: 'mollie_apple_pay_update_shipping_contact',
- simplifiedContact: event.shippingContact,
- callerPage: 'cart',
- needShipping: needShipping,
- 'woocommerce-process-checkout-nonce': nonce,
- },
- complete: (jqXHR, textStatus) => {
- },
- success: (applePayShippingContactUpdate, textStatus, jqXHR) => {
- let response = applePayShippingContactUpdate.data
- updatedContactInfo = event.shippingContact
- if (applePayShippingContactUpdate.success === false) {
- response.errors = createAppleErrors(response.errors)
- }
- if (response.newShippingMethods) {
- selectedShippingMethod = response.newShippingMethods[0]
- }
- this.completeShippingContactSelection(response)
- },
- error: (jqXHR, textStatus, errorThrown) => {
- console.warn(textStatus, errorThrown)
- session.abort()
- },
- })
- }
- session.onvalidatemerchant = (applePayValidateMerchantEvent) => {
- jQuery.ajax({
- url: ajaxUrl,
- method: 'POST',
- data: {
- action: 'mollie_apple_pay_validation',
- validationUrl: applePayValidateMerchantEvent.validationURL,
- 'woocommerce-process-checkout-nonce': nonce,
- },
- complete: (jqXHR, textStatus) => {
- },
- success: (merchantSession, textStatus, jqXHR) => {
- if (merchantSession.success === true) {
- session.completeMerchantValidation(JSON.parse(merchantSession.data))
- } else {
- console.warn(merchantSession.data)
- session.abort()
- }
- },
- error: (jqXHR, textStatus, errorThrown) => {
- console.warn(textStatus, errorThrown)
- session.abort()
- },
- })
- }
- session.onpaymentauthorized = (ApplePayPayment) => {
- const {billingContact, shippingContact } = ApplePayPayment.payment
-
- jQuery.ajax({
- url: ajaxUrl,
- method: 'POST',
- data: {
- action: 'mollie_apple_pay_create_order_cart',
- shippingContact: ApplePayPayment.payment.shippingContact,
- billingContact: ApplePayPayment.payment.billingContact,
- token: ApplePayPayment.payment.token,
- shippingMethod: selectedShippingMethod,
- 'mollie-payments-for-woocommerce_issuer_applepay': 'applepay',
- 'woocommerce-process-checkout-nonce': nonce,
- 'billing_first_name': billingContact.givenName || '',
- 'billing_last_name': billingContact.familyName || '',
- 'billing_company': '',
- 'billing_country': billingContact.countryCode || '',
- 'billing_address_1': billingContact.addressLines[0] || '',
- 'billing_address_2': billingContact.addressLines[1] || '',
- 'billing_postcode': billingContact.postalCode || '',
- 'billing_city': billingContact.locality || '',
- 'billing_state': billingContact.administrativeArea || '',
- 'billing_phone': billingContact.phoneNumber || '000000000000',
- 'billing_email': shippingContact.emailAddress || '',
- 'shipping_first_name': shippingContact.givenName || '',
- 'shipping_last_name': shippingContact.familyName || '',
- 'shipping_company': '',
- 'shipping_country': shippingContact.countryCode || '',
- 'shipping_address_1': shippingContact.addressLines[0] || '',
- 'shipping_address_2': shippingContact.addressLines[1] || '',
- 'shipping_postcode': shippingContact.postalCode || '',
- 'shipping_city': shippingContact.locality || '',
- 'shipping_state': shippingContact.administrativeArea || '',
- 'shipping_phone': shippingContact.phoneNumber || '000000000000',
- 'shipping_email': shippingContact.emailAddress || '',
- 'order_comments' : '',
- 'payment_method' : 'mollie_wc_gateway_applepay',
- '_wp_http_referer' : '/?wc-ajax=update_order_review'
- },
- complete: (jqXHR, textStatus) => {
-
- },
- success: (authorizationResult, textStatus, jqXHR) => {
- let result = authorizationResult.data
- if (authorizationResult.success === true) {
- redirectionUrl = result['returnUrl'];
- session.completePayment(result['responseToApple'])
- window.location.href = redirectionUrl
- } else {
- result.errors = createAppleErrors(result.errors)
- session.completePayment(result)
- }
- },
- error: (jqXHR, textStatus, errorThrown) => {
- console.warn(textStatus, errorThrown)
- session.abort()
- },
- })
- }
- }
- document.querySelector('#mollie_applepay_button').addEventListener('click', (evt) => {
- applePaySession()
- })
- },2000);
-
- }
-)
-(
- window
-)
diff --git a/resources/js/blocks/ApplePayButtonComponent.js b/resources/js/blocks/ApplePayButtonComponent.js
new file mode 100644
index 000000000..d712477cf
--- /dev/null
+++ b/resources/js/blocks/ApplePayButtonComponent.js
@@ -0,0 +1,185 @@
+import {request} from "../applePayRequest";
+import {createAppleErrors} from "../applePayError";
+
+export const ApplePayButtonComponent = ({cart, extensions}) => {
+ const mollieApplePayBlockDataCart = window.mollieApplePayBlockDataCart || window.mollieBlockData.mollieApplePayBlockDataCart
+ const nonce = document.getElementById("woocommerce-process-checkout-nonce").value
+ let updatedContactInfo = []
+ let redirectionUrl = ''
+ const {
+ product: {needShipping = true, subtotal},
+ shop: {countryCode, currencyCode = 'EUR', totalLabel = ''},
+ ajaxUrl,
+ } = mollieApplePayBlockDataCart
+
+ const findSelectedShippingMethod = (shippingRates) => {
+ let shippingRate = shippingRates.find((shippingMethod) => shippingMethod.selected === true)
+ const appleFormattedRate = {
+ amount: '',
+ detail: '',
+ label: shippingRate.name,
+ identifier: shippingRate.rate_id,
+ selected: shippingRate.selected,
+ }
+ return shippingRate ? appleFormattedRate : ''
+ }
+
+ let applePaySession = () => {
+ const session = new ApplePaySession(3, request(countryCode, currencyCode, totalLabel, subtotal))
+ const store = wp.data.select('wc/store/cart')
+ const shippingRates = store.getShippingRates()?.[0]?.shipping_rates;
+ let selectedShippingMethod = '';
+ if (shippingRates && shippingRates.length > 0) {
+ selectedShippingMethod = findSelectedShippingMethod(shippingRates, selectedShippingMethod);
+ }
+ session.onshippingmethodselected = function (event) {
+ jQuery.ajax({
+ url: ajaxUrl,
+ method: 'POST',
+ data: {
+ action: 'mollie_apple_pay_update_shipping_method',
+ shippingMethod: event.shippingMethod,
+ callerPage: 'cart',
+ simplifiedContact: updatedContactInfo,
+ 'woocommerce-process-checkout-nonce': nonce,
+ },
+ success: (applePayShippingMethodUpdate, textStatus, jqXHR) => {
+ let response = applePayShippingMethodUpdate.data
+ selectedShippingMethod = event.shippingMethod
+ if (applePayShippingMethodUpdate.success === false) {
+ response.errors = createAppleErrors(response.errors)
+ }
+ this.completeShippingMethodSelection(response)
+ },
+ error: (jqXHR, textStatus, errorThrown) => {
+ console.warn(textStatus, errorThrown)
+ session.abort()
+ },
+ })
+ }
+ session.onshippingcontactselected = function (event) {
+ jQuery.ajax({
+ url: ajaxUrl,
+ method: 'POST',
+ data: {
+ action: 'mollie_apple_pay_update_shipping_contact',
+ simplifiedContact: event.shippingContact,
+ callerPage: 'cart',
+ needShipping: needShipping,
+ 'woocommerce-process-checkout-nonce': nonce,
+ shippingMethod: selectedShippingMethod,
+ },
+ success: (applePayShippingContactUpdate, textStatus, jqXHR) => {
+ let response = applePayShippingContactUpdate.data
+ updatedContactInfo = event.shippingContact
+ if (applePayShippingContactUpdate.success === false) {
+ response.errors = createAppleErrors(response.errors)
+ }
+ if (response.newShippingMethods) {
+ selectedShippingMethod = response.newShippingMethods[0]
+ }
+ this.completeShippingContactSelection(response)
+ },
+ error: (jqXHR, textStatus, errorThrown) => {
+ console.warn(textStatus, errorThrown)
+ session.abort()
+ },
+ })
+ }
+ session.onvalidatemerchant = (applePayValidateMerchantEvent) => {
+ jQuery.ajax({
+ url: ajaxUrl,
+ method: 'POST',
+ data: {
+ action: 'mollie_apple_pay_validation',
+ validationUrl: applePayValidateMerchantEvent.validationURL,
+ 'woocommerce-process-checkout-nonce': nonce,
+ },
+ success: (merchantSession, textStatus, jqXHR) => {
+ if (merchantSession.success === true) {
+ session.completeMerchantValidation(JSON.parse(merchantSession.data))
+ } else {
+ console.warn(merchantSession.data)
+ session.abort()
+ }
+ },
+ error: (jqXHR, textStatus, errorThrown) => {
+ console.warn(textStatus, errorThrown)
+ session.abort()
+ },
+ })
+ }
+ session.onpaymentauthorized = (ApplePayPayment) => {
+ const {billingContact, shippingContact} = ApplePayPayment.payment
+
+ jQuery.ajax({
+ url: ajaxUrl,
+ method: 'POST',
+ data: {
+ action: 'mollie_apple_pay_create_order_cart',
+ shippingContact: ApplePayPayment.payment.shippingContact,
+ billingContact: ApplePayPayment.payment.billingContact,
+ token: ApplePayPayment.payment.token,
+ shippingMethod: selectedShippingMethod,
+ 'mollie-payments-for-woocommerce_issuer_applepay': 'applepay',
+ 'woocommerce-process-checkout-nonce': nonce,
+ 'billing_first_name': billingContact.givenName || '',
+ 'billing_last_name': billingContact.familyName || '',
+ 'billing_company': '',
+ 'billing_country': billingContact.countryCode || '',
+ 'billing_address_1': billingContact.addressLines[0] || '',
+ 'billing_address_2': billingContact.addressLines[1] || '',
+ 'billing_postcode': billingContact.postalCode || '',
+ 'billing_city': billingContact.locality || '',
+ 'billing_state': billingContact.administrativeArea || '',
+ 'billing_phone': billingContact.phoneNumber || '000000000000',
+ 'billing_email': shippingContact.emailAddress || '',
+ 'shipping_first_name': shippingContact.givenName || '',
+ 'shipping_last_name': shippingContact.familyName || '',
+ 'shipping_company': '',
+ 'shipping_country': shippingContact.countryCode || '',
+ 'shipping_address_1': shippingContact.addressLines[0] || '',
+ 'shipping_address_2': shippingContact.addressLines[1] || '',
+ 'shipping_postcode': shippingContact.postalCode || '',
+ 'shipping_city': shippingContact.locality || '',
+ 'shipping_state': shippingContact.administrativeArea || '',
+ 'shipping_phone': shippingContact.phoneNumber || '000000000000',
+ 'shipping_email': shippingContact.emailAddress || '',
+ 'order_comments': '',
+ 'payment_method': 'mollie_wc_gateway_applepay',
+ '_wp_http_referer': '/?wc-ajax=update_order_review'
+ },
+ success: (authorizationResult, textStatus, jqXHR) => {
+ let result = authorizationResult.data
+ if (authorizationResult.success === true) {
+ redirectionUrl = result['returnUrl'];
+ session.completePayment(result['responseToApple'])
+ window.location.href = redirectionUrl
+ } else {
+ result.errors = createAppleErrors(result.errors)
+ session.completePayment(result)
+ }
+ },
+ error: (jqXHR, textStatus, errorThrown) => {
+ console.warn(textStatus, errorThrown)
+ session.abort()
+ },
+ })
+ }
+ session.begin()
+ }
+
+ return (
+ {
+ event.preventDefault();
+ applePaySession();
+ }}
+ >
+
+ );
+}
+
+export default ApplePayButtonComponent;
diff --git a/resources/js/mollieBlockIndex.js b/resources/js/mollieBlockIndex.js
index 04c6d367b..fdfaa0141 100644
--- a/resources/js/mollieBlockIndex.js
+++ b/resources/js/mollieBlockIndex.js
@@ -1,10 +1,12 @@
import molliePaymentMethod from './blocks/molliePaymentMethod'
+import ApplePayButtonComponent from './blocks/ApplePayButtonComponent'
(
function ({ mollieBlockData, wc, _, jQuery}) {
if (_.isEmpty(mollieBlockData)) {
return;
}
+
window.onload = (event) => {
const { registerPaymentMethod } = wc.wcBlocksRegistry;
const { checkoutData, defaultFields } = wc.wcSettings.allSettings;
@@ -47,8 +49,24 @@ import molliePaymentMethod from './blocks/molliePaymentMethod'
gatewayData.forEach(item => {
let register = () => registerPaymentMethod(molliePaymentMethod(useEffect, ajaxUrl, filters, gatewayData, availableGateways, item, jQuery, requiredFields, isCompanyFieldVisible, isPhoneFieldVisible));
if (item.name === 'mollie_wc_gateway_applepay' && !isBlockEditor) {
+ const {isExpressEnabled} = item;
if ((isAppleSession && window.ApplePaySession.canMakePayments())) {
register();
+ if (isExpressEnabled !== true) {
+ return;
+ }
+ const {registerExpressPaymentMethod} = wc.wcBlocksRegistry;
+ registerExpressPaymentMethod({
+ name: 'mollie_wc_gateway_applepay_express',
+ content: ,
+ edit: ,
+ ariaLabel: 'Apple Pay',
+ canMakePayment: () => true,
+ paymentMethodId: 'mollie_wc_gateway_applepay',
+ supports: {
+ features: ['products'],
+ },
+ })
}
return;
}
diff --git a/resources/scss/mollie-applepaydirect.scss b/resources/scss/mollie-applepaydirect.scss
index 0cb757d88..07e9ae8fd 100644
--- a/resources/scss/mollie-applepaydirect.scss
+++ b/resources/scss/mollie-applepaydirect.scss
@@ -3,10 +3,35 @@
}
.apple-pay-button {
display: inline-block;
+ width: 100%;
-webkit-appearance: -apple-pay-button;
-apple-pay-button-type: checkout; /* also: check-out, book, or subscribe */
}
+@media (max-width: 480px) {
+ .apple-pay-button {
+ height: 41px;
+ min-height: 40px;
+ max-height: 47px;
+ }
+}
+
+@media (min-width: 481px) and (max-width: 1024px) {
+ .apple-pay-button {
+ height: 48px;
+ min-height: 48px;
+ max-height: 55px;
+ }
+}
+
+@media (min-width: 1025px) {
+ .apple-pay-button {
+ height: 56px;
+ min-height: 56px;
+ max-height: 64px;
+ }
+}
+
.apple-pay-button-black {
-apple-pay-button-style: black;
}
diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php
index b4312bad7..6a400719c 100644
--- a/src/Assets/AssetsModule.php
+++ b/src/Assets/AssetsModule.php
@@ -74,13 +74,13 @@ public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPat
'mollie_applepayButtonBlock',
$this->getPluginUrl(
$pluginUrl,
- '/public/js/applepayButtonBlockComponent.min.js'
+ '/public/js/applepayButtonBlock.min.js'
),
[],
(string) filemtime(
$this->getPluginPath(
$pluginPath,
- '/public/js/applepayButtonBlockComponent.min.js'
+ '/public/js/applepayButtonBlock.min.js'
)
),
true
diff --git a/src/Assets/MollieCheckoutBlocksSupport.php b/src/Assets/MollieCheckoutBlocksSupport.php
index 450f6b76f..16d2d7481 100644
--- a/src/Assets/MollieCheckoutBlocksSupport.php
+++ b/src/Assets/MollieCheckoutBlocksSupport.php
@@ -64,12 +64,13 @@ public function get_payment_method_script_handles(): array
public static function localizeWCBlocksData($dataService, $gatewayInstances)
{
-
+ wp_enqueue_style('mollie-applepaydirect');
wp_localize_script(
self::$scriptHandle,
'mollieBlockData',
[
'gatewayData' => self::gatewayDataForWCBlocks($dataService, $gatewayInstances),
+ 'mollieApplePayBlockDataCart' => $dataService->mollieApplePayBlockDataCart(),
]
);
}
@@ -112,26 +113,26 @@ public static function gatewayDataForWCBlocks(Data $dataService, array $gatewayI
$isSepaEnabled = isset($gatewayInstances['mollie_wc_gateway_directdebit']) && $gatewayInstances['mollie_wc_gateway_directdebit']->enabled === 'yes';
/** @var MolliePaymentGateway $gateway */
foreach ($gatewayInstances as $gatewayKey => $gateway) {
- $gatewayId = is_string($gateway->paymentMethod()->getProperty('id')) ? $gateway->paymentMethod(
- )->getProperty('id') : "";
+ $method = $gateway->paymentMethod();
+ $gatewayId = is_string($method->getProperty('id')) ? $method->getProperty('id') : "";
if ($gateway->enabled !== 'yes' || ($gatewayId === 'directdebit' && !is_admin())) {
continue;
}
- $content = $gateway->paymentMethod()->getProcessedDescriptionForBlock();
+ $content = $method->getProcessedDescriptionForBlock();
$issuers = false;
- if ($gateway->paymentMethod()->getProperty('paymentFields') === true) {
- $paymentFieldsService = $gateway->paymentMethod()->paymentFieldsService();
- $paymentFieldsService->setStrategy($gateway->paymentMethod());
- $issuers = $gateway->paymentMethod()->paymentFieldsService()->getStrategyMarkup($gateway);
+ if ($method->getProperty('paymentFields') === true) {
+ $paymentFieldsService = $method->paymentFieldsService();
+ $paymentFieldsService->setStrategy($method);
+ $issuers = $method->paymentFieldsService()->getStrategyMarkup($gateway);
}
if ($gatewayId === 'creditcard') {
$content .= $issuers;
$issuers = false;
}
- $title = $gateway->paymentMethod()->title();
+ $title = $method->title();
$labelMarkup = "{$title} {$gateway->icon}";
- $hasSurcharge = $gateway->paymentMethod()->hasSurcharge();
+ $hasSurcharge = $method->hasSurcharge();
$countryCodes = [
'BE' => '+32xxxxxxxxx',
'NL' => '+316xxxxxxxx',
@@ -154,15 +155,16 @@ public static function gatewayDataForWCBlocks(Data $dataService, array $gatewayI
'edit' => $content,
'paymentMethodId' => $gatewayKey,
'allowedCountries' => is_array(
- $gateway->paymentMethod()->getProperty('allowed_countries')
- ) ? $gateway->paymentMethod()->getProperty('allowed_countries') : [],
- 'ariaLabel' => $gateway->paymentMethod()->getProperty('defaultDescription'),
- 'supports' => self::gatewaySupportsFeatures($gateway->paymentMethod(), $isSepaEnabled),
- 'errorMessage' => $gateway->paymentMethod()->getProperty('errorMessage'),
- 'companyPlaceholder' => $gateway->paymentMethod()->getProperty('companyPlaceholder'),
- 'phoneLabel' => $gateway->paymentMethod()->getProperty('phoneLabel'),
+ $method->getProperty('allowed_countries')
+ ) ? $method->getProperty('allowed_countries') : [],
+ 'ariaLabel' => $method->getProperty('defaultDescription'),
+ 'supports' => self::gatewaySupportsFeatures($method, $isSepaEnabled),
+ 'errorMessage' => $method->getProperty('errorMessage'),
+ 'companyPlaceholder' => $method->getProperty('companyPlaceholder'),
+ 'phoneLabel' => $method->getProperty('phoneLabel'),
'phonePlaceholder' => $phonePlaceholder,
- 'birthdatePlaceholder' => $gateway->paymentMethod()->getProperty('birthdatePlaceholder'),
+ 'birthdatePlaceholder' => $method->getProperty('birthdatePlaceholder'),
+ 'isExpressEnabled' => $gatewayId === 'applepay' && $method->getProperty('mollie_apple_pay_button_enabled_express_checkout') === 'yes',
];
}
$dataToScript['gatewayData'] = $gatewayData;
diff --git a/src/Buttons/ApplePayButton/AppleAjaxRequests.php b/src/Buttons/ApplePayButton/AppleAjaxRequests.php
index 59a82fb98..ec1b28b1a 100644
--- a/src/Buttons/ApplePayButton/AppleAjaxRequests.php
+++ b/src/Buttons/ApplePayButton/AppleAjaxRequests.php
@@ -191,7 +191,7 @@ public function updateShippingContact()
}
$paymentDetails = $this->whichCalculateTotals($applePayRequestDataObject);
- $response = $this->responseTemplates->appleFormattedResponse($paymentDetails);
+ $response = $this->responseTemplates->appleFormattedResponse($paymentDetails, $applePayRequestDataObject);
$this->responseTemplates->responseSuccess($response);
}
@@ -212,7 +212,7 @@ public function updateShippingMethod()
$this->responseTemplates->responseWithDataErrors($applePayRequestDataObject->errors());
}
$paymentDetails = $this->whichCalculateTotals($applePayRequestDataObject);
- $response = $this->responseTemplates->appleFormattedResponse($paymentDetails);
+ $response = $this->responseTemplates->appleFormattedResponse($paymentDetails, $applePayRequestDataObject);
$this->responseTemplates->responseSuccess($response);
}
diff --git a/src/Buttons/ApplePayButton/DataToAppleButtonScripts.php b/src/Buttons/ApplePayButton/DataToAppleButtonScripts.php
index b6e551b25..d3e37ab1c 100644
--- a/src/Buttons/ApplePayButton/DataToAppleButtonScripts.php
+++ b/src/Buttons/ApplePayButton/DataToAppleButtonScripts.php
@@ -14,6 +14,9 @@ class DataToAppleButtonScripts
*/
public function applePayScriptData(bool $isBlock = false): array
{
+ if (is_admin()) {
+ return [];
+ }
$base_location = wc_get_base_location();
$shopCountryCode = $base_location['country'];
$currencyCode = get_woocommerce_currency();
diff --git a/src/Buttons/ApplePayButton/ResponsesToApple.php b/src/Buttons/ApplePayButton/ResponsesToApple.php
index b4b580c2b..2f9f34cde 100644
--- a/src/Buttons/ApplePayButton/ResponsesToApple.php
+++ b/src/Buttons/ApplePayButton/ResponsesToApple.php
@@ -84,11 +84,15 @@ public function responseWithDataErrors($errorList)
*
* @return array
*/
- public function appleFormattedResponse(array $paymentDetails)
+ public function appleFormattedResponse(array $paymentDetails, $applePayRequestDataObject)
{
$response = [];
if ($paymentDetails['shippingMethods']) {
- $response['newShippingMethods'] = $paymentDetails['shippingMethods'];
+ $selectedShippingMethod = $applePayRequestDataObject->shippingMethod();
+ $response['newShippingMethods'] = $this->reorderShippingMethods(
+ $paymentDetails['shippingMethods'],
+ $selectedShippingMethod
+ );
}
$response['newLineItems'] = $this->appleNewLineItemsResponse(
@@ -101,6 +105,28 @@ public function appleFormattedResponse(array $paymentDetails)
return $response;
}
+ /**
+ * Reorders the shipping methods to have the selected shipping method on top so we see it as selected
+ * @param array $methods
+ * @param array $selectedShippingMethod
+ * @return array
+ */
+ private function reorderShippingMethods(array $methods, array $selectedShippingMethod): array
+ {
+ $reordered_methods = [];
+
+ foreach ($methods as $key => $method) {
+ if ($method['identifier'] === $selectedShippingMethod['identifier']) {
+ $reordered_methods[] = $method;
+ unset($methods[$key]);
+ break;
+ }
+ }
+
+ return array_merge($reordered_methods, array_values($methods));
+ }
+
+
/**
* Returns a success response to be handled by the script
*/
diff --git a/src/PaymentMethods/Applepay.php b/src/PaymentMethods/Applepay.php
index b1ae1f9eb..226993aaf 100644
--- a/src/PaymentMethods/Applepay.php
+++ b/src/PaymentMethods/Applepay.php
@@ -33,7 +33,6 @@ public function getFormFields($generalFormFields): array
$paymentMethodFormFieds = [
'mollie_apple_pay_button_enabled_cart' => [
'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'),
- /* translators: Placeholder 1: enabled or disabled */
'desc' => __(
'Enable the Apple Pay direct buy button on the Cart page',
'mollie-payments-for-woocommerce'
@@ -43,7 +42,6 @@ public function getFormFields($generalFormFields): array
],
'mollie_apple_pay_button_enabled_product' => [
'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'),
- /* translators: Placeholder 1: enabled or disabled */
'desc' => __(
'Enable the Apple Pay direct buy button on the Product page',
'mollie-payments-for-woocommerce'
@@ -51,6 +49,12 @@ public function getFormFields($generalFormFields): array
'type' => 'checkbox',
'default' => 'no',
],
+ 'mollie_apple_pay_button_enabled_express_checkout' => [
+ 'title' => __('Enable Apple Pay Express Button on Checkout page', 'mollie-payments-for-woocommerce'),
+ 'desc' => __('Enable the Apple Pay direct buy button on the Express Buttons section of the Checkout page', 'mollie-payments-for-woocommerce'),
+ 'type' => 'checkbox',
+ 'default' => 'no',
+ ],
];
return array_merge($generalFormFields, $paymentMethodFormFieds);
}
diff --git a/src/Shared/Data.php b/src/Shared/Data.php
index 54230c6db..cf38fd51f 100644
--- a/src/Shared/Data.php
+++ b/src/Shared/Data.php
@@ -7,6 +7,7 @@
use Exception;
use InvalidArgumentException;
use Mollie\Api\Resources\Method;
+use Mollie\WooCommerce\Buttons\ApplePayButton\DataToAppleButtonScripts;
use Mollie\WooCommerce\SDK\Api;
use Mollie\WooCommerce\Settings\Settings;
use Psr\Log\LoggerInterface as Logger;
@@ -786,4 +787,10 @@ protected function addRecurringPaymentMethods($apiKey, bool $testMode, bool $use
}
return $result;
}
+
+ public function mollieApplePayBlockDataCart()
+ {
+ $dataToScripts = new DataToAppleButtonScripts();
+ return $dataToScripts->applePayScriptData(true);
+ }
}
diff --git a/tests/php/Functional/ApplePayButton/DataToAppleButtonScriptsTest.php b/tests/php/Functional/ApplePayButton/DataToAppleButtonScriptsTest.php
index 1d4c79cea..40fe4bbda 100644
--- a/tests/php/Functional/ApplePayButton/DataToAppleButtonScriptsTest.php
+++ b/tests/php/Functional/ApplePayButton/DataToAppleButtonScriptsTest.php
@@ -52,6 +52,7 @@ public function testApplePayScriptDataOnProduct()
'wc_get_product' => $this->wcProduct(),
'admin_url' => 'admin-ajax.php',
'get_option' => false,
+ 'is_admin' => false,
]
);
@@ -97,6 +98,7 @@ public function testApplePayScriptDataOnCart()
'admin_url' => 'admin-ajax.php',
'WC' => $this->wooCommerce($subtotal),
'wp_nonce_field'=> 'testNonce',
+ 'is_admin' => false,
]
);
diff --git a/tests/php/Functional/ApplePayButton/ResponsesToAppleTest.php b/tests/php/Functional/ApplePayButton/ResponsesToAppleTest.php
index 5f5c793e3..59908b6b0 100644
--- a/tests/php/Functional/ApplePayButton/ResponsesToAppleTest.php
+++ b/tests/php/Functional/ApplePayButton/ResponsesToAppleTest.php
@@ -71,7 +71,8 @@ public function testAppleFormattedResponseWithoutShippingMethod()
]
];
-
+ //shippingMethods is null this is not going to run
+ $applePayRequestDataObject = [];
expect('get_bloginfo')
->once()
->with('name')
@@ -82,7 +83,7 @@ public function testAppleFormattedResponseWithoutShippingMethod()
$logger = $this->helperMocks->loggerMock();
$appleGateway = $this->mollieGateway('applepay', false, true);
$responsesTemplate = new ResponsesToApple($logger, $appleGateway);
- $response = $responsesTemplate->appleFormattedResponse($paymentDetails);
+ $response = $responsesTemplate->appleFormattedResponse($paymentDetails, $applePayRequestDataObject);
self::assertEquals($response, $expectedResponse);
}
@@ -107,6 +108,8 @@ public function testAppleFormattedResponseWithShippingMethod()
'taxes' => $taxes,
'total' => $total
];
+ //shippingMethods is null this is not going to run
+ $applePayRequestDataObject = [];
$expectedResponse = [
'newLineItems'=>[
[
@@ -143,7 +146,7 @@ public function testAppleFormattedResponseWithShippingMethod()
$logger = $this->helperMocks->loggerMock();
$appleGateway = $this->mollieGateway('applepay', false, true);
$responsesTemplate = new ResponsesToApple($logger, $appleGateway);
- $response = $responsesTemplate->appleFormattedResponse($paymentDetails);
+ $response = $responsesTemplate->appleFormattedResponse($paymentDetails, $applePayRequestDataObject);
self::assertEquals($response, $expectedResponse);
}
diff --git a/webpack.config.js b/webpack.config.js
index 19805a960..6ef260ea6 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -29,7 +29,7 @@ function configJavaScript ({ basePath })
.addEntry('mollie-components-blocks.min', './resources/js/mollie-components-blocks.js')
.addEntry('mollieBlockIndex.min', './resources/js/mollieBlockIndex.js')
.addEntry('paypalButtonBlockComponent.min', './resources/js/paypalButtonBlockComponent.js')
- .addEntry('applepayButtonBlockComponent.min', './resources/js/applepayButtonBlockComponent.js')
+ .addEntry('applepayButtonBlock.min', './resources/js/applepayButtonBlock.js')
.addEntry('rivertyCountryPlaceholder.min', './resources/js/rivertyCountryPlaceholder.js')
.addEntry('mollie-settings-2024.min', './resources/js/mollie-settings-2024.js')
.enableSourceMaps(!Encore.isProduction())
From 55dc2eabe36bea8e673c28373e41f3b4344eeef1 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:22:08 +0100
Subject: [PATCH 12/17] Update modules bootstrap
---
mollie-payments-for-woocommerce.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php
index fbafd7de6..1ddb62437 100644
--- a/mollie-payments-for-woocommerce.php
+++ b/mollie-payments-for-woocommerce.php
@@ -153,7 +153,10 @@ function initialize()
new UninstallModule(),
];
$modules = apply_filters('mollie_wc_plugin_modules', $modules);
- $bootstrap->boot(...$modules);
+ foreach ($modules as $module) {
+ $bootstrap->addModule($module);
+ }
+ $bootstrap->boot();
} catch (Throwable $throwable) {
handleException($throwable);
}
From 19dae4ad570f0dda180dd5c9704ddf4617a664a3 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:22:29 +0100
Subject: [PATCH 13/17] Update version
---
mollie-payments-for-woocommerce.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php
index 1ddb62437..77d4377bc 100644
--- a/mollie-payments-for-woocommerce.php
+++ b/mollie-payments-for-woocommerce.php
@@ -3,11 +3,11 @@
* Plugin Name: Mollie Payments for WooCommerce
* Plugin URI: https://www.mollie.com
* Description: Accept payments in WooCommerce with the official Mollie plugin
- * Version: 7.8.2
+ * Version: 7.9.0-beta
* Author: Mollie
* Author URI: https://www.mollie.com
* Requires at least: 5.0
- * Tested up to: 6.6
+ * Tested up to: 6.7
* Text Domain: mollie-payments-for-woocommerce
* Domain Path: /languages
* License: GPLv2 or later
From 9a03654b25a288a7c774f325f140892da1cb215c Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:24:08 +0100
Subject: [PATCH 14/17] Move clear options to advanced section PIWOO-564
---
src/Settings/Page/Section/Advanced.php | 33 ++++++--
src/Settings/Page/Section/PaymentMethods.php | 80 ++++++++------------
2 files changed, 57 insertions(+), 56 deletions(-)
diff --git a/src/Settings/Page/Section/Advanced.php b/src/Settings/Page/Section/Advanced.php
index 8b3c8967e..454d0f37d 100644
--- a/src/Settings/Page/Section/Advanced.php
+++ b/src/Settings/Page/Section/Advanced.php
@@ -11,6 +11,7 @@ class Advanced extends AbstractSection
{
public function config(): array
{
+ $this->cleanDbIfRequested();
$config = [
[
'id' => $this->settings->getSettingId('title'),
@@ -48,9 +49,9 @@ public function config(): array
'type' => 'select',
'options' => [
SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE => __(
- 'Automatically send WordPress language',
- 'mollie-payments-for-woocommerce'
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
+ 'Automatically send WordPress language',
+ 'mollie-payments-for-woocommerce'
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
SharedDataDictionary::SETTING_LOCALE_DETECT_BY_BROWSER => __(
'Detect using browser language',
'mollie-payments-for-woocommerce'
@@ -110,8 +111,8 @@ public function config(): array
'type' => 'select',
'options' => [
PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_ORDER
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
+ PaymentService::PAYMENT_METHOD_TYPE_ORDER
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
. ')',
PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst(
PaymentService::PAYMENT_METHOD_TYPE_PAYMENT
@@ -202,8 +203,8 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto
'type' => 'checkbox',
'default' => 'no',
'desc' => __("Remove options and scheduled actions from database when uninstalling the plugin.", "mollie-payments-for-woocommerce") . ' (' . strtolower(
- __('Clear now', 'mollie-payments-for-woocommerce')
- ) . ' )',
+ __('Clear now', 'mollie-payments-for-woocommerce')
+ ) . ')',
],
[
'id' => $this->settings->getSettingId('sectionend'),
@@ -245,4 +246,22 @@ protected function content(): string
settings->cleanDb();
+ $cleaner->cleanAll();
+ //set default settings
+ foreach ($this->paymentMethods as $paymentMethod) {
+ $paymentMethod->getSettings();
+ }
+ }
+ }
+
}
diff --git a/src/Settings/Page/Section/PaymentMethods.php b/src/Settings/Page/Section/PaymentMethods.php
index e1a9308af..4bcd17a73 100644
--- a/src/Settings/Page/Section/PaymentMethods.php
+++ b/src/Settings/Page/Section/PaymentMethods.php
@@ -35,22 +35,21 @@ protected function content(): string
public function renderGateways(): string
{
$this->refreshIfRequested();
- $this->cleanDbIfRequested();
$titleActivePaymentMethods = __(
- 'Currently Active Payment Methods',
- 'mollie-payments-for-woocommerce'
+ 'Currently Active Payment Methods',
+ 'mollie-payments-for-woocommerce'
);
$descriptionActivePaymentMethods = __(
- 'These payment methods are active in your Mollie profile.
+ 'These payment methods are active in your Mollie profile.
You can enable these payment methods in their settings to make them available for your customers.',
- 'mollie-payments-for-woocommerce'
+ 'mollie-payments-for-woocommerce'
);
$titleInactivePaymentMethods = __('Inactive Payment Methods', 'mollie-payments-for-woocommerce');
$descriptionInactivePaymentMethods = __(
- 'These payment methods are available in your Mollie profile but are
+ 'These payment methods are available in your Mollie profile but are
not currently active. Activate them to offer more payment options to your customers.',
- 'mollie-payments-for-woocommerce'
+ 'mollie-payments-for-woocommerce'
);
$activatedGateways = '';
@@ -71,14 +70,14 @@ public function renderGateways(): string
}
return $this->paymentGatewaysBlock(
- $titleActivePaymentMethods,
- $descriptionActivePaymentMethods,
- $activatedGateways
- ) . $this->paymentGatewaysBlock(
- $titleInactivePaymentMethods,
- $descriptionInactivePaymentMethods,
- $deactivatedGateways
- );
+ $titleActivePaymentMethods,
+ $descriptionActivePaymentMethods,
+ $activatedGateways
+ ) . $this->paymentGatewaysBlock(
+ $titleInactivePaymentMethods,
+ $descriptionInactivePaymentMethods,
+ $deactivatedGateways
+ );
}
protected function paymentGatewaysBlock(string $title, string $description, string $html): string
@@ -99,7 +98,7 @@ protected function paymentGatewaysBlock(string $title, string $description, stri
protected function getGatewaySettingsUrl(string $gatewayClassName): string
{
return admin_url(
- 'admin.php?page=wc-settings&tab=checkout§ion=' . sanitize_title(strtolower($gatewayClassName))
+ 'admin.php?page=wc-settings&tab=checkout§ion=' . sanitize_title(strtolower($gatewayClassName))
);
}
@@ -178,8 +177,8 @@ protected function refreshIfRequested()
isset($_GET['refresh-methods']) &&
isset($_GET['nonce_mollie_refresh_methods']) &&
wp_verify_nonce(
- filter_input(INPUT_GET, 'nonce_mollie_refresh_methods', FILTER_SANITIZE_SPECIAL_CHARS),
- 'nonce_mollie_refresh_methods'
+ filter_input(INPUT_GET, 'nonce_mollie_refresh_methods', FILTER_SANITIZE_SPECIAL_CHARS),
+ 'nonce_mollie_refresh_methods'
)
) {
$testMode = $this->testModeEnabled;
@@ -194,53 +193,36 @@ protected function refreshIfRequested()
}
}
- protected function cleanDbIfRequested()
- {
- if (
- isset($_GET['cleanDB-mollie']) && wp_verify_nonce(
- filter_input(INPUT_GET, 'nonce_mollie_cleanDb', FILTER_SANITIZE_SPECIAL_CHARS),
- 'nonce_mollie_cleanDb'
- )
- ) {
- $cleaner = $this->settings->cleanDb();
- $cleaner->cleanAll();
- //set default settings
- foreach ($this->paymentMethods as $paymentMethod) {
- $paymentMethod->getSettings();
- }
- }
- }
-
protected function paymentGatewayButton(AbstractPaymentMethod $paymentMethod, $enabledInMollie): string
{
$documentationLink = $paymentMethod->getProperty('docs');
$paymentMethodId = $paymentMethod->getProperty('id');
$gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId;
$button = '' . esc_html(__(
- 'Manage Payment Method',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ $gatewayKey
+ ) . '">' . esc_html(__(
+ 'Manage Payment Method',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
$messageOrLink = '';
$enabledInWoo = ($paymentMethod->getSettings())['enabled'] === 'yes';
if ($enabledInMollie && $enabledInWoo) {
$messageOrLink = '' . esc_html(__(
- 'enabled',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'enabled',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
} elseif ($enabledInMollie && !$enabledInWoo) {
$messageOrLink = '' . esc_html(__(
- 'disabled',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'disabled',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
} else {
if ($documentationLink) {
$messageOrLink = "" . esc_html(__(
- 'More information',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'More information',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
}
$button = '' .
esc_html(__('Activate Payment Method', 'mollie-payments-for-woocommerce'))
From 4d467ecbf7ec0066accbca8e27ce4406b10ec255 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:33:27 +0100
Subject: [PATCH 15/17] Check keys before saving in all cases PIWOO-566
---
src/Settings/MollieSettingsPage.php | 73 +++++++++++++++--------------
src/Shared/Data.php | 4 +-
2 files changed, 40 insertions(+), 37 deletions(-)
diff --git a/src/Settings/MollieSettingsPage.php b/src/Settings/MollieSettingsPage.php
index ac0625360..61e835f2c 100644
--- a/src/Settings/MollieSettingsPage.php
+++ b/src/Settings/MollieSettingsPage.php
@@ -199,43 +199,46 @@ protected function saveApiKeys($settings)
if (!$isNonceValid) {
return $settings;
}
- $liveKeyName = 'mollie-payments-for-woocommerce_live_api_key';
- $testKeyName = 'mollie-payments-for-woocommerce_test_api_key';
- $liveValueInDb = get_option($liveKeyName);
- $testValueInDb = get_option($testKeyName);
- $postedLiveValue = isset($_POST[$liveKeyName]) ? sanitize_text_field(wp_unslash($_POST[$liveKeyName])) : '';
- $postedTestValue = isset($_POST[$testKeyName]) ? sanitize_text_field(wp_unslash($_POST[$testKeyName])) : '';
+ $apiKeys = [
+ 'live' => [
+ 'keyName' => 'mollie-payments-for-woocommerce_live_api_key',
+ 'pattern' => '/^live_\w{30,}$/',
+ 'valueInDb' => get_option('mollie-payments-for-woocommerce_live_api_key'),
+ 'postedValue' => isset($_POST['mollie-payments-for-woocommerce_live_api_key'])
+ ? sanitize_text_field(wp_unslash($_POST['mollie-payments-for-woocommerce_live_api_key']))
+ : ''
+ ],
+ 'test' => [
+ 'keyName' => 'mollie-payments-for-woocommerce_test_api_key',
+ 'pattern' => '/^test_\w{30,}$/',
+ 'valueInDb' => get_option('mollie-payments-for-woocommerce_test_api_key'),
+ 'postedValue' => isset($_POST['mollie-payments-for-woocommerce_test_api_key'])
+ ? sanitize_text_field(wp_unslash($_POST['mollie-payments-for-woocommerce_test_api_key']))
+ : ''
+ ]
+ ];
foreach ($settings as $setting) {
- if (
- $setting['id']
- === $liveKeyName
- && $liveValueInDb
- ) {
- if ($postedLiveValue === '**********') {
- $_POST[$liveKeyName] = $liveValueInDb;
- } else {
- $pattern = '/^live_\w{30,}$/';
- $this->validateApiKeyOrRemove(
- $pattern,
- $postedLiveValue,
- $liveKeyName
- );
- }
- } elseif (
- $setting['id']
- === $testKeyName
- && $testValueInDb
- ) {
- if ($postedTestValue === '**********') {
- $_POST[$testKeyName] = $testValueInDb;
- } else {
- $pattern = '/^test_\w{30,}$/';
- $this->validateApiKeyOrRemove(
- $pattern,
- $postedTestValue,
- $testKeyName
- );
+ foreach ($apiKeys as $type => $apiKey) {
+ if ($setting['id'] === $apiKey['keyName']) {
+ if ($apiKey['postedValue'] === '**********') {
+ // If placeholder is detected but no DB value, validate as new key
+ if (!$apiKey['valueInDb']) {
+ $this->validateApiKeyOrRemove(
+ $apiKey['pattern'],
+ '', // No DB value; treat as new
+ $apiKey['keyName']
+ );
+ } else {
+ $_POST[$apiKey['keyName']] = $apiKey['valueInDb'];
+ }
+ } else {
+ $this->validateApiKeyOrRemove(
+ $apiKey['pattern'],
+ $apiKey['postedValue'],
+ $apiKey['keyName']
+ );
+ }
}
}
}
diff --git a/src/Shared/Data.php b/src/Shared/Data.php
index cf38fd51f..a20770bb0 100644
--- a/src/Shared/Data.php
+++ b/src/Shared/Data.php
@@ -113,9 +113,9 @@ public function isTestModeEnabled(): bool
/**
* @param bool $overrideTestMode
*
- * @return null|string
+ * @return false|string
*/
- public function getApiKey($overrideTestMode = 2): ?string
+ public function getApiKey($overrideTestMode = 2)
{
return $this->settingsHelper->getApiKey($overrideTestMode);
}
From 39d2111c529173c9d48f70a02a2c116f954b79e7 Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 4 Nov 2024 14:50:03 +0100
Subject: [PATCH 16/17] Fix CS
---
src/Settings/MollieSettingsPage.php | 58 ++++++++++--------
src/Settings/Page/Section/Advanced.php | 15 +++--
src/Settings/Page/Section/PaymentMethods.php | 62 ++++++++++----------
3 files changed, 72 insertions(+), 63 deletions(-)
diff --git a/src/Settings/MollieSettingsPage.php b/src/Settings/MollieSettingsPage.php
index 61e835f2c..cafb4ac87 100644
--- a/src/Settings/MollieSettingsPage.php
+++ b/src/Settings/MollieSettingsPage.php
@@ -206,7 +206,7 @@ protected function saveApiKeys($settings)
'valueInDb' => get_option('mollie-payments-for-woocommerce_live_api_key'),
'postedValue' => isset($_POST['mollie-payments-for-woocommerce_live_api_key'])
? sanitize_text_field(wp_unslash($_POST['mollie-payments-for-woocommerce_live_api_key']))
- : ''
+ : '',
],
'test' => [
'keyName' => 'mollie-payments-for-woocommerce_test_api_key',
@@ -214,32 +214,13 @@ protected function saveApiKeys($settings)
'valueInDb' => get_option('mollie-payments-for-woocommerce_test_api_key'),
'postedValue' => isset($_POST['mollie-payments-for-woocommerce_test_api_key'])
? sanitize_text_field(wp_unslash($_POST['mollie-payments-for-woocommerce_test_api_key']))
- : ''
- ]
+ : '',
+ ],
];
foreach ($settings as $setting) {
- foreach ($apiKeys as $type => $apiKey) {
- if ($setting['id'] === $apiKey['keyName']) {
- if ($apiKey['postedValue'] === '**********') {
- // If placeholder is detected but no DB value, validate as new key
- if (!$apiKey['valueInDb']) {
- $this->validateApiKeyOrRemove(
- $apiKey['pattern'],
- '', // No DB value; treat as new
- $apiKey['keyName']
- );
- } else {
- $_POST[$apiKey['keyName']] = $apiKey['valueInDb'];
- }
- } else {
- $this->validateApiKeyOrRemove(
- $apiKey['pattern'],
- $apiKey['postedValue'],
- $apiKey['keyName']
- );
- }
- }
+ foreach ($apiKeys as $apiKey) {
+ $this->processApiKeys($setting['id'], $apiKey);
}
}
return $settings;
@@ -266,4 +247,33 @@ protected function validateApiKeyOrRemove($pattern, $value, $keyName)
unset($_POST[$keyName]);
}
}
+
+ /**
+ * @param $id
+ * @param array $apiKey
+ * @return void
+ */
+ public function processApiKeys($id, array $apiKey): void
+ {
+ if ($id === $apiKey['keyName']) {
+ if ($apiKey['postedValue'] === '**********') {
+ // If placeholder is detected but no DB value, validate as new key
+ if (!$apiKey['valueInDb']) {
+ $this->validateApiKeyOrRemove(
+ $apiKey['pattern'],
+ '', // No DB value; treat as new
+ $apiKey['keyName']
+ );
+ } else {
+ $_POST[$apiKey['keyName']] = $apiKey['valueInDb'];
+ }
+ } else {
+ $this->validateApiKeyOrRemove(
+ $apiKey['pattern'],
+ $apiKey['postedValue'],
+ $apiKey['keyName']
+ );
+ }
+ }
+ }
}
diff --git a/src/Settings/Page/Section/Advanced.php b/src/Settings/Page/Section/Advanced.php
index 454d0f37d..a4e048a91 100644
--- a/src/Settings/Page/Section/Advanced.php
+++ b/src/Settings/Page/Section/Advanced.php
@@ -49,9 +49,9 @@ public function config(): array
'type' => 'select',
'options' => [
SharedDataDictionary::SETTING_LOCALE_WP_LANGUAGE => __(
- 'Automatically send WordPress language',
- 'mollie-payments-for-woocommerce'
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
+ 'Automatically send WordPress language',
+ 'mollie-payments-for-woocommerce'
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce') . ')',
SharedDataDictionary::SETTING_LOCALE_DETECT_BY_BROWSER => __(
'Detect using browser language',
'mollie-payments-for-woocommerce'
@@ -111,8 +111,8 @@ public function config(): array
'type' => 'select',
'options' => [
PaymentService::PAYMENT_METHOD_TYPE_ORDER => ucfirst(
- PaymentService::PAYMENT_METHOD_TYPE_ORDER
- ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
+ PaymentService::PAYMENT_METHOD_TYPE_ORDER
+ ) . ' (' . __('default', 'mollie-payments-for-woocommerce')
. ')',
PaymentService::PAYMENT_METHOD_TYPE_PAYMENT => ucfirst(
PaymentService::PAYMENT_METHOD_TYPE_PAYMENT
@@ -203,8 +203,8 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto
'type' => 'checkbox',
'default' => 'no',
'desc' => __("Remove options and scheduled actions from database when uninstalling the plugin.", "mollie-payments-for-woocommerce") . ' (' . strtolower(
- __('Clear now', 'mollie-payments-for-woocommerce')
- ) . ' )',
+ __('Clear now', 'mollie-payments-for-woocommerce')
+ ) . ' )',
],
[
'id' => $this->settings->getSettingId('sectionend'),
@@ -263,5 +263,4 @@ protected function cleanDbIfRequested()
}
}
}
-
}
diff --git a/src/Settings/Page/Section/PaymentMethods.php b/src/Settings/Page/Section/PaymentMethods.php
index 4bcd17a73..11fc8f676 100644
--- a/src/Settings/Page/Section/PaymentMethods.php
+++ b/src/Settings/Page/Section/PaymentMethods.php
@@ -37,19 +37,19 @@ public function renderGateways(): string
$this->refreshIfRequested();
$titleActivePaymentMethods = __(
- 'Currently Active Payment Methods',
- 'mollie-payments-for-woocommerce'
+ 'Currently Active Payment Methods',
+ 'mollie-payments-for-woocommerce'
);
$descriptionActivePaymentMethods = __(
- 'These payment methods are active in your Mollie profile.
+ 'These payment methods are active in your Mollie profile.
You can enable these payment methods in their settings to make them available for your customers.',
- 'mollie-payments-for-woocommerce'
+ 'mollie-payments-for-woocommerce'
);
$titleInactivePaymentMethods = __('Inactive Payment Methods', 'mollie-payments-for-woocommerce');
$descriptionInactivePaymentMethods = __(
- 'These payment methods are available in your Mollie profile but are
+ 'These payment methods are available in your Mollie profile but are
not currently active. Activate them to offer more payment options to your customers.',
- 'mollie-payments-for-woocommerce'
+ 'mollie-payments-for-woocommerce'
);
$activatedGateways = '';
@@ -70,14 +70,14 @@ public function renderGateways(): string
}
return $this->paymentGatewaysBlock(
- $titleActivePaymentMethods,
- $descriptionActivePaymentMethods,
- $activatedGateways
- ) . $this->paymentGatewaysBlock(
- $titleInactivePaymentMethods,
- $descriptionInactivePaymentMethods,
- $deactivatedGateways
- );
+ $titleActivePaymentMethods,
+ $descriptionActivePaymentMethods,
+ $activatedGateways
+ ) . $this->paymentGatewaysBlock(
+ $titleInactivePaymentMethods,
+ $descriptionInactivePaymentMethods,
+ $deactivatedGateways
+ );
}
protected function paymentGatewaysBlock(string $title, string $description, string $html): string
@@ -98,7 +98,7 @@ protected function paymentGatewaysBlock(string $title, string $description, stri
protected function getGatewaySettingsUrl(string $gatewayClassName): string
{
return admin_url(
- 'admin.php?page=wc-settings&tab=checkout§ion=' . sanitize_title(strtolower($gatewayClassName))
+ 'admin.php?page=wc-settings&tab=checkout§ion=' . sanitize_title(strtolower($gatewayClassName))
);
}
@@ -177,8 +177,8 @@ protected function refreshIfRequested()
isset($_GET['refresh-methods']) &&
isset($_GET['nonce_mollie_refresh_methods']) &&
wp_verify_nonce(
- filter_input(INPUT_GET, 'nonce_mollie_refresh_methods', FILTER_SANITIZE_SPECIAL_CHARS),
- 'nonce_mollie_refresh_methods'
+ filter_input(INPUT_GET, 'nonce_mollie_refresh_methods', FILTER_SANITIZE_SPECIAL_CHARS),
+ 'nonce_mollie_refresh_methods'
)
) {
$testMode = $this->testModeEnabled;
@@ -199,30 +199,30 @@ protected function paymentGatewayButton(AbstractPaymentMethod $paymentMethod, $e
$paymentMethodId = $paymentMethod->getProperty('id');
$gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId;
$button = '' . esc_html(__(
- 'Manage Payment Method',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ $gatewayKey
+ ) . '">' . esc_html(__(
+ 'Manage Payment Method',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
$messageOrLink = '';
$enabledInWoo = ($paymentMethod->getSettings())['enabled'] === 'yes';
if ($enabledInMollie && $enabledInWoo) {
$messageOrLink = '' . esc_html(__(
- 'enabled',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'enabled',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
} elseif ($enabledInMollie && !$enabledInWoo) {
$messageOrLink = '' . esc_html(__(
- 'disabled',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'disabled',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
} else {
if ($documentationLink) {
$messageOrLink = "" . esc_html(__(
- 'More information',
- 'mollie-payments-for-woocommerce'
- )) . ' ';
+ 'More information',
+ 'mollie-payments-for-woocommerce'
+ )) . '';
}
$button = '' .
esc_html(__('Activate Payment Method', 'mollie-payments-for-woocommerce'))
From 94596400d3946c2a10486a1bdf826b19e9d3183c Mon Sep 17 00:00:00 2001
From: carmenmaymo
Date: Mon, 18 Nov 2024 11:40:49 +0100
Subject: [PATCH 17/17] Update version and tested version
---
mollie-payments-for-woocommerce.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php
index 77d4377bc..096abea8b 100644
--- a/mollie-payments-for-woocommerce.php
+++ b/mollie-payments-for-woocommerce.php
@@ -3,7 +3,7 @@
* Plugin Name: Mollie Payments for WooCommerce
* Plugin URI: https://www.mollie.com
* Description: Accept payments in WooCommerce with the official Mollie plugin
- * Version: 7.9.0-beta
+ * Version: 7.9.0
* Author: Mollie
* Author URI: https://www.mollie.com
* Requires at least: 5.0
@@ -12,7 +12,7 @@
* Domain Path: /languages
* License: GPLv2 or later
* WC requires at least: 3.9
- * WC tested up to: 9.3
+ * WC tested up to: 9.4
* Requires PHP: 7.4
* Requires Plugins: woocommerce
*/