{"id":19932022,"url":"https://github.com/phpcompatibility/phpcompatibilitywp","last_synced_at":"2025-05-14T23:07:48.887Z","repository":{"id":32730358,"uuid":"140864153","full_name":"PHPCompatibility/PHPCompatibilityWP","owner":"PHPCompatibility","description":"PHPCompatibility ruleset for WordPress projects","archived":false,"fork":false,"pushed_at":"2025-05-12T16:40:08.000Z","size":98,"stargazers_count":192,"open_issues_count":1,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-14T23:07:36.860Z","etag":null,"topics":["php","php-codesniffer","phpcompatibility","phpcs-standard","wordpress"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPCompatibility.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"php_codesniffer","github":["PHPCompatibility","jrfnl"],"thanks_dev":"u/gh/phpcompatibility"}},"created_at":"2018-07-13T15:30:57.000Z","updated_at":"2025-05-14T09:25:30.000Z","dependencies_parsed_at":"2024-06-18T11:21:47.177Z","dependency_job_id":"65d9ec91-066a-4be4-b58b-0bac38179191","html_url":"https://github.com/PHPCompatibility/PHPCompatibilityWP","commit_stats":{"total_commits":39,"total_committers":5,"mean_commits":7.8,"dds":"0.10256410256410253","last_synced_commit":"262f9d81273932315d15d704f69b9d678b939cb3"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityWP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityWP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityWP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityWP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPCompatibility","download_url":"https://codeload.github.com/PHPCompatibility/PHPCompatibilityWP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243363,"owners_count":22038046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-codesniffer","phpcompatibility","phpcs-standard","wordpress"],"created_at":"2024-11-12T23:08:47.074Z","updated_at":"2025-05-14T23:07:43.864Z","avatar_url":"https://github.com/PHPCompatibility.png","language":"PHP","readme":"[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-wp?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp)\n[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp)\n[![License](https://img.shields.io/github/license/PHPCompatibility/PHPCompatibilityWP?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilityWP/blob/master/LICENSE)\n[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityWP/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityWP/actions/workflows/ci.yml)\n\n# PHPCompatibilityWP\n\nUsing PHPCompatibilityWP, you can analyse the codebase of a WordPress-based project for PHP cross-version compatibility.\n\n\n## What's in this repo ?\n\nA ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects based on the WordPress CMS.\n\nThis WordPress specific ruleset prevents false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility) by excluding back-fills and poly-fills which are provided by WordPress.\n\n\n## Requirements\n\n* [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).\n    * PHP 5.3+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 2.3.0+.\n    * PHP 5.4+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 3.0.2+.\n\n    Use the latest stable release of PHP_CodeSniffer for the best results.\n    The minimum _recommended_ version of PHP_CodeSniffer is version 2.6.0.\n* [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) 9.0.0+.\n* [PHPCompatibilityParagonie](https://github.com/PHPCompatibility/PHPCompatibilityParagonie) 1.0.0+.\n\n\n## Installation instructions\n\nThe only supported installation method is via [Composer](https://getcomposer.org/).\n\nIf you don't have a Composer plugin installed to manage the `installed_paths` setting for PHP_CodeSniffer, run the following from the command-line:\n```bash\ncomposer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true\ncomposer require --dev dealerdirect/phpcodesniffer-composer-installer:\"^0.7\" phpcompatibility/phpcompatibility-wp:\"*\"\n```\n\nIf you already have a Composer PHP_CodeSniffer plugin installed, run:\n```bash\ncomposer require --dev phpcompatibility/phpcompatibility-wp:\"*\"\n```\n\nNext, run:\n```bash\nvendor/bin/phpcs -i\n```\nIf all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityWP` and some more PHPCompatibility standards are installed for PHP_CodeSniffer.\n\n\n## How to use\n\nNow you can use the following command to inspect your code:\n```bash\n./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP\n```\n\nBy default, you will only receive notifications about deprecated and/or removed PHP features.\n\nTo get the most out of the PHPCompatibilityWP standard, you should specify a `testVersion` to check against. That will enable the checks for both deprecated/removed PHP features as well as the detection of code using new PHP features.\n\nThe minimum PHP requirement of the WordPress project up to WP 5.1 was 5.2.4. As of WP 5.2 it will be PHP 5.6.20. If you want to enforce this, either add `--runtime-set testVersion 5.6-` to your command-line command or add `\u003cconfig name=\"testVersion\" value=\"5.6-\"/\u003e` to your [custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset).\n\nFor example:\n```bash\n# For a project which should be compatible with PHP 5.6 and higher:\n./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP --runtime-set testVersion 5.6-\n```\n\nFor more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) standard.\n\n\n### Testing PHP files only\n\nBy default PHP_CodeSniffer will analyse PHP, JavaScript and CSS files. As the PHPCompatibility sniffs only target PHP code, you can make the run slightly faster by telling PHP_CodeSniffer to only check PHP files, like so:\n```bash\n./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6-\n```\n\n## License\n\nAll code within the PHPCompatibility organisation is released under the GNU Lesser General Public License (LGPL). For more information, visit https://www.gnu.org/copyleft/lesser.html\n\n\n## Changelog\n\n### 2.1.6 - 2025-01-16\n\n- README: Fixed some broken badges.\n- General housekeeping and documentation updates. Including a contribution by [@johnbillion].\n\n### 2.1.5 - 2024-04-25\n\n- Ruleset: Updated for compatibility with WordPress 6.5. Thanks [@swissspidy]\n- The recommended version of the [Composer PHPCS plugin] is now `^1.0`.\n- Other housekeeping and documentation updates. Includes contributions from [@fredden] and [@johnbillion].\n\n### 2.1.4 - 2022-10-24\n\n- Composer: The package will now identify itself as a static analysis tool. Thanks [@GaryJones]!\n- Other housekeeping and minor documentation updates.\n\n### 2.1.3 - 2021-12-31\n\n- Ruleset: Updated for compatibility with WordPress 5.9.\n- README: Updated the installation instructions for [compatibility with Composer \u003e= 2.2][composer22announce].\n- Minor housekeeping.\n\n[composer22announce]: https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution\n\n### 2.1.2 - 2021-07-21\n\n- Ruleset: Updated for compatibility with WordPress 5.8.\n- Documentation: improved installation instructions. Props [Andy Fragen](https://github.com/afragen).\n\n### 2.1.1 - 2021-02-15\n\n- The recommended version of the [Composer PHPCS plugin] is now `^0.7.0`, which offers compatibility with Composer 2.0.\n- The ruleset is now also tested against PHP 7.4 and 8.0.\n    Note: full PHP 7.4 support is only available in combination with PHP_CodeSniffer \u003e= 3.5.6.\n    Note: runtime PHP 8.0 support is only available in combination with PHP_CodeSniffer \u003e= 3.5.7, full support is expected in PHP_CodeSniffer 3.6.0.\n\n### 2.1.0 - 2019-08-29\n\n- Ruleset: Updated for the Sodium_Compat polyfill which is included in WordPress 5.2.\n- Composer: The recommended version of the [Composer PHPCS plugin] has been upped to `^0.5.0`.\n- Documentation: Updated the ruleset inline documentation and the Readme to reflect the change in minimum PHP requirements for WordPress as of WP 5.2.\n- Documentation: Updated the ruleset inline documentation to include information on when each polyfill was added to/removed from WordPress.\n- CI: The rulesets are now also tested against PHP 7.3.\n    Note: full PHP 7.3 support is only available in combination with PHP_CodeSniffer 2.9.2 or 3.3.1+ due to an incompatibility within PHP_CodeSniffer itself.\n\n### 2.0.0 - 2018-10-07\n\n- Ruleset: Updated for compatibility with PHPCompatibility 9.0+.\n- Composer: Added dependency for a dedicated polyfill-based PHPCompatibility ruleset.\n- CI: Added a test for the ruleset.\n- Readme: Removed the installation instructions for a non-Composer based install.\n\n### 1.0.0 - 2018-07-17\n\nInitial release of the PHPCompatibilityWP ruleset.\n\n[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer/\n\n[@fredden]:     https://github.com/fredden\n[@GaryJones]:   https://github.com/GaryJones\n[@johnbillion]: https://github.com/johnbillion\n[@swissspidy]:  https://github.com/swissspidy\n","funding_links":["https://opencollective.com/php_codesniffer","https://github.com/sponsors/PHPCompatibility","https://github.com/sponsors/jrfnl","https://thanks.dev/u/gh/phpcompatibility"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitywp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitywp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitywp/lists"}