| @@ -1,90 +1,90 @@ | ||
| 1 | -<?xml version="1.0"?> | |
| 2 | -<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | |
| 3 | - | |
| 4 | - <description>The Coding standard for the WordPress Coding Standards itself.</description> | |
| 5 | - | |
| 6 | - <file>.</file> | |
| 7 | - | |
| 8 | - <arg value="sp"/> | |
| 9 | - <arg name="extensions" value="php"/> | |
| 10 | - <arg name="basepath" value="."/> | |
| 11 | - <arg name="parallel" value="8"/> | |
| 12 | - <!-- <arg name="cache" value="false"/> --> | |
| 13 | - <!-- <arg name="standard" value="WordPress"/> --> | |
| 14 | - | |
| 15 | - <exclude-pattern>dev-*</exclude-pattern> | |
| 16 | - <exclude-pattern>node_modules/*</exclude-pattern> | |
| 17 | - <exclude-pattern>vendor/*</exclude-pattern> | |
| 18 | - <exclude-pattern>vendor/*</exclude-pattern> | |
| 19 | - <exclude-pattern>build-package/*</exclude-pattern> | |
| 20 | - <exclude-pattern>assets/*</exclude-pattern> | |
| 21 | - <exclude-pattern>build/*</exclude-pattern> | |
| 22 | - | |
| 23 | - <!-- <rule ref="WordPress"> --> | |
| 24 | - <!-- <exclude name="WordPress.Files.FileName"/> --> | |
| 25 | - <!-- <exclude name="WordPress.NamingConventions.ValidVariableName"/> --> | |
| 26 | - <!-- <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> --> | |
| 27 | - <!-- </rule> --> | |
| 28 | - | |
| 29 | - <rule ref="WordPress.WP.I18n"> | |
| 30 | - <properties> | |
| 31 | - <property name="text_domain" type="array" value="emailkit"/> | |
| 32 | - </properties> | |
| 33 | - </rule> | |
| 34 | - | |
| 35 | - <rule ref="WordPress.Security"> | |
| 36 | - <exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"/> | |
| 37 | - <exclude name="WordPress.Files.FileName"/> | |
| 38 | - <exclude name="WordPress.Arrays"/> | |
| 39 | - <exclude name="WordPress.NamingConventions.ValidVariableName"/> | |
| 40 | - <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> | |
| 41 | - </rule> | |
| 42 | - <!-- Enforce PSR1 compatible namespaces. --> | |
| 43 | - <!-- <rule ref="PSR1.Classes.ClassDeclaration"/> --> | |
| 44 | - | |
| 45 | - <!-- <rule ref="WordPress.Arrays.MultipleStatementAlignment"> --> | |
| 46 | - <!-- <properties> --> | |
| 47 | - <!-- <property name="alignMultilineItems" value="!=100"/> --> | |
| 48 | - <!-- <property name="exact" value="false" phpcs-only="true"/> --> | |
| 49 | - <!-- </properties> --> | |
| 50 | - <!-- </rule> --> | |
| 51 | - | |
| 52 | - <rule ref="PSR2.Methods.FunctionClosingBrace"/> | |
| 53 | - | |
| 54 | - <!-- Check code for cross-version PHP compatibility. --> | |
| 55 | - <!-- <config name="testVersion" value="5.4-"/> --> | |
| 56 | - <!-- <rule ref="PHPCompatibility"> --> | |
| 57 | - <!-- Exclude PHP constants back-filled by PHPCS. --> | |
| 58 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/> --> | |
| 59 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/> --> | |
| 60 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/> --> | |
| 61 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/> --> | |
| 62 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/> --> | |
| 63 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/> --> | |
| 64 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/> --> | |
| 65 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/> --> | |
| 66 | - <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/> --> | |
| 67 | - <!-- </rule> --> | |
| 68 | - | |
| 69 | - <!-- | |
| 70 | - ############################################################################# | |
| 71 | - Handbook: PHP - Formatting SQL statements. | |
| 72 | - Ref: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#formatting-sql-statements | |
| 73 | - ############################################################################# | |
| 74 | - --> | |
| 75 | - | |
| 76 | - <!-- Rule: in $wpdb->prepare - %s is used for string placeholders and %d is used for integer | |
| 77 | - placeholders. Note that they are not 'quoted'! --> | |
| 78 | - <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> | |
| 79 | - <!-- <rule ref="WordPress.DB.DirectDatabaseQuery" /> --> | |
| 80 | - | |
| 81 | - <!-- Covers rule: $wpdb->prepare()... The benefit of this is that we don't have to remember | |
| 82 | - to manually use esc_sql(), and also that it is easy to see at a glance whether something | |
| 83 | - has been escaped or not, because it happens right when the query happens. --> | |
| 84 | - <rule ref="WordPress.DB.PreparedSQL"/> | |
| 85 | - | |
| 86 | - <!-- Covers rule: Avoid touching the database directly. --> | |
| 87 | - <rule ref="WordPress.DB.RestrictedFunctions"/> | |
| 88 | - <rule ref="WordPress.DB.RestrictedClasses"/> | |
| 89 | - | |
| 1 | +<?xml version="1.0"?> | |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> | |
| 3 | + | |
| 4 | + <description>The Coding standard for the WordPress Coding Standards itself.</description> | |
| 5 | + | |
| 6 | + <file>.</file> | |
| 7 | + | |
| 8 | + <arg value="sp"/> | |
| 9 | + <arg name="extensions" value="php"/> | |
| 10 | + <arg name="basepath" value="."/> | |
| 11 | + <arg name="parallel" value="8"/> | |
| 12 | + <!-- <arg name="cache" value="false"/> --> | |
| 13 | + <!-- <arg name="standard" value="WordPress"/> --> | |
| 14 | + | |
| 15 | + <exclude-pattern>dev-*</exclude-pattern> | |
| 16 | + <exclude-pattern>node_modules/*</exclude-pattern> | |
| 17 | + <exclude-pattern>vendor/*</exclude-pattern> | |
| 18 | + <exclude-pattern>vendor/*</exclude-pattern> | |
| 19 | + <exclude-pattern>build-package/*</exclude-pattern> | |
| 20 | + <exclude-pattern>assets/*</exclude-pattern> | |
| 21 | + <exclude-pattern>build/*</exclude-pattern> | |
| 22 | + | |
| 23 | + <!-- <rule ref="WordPress"> --> | |
| 24 | + <!-- <exclude name="WordPress.Files.FileName"/> --> | |
| 25 | + <!-- <exclude name="WordPress.NamingConventions.ValidVariableName"/> --> | |
| 26 | + <!-- <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> --> | |
| 27 | + <!-- </rule> --> | |
| 28 | + | |
| 29 | + <rule ref="WordPress.WP.I18n"> | |
| 30 | + <properties> | |
| 31 | + <property name="text_domain" type="array" value="emailkit"/> | |
| 32 | + </properties> | |
| 33 | + </rule> | |
| 34 | + | |
| 35 | + <rule ref="WordPress.Security"> | |
| 36 | + <exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"/> | |
| 37 | + <exclude name="WordPress.Files.FileName"/> | |
| 38 | + <exclude name="WordPress.Arrays"/> | |
| 39 | + <exclude name="WordPress.NamingConventions.ValidVariableName"/> | |
| 40 | + <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> | |
| 41 | + </rule> | |
| 42 | + <!-- Enforce PSR1 compatible namespaces. --> | |
| 43 | + <!-- <rule ref="PSR1.Classes.ClassDeclaration"/> --> | |
| 44 | + | |
| 45 | + <!-- <rule ref="WordPress.Arrays.MultipleStatementAlignment"> --> | |
| 46 | + <!-- <properties> --> | |
| 47 | + <!-- <property name="alignMultilineItems" value="!=100"/> --> | |
| 48 | + <!-- <property name="exact" value="false" phpcs-only="true"/> --> | |
| 49 | + <!-- </properties> --> | |
| 50 | + <!-- </rule> --> | |
| 51 | + | |
| 52 | + <rule ref="PSR2.Methods.FunctionClosingBrace"/> | |
| 53 | + | |
| 54 | + <!-- Check code for cross-version PHP compatibility. --> | |
| 55 | + <!-- <config name="testVersion" value="5.4-"/> --> | |
| 56 | + <!-- <rule ref="PHPCompatibility"> --> | |
| 57 | + <!-- Exclude PHP constants back-filled by PHPCS. --> | |
| 58 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/> --> | |
| 59 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/> --> | |
| 60 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/> --> | |
| 61 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/> --> | |
| 62 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/> --> | |
| 63 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/> --> | |
| 64 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/> --> | |
| 65 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/> --> | |
| 66 | + <!-- <exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/> --> | |
| 67 | + <!-- </rule> --> | |
| 68 | + | |
| 69 | + <!-- | |
| 70 | + ############################################################################# | |
| 71 | + Handbook: PHP - Formatting SQL statements. | |
| 72 | + Ref: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#formatting-sql-statements | |
| 73 | + ############################################################################# | |
| 74 | + --> | |
| 75 | + | |
| 76 | + <!-- Rule: in $wpdb->prepare - %s is used for string placeholders and %d is used for integer | |
| 77 | + placeholders. Note that they are not 'quoted'! --> | |
| 78 | + <rule ref="WordPress.DB.PreparedSQLPlaceholders"/> | |
| 79 | + <!-- <rule ref="WordPress.DB.DirectDatabaseQuery" /> --> | |
| 80 | + | |
| 81 | + <!-- Covers rule: $wpdb->prepare()... The benefit of this is that we don't have to remember | |
| 82 | + to manually use esc_sql(), and also that it is easy to see at a glance whether something | |
| 83 | + has been escaped or not, because it happens right when the query happens. --> | |
| 84 | + <rule ref="WordPress.DB.PreparedSQL"/> | |
| 85 | + | |
| 86 | + <!-- Covers rule: Avoid touching the database directly. --> | |
| 87 | + <rule ref="WordPress.DB.RestrictedFunctions"/> | |
| 88 | + <rule ref="WordPress.DB.RestrictedClasses"/> | |
| 89 | + | |
| 90 | 90 | </ruleset> |