All notable changes to this project will be documented in this file.
This projects adheres to Semantic Versioning and Keep a CHANGELOG.
- Sniff to flag dynamic translatable strings and textdomains.
get_children()
,wp_get_object_terms()
,wp_get_post_(categories|tags|terms)()
,get_category_by_slug()
,get_cat_ID()
,count_user_posts()
, andwp_old_slug_redirect()
to the list of restricted functions in theWordPress.VIP.RestrictedFunctions
sniff.
0.8.0 - 2015-10-02
implode()
andjoin()
to the list of formatting functions in theWordPress.XSS.EscapeOutput
sniff. This is useful when you need to have HTML in the$glue
parameter.- Support in the
WordPress.XSS.EscapeOutput
sniff for escaping an array of values usingarray_map()
. (Otherwise the support forimplode()
isn't of much use :) - Docs for running WPCS in Sublime Text.
nl2br()
to the list of formatting functions.wp_dropdown_pages()
to the list of printing functions.- Error codes to all error/warning messages.
WordPress.WP.PreparedSQL
sniff for flagging unprepared SQL queries.
- Sniffing for the number of spaces before a closure's opening parenthesis from the
default configuration of the
WordPress.WhiteSpace.ControlStructureSpacing
sniff. It can be re-enabled per-project as desired.
- The
WordPress.XSS.EscapeOutput
sniff giving error messages with the closing parenthesis in them instead of the offending function's name.
0.7.1 - 2015-08-31
- The default number of spaces before a closure's opening parenthesis from 1 to 0.
0.7.0 - 2015-08-30
- Automatic error fixing to the
WordPress.Arrays.ArrayKeySpacingRestrictions
sniff. - Functions and closures to the control structures checked by the
WordPress.WhiteSpace.ControlStructureSpacing
sniff. - Sniffing and fixing for extra spacing in the
WordPress.WhiteSpace.ControlStructureSpacing
sniff. (Previously it only checked for insufficient spacing.) .twig
files to the default ignored files.esc_url_raw()
andhash_equals()
to the list of sanitizing functions.intval()
andboolval()
to list of unslashing functions.do_shortcode()
to the list of auto-escaped functions.
WordPress.Functions.FunctionDeclarationArgumentSpacing
in favor of the upstream sniffSquiz.Functions.FunctionDeclarationArgumentSpacing
.
- Reference to incorrect issue in the inline docs of the
WordPress.VIP.SessionVariableUsage
sniff. WordPress.XSS.EscapeOutput
sniff incorrectly handling ternary conditions inecho
statements without parentheses in some cases.
0.6.0 - 2015-06-30
- Support for
wp_cache_add()
andwp_cache_delete()
, as well as custom cache functions,in theWordPress.VIP.DirectDatabaseQuery
sniff.
WordPress.Functions.FunctionRestrictions
andWordPress.Variables.VariableRestrictions
from theWordPress-VIP
standard, since they are just parents for other sniffs.
0.5.0 - 2015-06-01
WordPress.CSRF.NonceVerification
sniff to flag form processing without nonce verification.in_array()
andis_array()
to the list of sanitizing functions.- Support for automatic error fixing to the
WordPress.Arrays.ArrayDeclaration
sniff. WordPress.PHP.StrictComparisions
to theWordPress-VIP
andWordPress-Extra
rulesets.WordPress-Docs
ruleset to sniff for proper commenting.Generic.PHP.LowerCaseKeyword
,Generic.Files.EndFileNewline
,Generic.Files.LowercasedFilename
,Generic.Formatting.SpaceAfterCast
, andGeneric.Functions.OpeningFunctionBraceKernighanRitchie
to theWordPress-Core
ruleset.Generic.PHP.DeprecatedFunctions
,Generic.PHP.ForbiddenFunctions
,Generic.Functions.CallTimePassByReference
,Generic.Formatting.DisallowMultipleStatements
,Generic.CodeAnalysis.EmptyStatement
,Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
,Generic.CodeAnalysis.ForLoopWithTestFunctionCall
,Generic.CodeAnalysis.JumbledIncrementer
,Generic.CodeAnalysis.UnconditionalIfStatement
,Generic.CodeAnalysis.UnnecessaryFinalModifier
,Generic.CodeAnalysis.UselessOverridingMethod
,Generic.Classes.DuplicateClassName
, andGeneric.Strings.UnnecessaryStringConcat
to theWordPress-Extra
ruleset.- Error for missing use of
wp_unslash()
on superglobal data to theWordPress.VIP.ValidatedSanitizedInput
sniff.
- The
WordPress.VIP.ValidatedSanitizedInput
sniff to require sanitization of input even when it is being directly escaped and output. - The minimum required PHP_CodeSniffer version to 2.2.0.
- The
WordPress.VIP.ValidatedSanitizedInput
andWordPress.XSS.EscapeOutput
sniffs: the list of escaping functions was split from the list of sanitizing functions. ThecustomSanitizingFunctions
property has been moved to theValidatedSanitizedInput
sniff, and thecustomEscapingFunctions
property should now be used instead for theEscapeOutput
sniff. - The
WordPress.Arrays.ArrayDeclaration
sniff to give errors forNoSpaceAfterOpenParenthesis
,SpaceAfterArrayOpener
, andSpaceAfterArrayCloser
, instead of warnings. - The
WordPress.NamingConventions.ValidFunctionName
sniff to allow camelCase method names in classes that implement interfaces.
- The
WordPress.VIP.ValidatedSanitizedInput
sniff not reporting missing validation when reporting missing sanitization. - The
WordPress.VIP.ValidatedSanitizedInput
sniff flagging superglobals as needing sanitization when they were only being used in a comparison usingif
orswitch
, etc.
0.4.0 - 2015-05-01
- Change log file.
- Handling for string-interpolated input variables in the
WordPress.VIP.ValidatedSanitizedInput
sniff. - Errors for using uncached functions when cached equivalents exist.
space_before_colon
setting for theWordPress.WhiteSpace.ControlStructureSpacing
sniff, for control structures using alternative syntax. Possible values:'required'
,'optional'
,'forbidden'
.- Support for
sanitization
whitelisting comments for theWordPress.VIP.ValidatedSanitizedInput
sniff. - Granular error/warning names for all errors and warnings.
- Handling for ternary conditions in the
WordPress.XSS.EscapeOutput
sniff. die
,exit
,printf
,vprintf
,wp_die
,_deprecated_argument
,_deprecated_function
,_deprecated_file
,_doing_it_wrong
,trigger_error
, anduser_error
to the list of printing functions in theWordPress.XSS.EscapeOutput
sniff.customPrintingFunctions
setting for theWordPress.XSS.EscapeOutput
sniff.rawurlencode()
andwp_parse_id_list()
to the list of "sanitizing" functions in theWordPress.XSS.EscapeOutput
sniff.json_encode()
to the list of discouraged functions in theWordPress.PHP.DiscouragedFunctions
sniff, in favor ofwp_json_encode()
.vip_powered_wpcom()
to the list of auto-escaped functions in theWordPress.XSS.EscapeOutput
sniff.debug_print_backtrace()
andvar_export()
to the list of discouraged functions in theWordPress.PHP.DiscouragedFunctions
sniff.- Smart handling for formatting functions (
sprintf()
andwp_sprintf()
) in theWordPress.XSS.EscapeOutput
sniff. WordPress.PHP.StrictComparisons
sniff.- Correct handling of
array_map()
in theWordPress.VIP.ValidatedSanitizedInput
sniff. $_COOKIE
and$_FILE
to the list of superglobals flagged by theWordPress.VIP.ValidatedSanitizedInput
andWordPress.VIP.SuperGlobalInputUsage
sniffs.$_SERVER
to the list of superglobals flagged by theWordPress.VIP.SuperGlobalInputUsage
sniff.Squiz.ControlStructures.ControlSignature
sniff to the rulesets.
WordPress.Arrays.ArrayKeySpacingRestrictions
sniff to give errors forNoSpacesAroundArrayKeys
andSpacesAroundArrayKeys
instead of just warnings.WordPress.NamingConventions.ValidFunctionName
sniff to allow for camel caps method names in child classes.WordPress.XSS.EscapeOutput
sniff to allow for integers (e.g.echo 5
andprint( -1 )
).
- Errors for mixed key/keyless array elements in the
WordPress.Arrays.ArrayDeclaration
sniff. - BOM from
WordPress.WhiteSpace.OperatorSpacing
sniff file. $content_width
from the list of non-overwritable globals in theWordPress.Variables.GlobalVariables
sniff.WordPress.Arrays.ArrayAssignmentRestrictions
sniff from theWordPress-VIP
ruleset.
- Incorrect errors for
else
statements using alternative syntax. WordPress.VIP.ValidatedSanitizedInput
sniff not always treating casting as sanitization.WordPress.XSS.EscapeOutput
sniff flagging comments as needing to be escaped.WordPress.XSS.EscapeOutput
sniff not sniffing comma-delimitedecho
arguments after encountering the first escaping function in the statement.WordPress.PHP.YodaConditions
sniff not flagging comparisons to constants or function calls.WordPress.Arrays.ArrayDeclaration
sniff not ignoring doc comments.- Link to phpStorm instructions in
README.md
. - Poor performance of the
WordPress.Arrays.ArrayAssignmentRestrictions
sniff. - Poor performance of the
WordPress.Files.FileName
sniff.
0.3.0 - 2014-12-11
See the comparison for full list.
- Use semantic version tags for releases.
See the comparison for full list.
Initial tagged release.