{"id":29215173,"url":"https://github.com/pronamic/wp-coding-standards","last_synced_at":"2026-01-06T12:11:02.271Z","repository":{"id":57045241,"uuid":"380010355","full_name":"pronamic/wp-coding-standards","owner":"pronamic","description":"Pronamic WordPress Coding Standards for PHP_CodeSniffer.","archived":false,"fork":false,"pushed_at":"2024-12-19T10:00:14.000Z","size":56,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-26T05:55:43.752Z","etag":null,"topics":["phpcs","phpcs-standard","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pronamic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-06-24T17:58:18.000Z","updated_at":"2024-12-19T11:44:11.000Z","dependencies_parsed_at":"2023-02-16T19:25:22.059Z","dependency_job_id":"34891ce7-c68f-4ff0-bdf0-0f1e69638008","html_url":"https://github.com/pronamic/wp-coding-standards","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"9ebf21339d925a01696e12d43b5c738252d151a2"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pronamic/wp-coding-standards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Fwp-coding-standards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Fwp-coding-standards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Fwp-coding-standards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Fwp-coding-standards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pronamic","download_url":"https://codeload.github.com/pronamic/wp-coding-standards/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Fwp-coding-standards/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262098626,"owners_count":23258637,"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":["phpcs","phpcs-standard","wordpress"],"created_at":"2025-07-03T00:08:18.556Z","updated_at":"2026-01-06T12:11:02.259Z","avatar_url":"https://github.com/pronamic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pronamic WordPress Coding Standards\n\nPronamic WordPress Coding Standards for PHP_CodeSniffer.\n\n## Versions\n\nWe try to provide support for the last 3 major releases of PHP and WordPress in our projects.\n\n### PHP\n\n- `8.5`\n- `8.4`\n- `8.3`\n\nhttps://www.php.net/supported-versions.php\n\n### WordPress\n\n- `6.9`\n- `6.8`\n- `6.7`\n\nhttps://codex.wordpress.org/WordPress_Versions\n\n### Other\n\n- https://make.wordpress.org/core/handbook/best-practices/browser-support/\n- https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/\n\n## PHP_CodeSniffer\n\nhttps://github.com/PHPCSStandards/PHP_CodeSniffer\n\n### Arguments\n\nhttps://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Usage\n\n#### `colors`\n\nBy default use colors in output.\n\n```xml\n\u003carg name=\"colors\" /\u003e\n```\n\n#### `extensions`\n\nBy default only check files with `php` extension:\n\n```xml\n\u003carg name=\"extensions\" value=\"php\" /\u003e\n```\n\n#### `parallel`\n\nBy default use `8` parallel processes.\n\n```xml\n\u003carg name=\"parallel\" value=\"8\" /\u003e\n```\n\nhttps://github.com/squizlabs/PHP_CodeSniffer/issues/1732\n\n#### `sp`\n\nBy default show sniff codes in all reports.\nBy default show progress of the run.\n\n```xml\n\u003carg value=\"sp\" /\u003e\n```\n\n## Rules\n\n### PHPCompatibilityWP\n\nhttps://github.com/PHPCompatibility/PHPCompatibilityWP\n\nBy default this package test PHP `8.3` and higher via the following setting:\n\n```xml\n\u003cconfig name=\"testVersion\" value=\"8.3-\"/\u003e\n```\n\n### PHPCompatibility\n\nhttps://github.com/PHPCompatibility/PHPCompatibility\n\nRequired through `PHPCompatibilityWP`.\n\n### WordPress\n\nhttps://github.com/WordPress/WordPress-Coding-Standards\n\nBy default the minimum WordPress version to check is set to `6.7` via the following setting:\n\n```xml\n\u003cconfig name=\"minimum_supported_wp_version\" value=\"6.7\" /\u003e\n```\n\nhttps://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#minimum-wp-version-to-check-for-usage-of-deprecated-functions-classes-and-function-parameters\n\n### WordPressVIPMinimum\n\nhttps://github.com/Automattic/VIP-Coding-Standards\n\n### WordPress-VIP-Go\n\nhttps://github.com/Automattic/VIP-Coding-Standards\n\n### VariableAnalysis\n\nhttps://github.com/sirbrillig/phpcs-variable-analysis\n\n## Exclusions\n\n### `WordPress.Files.FileName.InvalidClassFileName`\n\nAccording to the WordPress PHP Coding Standards:\n\n\u003e Class file names should be based on the class name with `class-` prepended and the underscores in the class name replaced with hyphens, for example `WP_Error` becomes:\n\u003e\n\u003e ```\n\u003e class-wp-error.php\n\u003e ```\n\n_Source:_ https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#naming-conventions\n\nThis sniff will check on this naming convention:\n\n```\nClass file names should be based on the class name with \"class-\" prepended. Expected class-test.php, but found Test.php.\n```\n\nWe often use the [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading mechanism and therefore deviate from it.\n\n### `WordPress.Files.FileName.NotHyphenatedLowercase`\n\nAccording to the WordPress PHP Coding Standards:\n\n\u003e Files should be named descriptively using lowercase letters. Hyphens should separate words.\n\u003e\n\u003e ```\n\u003e my-plugin-name.php\n\u003e ```\n\n_Source:_ https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#naming-conventions\n\n```\nFilenames should be all lowercase with hyphens as word separators. Expected test.php, but found Test.php.\n```\n\nWe often use the [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading mechanism and therefore deviate from it.\n\n### `Universal.Arrays.DisallowShortArraySyntax`\n\nAccording to the WordPress PHP Coding Standards:\n\n\u003e Using long array syntax ( `array( 1, 2, 3 )` ) for declaring arrays is generally more readable than short array syntax ( `[ 1, 2, 3 ]` ), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.\n\u003e \n\u003e Arrays must be declared using long array syntax.\n\n_Source:_ https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#declaring-arrays\n\n[![Pronamic - Work with us](https://github.com/pronamic/brand-resources/blob/main/banners/pronamic-work-with-us-leaderboard-728x90%404x.png)](https://www.pronamic.eu/contact/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronamic%2Fwp-coding-standards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpronamic%2Fwp-coding-standards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronamic%2Fwp-coding-standards/lists"}