diff --git a/.distignore b/.distignore index 8c5cb7454..32ec1a623 100644 --- a/.distignore +++ b/.distignore @@ -4,6 +4,7 @@ tests/ resources/ vendor/**/test* +vendor/mollie/mollie-api-php/examples/ languages/*.po bin/ *.lock diff --git a/composer.lock b/composer.lock index f905d204a..e9c88ffc2 100644 --- a/composer.lock +++ b/composer.lock @@ -8,28 +8,28 @@ "packages": [ { "name": "composer/ca-bundle", - "version": "1.3.6", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" }, "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/063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", "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", - "psr/log": "^1.0", + "phpstan/phpstan": "^1.10", + "psr/log": "^1.0 || ^2.0 || ^3.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.1" }, "funding": [ { @@ -80,20 +80,20 @@ "type": "tidelift" } ], - "time": "2023-06-06T12:02:59+00:00" + "time": "2024-07-08T15:28:20+00:00" }, { "name": "mollie/mollie-api-php", - "version": "v2.61.0", + "version": "v2.71.0", "source": { "type": "git", "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a" + "reference": "dff324f0621ff134fbefffa42ee511833a58578f" }, "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/dff324f0621ff134fbefffa42ee511833a58578f", + "reference": "dff324f0621ff134fbefffa42ee511833a58578f", "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.71.0" }, - "time": "2023-07-31T15:37:46+00:00" + "time": "2024-07-17T08:02:14+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,20 +313,20 @@ "type": "github" } ], - "time": "2022-02-20T17:52:18+00:00" + "time": "2024-03-21T18:52:26+00:00" }, { "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 +342,6 @@ "psalm/phar": "^3.11.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "files": [ "lib/functions.php" @@ -370,7 +365,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 +375,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,20 +384,20 @@ "type": "github" } ], - "time": "2021-03-30T17:13:30+00:00" + "time": "2024-04-13T18:00:56+00:00" }, { "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 +418,7 @@ } ], "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", + "homepage": "https://antecedent.github.io/patchwork/", "keywords": [ "aop", "aspect", @@ -436,9 +430,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", @@ -684,30 +678,38 @@ }, { "name": "composer/pcre", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717" + "reference": "0e455b78ac53637929b29d5ab5bf3c978329c1eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3fdb2807b31a78a40ad89570e30ec77466c98717", - "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717", + "url": "https://api.github.com/repos/composer/pcre/zipball/0e455b78ac53637929b29d5ab5bf3c978329c1eb", + "reference": "0e455b78ac53637929b29d5ab5bf3c978329c1eb", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "2.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -735,7 +737,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.2.0" }, "funding": [ { @@ -751,20 +753,20 @@ "type": "tidelift" } ], - "time": "2022-11-16T18:32:04+00:00" + "time": "2024-07-25T09:28:32+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -814,9 +816,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.2" }, "funding": [ { @@ -832,20 +834,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "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/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -856,7 +858,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 +882,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.5" }, "funding": [ { @@ -898,7 +900,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -1291,16 +1293,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 +1316,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,9 +1352,9 @@ "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", @@ -1496,16 +1498,16 @@ }, { "name": "johnpbloch/wordpress-core", - "version": "5.9.7", + "version": "5.9.10", "source": { "type": "git", "url": "https://github.com/johnpbloch/wordpress-core.git", - "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb" + "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a" }, "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/5ca1365f22e0c57e8362ce0dbc735281e304130a", + "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a", "shasum": "" }, "require": { @@ -1513,7 +1515,7 @@ "php": ">=5.6.20" }, "provide": { - "wordpress/core-implementation": "5.9.7" + "wordpress/core-implementation": "5.9.10" }, "type": "wordpress-core", "notification-url": "https://packagist.org/downloads/", @@ -1540,7 +1542,7 @@ "source": "https://core.trac.wordpress.org/browser", "wiki": "https://codex.wordpress.org/" }, - "time": "2023-05-20T04:40:18+00:00" + "time": "2024-06-24T17:31:05+00:00" }, { "name": "mockery/mockery", @@ -1613,16 +1615,16 @@ }, { "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": { @@ -1630,11 +1632,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", @@ -1660,7 +1663,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": [ { @@ -1668,20 +1671,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "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 +1695,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 +1720,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 +1776,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 +1835,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 +1890,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", @@ -1987,29 +1997,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", @@ -2026,9 +2038,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", @@ -2254,16 +2266,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 +2327,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 +2335,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 +2387,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 +2395,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 +2444,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 +2491,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 +2499,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,48 +2563,48 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.33", + "version": "8.5.39", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e" + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/172ba97bcf97ae6ef86ca256adf77aece8a143fe", + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe", "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": { - "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 +2640,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.39" }, "funding": [ { @@ -2644,7 +2657,7 @@ "type": "tidelift" } ], - "time": "2023-02-27T13:04:50+00:00" + "time": "2024-07-10T11:43:00+00:00" }, { "name": "psr/container", @@ -2738,16 +2751,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 +2794,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 +2802,7 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2024-03-01T13:45:45+00:00" }, { "name": "sebastian/comparator", @@ -2867,16 +2880,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 +2934,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 +2942,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 +2997,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 +3005,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 +3074,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 +3082,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 +3138,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 +3146,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 +3195,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 +3203,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 +3250,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 +3258,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 +3313,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 +3321,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 +3364,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 +3372,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 +3420,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 +3428,7 @@ "type": "github" } ], - "time": "2020-11-30T07:25:11+00:00" + "time": "2024-03-01T14:04:07+00:00" }, { "name": "sebastian/version", @@ -3467,16 +3479,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": { @@ -3521,19 +3533,19 @@ "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", "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 +3589,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.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827" + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { @@ -3660,7 +3686,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.28" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, "funding": [ { @@ -3676,20 +3702,20 @@ "type": "tidelift" } ], - "time": "2023-08-07T06:12:30+00:00" + "time": "2024-07-26T12:21:55+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 +3753,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 +3769,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "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/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -3770,9 +3796,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3809,7 +3832,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -3825,20 +3848,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "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/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -3849,9 +3872,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3890,7 +3910,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.30.0" }, "funding": [ { @@ -3906,20 +3926,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "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/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -3930,9 +3950,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3974,7 +3991,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.30.0" }, "funding": [ { @@ -3990,20 +4007,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "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/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -4017,9 +4034,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4057,7 +4071,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -4073,20 +4087,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "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/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -4094,9 +4108,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4136,7 +4147,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -4152,20 +4163,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "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/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -4173,9 +4184,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4219,7 +4227,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -4235,7 +4243,7 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/service-contracts", @@ -4318,16 +4326,16 @@ }, { "name": "symfony/string", - "version": "v5.4.26", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1181fe9270e373537475e826873b5867b863883c" + "reference": "909cec913edea162a3b2836788228ad45fcab337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", - "reference": "1181fe9270e373537475e826873b5867b863883c", + "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", + "reference": "909cec913edea162a3b2836788228ad45fcab337", "shasum": "" }, "require": { @@ -4384,7 +4392,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.26" + "source": "https://github.com/symfony/string/tree/v5.4.42" }, "funding": [ { @@ -4400,20 +4408,20 @@ "type": "tidelift" } ], - "time": "2023-06-28T12:46:07+00:00" + "time": "2024-07-20T18:38:32+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 +4450,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 +4458,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "vimeo/psalm", @@ -4735,5 +4743,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/inc/settings/mollie_advanced_settings.php b/inc/settings/mollie_advanced_settings.php index 553eb31c9..e108e62d9 100644 --- a/inc/settings/mollie_advanced_settings.php +++ b/inc/settings/mollie_advanced_settings.php @@ -71,6 +71,7 @@ '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'), '', '' @@ -80,8 +81,8 @@ [ 'id' => $pluginName . '_customer_details', 'title' => __('Store customer details at Mollie', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ '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' @@ -110,8 +111,8 @@ ), ], 'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER, - /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */ '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' @@ -160,8 +161,8 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto array_keys($api_payment_description_labels), $api_payment_description_labels )), - /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */ 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' @@ -180,11 +181,9 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto 'type' => 'text', 'custom_attributes' => ['maxlength' => '30'], 'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'), - 'desc' => sprintf( - __( - 'This is the label will appear in frontend when the surcharge applies', - 'mollie-payments-for-woocommerce' - ) + 'desc' => __( + 'This is the label will appear in frontend when the surcharge applies', + 'mollie-payments-for-woocommerce' ), ], [ diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php index 773463142..2ef1c3fa0 100644 --- a/inc/settings/mollie_applepay_settings.php +++ b/inc/settings/mollie_applepay_settings.php @@ -27,8 +27,8 @@ [ 'id' => 'title', 'title' => __('Title', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Gateway title */ 'desc' => sprintf( + /* translators: Placeholder 1: Gateway title */ __( 'This controls the title which the user sees during checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -44,11 +44,9 @@ [ 'id' => 'display_logo', 'title' => __('Display logo', 'mollie-payments-for-woocommerce'), - 'desc' => sprintf( - __( - 'Display logo', - 'mollie-payments-for-woocommerce' - ) + 'desc' => __( + 'Display logo', + 'mollie-payments-for-woocommerce' ), 'desc_tip' => true, 'type' => 'checkbox', @@ -59,8 +57,8 @@ [ 'id' => 'description', 'title' => __('Description', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Gateway description */ 'desc' => sprintf( + /* translators: Placeholder 1: Gateway description */ __( 'Payment method description that the customer will see on your checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -88,8 +86,8 @@ [ 'id' => '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' => sprintf( + /* translators: Placeholder 1: enabled or disabled */ __( 'Enable the Apple Pay direct buy button on the Cart page', 'mollie-payments-for-woocommerce' @@ -104,8 +102,8 @@ [ 'id' => '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' => sprintf( + /* translators: Placeholder 1: enabled or disabled */ __( 'Enable the Apple Pay direct buy button on the Product page', 'mollie-payments-for-woocommerce' diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index d129381e3..0a6bf7d86 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.7.0 + * Version: 7.8.0 * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 diff --git a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php index 80ba90a4c..4bdb2ed14 100644 --- a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php +++ b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php @@ -36,7 +36,7 @@ abstract class AbstractVersionConstraint implements ConstraintInterface public function __construct($requiredVersion, $requiredPluginName = null) { $this->requiredVersion = $requiredVersion; - $this->requiredPluginName = $requiredPluginName; + $this->requiredPluginName = esc_html($requiredPluginName); $this->error = ''; $this->message = ''; } @@ -60,11 +60,13 @@ protected function checkVersion($actualVersion) if ($result) { return $result; } - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, $actualVersion, [$this->error], - $this->message + esc_html($this->message) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } } diff --git a/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php b/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php index 6a74803e5..12eb0f203 100644 --- a/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php +++ b/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php @@ -15,7 +15,7 @@ class ExtensionConstraint extends AbstractVersionConstraint public function __construct($requiredVersion) { parent::__construct($requiredVersion); - $this->error = 'Required Extension not loaded'; + $this->error = esc_html('Required Extension not loaded'); } /** @@ -25,18 +25,21 @@ public function check() { $this->message = $this->requiredVersion . ' extension is required. Enable it in your server or ask your webhoster to enable it for you.'; + $this->message = esc_html($this->message); if (function_exists('extension_loaded') && !extension_loaded( $this->requiredVersion ) ) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, $this->requiredVersion, [$this->error], $this->message ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } return true; } } diff --git a/pluginEnvironmentChecker/Constraints/PluginConstraint.php b/pluginEnvironmentChecker/Constraints/PluginConstraint.php index 07634283f..ac1b3ae17 100644 --- a/pluginEnvironmentChecker/Constraints/PluginConstraint.php +++ b/pluginEnvironmentChecker/Constraints/PluginConstraint.php @@ -18,7 +18,7 @@ class PluginConstraint extends AbstractVersionConstraint public function __construct($requiredVersion, $requiredPluginName, $pluginDisplayName) { parent::__construct($requiredVersion, $requiredPluginName); - $this->error = 'Plugin incompatibility'; + $this->error = esc_html('Plugin incompatibility'); $this->requiredPluginName = $requiredPluginName; $this->pluginDisplayName = $pluginDisplayName; } @@ -33,23 +33,26 @@ public function check() if (!$isPluginActive) { $this->message = "The {$this->pluginDisplayName} plugin must be active. Please install & activate {$this->pluginDisplayName}"; - + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped throw new ConstraintFailedException( $this, - $this->requiredPluginName, + esc_html($this->requiredPluginName), [$this->error], - $this->message + esc_html($this->message) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } $pathToPluginFile = $this->absolutePathToPlugin(); if (!$pathToPluginFile) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, - $this->requiredPluginName, + esc_html($this->requiredPluginName), [$this->error], - "Cannot find absolute path to {$this->pluginDisplayName} plugin" + esc_html("Cannot find absolute path to {$this->pluginDisplayName} plugin") ); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; @@ -59,7 +62,7 @@ public function check() $this->message = "The {$this->pluginDisplayName} plugin has to be version " . $this->requiredVersion . " or higher. Please update your {$this->pluginDisplayName} version."; - + $this->message = esc_html($this->message); return $this->checkVersion( $currentVersion ); diff --git a/pluginEnvironmentChecker/Constraints/WordPressConstraint.php b/pluginEnvironmentChecker/Constraints/WordPressConstraint.php index 5f7a8b028..29dcf1676 100644 --- a/pluginEnvironmentChecker/Constraints/WordPressConstraint.php +++ b/pluginEnvironmentChecker/Constraints/WordPressConstraint.php @@ -12,7 +12,7 @@ class WordPressConstraint extends AbstractVersionConstraint public function __construct($requiredVersion) { parent::__construct($requiredVersion); - $this->error = 'Wordpress version incompatibility'; + $this->error = esc_html('Wordpress version incompatibility'); } /** @@ -24,6 +24,7 @@ public function check() $this->message = 'WordPress version has to be ' . $this->requiredVersion . ' or higher. Please update your WordPress version'; + $this->message = esc_html($this->message); return $this->checkVersion( $WPCurrentVersion diff --git a/pluginEnvironmentChecker/EnvironmentChecker.php b/pluginEnvironmentChecker/EnvironmentChecker.php index d269f73bb..bb0ae235c 100644 --- a/pluginEnvironmentChecker/EnvironmentChecker.php +++ b/pluginEnvironmentChecker/EnvironmentChecker.php @@ -42,13 +42,15 @@ public function check() $errCount = count($this->errors); if ($errCount) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, 'General Checker', $this->errors, - $this->__('Validation failed with %1$d errors', [$errCount]) + $this->esc_html__('Validation failed with %1$d errors', [$errCount]) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } } /** @@ -60,6 +62,6 @@ public function check() */ protected function __($string, $params = []) { - return vsprintf($string, $params); + return esc_html(vsprintf($string, $params)); } } diff --git a/public/images/satispay.svg b/public/images/satispay.svg new file mode 100644 index 000000000..c1ab71ecb --- /dev/null +++ b/public/images/satispay.svg @@ -0,0 +1 @@ + diff --git a/readme.txt b/readme.txt index 65478312f..f02e326bd 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, syde, l.vangunst, ndij Tags: mollie, payments, payment gateway, woocommerce, credit card, apple pay, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions Requires at least: 3.8 Tested up to: 6.6 -Stable tag: 7.7.0 +Stable tag: 7.8.0 Requires PHP: 7.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -221,6 +221,11 @@ Automatic updates should work like a charm; as always though, ensure you backup == Changelog == += 7.8.0 - 27-08-2024 = + +* Added - Satispay payment method +* Security - Remove Mollie SDK examples folder and some CS fixes + = 7.7.0 - 12-08-2024 = * Added - Payconiq payment method diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index 21b75beab..ec70f8c7b 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -83,25 +83,6 @@ public function initDb() public function handleTranslations(): void { add_action('core_upgrade_preamble', 'mollieDeleteWPTranslationFiles'); - add_filter( - 'site_transient_update_plugins', - static function ($value) { - if (isset($value->translations)) { - $i = 0; - foreach ($value->translations as $translation) { - if ( - $translation["slug"] - === "mollie-payments-for-woocommerce" - ) { - unset($value->translations[$i]); - } - $i++; - } - } - - return $value; - } - ); } /** @@ -136,8 +117,8 @@ public function mollieWcNoticeApiKeyMissing() } $notice = new AdminNotice(); - /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/ $message = sprintf( + /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/ esc_html__( '%1$sMollie Payments for WooCommerce: API keys missing%2$s Please%3$s set your API keys here%4$s.', 'mollie-payments-for-woocommerce' @@ -180,6 +161,7 @@ public function pluginInit() false, dirname(plugin_basename($this->baseFile)) . '/languages/' ); + $this->markUpdatedOrNew(); $this->initDb(); } diff --git a/src/Activation/ConstraintsChecker.php b/src/Activation/ConstraintsChecker.php index ed257e294..27a662d04 100644 --- a/src/Activation/ConstraintsChecker.php +++ b/src/Activation/ConstraintsChecker.php @@ -103,11 +103,21 @@ public function maybeShowWarning($constraint, $warning) protected function showNotice(array $errors) { - $message = sprintf(__('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), '

', '

'); + $message = sprintf( + /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ + __('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), + '

', + '

' + ); foreach ($errors as $error) { $message .= sprintf('

%s

', $error); } - $message .= sprintf(__('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), '

', '

'); + $message .= sprintf( + /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ + __('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), + '

', + '

' + ); $errorLevel = 'notice-error'; $this->notice->addNotice($errorLevel, $message); } diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 8b9f3a96c..9cb2e3613 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -247,7 +247,7 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirectCart.min.js')), true ); - wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [], date("d"), true); + wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [], gmdate("d"), true); wp_register_script( 'mollie-components', $this->getPluginUrl($pluginUrl, '/public/js/mollie-components.min.js'), diff --git a/src/Buttons/ApplePayButton/AppleAjaxRequests.php b/src/Buttons/ApplePayButton/AppleAjaxRequests.php index 6643cffe1..59a82fb98 100644 --- a/src/Buttons/ApplePayButton/AppleAjaxRequests.php +++ b/src/Buttons/ApplePayButton/AppleAjaxRequests.php @@ -116,7 +116,7 @@ public function validateMerchant() //we cannot access the endpoint in testmode, we override it to be testMode = false $apiKey = $this->settingsHelper->getApiKey(false); $validationUrl = $applePayRequestDataObject->validationUrl(); - $completeDomain = parse_url(get_site_url(), PHP_URL_HOST); + $completeDomain = wp_parse_url(get_site_url(), PHP_URL_HOST); $removeHttp = ["https://", "http://"]; $regex = '/.+\.\w+\/?((\w*\/*)*)/i'; $domain = str_replace($removeHttp, "", $completeDomain); @@ -695,8 +695,8 @@ function ($result, $order_id) { ) ); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( + /* translators: Placeholder 1: Payment method title */ __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index bf80e8bb0..71a9e4aff 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -37,8 +37,8 @@ public function __construct(AdminNotice $notice, AppleAjaxRequests $ajaxRequests public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) { if (!$this->isApplePayCompatible()) { - /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ $message = sprintf( + /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ esc_html__( '%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work', 'mollie-payments-for-woocommerce' @@ -53,8 +53,8 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) } if (!$this->merchantValidated()) { - /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ $message = sprintf( + /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ esc_html__( 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', 'mollie-payments-for-woocommerce' diff --git a/src/Buttons/PayPalButton/PayPalAjaxRequests.php b/src/Buttons/PayPalButton/PayPalAjaxRequests.php index 17f231bc9..30e65bc31 100644 --- a/src/Buttons/PayPalButton/PayPalAjaxRequests.php +++ b/src/Buttons/PayPalButton/PayPalAjaxRequests.php @@ -108,8 +108,8 @@ public function createWcOrder() ) { wp_send_json_success($result); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( + /* translators: Placeholder 1: Payment method title */ __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' @@ -152,8 +152,8 @@ public function createWcOrderFromCart() ) { wp_send_json_success($result); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( + /* translators: Placeholder 1: Payment method title */ __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 6aaae88b3..0004ef09f 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -735,6 +735,7 @@ public function addPaymentMethodMandatoryFields($fields, string $gatewayName, st $errors->add( 'validation', sprintf( + /* translators: Placeholder 1: field name. */ __('%s is a required field.', 'woocommerce'), "$fieldLabel" ) @@ -752,6 +753,7 @@ public function addPaymentMethodMandatoryFieldsPhoneVerification( string $fieldLabel, $errors ) { + if ($fields['payment_method'] !== $gatewayName) { return $fields; } @@ -833,10 +835,9 @@ public function addBirthdateWhenRest($arrayContext) $context->order->update_meta_data('billing_birthdate', $billingBirthdate); $context->order->save(); } else { - $message = __('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce'); throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', - $message, + esc_html__('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce'), 402 ); } diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index 1ff2cc0cb..e880f4836 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -649,6 +649,7 @@ protected function noOrderPaymentFailure($orderId): array $this->notice->addNotice( 'error', sprintf( + /* translators: Placeholder 1: order id. */ __( 'Could not load order %s', 'mollie-payments-for-woocommerce' @@ -688,7 +689,7 @@ protected function activePaymentObject($orderId, $useCache): Payment if ($activePaymentObject === null) { throw new UnexpectedValueException( - "Active Payment Object is not a valid Payment Resource instance. Order ID: {$orderId}" + esc_html(sprintf("Active Payment Object is not a valid Payment Resource instance. Order ID: %s", $orderId)) ); } @@ -887,7 +888,7 @@ public function onOrderReceivedTitle($title, $id = null) ); $order_key = apply_filters( 'woocommerce_thankyou_order_key', - empty($_GET['key']) ? '' : wc_clean(filter_input(INPUT_GET, 'key', FILTER_SANITIZE_SPECIAL_CHARS)) + empty($_GET['key']) ? '' : wc_clean(filter_input(INPUT_GET, 'key', FILTER_SANITIZE_SPECIAL_CHARS))// WPCS: input var ok, CSRF ok. ); if ($order_id > 0) { $order = wc_get_order($order_id); diff --git a/src/Gateway/Surcharge.php b/src/Gateway/Surcharge.php index 6b2f88294..bc9666238 100644 --- a/src/Gateway/Surcharge.php +++ b/src/Gateway/Surcharge.php @@ -298,8 +298,8 @@ protected function name_fixed_fee_percentage($paymentMethod) $amountFix = $paymentMethod->getProperty(self::FIXED_FEE); $currency = get_woocommerce_currency_symbol(); $amountPercent = $paymentMethod->getProperty(self::PERCENTAGE); - /* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */ return sprintf( + /* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */ __(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'), $currency, $amountFix, diff --git a/src/Log/WcPsrLoggerAdapter.php b/src/Log/WcPsrLoggerAdapter.php index 781a872fc..725bed753 100644 --- a/src/Log/WcPsrLoggerAdapter.php +++ b/src/Log/WcPsrLoggerAdapter.php @@ -80,7 +80,8 @@ public function log($level, $message, array $context = []) } if (\WC_Log_Levels::get_level_severity($wcLevel) < \WC_Log_Levels::get_level_severity($this->loggingLevel)) { - throw new InvalidArgumentException("Unknown log level {$wcLevel}"); + $message = sprintf("Unknown log level %s", $wcLevel); + throw new InvalidArgumentException(esc_html($message)); } if (isset($context['source']) && $context['source'] !== $this-> loggerSource) { diff --git a/src/MerchantCapture/Capture/Action/CapturePayment.php b/src/MerchantCapture/Capture/Action/CapturePayment.php index 8d50f6994..215fcca45 100644 --- a/src/MerchantCapture/Capture/Action/CapturePayment.php +++ b/src/MerchantCapture/Capture/Action/CapturePayment.php @@ -40,7 +40,7 @@ public function __invoke() ]; $this->logger->debug( 'SEND AN ORDER CAPTURE, orderId: ' . $this->order->get_id( - ) . ' transactionId: ' . $paymentId . 'Capture data: ' . json_encode($captureData) + ) . ' transactionId: ' . $paymentId . 'Capture data: ' . wp_json_encode($captureData) ); $paymentCapturesApi->createForId($paymentId, $captureData); $this->order->update_meta_data( @@ -49,6 +49,7 @@ public function __invoke() ); $this->order->add_order_note( sprintf( + /* translators: Placeholder 1: Order price */ __( 'The payment capture of %s has been sent successfully, and we are currently awaiting confirmation.', 'mollie-payments-for-woocommerce' diff --git a/src/MerchantCapture/UI/OrderActionBlock.php b/src/MerchantCapture/UI/OrderActionBlock.php index d0fbd6563..b81776306 100644 --- a/src/MerchantCapture/UI/OrderActionBlock.php +++ b/src/MerchantCapture/UI/OrderActionBlock.php @@ -11,7 +11,7 @@ public function __invoke(array $paragraphs) echo "
  • "; foreach ($paragraphs as $paragraph) { ?> -

    ['class' => []], 'span' => []]); ?>

    +

    ['class' => []], 'span' => []]); ?>

    '; diff --git a/src/MerchantCapture/UI/StatusButton.php b/src/MerchantCapture/UI/StatusButton.php index 063217a51..712941d48 100644 --- a/src/MerchantCapture/UI/StatusButton.php +++ b/src/MerchantCapture/UI/StatusButton.php @@ -9,7 +9,7 @@ class StatusButton public function __invoke(string $text, string $status) { ?> - + -
    - +
    +
    getCustomerBirthdate($order); @@ -713,7 +712,7 @@ public function refund_order_items($order, $orderId, $amount, $items, $paymentOb ); $this->logger->debug(__METHOD__ . " - Order $orderId: " . $noteMessage); - throw new Exception($noteMessage); + throw new Exception(esc_html(sprintf("%s", $noteMessage))); } $this->processOrderItemsRefund( @@ -756,8 +755,8 @@ public function refund_amount($order, $amount, $paymentObject, $reason) $apiKey = $this->settingsHelper->getApiKey(); if ($paymentObject->isCreated() || $paymentObject->isAuthorized() || $paymentObject->isShipping()) { - /* translators: Placeholder 1: payment status.*/ $noteMessage = sprintf( + /* translators: Placeholder 1: payment status.*/ _x( 'Can not refund order amount that has status %1$s at Mollie.', 'Order note error', @@ -767,7 +766,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ); $order->add_order_note($noteMessage); $this->logger->debug(__METHOD__ . ' - ' . $noteMessage); - throw new Exception($noteMessage); + throw new Exception(esc_html(sprintf("%s", $noteMessage))); } if ($paymentObject->isPaid() || $paymentObject->isShipping() || $paymentObject->isCompleted()) { @@ -778,8 +777,8 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ], 'description' => $reason, ]); - /* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/ $noteMessage = sprintf( + /* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/ __('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'), $this->dataHelper->getOrderCurrency($order), $amount, @@ -826,8 +825,6 @@ public function updatePaymentDataWithOrderData($order, $orderId) } } - - /** * @param WC_Order $order * @param $newOrderStatus @@ -937,8 +934,8 @@ protected function processOrderItemsRefund( ); if ($refund === null) { - /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/ $noteMessage = sprintf( + /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/ __( '%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' @@ -961,8 +958,8 @@ protected function processOrderItemsRefund( $order ) . wc_format_decimal($itemRefundAmount) . (!empty($reason) ? ', reason: ' . $reason : '') ); - /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */ $noteMessage = sprintf( + /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */ __( '%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s.', 'mollie-payments-for-woocommerce' @@ -1014,7 +1011,7 @@ protected function getCustomerBirthdate($order) return null; } $format = "Y-m-d"; - return date($format, (int) strtotime($fieldPosted)); + return gmdate($format, (int) strtotime($fieldPosted)); } return null; } diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index ede0c6d05..369dae463 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -269,7 +269,7 @@ protected function processRefunds(WC_Order $order, $payment) $refundIds = $this->findRefundIds($payment); // Check for new refund $this->logger->debug( - __METHOD__ . " All refund IDs for {$logId}: " . json_encode( + __METHOD__ . " All refund IDs for {$logId}: " . wp_json_encode( $refundIds ) ); @@ -293,7 +293,7 @@ protected function processRefunds(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Refunds that need to be processed for {$logId}: " - . json_encode($refundsToProcess) + . wp_json_encode($refundsToProcess) ); $order = wc_get_order($orderId); @@ -348,7 +348,7 @@ protected function processChargebacks(WC_Order $order, $payment) } $this->logger->debug( - __METHOD__ . " All chargeback IDs for {$logId}: " . json_encode( + __METHOD__ . " All chargeback IDs for {$logId}: " . wp_json_encode( $chargebackIds ) ); @@ -365,7 +365,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Already processed chargebacks for {$logId}: " - . json_encode($processedChargebackIds) + . wp_json_encode($processedChargebackIds) ); // Order the chargeback arrays by value (chargeback ID) @@ -382,7 +382,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Chargebacks that need to be processed for {$logId}: " - . json_encode($chargebacksToProcess) + . wp_json_encode($chargebacksToProcess) ); } else { // No new chargebacks, stop processing. @@ -402,9 +402,9 @@ protected function processChargebacks(WC_Order $order, $payment) __METHOD__ . " New chargeback {$chargebackToProcess} for {$logId}. Order note and order status updated." ); - /* translators: Placeholder 1: Chargeback to process id. */ $order->add_order_note( sprintf( + /* translators: Placeholder 1: Chargeback to process id. */ __( 'New chargeback %s processed! Order note and order status updated.', 'mollie-payments-for-woocommerce' @@ -466,7 +466,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Updated, all processed chargebacks for {$logId}: " - . json_encode($processedChargebackIds) + . wp_json_encode($processedChargebackIds) ); $order->save(); @@ -797,7 +797,7 @@ protected function getProcessedRefundIds(WC_Order $order, string $logId) $this->logger->debug( __METHOD__ . " Already processed refunds for {$logId}: " - . json_encode($processedRefundIds) + . wp_json_encode($processedRefundIds) ); return $processedRefundIds; } @@ -816,9 +816,9 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId __METHOD__ . " New refund {$refundToProcess} processed in Mollie Dashboard for {$logId} Order note added, but order not updated." ); - /* translators: Placeholder 1: Refund to process id. */ $order->add_order_note( sprintf( + /* translators: Placeholder 1: Refund to process id. */ __( 'New refund %s processed in Mollie Dashboard! Order note added, but order not updated.', 'mollie-payments-for-woocommerce' @@ -836,7 +836,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId ); $this->logger->debug( __METHOD__ . " Updated, all processed refunds for {$logId}: " - . json_encode($processedRefundIds) + . wp_json_encode($processedRefundIds) ); return $processedRefundIds; } diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index 0d319e54f..f4dfbab5e 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -120,7 +120,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken) { - $encodedApplePayToken = json_encode($applePayToken); + $encodedApplePayToken = wp_json_encode($applePayToken); $paymentRequestData['applePayPaymentToken'] = $encodedApplePayToken; } $paymentRequestData = $this->addCustomRequestFields($order, $paymentRequestData, $gateway); diff --git a/src/Payment/OrderItemsRefunder.php b/src/Payment/OrderItemsRefunder.php index 330e0c5f2..09a9a01cb 100644 --- a/src/Payment/OrderItemsRefunder.php +++ b/src/Payment/OrderItemsRefunder.php @@ -118,7 +118,7 @@ private function normalizedWooCommerceItemsList(array $items) if (!$toRefundItemId) { throw new UnexpectedValueException( - __( + esc_html__( 'One of the WooCommerce order items does not have the refund item ID meta value associated to Mollie Order item.', 'mollie-payments-for-woocommerce' ) @@ -163,11 +163,12 @@ private function normalizedRemoteItems(array $remoteItems) if (!$orderItemId) { throw new UnexpectedValueException( sprintf( - __( + /* translators: Placeholder 1: item id. */ + esc_html__( 'Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' ), - $remoteItem->id + esc_html($remoteItem->id) ) ); } @@ -187,7 +188,7 @@ private function bailIfNoItemsToRefund(array $items, array $remoteItems) { if (empty($items) || empty($remoteItems)) { throw new UnexpectedValueException( - __( + esc_html__( 'Empty WooCommerce order items or mollie order lines.', 'mollie-payments-for-woocommerce' ) diff --git a/src/Payment/OrderLines.php b/src/Payment/OrderLines.php index 1c76bbf33..e70f72ed4 100644 --- a/src/Payment/OrderLines.php +++ b/src/Payment/OrderLines.php @@ -75,7 +75,7 @@ private function process_missmatch() { $orderTotal = (float) $this->order->get_total(); $orderTotalRounded = round($orderTotal, 2); - $linesTotal = array_sum(array_map(function ($line) { + $linesTotal = array_sum(array_map(static function ($line) { return $line['totalAmount']['value']; }, $this->order_lines)); $orderTotalDiff = $orderTotalRounded - $linesTotal; @@ -324,7 +324,7 @@ private function get_item_name($cart_item) { $item_name = $cart_item->get_name(); - return html_entity_decode(strip_tags($item_name)); + return html_entity_decode(wp_strip_all_tags($item_name)); } /** diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index d7c92734c..31c721dae 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -217,6 +217,7 @@ public function addOrderNoteForRefundCreated( ) { $orderNote = sprintf( + /* translators: Placeholder 1: number of items. */ __( '%1$s items refunded in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' @@ -235,6 +236,7 @@ public function addOrderNoteForRefundCreated( public function addOrderNoteForCancelledLineItems(array $data, WC_Order $order) { $orderNote = sprintf( + /* translators: Placeholder 1: number of items. */ __( '%1$s items cancelled in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' @@ -513,7 +515,7 @@ public function IsExpiryDateEnabled($paymentMethods): bool foreach ($paymentMethods as $paymentMethod) { $optionName = "mollie_wc_gateway_{$paymentMethod->getProperty('id')}_settings"; $option = get_option($optionName, false); - if ($option && $option['enabled'] !== 'yes') { + if (!empty($option) && isset($option['enabled']) && $option['enabled'] !== 'yes') { continue; } if (!empty($option["activate_expiry_days_setting"]) && $option["activate_expiry_days_setting"] === 'yes') { @@ -540,14 +542,14 @@ public function orderByRequest() if (!$order) { throw new RuntimeException( - "Could not find order by order Id {$orderId}", + esc_html("Could not find order by order Id {$orderId}"), 404 ); } if (!$order->key_is_valid($key)) { throw new RuntimeException( - "Invalid key given. Key {$key} does not match the order id: {$orderId}", + esc_html("Invalid key given. Key {$key} does not match the order id: {$orderId}"), 401 ); } diff --git a/src/Payment/PaymentService.php b/src/Payment/PaymentService.php index bd7bf82d1..87794c8c7 100644 --- a/src/Payment/PaymentService.php +++ b/src/Payment/PaymentService.php @@ -372,10 +372,10 @@ protected function processAsMollieOrder( ? $data['orderNumber'] : '', 'lines' => isset($data['lines']) ? $data['lines'] : '', ]; - $this->logger->debug(json_encode($apiCallLog)); + $this->logger->debug(wp_json_encode($apiCallLog)); $paymentOrder = $paymentObject; $paymentObject = $this->apiHelper->getApiClient($apiKey)->orders->create($data); - $this->logger->debug(json_encode($paymentObject)); + $this->logger->debug(wp_json_encode($paymentObject)); $settingsHelper = $this->settingsHelper; if ($settingsHelper->getOrderStatusCancelledPayments() === 'cancelled') { $orderId = $order->get_id(); @@ -492,7 +492,7 @@ protected function processAsMolliePayment( : '', ]; - $this->logger->debug(json_encode($apiCallLog, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + $this->logger->debug(wp_json_encode($apiCallLog, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); // Try as simple payment $paymentObject = $this->apiHelper->getApiClient( @@ -649,7 +649,7 @@ protected function noValidMandateForSubsSwitchFailure($orderId): void ) ); throw new ApiException( - __('Failed switching subscriptions, no valid mandate.', 'mollie-payments-for-woocommerce') + esc_html__('Failed switching subscriptions, no valid mandate.', 'mollie-payments-for-woocommerce') ); } @@ -892,7 +892,7 @@ public function handleMollieOutage(ApiException $e): void ); throw new ApiException( - __( + esc_html__( 'Payment failed due to: Mollie is out of service. Please try again later.', 'mollie-payments-for-woocommerce' ) @@ -915,7 +915,7 @@ public function handleMollieFraudRejection(ApiException $e): void ); throw new ApiException( - __( + esc_html__( 'Payment failed due to: The payment was declined due to suspected fraud.', 'mollie-payments-for-woocommerce' ) diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index 57ab8914d..2815fad7b 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -59,7 +59,14 @@ public function buildLineItems( if ($toRefundRemoteItem === null) { throw new UnexpectedValueException( - sprintf('Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', $toRefundItemId) + sprintf( + /* translators: Placeholder 1: item id. */ + esc_html__( + 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', + 'mollie-payments-for-woocommerce' + ), + esc_html($toRefundItemId) + ) ); } @@ -123,7 +130,7 @@ private function buildLineItem( if ($toRefundRemoteItemAmount !== $toRefundItemAmount) { throw new PartialRefundException( - __( + esc_html__( "Mollie doesn't allow a partial refund of the full amount or quantity of at least one order line. Trying to process this as an amount refund instead.", 'mollie-payments-for-woocommerce' ) diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index c27503213..93a6f3f10 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -96,7 +96,7 @@ public function addPaymentArguments(array $args, WC_Order $order) $expiry_days = (int)$this->getProperty(self::EXPIRY_DAYS_OPTION) ?: self::EXPIRY_DEFAULT_DAYS; if ($expiry_days >= self::EXPIRY_MIN_DAYS && $expiry_days <= self::EXPIRY_MAX_DAYS) { - $expiry_date = date("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); + $expiry_date = gmdate("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); // Add dueDate at the correct location if ($this->isExpiredDateSettingActivated()) { diff --git a/src/PaymentMethods/Creditcard.php b/src/PaymentMethods/Creditcard.php index 4ef1a9ae5..237ad4ce7 100644 --- a/src/PaymentMethods/Creditcard.php +++ b/src/PaymentMethods/Creditcard.php @@ -50,8 +50,8 @@ protected function includeMollieComponentsFields($generalFormFields) 'mollie_components_enabled' => [ 'type' => 'checkbox', 'title' => __('Enable Mollie Components', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Mollie Components.*/ 'description' => sprintf( + /* translators: Placeholder 1: Mollie Components.*/ __( 'Use the Mollie Components for this Gateway. Read more about %s and how it improves your conversion.', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/Giftcard.php b/src/PaymentMethods/Giftcard.php index dbbd3895c..812e3cd7f 100644 --- a/src/PaymentMethods/Giftcard.php +++ b/src/PaymentMethods/Giftcard.php @@ -27,6 +27,7 @@ public function debugGiftcardDetails( $orderNoteLine = ""; foreach ($details->giftcards as $giftcard) { $orderNoteLine .= sprintf( + /* translators: Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency */ esc_html_x( 'Mollie - Giftcard details: %1$s %2$s %3$s.', 'Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency', @@ -39,6 +40,7 @@ public function debugGiftcardDetails( } if ($details->remainderMethod) { $orderNoteLine .= sprintf( + /* translators: Placeholder 1: Method Placeholder 2: Value Placeholder 3: currency */ esc_html_x( ' Remainder: %1$s %2$s %3$s.', 'Placeholder 1: remainder method, Placeholder 2: amount value, Placeholder 3: currency', diff --git a/src/PaymentMethods/Giropay.php b/src/PaymentMethods/Giropay.php index f7e700fe0..440b8f0b8 100644 --- a/src/PaymentMethods/Giropay.php +++ b/src/PaymentMethods/Giropay.php @@ -31,6 +31,7 @@ public function getFormFields($generalFormFields): array 'notice' => [ 'title' => sprintf( + /* translators: Placeholder 1: paragraph opening tag Placeholder 2: link url Placeholder 3: closing tags */ __( '%1$s Paydirekt, the owner of Giropay, has decided to deprecate Giropay. On Monday, 24 June 2024, Mollie was informed that Giropay would cease onboarding new merchants and processing new payments after 30 June 2024. No action is needed from your side. Mollie will automatically remove Giropay as a payment option from your Checkout by 30 June. Subscription renewals and refunds will continue to be processed as usual beyond June 30. More details can be found in the %2$s Giropay Deprecation FAQ. %3$s', diff --git a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php index 13f8deb0e..631e998e7 100644 --- a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php +++ b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php @@ -15,8 +15,8 @@ public function execute( if ($payment->isPaid() && $payment->details) { return sprintf( + /* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */ __( - /* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */ 'Payment completed by %1$s - %2$s', 'mollie-payments-for-woocommerce' ), diff --git a/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php index 777f9fe10..77b2704a2 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/BancomatpayFieldsStrategy.php @@ -41,13 +41,13 @@ protected function phoneNumber($phoneValue) $phoneValue = $phoneValue ?: ''; ?>

    -

    -

    -

    -

    -

    -

    'satispay', + 'defaultTitle' => __('Satispay', 'mollie-payments-for-woocommerce'), + 'settingsDescription' => '', + 'defaultDescription' => '', + 'paymentFields' => false, + 'instructions' => false, + 'supports' => ['products', 'refunds'], + 'filtersOnBuild' => false, + 'confirmationDelayed' => false, + 'SEPA' => false, + ]; + } + + public function getFormFields($generalFormFields): array + { + return $generalFormFields; + } +} diff --git a/src/SDK/Api.php b/src/SDK/Api.php index d3526fb7a..d4726ecd1 100644 --- a/src/SDK/Api.php +++ b/src/SDK/Api.php @@ -44,9 +44,18 @@ public function getApiClient($apiKey, $needToUpdateApiKey = false) } if (empty($apiKey)) { - throw new \Mollie\Api\Exceptions\ApiException(__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); - } elseif (! preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { - throw new \Mollie\Api\Exceptions\ApiException(sprintf(__("Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", 'mollie-payments-for-woocommerce'), '', '')); + throw new \Mollie\Api\Exceptions\ApiException(esc_html__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); + } elseif (!preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { + throw new \Mollie\Api\Exceptions\ApiException( + sprintf( + esc_html__( + "Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", + 'mollie-payments-for-woocommerce' + ), + '', + '' + ) + ); } if (empty(self::$api_client) || $needToUpdateApiKey) { diff --git a/src/SDK/WordPressHttpAdapter.php b/src/SDK/WordPressHttpAdapter.php index 5337cd0c9..53aa5825d 100644 --- a/src/SDK/WordPressHttpAdapter.php +++ b/src/SDK/WordPressHttpAdapter.php @@ -45,7 +45,9 @@ public function send($httpMethod, $url, $headers, $httpBody) if (is_wp_error($response)) { $message = $response->get_error_message() ?? 'Unknown error'; $code = is_int($response->get_error_code()) ? $response->get_error_code() : 0; - throw new ApiException($message, $code); + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ApiException(esc_html($message), $code); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $this->parseResponse($response); @@ -70,22 +72,22 @@ protected function parseResponse($response) return null; } - throw new ApiException("No response body found."); + throw new ApiException(esc_html("No response body found.")); } $body = @json_decode($httpBody); // GUARDS if (json_last_error() !== JSON_ERROR_NONE) { - throw new ApiException("Unable to decode Mollie response: '{$response}'."); + throw new ApiException(esc_html("Unable to decode Mollie response: '{$response}'.")); } if (isset($body->error)) { - throw new ApiException($body->error->message); + throw new ApiException(esc_html($body->error->message)); } if ($statusCode >= 400) { - $message = "Error executing API call ({$body->status}: {$body->title}): {$body->detail}"; + $message = esc_html("Error executing API call ({$body->status}: {$body->title}): {$body->detail}"); $field = null; @@ -100,8 +102,9 @@ protected function parseResponse($response) if ($httpBody) { $message .= ". Request body: {$httpBody}"; } - - throw new ApiException($message, $statusCode, $field); + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ApiException(esc_html($message), $statusCode, esc_html($field)); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $body; diff --git a/src/Settings/General/MollieGeneralSettings.php b/src/Settings/General/MollieGeneralSettings.php index d92ea402f..e6ef54571 100644 --- a/src/Settings/General/MollieGeneralSettings.php +++ b/src/Settings/General/MollieGeneralSettings.php @@ -21,8 +21,8 @@ public function gatewayFormFields( 'mollie-payments-for-woocommerce' ), 'type' => 'checkbox', - /* translators: Placeholder 1: Gateway title */ 'label' => sprintf( + /* translators: Placeholder 1: Gateway title */ __('Enable %s', 'mollie-payments-for-woocommerce'), $defaultTitle ), @@ -49,8 +49,8 @@ public function gatewayFormFields( 'title' => [ 'title' => __('Title', 'mollie-payments-for-woocommerce'), 'type' => 'text', - /* translators: Placeholder 1: Gateway title */ 'description' => sprintf( + /* translators: Placeholder 1: Gateway title */ __( 'This controls the title which the user sees during checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -92,19 +92,17 @@ public function gatewayFormFields( 'default' => null, 'type' => 'file', 'custom_attributes' => ['accept' => '.png, .jpeg, .svg, image/png, image/jpeg'], - 'description' => sprintf( - __( - 'Upload a custom icon for this gateway. The feature must be enabled.', - 'mollie-payments-for-woocommerce' - ) + 'description' => __( + 'Upload a custom icon for this gateway. The feature must be enabled.', + 'mollie-payments-for-woocommerce' ), 'desc_tip' => true, ], 'description' => [ 'title' => __('Description', 'mollie-payments-for-woocommerce'), 'type' => 'textarea', - /* translators: Placeholder 1: Gateway description */ 'description' => sprintf( + /* translators: Placeholder 1: Gateway description */ __( 'Payment method description that the customer will see on your checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -116,10 +114,10 @@ public function gatewayFormFields( ], 'sales' => [ 'id' => $defaultTitle . '_' . 'title', - 'title' => sprintf(__( + 'title' => __( 'Sales countries', 'mollie-payments-for-woocommerce' - )), + ), 'type' => 'title', ], 'allowed_countries' => [ @@ -192,19 +190,20 @@ public function gatewayFormFields( 'percentage' => [ 'title' => __('Payment surcharge percentage amount %', 'mollie-payments-for-woocommerce'), 'type' => 'number', - 'description' => sprintf( - __( - 'Control the percentage fee added on checkout. Default 0.00', - 'mollie-payments-for-woocommerce' - ) + 'description' => __( + 'Control the percentage fee added on checkout. Default 0.00', + 'mollie-payments-for-woocommerce' ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', 'desc_tip' => true, ], 'surcharge_limit' => [ + 'title' => sprintf( /* translators: Placeholder 1: currency */ - 'title' => sprintf(__('Payment surcharge limit in %s', 'mollie-payments-for-woocommerce'), html_entity_decode(get_woocommerce_currency_symbol())), + __('Payment surcharge limit in %s', 'mollie-payments-for-woocommerce'), + html_entity_decode(get_woocommerce_currency_symbol()) + ), 'type' => 'number', 'description' => sprintf( __( @@ -217,14 +216,15 @@ public function gatewayFormFields( 'desc_tip' => true, ], 'maximum_limit' => [ + 'title' => sprintf( /* translators: Placeholder 1: currency */ - 'title' => sprintf(__('Surcharge only under this limit, in %s', 'mollie-payments-for-woocommerce'), html_entity_decode(get_woocommerce_currency_symbol())), + __('Surcharge only under this limit, in %s', 'mollie-payments-for-woocommerce'), + html_entity_decode(get_woocommerce_currency_symbol()) + ), 'type' => 'number', - 'description' => sprintf( - __( - 'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum', - 'mollie-payments-for-woocommerce' - ) + 'description' => __( + 'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum', + 'mollie-payments-for-woocommerce' ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', @@ -258,8 +258,8 @@ public function gatewayFormFields( ), ], 'default' => SharedDataDictionary::STATUS_ON_HOLD, - /* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */ 'description' => sprintf( + /* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */ __( 'Some payment methods take longer than a few hours to complete. The initial order state is then set to \'%1$s\'. This ensures the order is not cancelled when the setting %2$s is used. This will also prevent the order to be canceled when expired.', 'mollie-payments-for-woocommerce' @@ -285,14 +285,12 @@ public function gatewayFormFields( 'default' => 'no', ]; $formFields['order_dueDate'] = [ - 'title' => sprintf(__('Expiry time', 'mollie-payments-for-woocommerce')), + 'title' => __('Expiry time', 'mollie-payments-for-woocommerce'), 'type' => 'number', 'custom_attributes' => ['step' => '1', 'min' => '10', 'max' => '526000'], - 'description' => sprintf( - __( - 'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.', - 'mollie-payments-for-woocommerce' - ) + 'description' => __( + 'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.', + 'mollie-payments-for-woocommerce' ), 'default' => '10', 'desc_tip' => false, diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index eeb7e43f9..c93589641 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -650,6 +650,7 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, $notice = new AdminNotice(); if ($extensionNotAllowed || $fileIsNotAnImage) { $message = sprintf( + /* translators: Placeholder 1: opening tag Placeholder 2: closing tag */ esc_html__( '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Only jpg, jpeg, png and gif files are allowed.', 'mollie-payments-for-woocommerce' @@ -663,6 +664,7 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, if ($invalidFileSize) { $message = sprintf( + /* translators: Placeholder 1: opening tag Placeholder 2: closing tag */ esc_html__( '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.', 'mollie-payments-for-woocommerce' @@ -678,24 +680,34 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, protected function processUploadedFile(string $name, string $tempName, WC_Payment_Gateway $gateway) { - $mollieUploadDirectory = trailingslashit(wp_upload_dir()['basedir']) - . 'mollie-uploads/' . $gateway->id; - wp_mkdir_p($mollieUploadDirectory); - $targetLocation = $mollieUploadDirectory . '/'; - $fileName = preg_replace( '#\s+#', '_', $name ); - move_uploaded_file($tempName, $targetLocation . $fileName); - $gatewaySettings["iconFileUrl"] = trailingslashit( - wp_upload_dir()['baseurl'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; - $gatewaySettings["iconFilePath"] = trailingslashit( - wp_upload_dir()['basedir'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; - update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); + if (!function_exists('wp_handle_upload')) { + require_once(ABSPATH . 'wp-admin/includes/file.php'); + } + + $upload_overrides = ['test_form' => false]; + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $file = isset($_FILES[$gateway->id . '_upload_logo']) ? wp_unslash($_FILES[$gateway->id . '_upload_logo']) : []; + if (!empty($file)) { + $file = [ + 'name' => $file['name'], + 'type' => $file['type'], + 'tmp_name' => $file['tmp_name'], + 'error' => $file['error'], + 'size' => $file['size'], + ]; + + $movefile = wp_handle_upload($file, $upload_overrides); + if ($movefile) { + $gatewaySettings["iconFileUrl"] = $movefile['url']; + $gatewaySettings["iconFilePath"] = $movefile['file']; + update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); + } + } } } diff --git a/src/Shared/Data.php b/src/Shared/Data.php index cea0c38d0..54230c6db 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -270,21 +270,33 @@ public function getFilters( $amountValue = $this->getAmountValue($orderTotal, $currency); if ($amountValue <= 0) { throw new InvalidArgumentException( - sprintf('Amount %s is not valid.', $amountValue) + sprintf( + /* translators: Placeholder 1: amount value */ + esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($amountValue) + ) ); } // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - sprintf('Currency %s is not valid.', $currency) + sprintf( + /* translators: Placeholder 1: currency */ + esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($currency) + ) ); } // Check if billing country is in ISO 3166-1 alpha-2 format (ex: NL) if (!preg_match('/^[a-zA-Z]{2}$/', $billingCountry)) { throw new InvalidArgumentException( - sprintf('Billing Country %s is not valid.', $billingCountry) + sprintf( + /* translators: Placeholder 1: billing country */ + esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($billingCountry) + ) ); } @@ -315,7 +327,7 @@ public function getRegularPaymentMethods($apiKey, $testMode = false, $useCache = $testMode = $this->isTestModeEnabled(); $methods = $this->getAllAvailablePaymentMethods($useCache); // We cannot access allActive for all methods so we filter them out here - $filtered_methods = array_filter($methods, function ($method) use ($testMode) { + $filtered_methods = array_filter($methods, static function ($method) use ($testMode) { if ($testMode === "live") { return $method['status'] === "activated"; } else { diff --git a/src/Shared/SharedDataDictionary.php b/src/Shared/SharedDataDictionary.php index 10cf5c0e2..7bd19e9de 100644 --- a/src/Shared/SharedDataDictionary.php +++ b/src/Shared/SharedDataDictionary.php @@ -38,6 +38,7 @@ class SharedDataDictionary 'Mollie_WC_Gateway_Trustly', 'Mollie_WC_Gateway_Payconiq', 'Mollie_WC_Gateway_Riverty', + 'Mollie_WC_Gateway_Satispay', ]; public const MOLLIE_OPTIONS_NAMES = [ diff --git a/src/Shared/Status.php b/src/Shared/Status.php index e7a9cde1a..69cfc199c 100644 --- a/src/Shared/Status.php +++ b/src/Shared/Status.php @@ -190,13 +190,11 @@ public function getMollieApiStatus($apiClient) } catch (\Mollie\Api\Exceptions\ApiException $apiException) { if ($apiException->getMessage() === 'Error executing API call (401: Unauthorized Request): Missing authentication, or failed to authenticate. Documentation: https://docs.mollie.com/guides/authentication') { throw new \Mollie\Api\Exceptions\ApiException( - 'incorrect API key or other authentication issue. Please check your API keys!' + esc_html__('incorrect API key or other authentication issue. Please check your API keys!', 'mollie-payments-for-woocommerce') ); } - - throw new \Mollie\Api\Exceptions\ApiException( - $apiException->getMessage() - ); + $message = $apiException->getMessage(); + throw new \Mollie\Api\Exceptions\ApiException(esc_html($message)); } } } diff --git a/src/Subscription/MollieSubscriptionGateway.php b/src/Subscription/MollieSubscriptionGateway.php index f62a6e839..ec3d17fa9 100644 --- a/src/Subscription/MollieSubscriptionGateway.php +++ b/src/Subscription/MollieSubscriptionGateway.php @@ -282,7 +282,16 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal ); } } catch (ApiException $e) { - throw new ApiException(sprintf(__('The customer (%s) could not be used or found. ', 'mollie-payments-for-woocommerce') . $e->getMessage(), $customer_id)); + throw new ApiException( + sprintf( + /* translators: Placeholder 1: customer id. */ + __( + 'The customer (%s) could not be used or found. ', + 'mollie-payments-for-woocommerce' + ) . $e->getMessage(), + $customer_id + ) + ); } // Check that there is at least one valid mandate @@ -312,7 +321,16 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal $mandateId = $payment->mandateId; } } else { - throw new ApiException(sprintf(__('The customer (%s) does not have a valid mandate.', 'mollie-payments-for-woocommerce-mandate-problem'), $customer_id)); + throw new ApiException( + sprintf( + /* translators: Placeholder 1: customer id. */ + __( + 'The customer (%s) does not have a valid mandate.', + 'mollie-payments-for-woocommerce-mandate-problem' + ), + $customer_id + ) + ); } } catch (ApiException $e) { throw $e; @@ -322,7 +340,7 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal $this->updateFirstPaymentMethodToRecurringPaymentMethod($renewal_order, $renewal_order_id, $payment); // Log successful creation of payment - $this->logger->debug($this->id . ': Renewal payment ' . $payment->id . ' (' . $payment->mode . ') created for order ' . $renewal_order_id . ' payment json response: ' . json_encode($payment)); + $this->logger->debug($this->id . ': Renewal payment ' . $payment->id . ' (' . $payment->mode . ') created for order ' . $renewal_order_id . ' payment json response: ' . wp_json_encode($payment)); // Unset & set active Mollie payment // Get correct Mollie Payment Object diff --git a/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php b/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php index cf0161ba2..fff43d732 100644 --- a/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php +++ b/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php @@ -67,7 +67,7 @@ public function testValidateMerchant() stubs( [ 'get_site_url' => 'http://www.testdomain.com', - + 'wp_parse_url' =>null ] ); list($logger, $responsesTemplate) = $this->responsesToApple(); diff --git a/tests/php/Functional/Payment/OrderItemsRefunderTest.php b/tests/php/Functional/Payment/OrderItemsRefunderTest.php index f6f18e894..15e04b900 100644 --- a/tests/php/Functional/Payment/OrderItemsRefunderTest.php +++ b/tests/php/Functional/Payment/OrderItemsRefunderTest.php @@ -21,6 +21,7 @@ use stdClass; use UnexpectedValueException; use function Brain\Monkey\Actions\expectDone as expectedActionDone; +use function Brain\Monkey\Functions\stubs; use function Brain\Monkey\Functions\when; /** @@ -196,6 +197,11 @@ public function testUnexpectedValueExceptionWhenBuildRefundItems() * Stubs */ $order = new \WC_Order(); + stubs( + [ + 'esc_html__' => null + ] + ); // Passing null is the key here, this will throw the exception because of invalid value. /** @var WC_Order_Item $orderItem */ $orderItem = $this->orderItem(['meta' => null]); @@ -242,6 +248,12 @@ public function testUnexpectedValueExceptionWhenBuildRemoteItems() * Stubs */ $order = new \WC_Order(); + stubs( + [ + 'esc_html__' => null, + 'esc_html' => null + ] + ); /** @var WC_Order_Item $orderItem */ $orderItem = $this->orderItem(['meta' => uniqid()]); $orderLineItem = $this->orderLineItem( @@ -289,6 +301,11 @@ public function testBailIfNoItemsToRefund() $order = new \WC_Order(); $remoteOrder = $this->remoteOrder([]); $refundReason = uniqid(); + stubs( + [ + 'esc_html__' => null, + ] + ); /* * Sut diff --git a/tests/php/Functional/Payment/PaymentServiceTest.php b/tests/php/Functional/Payment/PaymentServiceTest.php index f8107c8ee..8e5d00300 100644 --- a/tests/php/Functional/Payment/PaymentServiceTest.php +++ b/tests/php/Functional/Payment/PaymentServiceTest.php @@ -97,6 +97,8 @@ public function processPayment_Order_success(){ 'add_query_arg' => 'https://webshop.example.org/wc-api/mollie_return?order_id=1&key=wc_order_hxZniP1zDcnM8', 'WC' => $this->wooCommerce(), 'wc_clean' => null, + 'wp_parse_url' => null, + 'wp_strip_all_tags' => null ] ); @@ -137,6 +139,7 @@ public function processAsMollieOrder_BailsIf_FraudException() { stubs([ 'array_filter' => [], + 'esc_html__' =>null ]); $mockedException = new TestApiException(); $mockedException->setTestCode(422); diff --git a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php index f31c91ef0..b5924f04f 100644 --- a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php +++ b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php @@ -13,6 +13,7 @@ use stdClass; use UnexpectedValueException; use function Brain\Monkey\Actions\expectDone as expectedActionDone; +use function Brain\Monkey\Functions\stubs; use function Brain\Monkey\Functions\when; /** @@ -278,6 +279,11 @@ public function testBuildLineItemsThrowPartialRefundExceptionBecauseRefundPriceD */ $reason = uniqid(); $currency = uniqid(); + stubs( + [ + 'esc_html__' => null + ] + ); $toRefundItem = $this->wooCommerceOrderItem(-1, mt_rand(-100, -1), 0); $toRefundRemoteItem = $this->orderLineItem( @@ -332,6 +338,12 @@ public function testBuildLineItemsThrowUnexpectedValueExceptionBecauseRemoteItem */ $reason = uniqid(); $currency = uniqid(); + stubs( + [ + 'esc_html__' => null, + 'esc_html' => null + ] + ); $toRefundItemId = uniqid(); $toRefundItem = $this->wooCommerceOrderItem(-1, mt_rand(-100, -1), 0); diff --git a/tests/php/Functional/Payment/RequestObjectTest.php b/tests/php/Functional/Payment/RequestObjectTest.php index 221b16986..0f4b5c93f 100644 --- a/tests/php/Functional/Payment/RequestObjectTest.php +++ b/tests/php/Functional/Payment/RequestObjectTest.php @@ -115,7 +115,9 @@ public function executeTest($order) 'WC' => $this->wooCommerce(), 'get_option' => ['enabled' => false], 'wc_get_product' => $wrapperMock, - 'wc_clean' => false + 'wc_clean' => false, + 'wp_parse_url' => null, + 'wp_strip_all_tags' => null ]); $apiClientMock = $this->createConfiguredMock( MollieApiClient::class, diff --git a/tests/php/Functional/SDK/SdkTest.php b/tests/php/Functional/SDK/SdkTest.php index d8f141d0e..eb2fd5ce2 100644 --- a/tests/php/Functional/SDK/SdkTest.php +++ b/tests/php/Functional/SDK/SdkTest.php @@ -19,6 +19,7 @@ use Mollie\WooCommerceTests\TestCase; use function Brain\Monkey\Functions\expect; +use function Brain\Monkey\Functions\stubs; /** @@ -47,6 +48,11 @@ public function __construct($name = null, array $data = [], $dataName = '') */ public function sdkThrows() { + stubs( + [ + 'esc_html' => null + ] + ); $testee = new WordPressHttpAdapter(); expect('wp_remote_request')->once()->andReturn(new \WP_Error()); expect('is_wp_error')->once()->andReturn(true);