sdc-build-wp 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composer.json +2 -3
- package/composer.lock +3 -313
- package/index.js +38 -21
- package/lib/blocks.js +8 -6
- package/lib/style.js +17 -0
- package/package.json +1 -1
- package/vendor/composer/autoload_classmap.php +0 -37
- package/vendor/composer/autoload_psr4.php +0 -1
- package/vendor/composer/autoload_real.php +2 -0
- package/vendor/composer/autoload_static.php +0 -53
- package/vendor/composer/installed.json +1 -329
- package/vendor/composer/installed.php +3 -39
- package/vendor/composer/platform_check.php +26 -0
- package/lib/bustCache.js +0 -14
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md +0 -22
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md +0 -285
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json +0 -71
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php +0 -637
- package/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +0 -590
- package/vendor/phpcsstandards/phpcsextra/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +0 -382
- package/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php +0 -305
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php +0 -226
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/README.md +0 -573
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml +0 -24
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml +0 -64
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml +0 -35
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml +0 -49
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml +0 -37
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml +0 -45
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml +0 -42
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml +0 -41
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml +0 -39
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php +0 -60
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php +0 -297
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php +0 -174
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php +0 -134
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php +0 -188
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php +0 -102
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php +0 -153
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php +0 -269
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php +0 -131
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php +0 -106
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php +0 -199
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php +0 -348
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php +0 -164
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php +0 -233
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php +0 -120
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php +0 -71
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php +0 -86
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php +0 -80
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php +0 -96
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php +0 -275
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php +0 -204
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php +0 -76
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php +0 -197
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php +0 -85
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php +0 -87
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php +0 -101
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php +0 -248
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php +0 -207
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php +0 -156
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php +0 -170
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +0 -155
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php +0 -79
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php +0 -408
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +0 -173
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +0 -445
- package/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/composer.json +0 -69
- package/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist +0 -36
- package/vendor/phpcsstandards/phpcsutils/CHANGELOG.md +0 -1106
- package/vendor/phpcsstandards/phpcsutils/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php +0 -551
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php +0 -781
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php +0 -123
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php +0 -202
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php +0 -44
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php +0 -47
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php +0 -43
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php +0 -50
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php +0 -246
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php +0 -218
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php +0 -687
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php +0 -269
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php +0 -164
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php +0 -75
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +0 -459
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php +0 -837
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php +0 -55
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php +0 -227
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php +0 -156
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php +0 -232
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php +0 -276
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php +0 -828
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php +0 -262
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php +0 -145
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php +0 -389
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php +0 -116
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php +0 -322
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php +0 -252
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php +0 -120
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php +0 -419
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php +0 -510
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php +0 -143
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php +0 -331
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php +0 -432
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php +0 -333
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml +0 -4
- package/vendor/phpcsstandards/phpcsutils/README.md +0 -297
- package/vendor/phpcsstandards/phpcsutils/composer.json +0 -92
- package/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php +0 -68
- package/vendor/wp-coding-standards/wpcs/CHANGELOG.md +0 -1654
- package/vendor/wp-coding-standards/wpcs/LICENSE +0 -21
- package/vendor/wp-coding-standards/wpcs/README.md +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php +0 -257
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php +0 -111
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php +0 -358
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml +0 -116
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml +0 -31
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml +0 -50
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml +0 -24
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +0 -119
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml +0 -121
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml +0 -53
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml +0 -69
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml +0 -43
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml +0 -92
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml +0 -150
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +0 -19
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml +0 -61
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php +0 -135
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php +0 -394
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php +0 -84
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php +0 -256
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php +0 -238
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php +0 -101
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php +0 -159
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php +0 -418
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php +0 -349
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php +0 -262
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php +0 -115
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php +0 -312
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php +0 -113
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php +0 -72
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php +0 -252
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php +0 -550
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php +0 -174
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php +0 -583
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php +0 -173
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php +0 -89
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php +0 -301
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +0 -761
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php +0 -242
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php +0 -58
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php +0 -168
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php +0 -313
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +0 -1297
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php +0 -188
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php +0 -277
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +0 -230
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php +0 -289
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php +0 -100
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php +0 -52
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php +0 -193
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php +0 -245
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php +0 -70
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php +0 -90
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php +0 -124
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php +0 -903
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php +0 -422
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php +0 -126
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php +0 -244
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php +0 -862
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php +0 -371
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php +0 -478
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php +0 -315
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php +0 -897
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php +0 -321
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php +0 -152
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php +0 -1708
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php +0 -291
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php +0 -509
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php +0 -160
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php +0 -241
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php +0 -436
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php +0 -977
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php +0 -102
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +0 -486
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml +0 -13
- package/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml +0 -948
- package/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml +0 -109
- package/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml +0 -199
- package/vendor/wp-coding-standards/wpcs/composer.json +0 -88
- package/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample +0 -153
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DB;
|
|
11
|
-
|
|
12
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
13
|
-
use PHPCSUtils\Tokens\Collections;
|
|
14
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
15
|
-
use WordPressCS\WordPress\Helpers\ContextHelper;
|
|
16
|
-
use WordPressCS\WordPress\Helpers\FormattingFunctionsHelper;
|
|
17
|
-
use WordPressCS\WordPress\Helpers\WPDBTrait;
|
|
18
|
-
use WordPressCS\WordPress\Sniff;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Sniff for prepared SQL.
|
|
22
|
-
*
|
|
23
|
-
* Makes sure that variables aren't directly interpolated into SQL statements.
|
|
24
|
-
*
|
|
25
|
-
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#formatting-sql-statements
|
|
26
|
-
*
|
|
27
|
-
* @since 0.8.0
|
|
28
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
29
|
-
* @since 1.0.0 This sniff has been moved from the `WP` category to the `DB` category.
|
|
30
|
-
*/
|
|
31
|
-
final class PreparedSQLSniff extends Sniff {
|
|
32
|
-
|
|
33
|
-
use WPDBTrait;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The lists of $wpdb methods.
|
|
37
|
-
*
|
|
38
|
-
* @since 0.8.0
|
|
39
|
-
* @since 0.11.0 Changed from static to non-static.
|
|
40
|
-
*
|
|
41
|
-
* @var array<string, bool>
|
|
42
|
-
*/
|
|
43
|
-
protected $methods = array(
|
|
44
|
-
'get_var' => true,
|
|
45
|
-
'get_col' => true,
|
|
46
|
-
'get_row' => true,
|
|
47
|
-
'get_results' => true,
|
|
48
|
-
'prepare' => true,
|
|
49
|
-
'query' => true,
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Functions that escape values for use in SQL queries.
|
|
54
|
-
*
|
|
55
|
-
* @since 0.9.0
|
|
56
|
-
* @since 0.11.0 Changed from public static to protected non-static.
|
|
57
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
58
|
-
* - The property visibility has changed from `protected` to `private`.
|
|
59
|
-
*
|
|
60
|
-
* @var array<string, bool>
|
|
61
|
-
*/
|
|
62
|
-
private $SQLEscapingFunctions = array(
|
|
63
|
-
'absint' => true,
|
|
64
|
-
'esc_sql' => true,
|
|
65
|
-
'floatval' => true,
|
|
66
|
-
'intval' => true,
|
|
67
|
-
'like_escape' => true,
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Functions whose output is automatically escaped for use in SQL queries.
|
|
72
|
-
*
|
|
73
|
-
* @since 0.9.0
|
|
74
|
-
* @since 0.11.0 Changed from public static to protected non-static.
|
|
75
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
76
|
-
* - The property visibility has changed from `protected` to `private`.
|
|
77
|
-
*
|
|
78
|
-
* @var array<string, bool>
|
|
79
|
-
*/
|
|
80
|
-
private $SQLAutoEscapedFunctions = array(
|
|
81
|
-
'count' => true,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Tokens that we don't flag when they are found in a $wpdb method call.
|
|
86
|
-
*
|
|
87
|
-
* This token array is augmented from within the register() method.
|
|
88
|
-
*
|
|
89
|
-
* @since 0.9.0
|
|
90
|
-
* @since 3.0.0 The property visibility has changed from `protected` to `private`.
|
|
91
|
-
*
|
|
92
|
-
* @var array
|
|
93
|
-
*/
|
|
94
|
-
private $ignored_tokens = array(
|
|
95
|
-
\T_STRING_CONCAT => true,
|
|
96
|
-
\T_CONSTANT_ENCAPSED_STRING => true,
|
|
97
|
-
\T_COMMA => true,
|
|
98
|
-
\T_LNUMBER => true,
|
|
99
|
-
\T_DNUMBER => true,
|
|
100
|
-
\T_NS_SEPARATOR => true,
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* A loop pointer.
|
|
105
|
-
*
|
|
106
|
-
* It is a property so that we can access it in all of our methods.
|
|
107
|
-
*
|
|
108
|
-
* @since 0.9.0
|
|
109
|
-
*
|
|
110
|
-
* @var int
|
|
111
|
-
*/
|
|
112
|
-
protected $i;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The loop end marker.
|
|
116
|
-
*
|
|
117
|
-
* It is a property so that we can access it in all of our methods.
|
|
118
|
-
*
|
|
119
|
-
* @since 0.9.0
|
|
120
|
-
*
|
|
121
|
-
* @var int
|
|
122
|
-
*/
|
|
123
|
-
protected $end;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Returns an array of tokens this test wants to listen for.
|
|
127
|
-
*
|
|
128
|
-
* @since 0.8.0
|
|
129
|
-
*
|
|
130
|
-
* @return array
|
|
131
|
-
*/
|
|
132
|
-
public function register() {
|
|
133
|
-
// Enrich the array of tokens which can be safely ignored.
|
|
134
|
-
$this->ignored_tokens += Tokens::$bracketTokens;
|
|
135
|
-
$this->ignored_tokens += Tokens::$heredocTokens;
|
|
136
|
-
$this->ignored_tokens += Tokens::$castTokens;
|
|
137
|
-
$this->ignored_tokens += Tokens::$arithmeticTokens;
|
|
138
|
-
$this->ignored_tokens += Collections::incrementDecrementOperators();
|
|
139
|
-
$this->ignored_tokens += Collections::objectOperators();
|
|
140
|
-
$this->ignored_tokens += Tokens::$emptyTokens;
|
|
141
|
-
|
|
142
|
-
// The contents of heredoc tokens needs to be examined.
|
|
143
|
-
unset( $this->ignored_tokens[ \T_HEREDOC ] );
|
|
144
|
-
|
|
145
|
-
return array(
|
|
146
|
-
\T_VARIABLE,
|
|
147
|
-
\T_STRING,
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Processes this test, when one of its tokens is encountered.
|
|
153
|
-
*
|
|
154
|
-
* @since 0.8.0
|
|
155
|
-
*
|
|
156
|
-
* @param int $stackPtr The position of the current token in the stack.
|
|
157
|
-
*
|
|
158
|
-
* @return int|void Integer stack pointer to skip forward or void to continue
|
|
159
|
-
* normal file processing.
|
|
160
|
-
*/
|
|
161
|
-
public function process_token( $stackPtr ) {
|
|
162
|
-
|
|
163
|
-
if ( ! $this->is_wpdb_method_call( $this->phpcsFile, $stackPtr, $this->methods ) ) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
for ( $this->i; $this->i < $this->end; $this->i++ ) {
|
|
168
|
-
|
|
169
|
-
if ( isset( $this->ignored_tokens[ $this->tokens[ $this->i ]['code'] ] ) ) {
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $this->i ]['code']
|
|
174
|
-
|| \T_HEREDOC === $this->tokens[ $this->i ]['code']
|
|
175
|
-
) {
|
|
176
|
-
|
|
177
|
-
$bad_variables = array_filter(
|
|
178
|
-
TextStrings::getEmbeds( $this->tokens[ $this->i ]['content'] ),
|
|
179
|
-
static function ( $symbol ) {
|
|
180
|
-
return preg_match( '`^\{?\$\{?wpdb\??->`', $symbol ) !== 1;
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
foreach ( $bad_variables as $bad_variable ) {
|
|
185
|
-
$this->phpcsFile->addError(
|
|
186
|
-
'Use placeholders and $wpdb->prepare(); found interpolated variable %s at %s',
|
|
187
|
-
$this->i,
|
|
188
|
-
'InterpolatedNotPrepared',
|
|
189
|
-
array(
|
|
190
|
-
$bad_variable,
|
|
191
|
-
$this->tokens[ $this->i ]['content'],
|
|
192
|
-
)
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if ( \T_VARIABLE === $this->tokens[ $this->i ]['code'] ) {
|
|
199
|
-
if ( '$wpdb' === $this->tokens[ $this->i ]['content'] ) {
|
|
200
|
-
$this->is_wpdb_method_call( $this->phpcsFile, $this->i, $this->methods );
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if ( ContextHelper::is_safe_casted( $this->phpcsFile, $this->i ) ) {
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if ( \T_STRING === $this->tokens[ $this->i ]['code'] ) {
|
|
210
|
-
|
|
211
|
-
if (
|
|
212
|
-
isset( $this->SQLEscapingFunctions[ $this->tokens[ $this->i ]['content'] ] )
|
|
213
|
-
|| isset( $this->SQLAutoEscapedFunctions[ $this->tokens[ $this->i ]['content'] ] )
|
|
214
|
-
) {
|
|
215
|
-
|
|
216
|
-
// Find the opening parenthesis.
|
|
217
|
-
$opening_paren = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $this->i + 1 ), null, true );
|
|
218
|
-
|
|
219
|
-
if ( false !== $opening_paren
|
|
220
|
-
&& \T_OPEN_PARENTHESIS === $this->tokens[ $opening_paren ]['code']
|
|
221
|
-
&& isset( $this->tokens[ $opening_paren ]['parenthesis_closer'] )
|
|
222
|
-
) {
|
|
223
|
-
// Skip past to the end of the function call.
|
|
224
|
-
$this->i = $this->tokens[ $opening_paren ]['parenthesis_closer'];
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
} elseif ( FormattingFunctionsHelper::is_formatting_function( $this->tokens[ $this->i ]['content'] ) ) {
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
$this->phpcsFile->addError(
|
|
233
|
-
'Use placeholders and $wpdb->prepare(); found %s',
|
|
234
|
-
$this->i,
|
|
235
|
-
'NotPrepared',
|
|
236
|
-
array( $this->tokens[ $this->i ]['content'] )
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return $this->end;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DB;
|
|
11
|
-
|
|
12
|
-
use WordPressCS\WordPress\AbstractClassRestrictionsSniff;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Verifies that no database related PHP classes are used.
|
|
16
|
-
*
|
|
17
|
-
* "Avoid touching the database directly. If there is a defined function that can get
|
|
18
|
-
* the data you need, use it. Database abstraction (using functions instead of queries)
|
|
19
|
-
* helps keep your code forward-compatible and, in cases where results are cached in memory,
|
|
20
|
-
* it can be many times faster."
|
|
21
|
-
*
|
|
22
|
-
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#database-queries
|
|
23
|
-
*
|
|
24
|
-
* @since 0.10.0
|
|
25
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
26
|
-
*/
|
|
27
|
-
final class RestrictedClassesSniff extends AbstractClassRestrictionsSniff {
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Groups of classes to restrict.
|
|
31
|
-
*
|
|
32
|
-
* Example: groups => array(
|
|
33
|
-
* 'lambda' => array(
|
|
34
|
-
* 'type' => 'error' | 'warning',
|
|
35
|
-
* 'message' => 'Avoid direct calls to the database.',
|
|
36
|
-
* 'classes' => array( 'PDO', '\Namespace\Classname' ),
|
|
37
|
-
* )
|
|
38
|
-
* )
|
|
39
|
-
*
|
|
40
|
-
* @return array
|
|
41
|
-
*/
|
|
42
|
-
public function getGroups() {
|
|
43
|
-
return array(
|
|
44
|
-
|
|
45
|
-
'mysql' => array(
|
|
46
|
-
'type' => 'error',
|
|
47
|
-
'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.',
|
|
48
|
-
'classes' => array(
|
|
49
|
-
'mysqli',
|
|
50
|
-
'PDO',
|
|
51
|
-
'PDOStatement',
|
|
52
|
-
),
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DB;
|
|
11
|
-
|
|
12
|
-
use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Verifies that no database related PHP functions are used.
|
|
16
|
-
*
|
|
17
|
-
* "Avoid touching the database directly. If there is a defined function that can get
|
|
18
|
-
* the data you need, use it. Database abstraction (using functions instead of queries)
|
|
19
|
-
* helps keep your code forward-compatible and, in cases where results are cached in memory,
|
|
20
|
-
* it can be many times faster."
|
|
21
|
-
*
|
|
22
|
-
* @link https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#database-queries
|
|
23
|
-
*
|
|
24
|
-
* @since 0.10.0
|
|
25
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
26
|
-
*/
|
|
27
|
-
final class RestrictedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Groups of functions to restrict.
|
|
31
|
-
*
|
|
32
|
-
* Example: groups => array(
|
|
33
|
-
* 'lambda' => array(
|
|
34
|
-
* 'type' => 'error' | 'warning',
|
|
35
|
-
* 'message' => 'Use anonymous functions instead please!',
|
|
36
|
-
* 'functions' => array( 'file_get_contents', 'create_function' ),
|
|
37
|
-
* )
|
|
38
|
-
* )
|
|
39
|
-
*
|
|
40
|
-
* @return array
|
|
41
|
-
*/
|
|
42
|
-
public function getGroups() {
|
|
43
|
-
return array(
|
|
44
|
-
|
|
45
|
-
'mysql' => array(
|
|
46
|
-
'type' => 'error',
|
|
47
|
-
'message' => 'Accessing the database directly should be avoided. Please use the $wpdb object and associated functions instead. Found: %s.',
|
|
48
|
-
'functions' => array(
|
|
49
|
-
'mysql_*',
|
|
50
|
-
'mysqli_*',
|
|
51
|
-
'mysqlnd_ms_*',
|
|
52
|
-
'mysqlnd_qc_*',
|
|
53
|
-
'mysqlnd_uh_*',
|
|
54
|
-
'mysqlnd_memcache_*',
|
|
55
|
-
'maxdb_*',
|
|
56
|
-
),
|
|
57
|
-
'allow' => array(
|
|
58
|
-
'mysql_to_rfc3339' => true,
|
|
59
|
-
),
|
|
60
|
-
),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DB;
|
|
11
|
-
|
|
12
|
-
use WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Flag potentially slow queries.
|
|
16
|
-
*
|
|
17
|
-
* @link https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/#uncached-pageload
|
|
18
|
-
*
|
|
19
|
-
* @since 0.3.0
|
|
20
|
-
* @since 0.13.0 Class name changed: this class is now namespaced.
|
|
21
|
-
* @since 1.0.0 This sniff has been moved from the `VIP` category to the `DB` category.
|
|
22
|
-
*/
|
|
23
|
-
final class SlowDBQuerySniff extends AbstractArrayAssignmentRestrictionsSniff {
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Groups of variables to restrict.
|
|
27
|
-
*
|
|
28
|
-
* @return array
|
|
29
|
-
*/
|
|
30
|
-
public function getGroups() {
|
|
31
|
-
return array(
|
|
32
|
-
'slow_db_query' => array(
|
|
33
|
-
'type' => 'warning',
|
|
34
|
-
'message' => 'Detected usage of %s, possible slow query.',
|
|
35
|
-
'keys' => array(
|
|
36
|
-
'tax_query',
|
|
37
|
-
'meta_query',
|
|
38
|
-
'meta_key',
|
|
39
|
-
'meta_value',
|
|
40
|
-
),
|
|
41
|
-
),
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Callback to process each confirmed key, to check value.
|
|
47
|
-
*
|
|
48
|
-
* @param string $key Array index / key.
|
|
49
|
-
* @param mixed $val Assigned value.
|
|
50
|
-
* @param int $line Token line.
|
|
51
|
-
* @param array $group Group definition.
|
|
52
|
-
*
|
|
53
|
-
* @return bool Always returns TRUE as the value is irrelevant.
|
|
54
|
-
*/
|
|
55
|
-
public function callback( $key, $val, $line, $group ) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
}
|
package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DateTime;
|
|
11
|
-
|
|
12
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
13
|
-
use PHPCSUtils\Utils\PassedParameters;
|
|
14
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
15
|
-
use WordPressCS\WordPress\AbstractFunctionParameterSniff;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Don't use current_time() to get a (timezone corrected) "timestamp".
|
|
19
|
-
*
|
|
20
|
-
* Disallow using the current_time() function to get "timestamps" as it
|
|
21
|
-
* doesn't produce a *real* timestamp, but a "WordPress timestamp", i.e.
|
|
22
|
-
* a Unix timestamp with current timezone offset, not a Unix timestamp ansich.
|
|
23
|
-
*
|
|
24
|
-
* @link https://developer.wordpress.org/reference/functions/current_time/
|
|
25
|
-
* @link https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
|
|
26
|
-
* @link https://core.trac.wordpress.org/ticket/40657
|
|
27
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1791
|
|
28
|
-
*
|
|
29
|
-
* @since 2.2.0
|
|
30
|
-
*/
|
|
31
|
-
final class CurrentTimeTimestampSniff extends AbstractFunctionParameterSniff {
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The group name for this group of functions.
|
|
35
|
-
*
|
|
36
|
-
* @since 2.2.0
|
|
37
|
-
*
|
|
38
|
-
* @var string
|
|
39
|
-
*/
|
|
40
|
-
protected $group_name = 'current_time';
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* List of functions to examine.
|
|
44
|
-
*
|
|
45
|
-
* @since 2.2.0
|
|
46
|
-
*
|
|
47
|
-
* @var array<string, true> Key is function name, value irrelevant.
|
|
48
|
-
*/
|
|
49
|
-
protected $target_functions = array(
|
|
50
|
-
'current_time' => true,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Process the parameters of a matched function.
|
|
55
|
-
*
|
|
56
|
-
* @since 2.2.0
|
|
57
|
-
*
|
|
58
|
-
* @param int $stackPtr The position of the current token in the stack.
|
|
59
|
-
* @param string $group_name The name of the group which was matched.
|
|
60
|
-
* @param string $matched_content The token content (function name) which was matched
|
|
61
|
-
* in lowercase.
|
|
62
|
-
* @param array $parameters Array with information about the parameters.
|
|
63
|
-
*
|
|
64
|
-
* @return void
|
|
65
|
-
*/
|
|
66
|
-
public function process_parameters( $stackPtr, $group_name, $matched_content, $parameters ) {
|
|
67
|
-
/*
|
|
68
|
-
* We already know there will be valid open & close parentheses as otherwise the parameter
|
|
69
|
-
* retrieval function call would have returned an empty array, so no additional checks needed.
|
|
70
|
-
*/
|
|
71
|
-
$open_parens = $this->phpcsFile->findNext( \T_OPEN_PARENTHESIS, $stackPtr );
|
|
72
|
-
$close_parens = $this->tokens[ $open_parens ]['parenthesis_closer'];
|
|
73
|
-
|
|
74
|
-
/*
|
|
75
|
-
* Check whether the first parameter is a timestamp format.
|
|
76
|
-
*/
|
|
77
|
-
$type_param = PassedParameters::getParameterFromStack( $parameters, 1, 'type' );
|
|
78
|
-
if ( false === $type_param ) {
|
|
79
|
-
// Type parameter not found. Bow out.
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
$content_type = '';
|
|
84
|
-
for ( $i = $type_param['start']; $i <= $type_param['end']; $i++ ) {
|
|
85
|
-
if ( isset( Tokens::$emptyTokens[ $this->tokens[ $i ]['code'] ] ) ) {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if ( isset( Tokens::$textStringTokens[ $this->tokens[ $i ]['code'] ] ) ) {
|
|
90
|
-
$content_type = trim( TextStrings::stripQuotes( $this->tokens[ $i ]['content'] ) );
|
|
91
|
-
if ( 'U' !== $content_type && 'timestamp' !== $content_type ) {
|
|
92
|
-
// Most likely valid use of current_time().
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if ( isset( Tokens::$heredocTokens[ $this->tokens[ $i ]['code'] ] ) ) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/*
|
|
104
|
-
* If we're still here, we've encountered an unexpected token, like a variable or
|
|
105
|
-
* function call. Bow out as we can't determine the runtime value.
|
|
106
|
-
*/
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
$gmt_true = false;
|
|
111
|
-
|
|
112
|
-
/*
|
|
113
|
-
* Check whether the second parameter, $gmt, is a set to `true` or `1`.
|
|
114
|
-
*/
|
|
115
|
-
$gmt_param = PassedParameters::getParameterFromStack( $parameters, 2, 'gmt' );
|
|
116
|
-
if ( is_array( $gmt_param ) ) {
|
|
117
|
-
$content_gmt = '';
|
|
118
|
-
if ( 'true' === $gmt_param['clean'] || '1' === $gmt_param['clean'] ) {
|
|
119
|
-
$content_gmt = $gmt_param['clean'];
|
|
120
|
-
$gmt_true = true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/*
|
|
125
|
-
* Non-UTC timestamp requested.
|
|
126
|
-
*/
|
|
127
|
-
if ( false === $gmt_true ) {
|
|
128
|
-
$this->phpcsFile->addWarning(
|
|
129
|
-
'Calling current_time() with a $type of "timestamp" or "U" is strongly discouraged as it will not return a Unix (UTC) timestamp. Please consider using a non-timestamp format or otherwise refactoring this code.',
|
|
130
|
-
$stackPtr,
|
|
131
|
-
'Requested'
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/*
|
|
138
|
-
* UTC timestamp requested. Should use time() instead.
|
|
139
|
-
*/
|
|
140
|
-
$has_comment = $this->phpcsFile->findNext( Tokens::$commentTokens, ( $stackPtr + 1 ), ( $close_parens + 1 ) );
|
|
141
|
-
$error = 'Don\'t use current_time() for retrieving a Unix (UTC) timestamp. Use time() instead. Found: %s';
|
|
142
|
-
$error_code = 'RequestedUTC';
|
|
143
|
-
|
|
144
|
-
$code_snippet = "current_time( '" . $content_type . "'";
|
|
145
|
-
if ( isset( $content_gmt ) ) {
|
|
146
|
-
$code_snippet .= ', ' . $content_gmt;
|
|
147
|
-
}
|
|
148
|
-
$code_snippet .= ' )';
|
|
149
|
-
|
|
150
|
-
if ( false !== $has_comment ) {
|
|
151
|
-
// If there are comments, we don't auto-fix as it would remove those comments.
|
|
152
|
-
$this->phpcsFile->addError( $error, $stackPtr, $error_code, array( $code_snippet ) );
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
$fix = $this->phpcsFile->addFixableError( $error, $stackPtr, $error_code, array( $code_snippet ) );
|
|
157
|
-
if ( true === $fix ) {
|
|
158
|
-
$this->phpcsFile->fixer->beginChangeset();
|
|
159
|
-
|
|
160
|
-
for ( $i = ( $stackPtr + 1 ); $i < $close_parens; $i++ ) {
|
|
161
|
-
$this->phpcsFile->fixer->replaceToken( $i, '' );
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
$this->phpcsFile->fixer->replaceToken( $stackPtr, 'time(' );
|
|
165
|
-
$this->phpcsFile->fixer->endChangeset();
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Sniffs\DateTime;
|
|
11
|
-
|
|
12
|
-
use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Forbids the use of various native DateTime related PHP/WP functions and suggests alternatives.
|
|
16
|
-
*
|
|
17
|
-
* @since 2.2.0
|
|
18
|
-
*/
|
|
19
|
-
final class RestrictedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Groups of functions to restrict.
|
|
23
|
-
*
|
|
24
|
-
* @return array
|
|
25
|
-
*/
|
|
26
|
-
public function getGroups() {
|
|
27
|
-
return array(
|
|
28
|
-
|
|
29
|
-
/*
|
|
30
|
-
* Disallow the changing the timezone.
|
|
31
|
-
*
|
|
32
|
-
* @link https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/#manipulating-the-timezone-server-side
|
|
33
|
-
*/
|
|
34
|
-
'timezone_change' => array(
|
|
35
|
-
'type' => 'error',
|
|
36
|
-
'message' => 'Using %s() and similar isn\'t allowed, instead use WP internal timezone support.',
|
|
37
|
-
'functions' => array(
|
|
38
|
-
'date_default_timezone_set',
|
|
39
|
-
),
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
/*
|
|
43
|
-
* Use gmdate(), not date().
|
|
44
|
-
* Don't rely on the current PHP time zone as it might have been changed by third party code.
|
|
45
|
-
*
|
|
46
|
-
* @link https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/
|
|
47
|
-
* @link https://core.trac.wordpress.org/ticket/46438
|
|
48
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1713
|
|
49
|
-
*/
|
|
50
|
-
'date' => array(
|
|
51
|
-
'type' => 'error',
|
|
52
|
-
'message' => '%s() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead.',
|
|
53
|
-
'functions' => array(
|
|
54
|
-
'date',
|
|
55
|
-
),
|
|
56
|
-
),
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
}
|