Skip to content

Instantly share code, notes, and snippets.

@dingo-d
Created July 8, 2019 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dingo-d/1a6a7a3f6f97ffb7c25e81d45d3c68c2 to your computer and use it in GitHub Desktop.
Save dingo-d/1a6a7a3f6f97ffb7c25e81d45d3c68c2 to your computer and use it in GitHub Desktop.
PHPCS Security scan (for WordPress). This setup can check your project for some possible security issues. It will also check it against the PHPCompatibility standard, WPCS-Extra standard (includes Core), and uses a security audit standard from Pheromone.
{
"require-dev": {
"pheromone/phpcs-security-audit": "^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"roave/security-advisories": "dev-master",
"phpcompatibility/php-compatibility": "^9.2",
"wp-coding-standards/wpcs": "^2.1"
},
"scripts": {
"phpcs-i": "@php vendor/bin/phpcs -i",
"check-cs": "@php vendor/bin/phpcs --parallel=8 --extensions=php,inc,lib,module,info -s",
"post-install-cmd": [
"bash vendor/pheromone/phpcs-security-audit/symlink.sh",
"@phpcs-i"
],
"post-update-cmd": [
"bash vendor/pheromone/phpcs-security-audit/symlink.sh",
"@phpcs-i"
]
}
}
<?xml version="1.0"?>
<ruleset name="Tarisio project">
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<config name="testVersion" value="7.3-"/>
<rule ref="PHPCompatibility"/>
<rule ref="Security"/>
<rule ref="WordPress-Extra"/>
<arg name="no-colors"/>
<ini name="memory_limit" value="2048M"/>
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment