Skip to content

Instantly share code, notes, and snippets.

@mcguffin
Last active November 15, 2024 07:50
Show Gist options
  • Save mcguffin/255909d4d7fcc241fe63363012553268 to your computer and use it in GitHub Desktop.
Save mcguffin/255909d4d7fcc241fe63363012553268 to your computer and use it in GitHub Desktop.

Revisions

  1. mcguffin revised this gist Jul 21, 2021. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions phpcs-security.ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -6,9 +6,11 @@

    <exclude-pattern>assets/*</exclude-pattern>
    <exclude-pattern>node_modules/*</exclude-pattern>
    <exclude-pattern>test/*</exclude-pattern>
    <exclude-pattern>vendor/*</exclude-pattern>
    <exclude-pattern>*.js</exclude-pattern>
    <exclude-pattern>*.css</exclude-pattern>
    <exclude-pattern>*.min.js</exclude-pattern>
    <exclude-pattern>js/*.js</exclude-pattern>
    <exclude-pattern>css/*.css</exclude-pattern>

    <rule ref="Generic.PHP.Syntax"/>

    @@ -20,7 +22,6 @@
    <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>
    <rule ref="WordPress.PHP">
    <!-- omit non security sniffs -->
    <exclude name="WordPress.PHP.DisallowShortTernary"/>
    <exclude name="WordPress.PHP.DontExtract"/>
    <exclude name="WordPress.PHP.YodaConditions"/>
    </rule>
    @@ -29,7 +30,6 @@
    <rule ref="WordPress.Utils">
    </rule>
    <rule ref="WordPress.WP">
    <exclude name="WordPress.WP.TimezoneChange"/>
    <exclude name="WordPress.WP.I18n.MixedOrderedPlaceholders"/>
    <exclude name="WordPress.WP.I18n.UnorderedPlaceholders"/>
    <exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
  2. mcguffin revised this gist Jul 24, 2020. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion composer.json
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    "name": "mcguffin/wp-package-security-check",
    "type": "wordpress-plugin",
    "license": "GPL-2.0-or-later",
    "homepage": "https://bitbucket.org/polyplanet/wp-faq-sections.git",
    "homepage": "https://gist.github.com/mcguffin/255909d4d7fcc241fe63363012553268",
    "require": {
    "composer/installers": "~1.2"
    },
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    {
    "name": "wp-package-security-check",
    "version": "0.0.1",
    "version": "0.0.2",
    "description": "",
    "private": true,
    "author": "mcguffin",
  3. mcguffin revised this gist Jun 16, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,8 @@
    "devDependencies": {},
    "scripts": {
    "postinstall": "composer install",
    "audit": "./vendor/squizlabs/php_codesniffer/bin/phpcs . --report=code --standard=./phpcs-security.ruleset.xml -n -s > ./phpcs-report.txt || exit 0"
    "audit": "./vendor/squizlabs/php_codesniffer/bin/phpcs . --report=code --standard=./phpcs-security.ruleset.xml -n -s > ./phpcs-report.txt || exit 0",
    "audit-win": "powershell ./vendor/squizlabs/php_codesniffer/bin/phpcs . --report=code --standard=./phpcs-security.ruleset.xml -n -s > ./phpcs-report.txt"
    },
    "repository": {},
    "bugs": {}
  4. mcguffin revised this gist Apr 6, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion composer.json
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    {
    "name": "wp-package-security-check",
    "name": "mcguffin/wp-package-security-check",
    "type": "wordpress-plugin",
    "license": "GPL-2.0-or-later",
    "homepage": "https://bitbucket.org/polyplanet/wp-faq-sections.git",
  5. mcguffin revised this gist Apr 6, 2020. 1 changed file with 2 additions and 8 deletions.
    10 changes: 2 additions & 8 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -11,12 +11,6 @@
    "postinstall": "composer install",
    "audit": "./vendor/squizlabs/php_codesniffer/bin/phpcs . --report=code --standard=./phpcs-security.ruleset.xml -n -s > ./phpcs-report.txt || exit 0"
    },
    "repository": {
    "type": "git",
    "url": "git+https://github.com/mcguffin/mcguffin-more-privacy-options.git"
    },
    "bugs": {
    "url": "https://github.com/mcguffin/mcguffin-more-privacy-options/issues"
    },
    "wporg": {}
    "repository": {},
    "bugs": {}
    }
  6. mcguffin created this gist Apr 6, 2020.
    28 changes: 28 additions & 0 deletions composer.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    {
    "name": "wp-package-security-check",
    "type": "wordpress-plugin",
    "license": "GPL-2.0-or-later",
    "homepage": "https://bitbucket.org/polyplanet/wp-faq-sections.git",
    "require": {
    "composer/installers": "~1.2"
    },
    "require-dev": {
    "squizlabs/php_codesniffer": "*",
    "wp-coding-standards/wpcs": "*",
    "phpcompatibility/php-compatibility": "*",
    "pheromone/phpcs-security-audit":"*"
    },
    "keywords": [
    "plugin",
    "wordpress",
    "security"
    ],
    "scripts": {
    "post-install-cmd": [
    "[ -f vendor/bin/phpcs ] && \"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/pheromone/phpcs-security-audit || true"
    ],
    "post-update-cmd": [
    "[ -f vendor/bin/phpcs ] && \"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/pheromone/phpcs-security-audit || true"
    ]
    }
    }
    22 changes: 22 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    {
    "name": "wp-package-security-check",
    "version": "0.0.1",
    "description": "",
    "private": true,
    "author": "mcguffin",
    "license": "GPL-3.0-or-later",
    "dependencies": {},
    "devDependencies": {},
    "scripts": {
    "postinstall": "composer install",
    "audit": "./vendor/squizlabs/php_codesniffer/bin/phpcs . --report=code --standard=./phpcs-security.ruleset.xml -n -s > ./phpcs-report.txt || exit 0"
    },
    "repository": {
    "type": "git",
    "url": "git+https://github.com/mcguffin/mcguffin-more-privacy-options.git"
    },
    "bugs": {
    "url": "https://github.com/mcguffin/mcguffin-more-privacy-options/issues"
    },
    "wporg": {}
    }
    37 changes: 37 additions & 0 deletions phpcs-security.ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    <?xml version="1.0"?>
    <ruleset name="WordPress Security">

    <!-- Set a description for this ruleset. -->
    <description>A WordPress Ruleset to check application safety.</description>

    <exclude-pattern>assets/*</exclude-pattern>
    <exclude-pattern>node_modules/*</exclude-pattern>
    <exclude-pattern>vendor/*</exclude-pattern>
    <exclude-pattern>*.js</exclude-pattern>
    <exclude-pattern>*.css</exclude-pattern>

    <rule ref="Generic.PHP.Syntax"/>

    <!-- Include the WordPress ruleset, with exclusions. -->
    <rule ref="WordPress.CodeAnalysis">
    </rule>
    <rule ref="WordPress.DB">
    </rule>
    <rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>
    <rule ref="WordPress.PHP">
    <!-- omit non security sniffs -->
    <exclude name="WordPress.PHP.DisallowShortTernary"/>
    <exclude name="WordPress.PHP.DontExtract"/>
    <exclude name="WordPress.PHP.YodaConditions"/>
    </rule>
    <rule ref="WordPress.Security">
    </rule>
    <rule ref="WordPress.Utils">
    </rule>
    <rule ref="WordPress.WP">
    <exclude name="WordPress.WP.TimezoneChange"/>
    <exclude name="WordPress.WP.I18n.MixedOrderedPlaceholders"/>
    <exclude name="WordPress.WP.I18n.UnorderedPlaceholders"/>
    <exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
    </rule>
    </ruleset>