diff --git a/.gitignore b/.gitignore index 141235ef..73302d94 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ codeception.yml plugin-build bin/strauss.phar CLAUDE.md -.claude +.claude/ diff --git a/composer.lock b/composer.lock index ccf1b762..b7416220 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "39cb5d24356b65d01b55bfdf193eee0d", + "content-hash": "775e640cc122cba00a8653eb87c9dcf8", "packages": [ { "name": "firebase/php-jwt", @@ -127,16 +127,16 @@ }, { "name": "axepress/wp-graphql-cs", - "version": "2.0.0-beta.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/AxeWP/WPGraphQL-Coding-Standards.git", - "reference": "764056aacbf67fd9a318d8dc7a3b9107102f974e" + "reference": "2107d7ae6d05759820b57d0b00125b43eeb7c2d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AxeWP/WPGraphQL-Coding-Standards/zipball/764056aacbf67fd9a318d8dc7a3b9107102f974e", - "reference": "764056aacbf67fd9a318d8dc7a3b9107102f974e", + "url": "https://api.github.com/repos/AxeWP/WPGraphQL-Coding-Standards/zipball/2107d7ae6d05759820b57d0b00125b43eeb7c2d2", + "reference": "2107d7ae6d05759820b57d0b00125b43eeb7c2d2", "shasum": "" }, "require": { @@ -149,8 +149,7 @@ "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^8.5 || ^9" + "phpcsstandards/phpcsdevtools": "^1.0" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -181,20 +180,20 @@ "issues": "https://github.com/AxeWP/WPGraphQL-Coding-Standards/issues", "source": "https://github.com/AxeWP/WPGraphQL-Coding-Standards" }, - "time": "2024-04-05T17:27:39+00:00" + "time": "2025-05-03T00:30:19+00:00" }, { "name": "axepress/wp-graphql-stubs", - "version": "v1.29.0", + "version": "v1.31.1", "source": { "type": "git", "url": "https://github.com/AxeWP/wp-graphql-stubs.git", - "reference": "79bc096361b1bf65a6b367a382fa90407d8952ba" + "reference": "55296773a7537e0dbc008010959718c7c796e170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/79bc096361b1bf65a6b367a382fa90407d8952ba", - "reference": "79bc096361b1bf65a6b367a382fa90407d8952ba", + "url": "https://api.github.com/repos/AxeWP/wp-graphql-stubs/zipball/55296773a7537e0dbc008010959718c7c796e170", + "reference": "55296773a7537e0dbc008010959718c7c796e170", "shasum": "" }, "require": { @@ -225,7 +224,7 @@ ], "support": { "issues": "https://github.com/AxeWP/wp-graphql-stubs/issues", - "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.29.0" + "source": "https://github.com/AxeWP/wp-graphql-stubs/tree/v1.31.1" }, "funding": [ { @@ -233,7 +232,7 @@ "type": "github" } ], - "time": "2024-09-20T01:43:19+00:00" + "time": "2025-01-29T12:41:14+00:00" }, { "name": "brainmaestro/composer-git-hooks", @@ -264,7 +263,6 @@ "type": "library", "extra": { "hooks": { - "pre-commit": "composer check-style", "pre-push": [ "composer test", "appver=$(grep -o -E '\\d.\\d.\\d' cghooks)", @@ -275,7 +273,8 @@ "sed -i -E \"s/$appver/$tag/\" cghooks", "exit 1", "fi" - ] + ], + "pre-commit": "composer check-style" } }, "autoload": { @@ -310,28 +309,28 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "reference": "e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1", + "reference": "e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.2", "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", + "composer/composer": "^2.2", "ext-json": "*", "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcompatibility/php-compatibility": "^9.0", "yoast/phpunit-polyfills": "^1.0" }, @@ -351,9 +350,9 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", @@ -361,7 +360,6 @@ } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -382,9 +380,28 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-07-17T20:45:56+00:00" }, { "name": "php-stubs/woocommerce-stubs", @@ -432,27 +449,30 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.6.2", + "version": "v6.8.2", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc" + "reference": "9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", - "reference": "f50fd7ed45894d036e4fef9ab7e5bbbaff6a30cc", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8", + "reference": "9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8", "shasum": "" }, + "conflict": { + "phpdocumentor/reflection-docblock": "5.6.1" + }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "nikic/php-parser": "^4.13", + "nikic/php-parser": "^5.5", "php": "^7.4 || ^8.0", "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.4.1", - "phpstan/phpstan": "^1.10.49", + "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.5", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1", "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" }, "suggest": { @@ -474,9 +494,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.2" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.2" }, - "time": "2024-09-30T07:10:48+00:00" + "time": "2025-07-16T06:41:00+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -542,16 +562,16 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", "shasum": "" }, "require": { @@ -608,27 +628,32 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" } ], - "time": "2024-04-24T21:30:46+00:00" + "time": "2025-09-19T17:43:28+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", + "version": "2.1.7", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + "reference": "5bfbbfbabb3df2b9a83e601de9153e4a7111962c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/5bfbbfbabb3df2b9a83e601de9153e4a7111962c", + "reference": "5bfbbfbabb3df2b9a83e601de9153e4a7111962c", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "phpcompatibility/phpcompatibility-paragonie": "^1.0", + "squizlabs/php_codesniffer": "^3.3" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0" @@ -678,35 +703,39 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" } ], - "time": "2024-04-24T21:37:59+00:00" + "time": "2025-05-12T16:38:37+00:00" }, { "name": "phpcsstandards/phpcsextra", - "version": "1.2.1", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" + "reference": "882b8c947ada27eb002870fe77fee9ce0a454cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", - "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/882b8c947ada27eb002870fe77fee9ce0a454cdb", + "reference": "882b8c947ada27eb002870fe77fee9ce0a454cdb", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.9", - "squizlabs/php_codesniffer": "^3.8.0" + "phpcsstandards/phpcsutils": "^1.1.2", + "squizlabs/php_codesniffer": "^3.13.4 || ^4.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcsstandards/phpcsdevcs": "^1.1.6", "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "type": "phpcodesniffer-standard", "extra": { @@ -756,35 +785,39 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2023-12-08T16:49:07+00:00" + "time": "2025-09-05T06:54:52+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.12", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" + "reference": "b22b59e3d9ec8fe4953e42c7d59117c6eae70eae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", - "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/b22b59e3d9ec8fe4953e42c7d59117c6eae70eae", + "reference": "b22b59e3d9ec8fe4953e42c7d59117c6eae70eae", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.13.3 || ^4.0" }, "require-dev": { "ext-filter": "*", "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -821,6 +854,7 @@ "phpcodesniffer-standard", "phpcs", "phpcs3", + "phpcs4", "standards", "static analysis", "tokens", @@ -844,9 +878,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-05-20T13:34:27+00:00" + "time": "2025-09-05T00:00:03+00:00" }, { "name": "phpstan/extension-installer", @@ -945,16 +983,11 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.8", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c" - }, + "version": "1.12.32", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6a60a4d66142b8156c9da923f1972657bc4748c", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", + "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", "shasum": "" }, "require": { @@ -999,7 +1032,7 @@ "type": "github" } ], - "time": "2024-11-06T19:06:49+00:00" + "time": "2025-09-30T10:16:31+00:00" }, { "name": "psr/container", @@ -1056,29 +1089,27 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.19", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/a15e970b8a0bf64cfa5e86d941f5e6b08855f369", + "reference": "a15e970b8a0bf64cfa5e86d941f5e6b08855f369", "shasum": "" }, "require": { "php": ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.6" + "squizlabs/php_codesniffer": "^3.5.7 || ^4.0.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", - "phpcsstandards/phpcsdevcs": "^1.1", - "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpstan/phpstan": "^1.7 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0 || ^6.0 || ^7.0" }, "type": "phpcodesniffer-standard", "autoload": { @@ -1110,7 +1141,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2024-06-26T20:08:34+00:00" + "time": "2025-09-30T22:22:48+00:00" }, { "name": "slevomat/coding-standard", @@ -1179,16 +1210,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "version": "3.13.4", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ad545ea9c1b7d270ce0fc9cbfb884161cd706119", + "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119", "shasum": "" }, "require": { @@ -1253,9 +1284,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2025-09-05T05:47:09+00:00" }, { "name": "symfony/console", @@ -1924,16 +1959,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", "shasum": "" }, "require": { @@ -1987,7 +2022,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" }, "funding": [ { @@ -1998,25 +2033,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-25T09:37:31+00:00" + "time": "2025-07-15T11:30:57+00:00" }, { "name": "symfony/string", - "version": "v6.4.24", + "version": "v6.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4" + "reference": "5621f039a71a11c87c106c1c598bdcd04a19aeea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f0ce0bd36a3accb4a225435be077b4b4875587f4", - "reference": "f0ce0bd36a3accb4a225435be077b4b4875587f4", + "url": "https://api.github.com/repos/symfony/string/zipball/5621f039a71a11c87c106c1c598bdcd04a19aeea", + "reference": "5621f039a71a11c87c106c1c598bdcd04a19aeea", "shasum": "" }, "require": { @@ -2030,7 +2069,6 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", "symfony/http-client": "^5.4|^6.0|^7.0", "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", @@ -2073,7 +2111,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.24" + "source": "https://github.com/symfony/string/tree/v6.4.26" }, "funding": [ { @@ -2093,7 +2131,7 @@ "type": "tidelift" } ], - "time": "2025-07-10T08:14:14+00:00" + "time": "2025-09-11T14:32:46+00:00" }, { "name": "szepeviktor/phpstan-wordpress", @@ -2160,16 +2198,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" + "reference": "d2421de7cec3274ae622c22c744de9a62c7925af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", - "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/d2421de7cec3274ae622c22c744de9a62c7925af", + "reference": "d2421de7cec3274ae622c22c744de9a62c7925af", "shasum": "" }, "require": { @@ -2178,13 +2216,13 @@ "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.2.1", - "phpcsstandards/phpcsutils": "^1.0.10", - "squizlabs/php_codesniffer": "^3.9.0" + "phpcsstandards/phpcsextra": "^1.4.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.2.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" @@ -2222,7 +2260,7 @@ "type": "custom" } ], - "time": "2024-03-25T16:39:00+00:00" + "time": "2025-07-24T20:08:31+00:00" } ], "aliases": [], diff --git a/includes/class-core-schema-filters.php b/includes/class-core-schema-filters.php index fbc009a4..ac702dbd 100644 --- a/includes/class-core-schema-filters.php +++ b/includes/class-core-schema-filters.php @@ -11,8 +11,14 @@ namespace WPGraphQL\WooCommerce; use GraphQL\Error\UserError; use WPGraphQL\WooCommerce\Data\Factory; use WPGraphQL\WooCommerce\Data\Loader\WC_CPT_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Cart_Item_Loader; use WPGraphQL\WooCommerce\Data\Loader\WC_Customer_Loader; -use WPGraphQL\WooCommerce\Data\Loader\WC_Db_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Downloadable_Item_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Order_Item_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Shipping_Method_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Shipping_Zone_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Tax_Class_Loader; +use WPGraphQL\WooCommerce\Data\Loader\WC_Tax_Rate_Loader; use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce as WooGraphQL; /** @@ -33,7 +39,7 @@ class Core_Schema_Filters { add_filter( 'register_taxonomy_args', [ self::class, 'register_taxonomy_args' ], 10, 2 ); // Add data-loaders to AppContext. - add_filter( 'graphql_data_loaders', [ self::class, 'graphql_data_loaders' ], 10, 2 ); + add_filter( 'graphql_data_loader_classes', [ self::class, 'graphql_data_loader_classes' ], 10 ); // Add node resolvers. add_filter( @@ -266,35 +272,25 @@ class Core_Schema_Filters { /** * Registers data-loaders to be used when resolving WooCommerce-related GraphQL types * - * @param array $loaders - assigned loaders. - * @param \WPGraphQL\AppContext $context - AppContext instance. + * @param array $loaders Assigned loaders. * * @return array */ - public static function graphql_data_loaders( $loaders, $context ) { + public static function graphql_data_loader_classes( $loaders ) { // WooCommerce customer loader. - $customer_loader = new WC_Customer_Loader( $context ); - $loaders['wc_customer'] = &$customer_loader; + $loaders['wc_customer'] = WC_Customer_Loader::class; // WooCommerce CPT loader. - $cpt_loader = new WC_CPT_Loader( $context ); - $loaders['wc_post'] = &$cpt_loader; + $loaders['wc_post'] = WC_CPT_Loader::class; // WooCommerce DB loaders. - $cart_item_loader = new WC_Db_Loader( $context, 'CART_ITEM' ); - $loaders['cart_item'] = &$cart_item_loader; - $downloadable_item_loader = new WC_Db_Loader( $context, 'DOWNLOADABLE_ITEM' ); - $loaders['downloadable_item'] = &$downloadable_item_loader; - $tax_class_loader = new WC_Db_Loader( $context, 'TAX_CLASS' ); - $loaders['tax_class'] = &$tax_class_loader; - $tax_rate_loader = new WC_Db_Loader( $context, 'TAX_RATE' ); - $loaders['tax_rate'] = &$tax_rate_loader; - $order_item_loader = new WC_Db_Loader( $context, 'ORDER_ITEM' ); - $loaders['order_item'] = &$order_item_loader; - $shipping_item_loader = new WC_Db_Loader( $context, 'SHIPPING_METHOD' ); - $loaders['shipping_method'] = &$shipping_item_loader; - $shipping_zone_loader = new WC_Db_Loader( $context, 'SHIPPING_ZONE' ); - $loaders['shipping_zone'] = &$shipping_zone_loader; + $loaders['cart_item'] = WC_Cart_Item_Loader::class; + $loaders['downloadable_item'] = WC_Downloadable_Item_Loader::class; + $loaders['tax_class'] = WC_Tax_Class_Loader::class; + $loaders['tax_rate'] = WC_Tax_Rate_Loader::class; + $loaders['order_item'] = WC_Order_Item_Loader::class; + $loaders['shipping_method'] = WC_Shipping_Method_Loader::class; + $loaders['shipping_zone'] = WC_Shipping_Zone_Loader::class; return $loaders; } @@ -404,11 +400,28 @@ class Core_Schema_Filters { public static function resolve_product_type( $value ) { $type_registry = \WPGraphQL::get_type_registry(); $possible_types = WooGraphQL::get_enabled_product_types(); - $product_type = $value->get_type(); + + if ( $value instanceof \WPGraphQL\Model\Post && ( 'product' === $value->post_type || 'product_variation' === $value->post_type ) ) { + $product_model = \WPGraphQL::get_app_context() + ->get_loader( 'wc_post' ) + ->load( $value->ID ); + } elseif ( $value instanceof \WPGraphQL\Model\Post && ( 'product' !== $value->post_type && 'product_variation' !== $value->post_type ) ) { + throw new UserError( + sprintf( + /* translators: %s: Post type slug */ + __( 'The "%s" post type is not a valid product type.', 'wp-graphql-woocommerce' ), + $value->post_type + ) + ); + } else { + $product_model = $value; + } + + $product_type = $product_model->get_type(); if ( isset( $possible_types[ $product_type ] ) ) { return $type_registry->get_type( $possible_types[ $product_type ] ); - } elseif ( $value instanceof \WPGraphQL\WooCommerce\Model\Product_Variation ) { - return self::resolve_product_variation_type( $value ); + } elseif ( $product_model instanceof \WPGraphQL\WooCommerce\Model\Product_Variation ) { + return self::resolve_product_variation_type( $product_model ); } elseif ( 'on' === woographql_setting( 'enable_unsupported_product_type', 'off' ) ) { $unsupported_type = WooGraphQL::get_supported_product_type(); return $type_registry->get_type( $unsupported_type ); @@ -418,7 +431,7 @@ class Core_Schema_Filters { sprintf( /* translators: %s: Product type */ __( 'The "%s" product type is not supported by the core WPGraphQL for WooCommerce (WooGraphQL) schema.', 'wp-graphql-woocommerce' ), - $value->type + $product_model->type ) ); } @@ -469,8 +482,8 @@ class Core_Schema_Filters { if ( $data instanceof \WP_Comment && 'order_note' === $data->comment_type ) { // Get the parent order. $order_id = absint( $data->comment_post_ID ); - $order = wc_get_order( $order_id ); - + $order = wc_get_order( $order_id ); + if ( ! $order ) { return true; // Keep it private if order not found. } @@ -481,9 +494,18 @@ class Core_Schema_Filters { } // Allow customers to see customer notes on their own orders. - $is_customer_note = get_comment_meta( $data->comment_ID, 'is_customer_note', true ); - if ( $is_customer_note && get_current_user_id() === $order->get_customer_id() ) { - return false; // Not private. + $comment_id = absint( $data->comment_ID ); + $is_customer_note = get_comment_meta( $comment_id, 'is_customer_note', true ); + if ( $is_customer_note && ! is_bool( $order ) && is_a( $order, \WC_Order::class ) ) { + if ( get_current_user_id() === $order->get_customer_id() ) { + return false; // Not private. + } + } elseif ( $is_customer_note && ! is_bool( $order ) && is_a( $order, \WC_Order_Refund::class ) ) { + /** @var \WC_Order|false $parent */ + $parent = wc_get_order( $order->get_parent_id() ); + if ( $parent && get_current_user_id() === $parent->get_customer_id() ) { + return false; // Not private. + } } // Otherwise keep it private. @@ -496,11 +518,11 @@ class Core_Schema_Filters { /** * Filter to set order notes visibility to public for authorized users. * - * @param string $visibility The visibility of the object. - * @param string $model_name The name of the model being checked. - * @param mixed $data The data being checked. - * @param int|null $owner The owner of the object. - * @param \WP_User $current_user The current user. + * @param string $visibility The visibility of the object. + * @param string $model_name The name of the model being checked. + * @param mixed $data The data being checked. + * @param int|null $owner The owner of the object. + * @param \WP_User $current_user The current user. * * @return string */ @@ -513,10 +535,14 @@ class Core_Schema_Filters { // Check if this is an order note and if user owns the order. if ( $data instanceof \WP_Comment && 'order_note' === $data->comment_type ) { $order = wc_get_order( $data->comment_post_ID ); - + // If user is the order owner, make it public. - if ( $order && get_current_user_id() === $order->get_customer_id() ) { - return 'public'; + if ( $order && ! is_bool( $order ) && is_a( $order, \WC_Order::class ) ) { + return get_current_user_id() === $order->get_customer_id() ? 'public' : $visibility; + } elseif ( $order && ! is_bool( $order ) && is_a( $order, \WC_Order_Refund::class ) ) { + /** @var \WC_Order|false $parent */ + $parent = wc_get_order( $order->get_parent_id() ); + return $parent && get_current_user_id() === $parent->get_customer_id() ? 'public' : $visibility; } } diff --git a/includes/class-wp-graphql-woocommerce.php b/includes/class-wp-graphql-woocommerce.php index 440eeb92..2f06fa53 100644 --- a/includes/class-wp-graphql-woocommerce.php +++ b/includes/class-wp-graphql-woocommerce.php @@ -181,6 +181,13 @@ if ( ! class_exists( '\WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce' ) ) : require $include_directory_path . 'data/loader/class-wc-cpt-loader.php'; require $include_directory_path . 'data/loader/class-wc-customer-loader.php'; require $include_directory_path . 'data/loader/class-wc-db-loader.php'; + require $include_directory_path . 'data/loader/class-wc-cart-item-loader.php'; + require $include_directory_path . 'data/loader/class-wc-downloadable-item-loader.php'; + require $include_directory_path . 'data/loader/class-wc-order-item-loader.php'; + require $include_directory_path . 'data/loader/class-wc-shipping-method-loader.php'; + require $include_directory_path . 'data/loader/class-wc-shipping-zone-loader.php'; + require $include_directory_path . 'data/loader/class-wc-tax-class-loader.php'; + require $include_directory_path . 'data/loader/class-wc-tax-rate-loader.php'; // Include connection resolver trait/class files. require $include_directory_path . 'data/connection/trait-wc-db-loader-common.php'; diff --git a/includes/data/connection/class-product-connection-resolver.php b/includes/data/connection/class-product-connection-resolver.php index 7fd96790..f4d885f9 100644 --- a/includes/data/connection/class-product-connection-resolver.php +++ b/includes/data/connection/class-product-connection-resolver.php @@ -491,7 +491,7 @@ class Product_Connection_Resolver extends AbstractConnectionResolver { $term_taxonomy_ids = []; foreach ( $terms as $term_slug ) { $term = get_term_by( 'slug', $term_slug, $taxonomy ); - if ( ! $term || is_wp_error( $term ) ) { + if ( ! $term ) { continue; } $term_taxonomy_ids[] = $term->term_taxonomy_id; diff --git a/includes/data/loader/class-wc-cart-item-loader.php b/includes/data/loader/class-wc-cart-item-loader.php new file mode 100644 index 00000000..52d65e82 --- /dev/null +++ b/includes/data/loader/class-wc-cart-item-loader.php @@ -0,0 +1,25 @@ +comment_ID ); + $comment_id = absint( $note->comment_ID ); + $result = wc_delete_order_note( $comment_id ); if ( ! $result ) { throw new UserError( __( 'Unable to delete order note.', 'wp-graphql-woocommerce' ) ); diff --git a/includes/mutation/class-review-delete-restore.php b/includes/mutation/class-review-delete-restore.php index 0fa1312f..29f7a33f 100644 --- a/includes/mutation/class-review-delete-restore.php +++ b/includes/mutation/class-review-delete-restore.php @@ -136,7 +136,7 @@ class Review_Delete_Restore { throw new UserError( __( 'Invalid Product Review ID provided', 'wp-graphql-woocommerce' ) ); } - $rating = get_comment_meta( absint( $id ), 'rating' ); + $rating = get_comment_meta( absint( $id ), 'rating', true ); // @codingStandardsIgnoreLine switch ( $info->fieldName ) { diff --git a/includes/type/object/class-collection-stats-type.php b/includes/type/object/class-collection-stats-type.php index 5dec08f0..3d1bd3dd 100644 --- a/includes/type/object/class-collection-stats-type.php +++ b/includes/type/object/class-collection-stats-type.php @@ -334,7 +334,7 @@ class Collection_Stats_Type { $category_ids = array_map( static function ( $category ) { $term = get_term_by( 'slug', $category, 'product_cat' ); - if ( $term && ! is_wp_error( $term ) ) { + if ( $term ) { return $term->term_id; } return 0; @@ -354,7 +354,7 @@ class Collection_Stats_Type { $tag_ids = array_map( static function ( $tag ) { $term = get_term_by( 'slug', $tag, 'product_tag' ); - if ( $term && ! is_wp_error( $term ) ) { + if ( $term ) { return $term->term_id; } return 0; diff --git a/includes/type/object/class-order-note-type.php b/includes/type/object/class-order-note-type.php index e1a4d47b..a0321848 100644 --- a/includes/type/object/class-order-note-type.php +++ b/includes/type/object/class-order-note-type.php @@ -25,7 +25,7 @@ class Order_Note_Type { register_graphql_object_type( 'OrderNote', [ - 'interfaces' => ['Node'], + 'interfaces' => [ 'Node' ], 'eagerlyLoadType' => true, 'description' => __( 'A order note', 'wp-graphql-woocommerce' ), 'fields' => apply_filters( 'woographql_order_note_field_definitions', self::get_fields() ), @@ -43,7 +43,7 @@ class Order_Note_Type { return array_merge( [ 'id' => [ - 'type' => ['non_null' => 'ID'], + 'type' => [ 'non_null' => 'ID' ], 'description' => __( 'Database ID or global ID of the order note', 'wp-graphql-woocommerce' ), 'resolve' => static function ( $order_note ) { return Relay::toGlobalId( 'order_note', $order_note->databaseId ); diff --git a/wp-graphql-woocommerce.php b/wp-graphql-woocommerce.php index 998d97d4..6f04bd7e 100644 --- a/wp-graphql-woocommerce.php +++ b/wp-graphql-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: WPGraphQL for WooCommerce (WooGraphQL) * Plugin URI: https://github.com/wp-graphql/wp-graphql-woocommerce * Description: Adds Woocommerce functionality to WPGraphQL schema. - * Version: 0.21.2 + * Version: 0.21.2 ~ Beta * Author: kidunot89 * Author URI: https://axistaylor.com * Text Domain: wp-graphql-woocommerce