From 54d0778401e60084330277085e9b7507bb65fcc2 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Mon, 14 Sep 2026 17:20:33 -0400 Subject: [PATCH 1/8] chore: add composer setup with phpcs, phpstan and CI static analysis Signed-off-by: YvesCesar --- .github/workflows/ci.yml | 31 ++ .gitignore | 1 + composer.json | 35 ++ composer.lock | 934 +++++++++++++++++++++++++++++++++++++++ phpcs.xml.dist | 55 +++ phpstan.neon.dist | 14 + 6 files changed, 1070 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 phpcs.xml.dist create mode 100644 phpstan.neon.dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3911ee4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + static: + name: Static analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + coverage: none + tools: composer + + - uses: ramsey/composer-install@v3 + + - run: composer lint + + - run: composer cs + + - run: composer stan diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7d61ee9 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "libresign/libresign-wp-customizations", + "description": "WordPress customizations for libresign.coop", + "type": "wordpress-plugin", + "license": "GPL-2.0-or-later", + "require": { + "php": ">=8.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "php-stubs/woocommerce-stubs": "^9.0", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "phpstan/phpstan": "^2.1", + "squizlabs/php_codesniffer": "^3.13", + "szepeviktor/phpstan-wordpress": "^2.0", + "wp-coding-standards/wpcs": "^3.2" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, + "scripts": { + "lint": "parallel-lint --exclude vendor .", + "cs": "phpcs", + "cs:fix": "phpcbf", + "stan": "phpstan analyse", + "ci": [ + "@lint", + "@cs", + "@stan" + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..0837a31 --- /dev/null +++ b/composer.lock @@ -0,0 +1,934 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c0839b6d891ac441a7b4ced2377fa1ce", + "packages": [], + "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.2", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "^2.2", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "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" + }, + "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": "2026-05-06T08:26:05+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, + { + "name": "php-stubs/woocommerce-stubs", + "version": "v9.9.5", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/woocommerce-stubs.git", + "reference": "3f4d4e14afe6150569bd96cf14e8a17a84812447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/3f4d4e14afe6150569bd96cf14e8a17a84812447", + "reference": "3f4d4e14afe6150569bd96cf14e8a17a84812447", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-stubs": "^5.3 || ^6.0" + }, + "require-dev": { + "php": "~7.1 || ~8.0", + "php-stubs/generator": "^0.8.0" + }, + "suggest": { + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WooCommerce function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/woocommerce-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "woocommerce", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v9.9.5" + }, + "time": "2025-07-14T17:12:48+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.9.4", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "90a9412826b9944f93b10bf41d795b5fe68abcd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/90a9412826b9944f93b10bf41d795b5fe68abcd5", + "reference": "90a9412826b9944f93b10bf41d795b5fe68abcd5", + "shasum": "" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "5.6.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^5.5", + "php": "^7.4 || ^8.0", + "php-stubs/generator": "^0.8.6", + "phpdocumentor/reflection-docblock": "^6.0", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.5", + "symfony/polyfill-php80": "*", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.9.4" + }, + "time": "2026-05-01T20:36:01+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-09-19T17:43:28+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.8", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-10-18T00:05:59+00:00" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "39467533fdb742446d68c1d10ac33d625ee0311c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/39467533fdb742446d68c1d10ac33d625ee0311c", + "reference": "39467533fdb742446d68c1d10ac33d625ee0311c", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.2.3", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "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": "2026-07-27T11:13:17+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/5f35d9408c54d7b529501f3c688b6eae562aea1f", + "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f", + "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.13.5 || ^4.0.1" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "phpcs4", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "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": "2026-07-27T10:28:41+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.2.14", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", + "reference": "9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-09-12T21:39:33+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.13.6", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/4c378e1a528ea066890fc2397cbdd2f94eb2fc91", + "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/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" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-08-06T00:17:32+00:00" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "84577e2ea1e4c2a95537fe5ea2ac8e18f4ceab1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/84577e2ea1e4c2a95537fe5ea2ac8e18f4ceab1a", + "reference": "84577e2ea1e4c2a95537fe5ea2ac8e18f4ceab1a", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "php-stubs/wordpress-stubs": ">=6.6.2", + "phpstan/phpstan": "^2.0" + }, + "require-dev": { + "composer/composer": "^2.1.14", + "composer/semver": "^3.4", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "SzepeViktor\\PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v2.0.4" + }, + "time": "2026-05-22T16:22:09+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "3.4.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "ec2ff942335f33683a5957a85d138753876a05cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/ec2ff942335f33683a5957a85d138753876a05cf", + "reference": "ec2ff942335f33683a5957a85d138753876a05cf", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.1", + "phpcsstandards/phpcsutils": "^1.2.3", + "squizlabs/php_codesniffer": "^3.13.5" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "suggest": { + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, + "funding": [ + { + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" + } + ], + "time": "2026-07-27T11:53:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=8.1" + }, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +} diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..96d9711 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,55 @@ + + + Lean ruleset: security, compatibility and global-scope hygiene. + + . + /vendor/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..6349570 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,14 @@ +includes: + - vendor/szepeviktor/phpstan-wordpress/extension.neon + +parameters: + level: 5 + paths: + - libresign-wp-customizations.php + - includes + bootstrapFiles: + - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php + ignoreErrors: + - + identifier: constant.notFound + message: '#^Constant (AUTH_KEY|SECURE_AUTH_SALT|NONCE_SALT) not found\.$#' From cd3e4f55ea58338c3f50d8cf6072040f659df84e Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Mon, 14 Sep 2026 17:21:19 -0400 Subject: [PATCH 2/8] fix: escape output and sanitize request input flagged by phpcs Signed-off-by: YvesCesar --- libresign-wp-customizations.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/libresign-wp-customizations.php b/libresign-wp-customizations.php index 70ed5dc..1620bac 100644 --- a/libresign-wp-customizations.php +++ b/libresign-wp-customizations.php @@ -202,7 +202,11 @@ function libresign_show_github_action_status_notice() { intval($status['post_id']), esc_html($status['language']) ); - echo "
$post_info
"; + printf( + '
%s
', + esc_attr($class), + wp_kses_post($post_info) + ); } } add_action('admin_notices', 'libresign_show_github_action_status_notice'); @@ -231,7 +235,7 @@ function libresign_add_settings_link($links) { }); function libresign_config_page() { if (!current_user_can('manage_options')) { - wp_die(__('Você não tem permissão para acessar esta página.')); + wp_die(esc_html__('Você não tem permissão para acessar esta página.', 'libresign-wp-customizations')); } ?> @@ -618,7 +622,7 @@ function libresign_is_root_my_account_endpoint_request() { return false; } - $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_unslash( $_SERVER['REQUEST_URI'] ) : ''; + $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $request_path = trim( (string) wp_parse_url( $request_uri, PHP_URL_PATH ), '/' ); if ( '' === $request_path ) { @@ -715,10 +719,12 @@ function libresign_render_nextcloud_account_button() { esc_html__( 'Use as mesmas credenciais do WordPress para acessar o sistema de assinaturas.', 'libresign-wp-customizations' ), esc_url( $nextcloud_host ), esc_html__( 'Ir para o sistema de assinaturas', 'libresign-wp-customizations' ), - sprintf( - /* translators: %s: link to the FAQ page */ - esc_html__( 'Se precisar de ajuda, veja nosso %s.', 'libresign-wp-customizations' ), - $faq_link + wp_kses_post( + sprintf( + /* translators: %s: link to the FAQ page */ + esc_html__( 'Se precisar de ajuda, veja nosso %s.', 'libresign-wp-customizations' ), + $faq_link + ) ) ); } @@ -785,7 +791,7 @@ function libresign_intercept_subscription_status_change() { return; } - $subscription = libresign_get_subscription_for_status_change( $_GET['subscription_id'], $new_status ); + $subscription = libresign_get_subscription_for_status_change( absint( wp_unslash( $_GET['subscription_id'] ) ), $new_status ); $nonce = wc_clean( wp_unslash( $_GET['_wpnonce'] ) ); if ( ! $subscription @@ -829,7 +835,7 @@ function libresign_render_subscription_change_confirmation() { return; } - $subscription = libresign_get_subscription_for_status_change( $_GET['libresign_confirm_subscription'], $new_status ); + $subscription = libresign_get_subscription_for_status_change( absint( wp_unslash( $_GET['libresign_confirm_subscription'] ) ), $new_status ); $nonce = wc_clean( wp_unslash( $_GET['_wpnonce'] ) ); if ( ! $subscription From 7d697a259a27d4f23339d3c9a3ffe7a0ac141639 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Mon, 14 Sep 2026 17:39:59 -0400 Subject: [PATCH 3/8] fix: harden request input handling and declare the php requirement Signed-off-by: YvesCesar --- .github/workflows/ci.yml | 8 ++++++-- libresign-wp-customizations.php | 16 +++++++++------- phpcs.xml.dist | 9 --------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3911ee4..7750d5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,14 +11,18 @@ permissions: jobs: static: - name: Static analysis + name: Static analysis (PHP ${{ matrix.php }}) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.3'] steps: - uses: actions/checkout@v5 - uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ matrix.php }} coverage: none tools: composer diff --git a/libresign-wp-customizations.php b/libresign-wp-customizations.php index 1620bac..ff3aced 100644 --- a/libresign-wp-customizations.php +++ b/libresign-wp-customizations.php @@ -15,6 +15,8 @@ * Version: 0.0.1 * Author: LibreCode * Author URI: https://github.com/LibreSign + * Requires at least: 6.7 + * Requires PHP: 8.1 * Text Domain: libresign-wp-customizations * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt @@ -622,7 +624,7 @@ function libresign_is_root_my_account_endpoint_request() { return false; } - $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; + $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; $request_path = trim( (string) wp_parse_url( $request_uri, PHP_URL_PATH ), '/' ); if ( '' === $request_path ) { @@ -776,7 +778,7 @@ function libresign_get_subscription_for_status_change( $subscription_id, $new_st */ function libresign_intercept_subscription_status_change() { if ( ! isset( $_GET['change_subscription_to'], $_GET['subscription_id'], $_GET['_wpnonce'] ) - || ! function_exists( 'wc_clean' ) + || ! function_exists( 'wcs_get_subscription' ) ) { return; } @@ -785,14 +787,14 @@ function libresign_intercept_subscription_status_change() { return; } - $new_status = wc_clean( wp_unslash( $_GET['change_subscription_to'] ) ); + $new_status = sanitize_text_field( wp_unslash( $_GET['change_subscription_to'] ) ); if ( ! libresign_get_subscription_confirmation_strings( $new_status ) ) { return; } $subscription = libresign_get_subscription_for_status_change( absint( wp_unslash( $_GET['subscription_id'] ) ), $new_status ); - $nonce = wc_clean( wp_unslash( $_GET['_wpnonce'] ) ); + $nonce = sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ); if ( ! $subscription || ! wp_verify_nonce( $nonce, $subscription->get_id() . $subscription->get_status() ) @@ -821,14 +823,14 @@ function libresign_render_subscription_change_confirmation() { if ( empty( $_GET['libresign_confirm_change'] ) || empty( $_GET['libresign_confirm_subscription'] ) || empty( $_GET['_wpnonce'] ) - || ! function_exists( 'wc_clean' ) + || ! function_exists( 'wcs_get_subscription' ) || ! function_exists( 'is_account_page' ) || ! is_account_page() ) { return; } - $new_status = wc_clean( wp_unslash( $_GET['libresign_confirm_change'] ) ); + $new_status = sanitize_text_field( wp_unslash( $_GET['libresign_confirm_change'] ) ); $strings = libresign_get_subscription_confirmation_strings( $new_status ); if ( ! $strings ) { @@ -836,7 +838,7 @@ function libresign_render_subscription_change_confirmation() { } $subscription = libresign_get_subscription_for_status_change( absint( wp_unslash( $_GET['libresign_confirm_subscription'] ) ), $new_status ); - $nonce = wc_clean( wp_unslash( $_GET['_wpnonce'] ) ); + $nonce = sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ); if ( ! $subscription || ! wp_verify_nonce( $nonce, $subscription->get_id() . $subscription->get_status() ) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 96d9711..820f86d 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -17,15 +17,6 @@ - - - - - - - - - From f3081c75c1f80c0b90b018a774a73c40a6bbd0c9 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Wed, 16 Sep 2026 18:49:33 -0400 Subject: [PATCH 4/8] ci: run each check in its own workflow Signed-off-by: YvesCesar --- .github/workflows/coding-standards.yml | 31 +++++++++++++++++++ .github/workflows/lint.yml | 31 +++++++++++++++++++ .../workflows/{ci.yml => static-analysis.yml} | 8 ++--- 3 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/coding-standards.yml create mode 100644 .github/workflows/lint.yml rename .github/workflows/{ci.yml => static-analysis.yml} (87%) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 0000000..ca7306d --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,31 @@ +name: Coding standards + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + coding-standards: + name: Coding standards (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.3'] + steps: + - uses: actions/checkout@v5 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer + + - uses: ramsey/composer-install@v3 + + - run: composer cs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1d0f7a8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + lint: + name: Lint (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.3'] + steps: + - uses: actions/checkout@v5 + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer + + - uses: ramsey/composer-install@v3 + + - run: composer lint diff --git a/.github/workflows/ci.yml b/.github/workflows/static-analysis.yml similarity index 87% rename from .github/workflows/ci.yml rename to .github/workflows/static-analysis.yml index 7750d5b..ff65532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/static-analysis.yml @@ -1,4 +1,4 @@ -name: CI +name: Static analysis on: push: @@ -10,7 +10,7 @@ permissions: contents: read jobs: - static: + static-analysis: name: Static analysis (PHP ${{ matrix.php }}) runs-on: ubuntu-latest strategy: @@ -28,8 +28,4 @@ jobs: - uses: ramsey/composer-install@v3 - - run: composer lint - - - run: composer cs - - run: composer stan From 54e033b08ebccf3ed24c0b2d65a53163b483ac5a Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Sat, 19 Sep 2026 11:59:47 -0400 Subject: [PATCH 5/8] ci: name each workflow after the tool it runs Signed-off-by: YvesCesar --- .github/workflows/{lint.yml => php-lint.yml} | 6 +++--- .github/workflows/{coding-standards.yml => phpcs.yml} | 6 +++--- .github/workflows/{static-analysis.yml => phpstan.yml} | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) rename .github/workflows/{lint.yml => php-lint.yml} (86%) rename .github/workflows/{coding-standards.yml => phpcs.yml} (83%) rename .github/workflows/{static-analysis.yml => phpstan.yml} (83%) diff --git a/.github/workflows/lint.yml b/.github/workflows/php-lint.yml similarity index 86% rename from .github/workflows/lint.yml rename to .github/workflows/php-lint.yml index 1d0f7a8..57ece48 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/php-lint.yml @@ -1,4 +1,4 @@ -name: Lint +name: PHP Lint on: push: @@ -10,8 +10,8 @@ permissions: contents: read jobs: - lint: - name: Lint (PHP ${{ matrix.php }}) + php-lint: + name: PHP Lint (PHP ${{ matrix.php }}) runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/phpcs.yml similarity index 83% rename from .github/workflows/coding-standards.yml rename to .github/workflows/phpcs.yml index ca7306d..bd715f8 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/phpcs.yml @@ -1,4 +1,4 @@ -name: Coding standards +name: PHPCS on: push: @@ -10,8 +10,8 @@ permissions: contents: read jobs: - coding-standards: - name: Coding standards (PHP ${{ matrix.php }}) + phpcs: + name: PHPCS (PHP ${{ matrix.php }}) runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/phpstan.yml similarity index 83% rename from .github/workflows/static-analysis.yml rename to .github/workflows/phpstan.yml index ff65532..c1b2187 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/phpstan.yml @@ -1,4 +1,4 @@ -name: Static analysis +name: PHPStan on: push: @@ -10,8 +10,8 @@ permissions: contents: read jobs: - static-analysis: - name: Static analysis (PHP ${{ matrix.php }}) + phpstan: + name: PHPStan (PHP ${{ matrix.php }}) runs-on: ubuntu-latest strategy: fail-fast: false From 01a8f7e4b5ef23c28f6e29ae7132f2f31f90d742 Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Sat, 19 Sep 2026 12:01:49 -0400 Subject: [PATCH 6/8] ci: drop php 8.1 from the check matrix Signed-off-by: YvesCesar --- .github/workflows/php-lint.yml | 2 +- .github/workflows/phpcs.yml | 2 +- .github/workflows/phpstan.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index 57ece48..732b236 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.3'] + php: ['8.3'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index bd715f8..ddae005 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.3'] + php: ['8.3'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index c1b2187..d3eb588 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.3'] + php: ['8.3'] steps: - uses: actions/checkout@v5 From 3f211ea10a834bc9ab8a3b951664f16b8b107eec Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Tue, 22 Sep 2026 15:41:20 -0400 Subject: [PATCH 7/8] chore: require php 8.3 and wordpress 7.0 Signed-off-by: YvesCesar --- composer.json | 2 +- composer.lock | 4 ++-- libresign-wp-customizations.php | 4 ++-- phpcs.xml.dist | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 7d61ee9..922664a 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "wordpress-plugin", "license": "GPL-2.0-or-later", "require": { - "php": ">=8.1" + "php": ">=8.3 <8.6" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", diff --git a/composer.lock b/composer.lock index 0837a31..c8a35da 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": "c0839b6d891ac441a7b4ced2377fa1ce", + "content-hash": "469d5c8e46eb384b802b9d91e6a9b7b1", "packages": [], "packages-dev": [ { @@ -927,7 +927,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.1" + "php": ">=8.3 <8.6" }, "platform-dev": {}, "plugin-api-version": "2.9.0" diff --git a/libresign-wp-customizations.php b/libresign-wp-customizations.php index ff3aced..2ca610e 100644 --- a/libresign-wp-customizations.php +++ b/libresign-wp-customizations.php @@ -15,8 +15,8 @@ * Version: 0.0.1 * Author: LibreCode * Author URI: https://github.com/LibreSign - * Requires at least: 6.7 - * Requires PHP: 8.1 + * Requires at least: 7.0 + * Requires PHP: 8.3 * Text Domain: libresign-wp-customizations * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 820f86d..a55a2cd 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -11,8 +11,8 @@ - - + + From 4fde3e8440487a892d2cef2c14f6d514435c1c1e Mon Sep 17 00:00:00 2001 From: YvesCesar Date: Tue, 22 Sep 2026 15:41:20 -0400 Subject: [PATCH 8/8] ci: derive the php matrix from composer.json Signed-off-by: YvesCesar --- .github/workflows/php-lint.yml | 14 +++++++++++++- .github/workflows/phpcs.yml | 14 +++++++++++++- .github/workflows/phpstan.yml | 14 +++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index 732b236..eca7865 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -10,13 +10,25 @@ permissions: contents: read jobs: + php-matrix: + name: PHP matrix + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.php-matrix.outputs.versions }} + steps: + - uses: actions/checkout@v5 + + - uses: typisttech/php-matrix-action@v3 + id: php-matrix + php-lint: name: PHP Lint (PHP ${{ matrix.php }}) + needs: php-matrix runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['8.3'] + php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index ddae005..06228a6 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -10,13 +10,25 @@ permissions: contents: read jobs: + php-matrix: + name: PHP matrix + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.php-matrix.outputs.versions }} + steps: + - uses: actions/checkout@v5 + + - uses: typisttech/php-matrix-action@v3 + id: php-matrix + phpcs: name: PHPCS (PHP ${{ matrix.php }}) + needs: php-matrix runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['8.3'] + php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d3eb588..f22f0d5 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -10,13 +10,25 @@ permissions: contents: read jobs: + php-matrix: + name: PHP matrix + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.php-matrix.outputs.versions }} + steps: + - uses: actions/checkout@v5 + + - uses: typisttech/php-matrix-action@v3 + id: php-matrix + phpstan: name: PHPStan (PHP ${{ matrix.php }}) + needs: php-matrix runs-on: ubuntu-latest strategy: fail-fast: false matrix: - php: ['8.3'] + php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} steps: - uses: actions/checkout@v5