Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 2.2.0 #1828

Merged
merged 122 commits into from Nov 11, 2019
Merged

Release version 2.2.0 #1828

merged 122 commits into from Nov 11, 2019

Commits on May 22, 2019

  1. Travis: run the code style related and ruleset checks in separate stages

    Travis now offers stages. Using stages we can:
    - Run the code style related checks before running any unit tests and stop the build early if any are detected.
    - Remove the duplicate unit test runs - i.e. previously we had an extra (third) build against PHP 7.2 (now changed to 7.3) which would run the code style related checks, but would also re-run the unit tests. This extra build will now no longer run the unit tests.
    
    While this does mean that the unit tests will run with a slight delay (the `Sniff` and `Rulesets` stages have to finish before they start), it also means that we:
    * Get code style errors reported earlier as it's been moved to be the first stage and the build will just stop if any are found.
    * We won't be wasting Travis's resources on builds which will have to be re-run anyway.
    
    Ref: https://docs.travis-ci.com/user/build-stages/
    
    Note that `Allowed failures` is no longer listed as a separate block in the Travis result overview, but is _is_ respected.
    
    For more discussion about this:
    * travis-ci/travis-ci#7789
    * https://travis-ci.community/t/always-show-allow-failures-allowed-failures-when-build-stages-are-used/217
    * https://travis-ci.community/t/work-out-kinks-in-interactions-between-stages-allow-fail-and-fast-finish/1090
    * travis-ci/travis-ci#9677
    jrfnl committed May 22, 2019
    Copy the full SHA
    0c7aff0 View commit details
    Browse the repository at this point in the history
  2. Update .travis.yml

    ntwb committed May 22, 2019
    Copy the full SHA
    fc44f79 View commit details
    Browse the repository at this point in the history
  3. Travis: run the code style related and ruleset checks in separate sta…

    …ges (#1711)
    
    Travis: run the code style related and ruleset checks in separate stages
    
    Co-authored-by: Stephen Edgar <stephen@netweb.com.au>
    GaryJones and ntwb committed May 22, 2019
    Copy the full SHA
    3b57ee0 View commit details
    Browse the repository at this point in the history
  4. ValidHookName: bug fix / skip over array keys

    String array keys for variable array access would also be examined as part of the hook name, while those should be skipped over as they are not part of the _hook_name.
    
    This fixes that.
    
    Includes unit test.
    
    This commit also lowers the nesting level of the loop by continuing early whenever possible.
    jrfnl committed May 22, 2019
    Copy the full SHA
    c6cb5c8 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2019

  1. Copy the full SHA
    ea20e20 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2019

  1. Merge pull request #1712 from WordPress-Coding-Standards/feature/vali…

    …dhookname-bugfix
    
    ValidHookName: bug fix  / skip over array keys
    GaryJones committed Jun 3, 2019
    Copy the full SHA
    744b379 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2019

  1. Copy the full SHA
    1418e16 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2019

  1. Merge pull request #1718 from ocean90/patch-1

    Add RECOVERY_MODE_COOKIE to whitelisted core constants
    jrfnl committed Jun 5, 2019
    Copy the full SHA
    d202e46 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2019

  1. Composer: Update repo URL references

    The repo has moved organization within GitHub.
    GaryJones committed Jun 26, 2019
    Copy the full SHA
    dd25d8a View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2019

  1. Composer: Update repo URL references (#1751)

    Composer: Update repo URL references
    ntwb committed Jun 27, 2019
    Copy the full SHA
    7f2f7fe View commit details
    Browse the repository at this point in the history
  2. Travis: add "quicktest" stage for non-PR/merge builds

    The "quicktest" stage will only run a CS check, ruleset check, linting and the unit tests against low/high PHP/PHPCS combinations. This should catch most issues.
    
    The more comprehensive complete build against a larger combination of PHP/PHPCS combination will now only be run on PRs and merges to `develop`/`master`.
    jrfnl committed Jun 27, 2019
    Copy the full SHA
    c3bdb1d View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1753 from WordPress/feature/travis-add-quick-buil…

    …d-stage
    
    Travis: add "quicktest" stage for non-PR/merge builds
    jrfnl committed Jun 27, 2019
    Copy the full SHA
    da20950 View commit details
    Browse the repository at this point in the history
  4. RestrictedPHPFunctions: add error for use of date()

    As this sniff is already included in the WP Core ruleset and the enhancement request is about PHP native functions, this seemed liked a logical sniff to add this to.
    
    I've elected to make this an `error` instead of a `warning` as the code within WP Core has been cleaned up for this issue now and it would be good to prevent new instances of `date()` creeping in.
    
    Fixes 1713
    jrfnl committed Jun 27, 2019
    Copy the full SHA
    d0b9d93 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #1714 from WordPress/feature/1713-restrictedphpfun…

    …ctions-add-date
    
    RestrictedPHPFunctions: add error for use of date()
    GaryJones committed Jun 27, 2019
    Copy the full SHA
    20c735a View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    ce7e4a7 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2019

  1. Copy the full SHA
    d50ee58 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2019

  1. Documentation: Update all links to the repository (#1748)

    The GitHub repository has moved from the dedicated `WordPress-Coding-Standards` organisation to the `WordPress` organisation.
    
    This:
    * Updates all links which pointed to the old repo on GH to the new one.
    * Updates the badges in the Readme to pick up things up correctly again for the new repo.
    * Updated all links to Travis from `.org` to `.com` as the build CI has moved as well.
    dingo-d authored and jrfnl committed Jul 1, 2019
    Copy the full SHA
    fab1ed5 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1754 from johnbillion/fix/global-plugin

    Add `$plugin` to the list of global variables that shouldn't be overridden
    jrfnl committed Jul 1, 2019
    Copy the full SHA
    6994433 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2019

  1. Copy the full SHA
    0af5b18 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1755 from Rarst/patch-1

    Added remaining plugin load globals
    jrfnl committed Jul 2, 2019
    Copy the full SHA
    9784d0d View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2019

  1. WordPress ruleset: efficiency fix

    Rulesets are processed top-to-bottom, one rule at the time.
    
    For the `WordPress` ruleset, this means that PHPCS would first load the `WordPress-Core` ruleset and process all rules in that file, then read the `WordPress-Docs` ruleset and lastly, the `WordPress-Extra` ruleset.
    
    As the `WordPress-Extra` ruleset includes `WordPress-Core`, it would re-process the `WordPress-Core` ruleset a second time and then process the additional rules in the `Extra` ruleset.
    
    This means that in effect, the `WordPress-Core` ruleset is processed twice when using the `WordPress` ruleset which is inefficient.
    
    By commenting that rule out, we still document that the `WordPress` ruleset includes `WordPress-Core` without double processing the ruleset.
    jrfnl committed Jul 4, 2019
    Copy the full SHA
    8d861ab View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2019

  1. Merge pull request #1758 from WordPress/feature/wp-ruleset-efficiency…

    …-fix
    
    WordPress ruleset: efficiency fix
    dingo-d committed Jul 5, 2019
    Copy the full SHA
    173fdd6 View commit details
    Browse the repository at this point in the history
  2. Docs/WordPress.WhiteSpace.CastStructureSpacing (#1738)

    Adds documentation for the WordPress.WhiteSpace.CastStructureSpacing
    
    Related to #1722
    ckanitz authored and jrfnl committed Jul 5, 2019
    Copy the full SHA
    bf3ef48 View commit details
    Browse the repository at this point in the history
  3. Docs/WordPress.WhiteSpace.PrecisionAlignment (#1725)

    Adds documentation for the WordPress.WhiteSpace.PrecisionAlignmentSniff
    
    Related to #1722
    ckanitz authored and jrfnl committed Jul 5, 2019
    Copy the full SHA
    d00b44b View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2019

  1. Copy the full SHA
    d8baf91 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    c8c576e View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2019

  1. Docs/WordPress.WhiteSpace.DisallowInlineTabs (#1735)

    Adds documentation for the WordPress.WhiteSpace.DisallowInlineTabs sniff
    
    Related to #1722
    ckanitz authored and jrfnl committed Jul 18, 2019
    Copy the full SHA
    13a8bc1 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2019

  1. CastStructureSpacing: allow for no whitespace before a cast when used…

    … in combination with a spread operator
    
    Includes updated docs.
    
    Related 1762
    Related 1524
    jrfnl committed Jul 20, 2019
    Copy the full SHA
    42332cc View commit details
    Browse the repository at this point in the history
  2. ✨ New DisallowShortTernary sniff

    This new sniff addresses the new "_The short ternary operator must not be used._" rule which was recently added to the handbook.
    
    The sniff has been added to the `WordPress-Core` ruleset.
    
    Refs:
    * https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#ternary-operator
    * https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/
    
    Includes unit tests.
    Includes documentation.
    jrfnl committed Jul 20, 2019
    Copy the full SHA
    acbeee6 View commit details
    Browse the repository at this point in the history
  3. Core: Add upstream Generic.Arrays.DisallowShortArraySyntax sniff

    Recently a new section has been added to the handbook which forbids the use of short arrays.
    
    > Using long array syntax ( array( 1, 2, 3 ) ) for declaring arrays is generally more readable than short array syntax ( [ 1, 2, 3 ] ), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.
    >
    > Arrays must be declared using long array syntax.
    
    https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#declaring-arrays
    
    This PR add an existing upstream sniff which addresses this.
    Includes auto-fixer.
    
    Also see: https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/
    
    Loosely related to 764
    jrfnl committed Jul 20, 2019
    Copy the full SHA
    fd0a1a2 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2019

  1. Merge pull request #1770 from WordPress/feature/add-disallow-short-ar…

    …rays-to-core
    
    Core: Add upstream Generic.Arrays.DisallowShortArraySyntax sniff
    dingo-d committed Jul 21, 2019
    Copy the full SHA
    80e82a2 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1768 from WordPress/feature/new-disallow-short-te…

    …rnary-sniff
    
    New DisallowShortTernary sniff
    dingo-d committed Jul 21, 2019
    Copy the full SHA
    4011319 View commit details
    Browse the repository at this point in the history
  3. PHP 7.4 compatibility / defensive coding

    WPCS is running into two PHP 7.4 issues where we use array access on a non-array value.
    This PR fixes both.
    
    Refs:
    * https://wiki.php.net/rfc/deprecate_curly_braces_array_access
    
    Build showing the issues:
    * https://travis-ci.com/WordPress/WordPress-Coding-Standards/jobs/218025587
    jrfnl committed Jul 21, 2019
    Copy the full SHA
    5fe9561 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2019

  1. GlobalVariablesOverride/PrefixAllGlobals: handle WP variables intende…

    …d to be overwritten
    
    WP Core contains the global `$content_width` variable which is intended to be set/overwritten by plugins and themes.
    
    For that reason the variable was previously removed from the `Sniff::$wp_globals` list in WPCS 0.4.0. See 276, 331.
    
    The downside of the variable not being in the list is that the `PrefixAllGlobals` sniff complains about it not being prefixed, as it doesn't realize it is a WP native global variable.
    
    The upside was that the `GlobalVariablesOverride` sniff did not complain about the variable being overwritten.
    
    Adding the variable to the `Sniff::$wp_globals` list would reverse that situation with the `PrefixAllGlobals` sniff staying silent and the `GlobalVariablesOverride` sniff starting to complain.
    
    This PR intends to solve this conundrum.
    
    * The list of WP Core globals in `Sniff::$wp_globals` should be complete and not intentionally miss certain variables without there being any documentation on why there are not listed there.
    * To still allow for the `GlobalVariablesOverride` sniff to function correctly, a new `$override_allowed` property has been added to that sniff, as well as logic to handle this.
    
    Unit tests confirming that this fixes the issue have been added to both sniffs.
    
    Additional notes:
    * There may be more variables in WP Core which are intended to be overwritten by plugins/themes. I have not verified this.
        If we do come across additional ones, it will now be easy enough to add them to the whitelist anyway.
        For now, only `content_width` and `wp_cockneyreplace` have been added.
        Also see: #924 (comment) and https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php#L123
    * This PR does not address the fact that the `Sniff::$wp_globals` list is grossly out of date. See 924
    
    Fixes 1043
    jrfnl committed Jul 23, 2019
    Copy the full SHA
    096f0cd View commit details
    Browse the repository at this point in the history
  2. EscapeOutput: improve the error message for non-escaped variables

    This improved the error message output when array variables are being accessed.
    
    ```php
    echo $strings['update-available'];
    ```
    
    **Old output:**
    `All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$strings'.`
    
    **New output:**
    `All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$strings['update-available']'.`
    
    No unit tests added as the unit tests don't test the message thrown.
    
    The effect can be tested & confirmed though by running the sniff over the above code snippet.
    
    Partially fixes 749
    jrfnl committed Jul 23, 2019
    Copy the full SHA
    47eddc7 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1776 from WordPress/feature/escape-output-improve…

    …-error-msg-variables
    
    EscapeOutput: improve the error message for non-escaped variables
    dingo-d committed Jul 23, 2019
    Copy the full SHA
    e65086e View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1773 from WordPress/feature/globalvars-prefixallg…

    …lobals-handle-content-width
    
    GlobalVariablesOverride/PrefixAllGlobals: handle WP variables intended to be overwritten
    dingo-d committed Jul 23, 2019
    Copy the full SHA
    89c2154 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2019

  1. ✨ New CodeAnalysis/EscapedNotTranslated sniff

    At times, people will accidentally forget to add the `__` when they intend to use one of the "translate + escape" functions.
    I've run into this a number of times now when reviewing/fixing code and found that they aren't that easy to spot visually when you're focussed on other things.
    
    So as it was such an easy sniff to write, I figured I may as well.
    
    AFAICS there are only two escaping functions in core which have direct "translate + escape" sister-functions.
    All the same, the sniff has been set up to allow for more similar function-combis to be added.
    
    Includes unit tests.
    Includes documentation.
    
    Sniff has been added to the `WordPress-Extra` ruleset.
    jrfnl committed Jul 24, 2019
    Copy the full SHA
    620adf2 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2019

  1. Merge pull request #1772 from WordPress/feature/php-7.4-compatibility

    PHP 7.4 compatibility / defensive coding
    dingo-d committed Jul 25, 2019
    Copy the full SHA
    6aab357 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1777 from WordPress/feature/new-codeanalysis-esca…

    …ped-not-translated-sniff
    
    New CodeAnalysis/EscapedNotTranslated sniff
    dingo-d committed Jul 25, 2019
    Copy the full SHA
    d3586ff View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2019

  1. ArrayKeySpacingRestrictions: check the size of the space on the insid…

    …e of the brackets
    
    For non-string, non-numeric array keys, WPCS demands a space on the inside of the square brackets around the array key.
    
    Up to now, the _size_ of the whitespace on the inside of the square brackets was not checked.
    
    This PR adds that check.
    
    Includes unit tests.
    Includes fixer.
    jrfnl committed Jul 27, 2019
    Copy the full SHA
    6004e4b View commit details
    Browse the repository at this point in the history
  2. ArrayKeySpacingRestrictions: fix whitespace violations in one go

    If the array key should not be surrounded by spaces and there was more than one whitespace token between a bracket and the array key, the fixer would take several loops to remove the consecutive whitespace tokens.
    
    This has been changed to fixing the whitespace in one go, reducing the chance of fixer conflicts and making the sniff more efficient.
    
    Includes unit tests.
    
    This can be tested by running the sniff with the `-v` option. Without this fix, the sniff takes 4 loops when fixing the unit test cases in this commit, with the fix, it takes 2 loops.
    jrfnl committed Jul 27, 2019
    Copy the full SHA
    23a17dc View commit details
    Browse the repository at this point in the history
  3. CastStructureSpacing: allow for spread operator (#1767)

    CastStructureSpacing: allow for spread operator
    GaryJones committed Jul 27, 2019
    Copy the full SHA
    d171c8d View commit details
    Browse the repository at this point in the history
  4. ArrayKeySpacingRestrictions: add space size check & fix errors… (#1779)

    ArrayKeySpacingRestrictions: add space size check & fix errors in one go
    GaryJones committed Jul 27, 2019
    Copy the full SHA
    3503cfc View commit details
    Browse the repository at this point in the history
  5. Travis: ignore PHP deprecation notices for stable PHPCS releases

    The unit tests will fail when a PHP warning/notice/deprecation notice is encountered.
    
    Deprecation notices thrown by already released PHPCS versions won't get fixed anymore (in that version), so failing the unit tests on those is moot and will skew the reliability of the Travis results.
    jrfnl committed Jul 27, 2019
    Copy the full SHA
    c21ccff View commit details
    Browse the repository at this point in the history
  6. Sniff: Add new is_short_list() utility method

    New utility method to determine whether a _short array_ token is in actual fact representing a PHP 7.1+ short list.
    
    This method will be short-lived in WPCS as it will be introduced in WPCS 3.5.0 and can be deprecated once the minimum required PHPCS version goes up.
    jrfnl committed Jul 27, 2019
    Copy the full SHA
    bc24df5 View commit details
    Browse the repository at this point in the history
  7. Array sniffs: ignore short lists

    While we should probably define rules for long/short list constructs, WPCS at this time, does not have a opinion on the formatting of these.
    
    The `Arrays` sniffs, however, would all treat _short lists_ as if they were _short arrays_ and apply the array rules on them.
    
    This PR fixes this by bowing out early if a short array is in actual fact a short list.
    
    Includes unit tests in each of the sniffs in the `Arrays` category affected by this issue.
    
    Fixes 1692
    jrfnl committed Jul 27, 2019
    Copy the full SHA
    ab53976 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2019

  1. Merge pull request #1780 from WordPress/feature/1692-array-sniffs-sho…

    …uld-ignore-short-lists
    
    Array sniffs: ignore short lists
    dingo-d committed Jul 28, 2019
    Copy the full SHA
    d6050e8 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1781 from WordPress/feature/travis-ignore-depreca…

    …tion-notices-phpcs-stable
    
    Travis: ignore PHP deprecation notices for stable PHPCS releases
    dingo-d committed Jul 28, 2019
    Copy the full SHA
    727fce4 View commit details
    Browse the repository at this point in the history
  3. Sniff: add new find_list_open_close() utility method

    Sister-method to the `find_array_open_close()` utility method to find the opener and closer for `list()` constructs, including short lists.
    jrfnl committed Jul 28, 2019
    Copy the full SHA
    a699e0d View commit details
    Browse the repository at this point in the history
  4. Sniff::find_array_open_close(): minor tweak

    The bracket opener array key will only be set if there is also a bracket closer.
    jrfnl committed Jul 28, 2019
    Copy the full SHA
    f30b102 View commit details
    Browse the repository at this point in the history
  5. Sniff: add new get_list_variables() utility method

    This adds a new utility method which will retrieve an array with the token pointers to the variables which are being assigned to in a `list()` construct, whether short or long list.
    
    This utility method takes all currently supported list features in PHP into account and handles the following correctly:
    * Nested lists
    * Empty list items
    * Trailing comma's in lists
    * Empty lists (no longer allowed as of PHP 7.0.0)
    * Short lists (PHP 7.1.0+)
    * Keyed lists (PHP 7.1.0+)
    jrfnl committed Jul 28, 2019
    Copy the full SHA
    c2bae67 View commit details
    Browse the repository at this point in the history
  6. PrefixAllGlobals: detect non-prefixed variables in list assignments

    Global variables to which an assignment is made via the long/short `list()` construct should also be prefixed.
    
    Includes unit tests.
    
    Related to 1774
    jrfnl committed Jul 28, 2019
    Copy the full SHA
    bd16416 View commit details
    Browse the repository at this point in the history
  7. GlobalVariablesOverride: detect global variable overrides in list ass…

    …ignments
    
    Global variables to which an assignment is made via the long/short `list()` construct should also be checked to make sure they don't override a WP global variable.
    
    Includes unit tests.
    
    Related to 1774
    jrfnl committed Jul 28, 2019
    Copy the full SHA
    f47cf7b View commit details
    Browse the repository at this point in the history
  8. Various minor doc fixes

    jrfnl committed Jul 28, 2019
    Copy the full SHA
    5853302 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2019

  1. Various minor doc fixes (#1784)

    Various minor doc fixes
    ntwb committed Jul 29, 2019
    Copy the full SHA
    d2ef2b5 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2019

  1. Merge pull request #1783 from WordPress/feature/1774-globalvarsoverri…

    …de-prefixallglobals-recognize-list-assignments
    
    PrefixAllGlobals/GlobalVariablesOverride: detect variables being set via list()
    dingo-d committed Jul 30, 2019
    Copy the full SHA
    b56232b View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2019

  1. Copy the full SHA
    605d2f7 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1741 from NielsdeBlaauw/1733-short-prefixes-error

    Fixes #1733 - Error on short prefixes
    jrfnl committed Jul 31, 2019
    Copy the full SHA
    e22e842 View commit details
    Browse the repository at this point in the history
  3. PrefixAllGlobals: add "php" to the list of blacklisted prefixes

    The `php` prefix is reserved for PHP itself.
    
    No unit tests added as the logic for this blacklist is already sufficiently unit tested.
    
    Fixes 1728
    jrfnl committed Jul 31, 2019
    Copy the full SHA
    d17d268 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2019

  1. Merge pull request #1785 from WordPress/feature/1728-prefixallglobals…

    …-blacklist-php-prefix
    
    PrefixAllGlobals: add "php" to the list of blacklisted prefixes
    dingo-d committed Aug 1, 2019
    Copy the full SHA
    45ecdf0 View commit details
    Browse the repository at this point in the history
  2. EscapeOutput: add highlight_string() to escaping functions

    While intended for code highlighting of PHP code, based on some tests I've run, the output of the PHP native `highlight_string()` function does appear to be safe, so I'm proposing to add this to the list of `$escapingFunctions`.
    
    Note: I'd appreciate some scrutiny of this PR. I wouldn't want to inadvertently add an unsafe function to the list.
    
    Refs:
    * https://3v4l.org/mYK5A
    * https://www.php.net/manual/en/function.highlight-string.php
    jrfnl committed Aug 1, 2019
    Copy the full SHA
    2f8089f View commit details
    Browse the repository at this point in the history
  3. EscapeOutput: add sanitize_key() to escaping functions

    `sanitize_key()` only allows for lowercase characters, numbers, underscore and dash characters. So a variable run through `sanitize_key()` can be considered just as safe, if not more so, than a variable run through one of the escaping functions.
    
    Ref:
    * https://developer.wordpress.org/reference/functions/sanitize_key/
    jrfnl committed Aug 1, 2019
    Copy the full SHA
    a8ad671 View commit details
    Browse the repository at this point in the history
  4. EscapeOutput: add sanitize_key() to escaping functions (#1786)

    EscapeOutput: add sanitize_key() to escaping functions
    GaryJones committed Aug 1, 2019
    Copy the full SHA
    30aef1d View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2019

  1. EscapeOutput: use Sniff::$safe_casts

    The `Sniff::$safe_casts` token list and the `EscapeOutputSniff::$safe_cast_tokens` were near duplicates.
    
    This removes the duplicate code (which can be safely removed as it is a `private` property) and adds the missing `T_UNSET_CAST` to the `Sniff::$safe_casts` list.
    jrfnl committed Aug 4, 2019
    Copy the full SHA
    3d80421 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2019

  1. Merge pull request #1788 from WordPress/feature/escapeoutput-minor-cl…

    …eanup
    
    EscapeOutput: use Sniff::$safe_casts
    dingo-d committed Aug 5, 2019
    Copy the full SHA
    05c0ee4 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2019

  1. EscapeOutput: add highlight_string() to escaping functions (#1787)

    EscapeOutput: add highlight_string() to escaping functions
    GaryJones committed Aug 6, 2019
    Copy the full SHA
    06966b2 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2019

  1. Fixed minor grammar issue

    Found this during the work on the twentytwenty theme so I thought I should just make a PR.
    dingo-d committed Sep 8, 2019
    Copy the full SHA
    10d727a View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2019

  1. Merge pull request #1793 from WordPress/feature/minor-comment-fix

    Fixed minor grammar issue
    jrfnl committed Sep 9, 2019
    Copy the full SHA
    ecb633d View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2019

  1. AlternativeFunctions: add extra unit test

    Just to be sure this was covered correctly (which it luckily was).
    jrfnl committed Sep 11, 2019
    Copy the full SHA
    75993cc View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2019

  1. AlternativeFunctions: add extra unit test (#1795)

    AlternativeFunctions: add extra unit test
    GaryJones committed Sep 12, 2019
    Copy the full SHA
    9c506d6 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2019

  1. YodaConditions: minor efficiency fix

    Performance: Don't unnecessarily use `array_merge()`.
    jrfnl committed Sep 19, 2019
    Copy the full SHA
    9a89756 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2019

  1. Merge pull request #1799 from WordPress/feature/yodaconditions-minor-…

    …efficiency-fix
    
    YodaConditions: minor efficiency fix
    dingo-d committed Sep 20, 2019
    Copy the full SHA
    2f396d1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    dda05c1 View commit details
    Browse the repository at this point in the history
  3. DisallowShortTernary: improve docs

    The valid example line was a bit too long... oops...
    jrfnl committed Sep 20, 2019
    Copy the full SHA
    54f1017 View commit details
    Browse the repository at this point in the history
  4. Documentation Class Instantiation

    oltho committed Sep 20, 2019
    Copy the full SHA
    6aec321 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2019

  1. New error handling Deprecated Classes and Functions (#1729)

    New error handling Deprecated Classes and Functions
    
    Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
    GaryJones and jrfnl committed Sep 22, 2019
    Copy the full SHA
    81a7fb2 View commit details
    Browse the repository at this point in the history
  2. DisallowShortTernary: improve docs (#1800)

    DisallowShortTernary: improve docs
    GaryJones committed Sep 22, 2019
    Copy the full SHA
    484335b View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2019

  1. Proccessed feedback from jrfnl

    oltho authored and oltho committed Sep 27, 2019
    Copy the full SHA
    aecdaa7 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2019

  1. Merge pull request #1801 from FORTE-WP/temp1

    Documentation Class Instantiation
    jrfnl committed Sep 28, 2019
    Copy the full SHA
    0d2f984 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2019

  1. CapitalPDangit: minor tweak

    Allow for the `test` TLD.
    
    Includes unit test.
    jrfnl committed Oct 3, 2019
    Copy the full SHA
    85f3016 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1804 from WordPress/feature/capitalpdangit-minor-…

    …tweak
    
    CapitalPDangit: minor tweak
    dingo-d committed Oct 3, 2019
    Copy the full SHA
    1ec0770 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2019

  1. Sniff: add new is_function_deprecated() utility function

    This new function:
    * Tries to find a function docblock, if it exists.
    * If found, checks if the docblock contains at least one `@deprecated` tag.
    
    Returns boolean true/false.
    
    Note: this method is `static` to allow the `ValidFunctionName` sniff which extends an upstream sniff to use the method as well.
    jrfnl committed Oct 4, 2019
    Copy the full SHA
    28bc144 View commit details
    Browse the repository at this point in the history
  2. ValidFunctionName: ignore deprecated functions

    Check the function docblock for a `@deprecated` tag and if found, bow out.
    
    Includes unit tests.
    
    Fixes 1797
    jrfnl committed Oct 4, 2019
    Copy the full SHA
    6226cdc View commit details
    Browse the repository at this point in the history
  3. PrefixAllGlobals: ignore deprecated functions

    Check the function docblock for a `@deprecated` tag and if found, bow out.
    
    Includes unit tests.
    
    Fixes 1797
    
    Note: the same should probably also be done for classes/interfaces/traits/constants marked as deprecated, but that's for another PR.
    jrfnl committed Oct 4, 2019
    Copy the full SHA
    d5640f8 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1806 from WordPress/feature/1797-ignore-deprecate…

    …d-functions-for-namechecks
    
    PrefixAllGlobals + ValidFunctionName: ignore deprecated methods by design
    dingo-d committed Oct 4, 2019
    Copy the full SHA
    e7bfc16 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2019

  1. DeprecatedClasses: update the sniff

    jrfnl committed Oct 7, 2019
    Copy the full SHA
    b5f989d View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1809 from WordPress/feature/deprecatedclasses-upd…

    …ate-list
    
    DeprecatedClasses: update the sniff
    dingo-d committed Oct 7, 2019
    Copy the full SHA
    313ddea View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2019

  1. Docs/WordPress.Arrays.ArrayIndentation (#1744)

    Adds documentations for the WordPress.Arrays.ArrayIndentation sniff
    
    Related to #1722
    Mike-Hermans authored and jrfnl committed Oct 13, 2019
    Copy the full SHA
    e38cee8 View commit details
    Browse the repository at this point in the history
  2. Docs/ArrayKeySpacingRestrictions and Array.MultipleStatementAlignment (

    …#1737)
    
    Adds documentations for the `WordPress.Arrays.ArrayKeySpacingRestrictions` sniff and the `WordPress.Arrays.MultipleStatementAlignment` sniff.
    
    Related to #1722
    Mike-Hermans authored and jrfnl committed Oct 13, 2019
    Copy the full SHA
    058be1b View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2019

  1. DeprecatedFunctions: update function list

    ... with functions which will be deprecated in WP 5.3.
    
    Not updating the `Sniff::$minimum_supported_version` property yet as WP 5.3 has not yet been released.
    jrfnl committed Oct 14, 2019
    Copy the full SHA
    5c82777 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2019

  1. ValidHookName: minor efficiency tweaks

    Instead of checking whether a `..._deprecated()` function was matched after the function matching, remove the deprecated hook invocation functions from the target function array in `getGroups()`.
    
    This allows the sniff to fail earlier.
    
    Also remove redundant check for `$parameters[1]`. If there are no parameters, the `process_parameters()` function wouldn't be called anyway.
    jrfnl committed Oct 22, 2019
    Copy the full SHA
    0e88b83 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2019

  1. ValidHookName: add documentation

    Related to 1722
    jrfnl committed Oct 23, 2019
    Copy the full SHA
    62d9924 View commit details
    Browse the repository at this point in the history
  2. New "DateTime.RestrictedFunctions" sniff

    This introduces a new `WordPress.DateTime.RestrictedFunctions` sniff which initially includes two groups:
    * `timezone_change` - moved from the `WordPress.WP.TimezoneChange` sniff
    * `date` - moved from the `WordPress.PHP.RestrictedPHPFunctions` sniff (group not yet in a released WPCS version yet)
    
    The `WordPress.WP.TimezoneChange` sniff is now deprecated.
    * The sniff is no longer included in the WPCS rulesets.
    * If the sniff is explicitly included via a custom ruleset, deprecation notices will be thrown.
    * If the `exclude` property is set from with a custom ruleset, a deprecation notice will be thrown.
    
    The new sniff is now included in the `Core` ruleset.
    
    Note: once WP Core upgrades, the one instance of using `date_default_timezone_set()` in WP Core (in `wp-settings.php`) will need to be whitelisted inline.
    There are a few more occurrences in the unit tests, but those can be ignored via file based excludes.
    
    Fixes 1805
    jrfnl committed Oct 23, 2019
    Copy the full SHA
    7947bce View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2019

  1. Merge pull request #1810 from WordPress/feature/update-deprecated-fun…

    …ctions-list-wp-5.3
    
    DeprecatedFunctions: update function list
    dingo-d committed Oct 24, 2019
    Copy the full SHA
    d803011 View commit details
    Browse the repository at this point in the history
  2. EscapeOutput: allow for typical pattern with _deprecated_file()

    The first parameter passed to `_deprecated_file()` generally is `basename( __FILE__ )` based on the code currently in WP Core.
    As the result of that function call is safe, I'm proposing making an exception for that particular code pattern.
    
    Includes unit tests.
    
    Note: the current code does not allow for comments in the first parameter. This would be rare encounter in these function calls anyway and allowance for it can be added later if needs be.
    jrfnl committed Oct 24, 2019
    Copy the full SHA
    864e4fd View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2019

  1. ValidHookName: minor efficiency tweaks (#1815)

    ValidHookName: minor efficiency tweaks
    GaryJones committed Oct 27, 2019
    Copy the full SHA
    1563450 View commit details
    Browse the repository at this point in the history
  2. ValidHookName: add documentation (#1817)

    ValidHookName: add documentation
    GaryJones committed Oct 27, 2019
    Copy the full SHA
    fcaf02b View commit details
    Browse the repository at this point in the history
  3. New "DateTime.RestrictedFunctions" sniff (#1807)

    New "DateTime.RestrictedFunctions" sniff
    GaryJones committed Oct 27, 2019
    Copy the full SHA
    619ced0 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1818 from WordPress/feature/escapeoutput-toleranc…

    …e-first-param-deprecated-file
    
    EscapeOutput: allow for typical pattern with `_deprecated_file()`
    dingo-d committed Oct 27, 2019
    Copy the full SHA
    3b204a6 View commit details
    Browse the repository at this point in the history
  5. ✨ New DateTime.CurrentTimeTimestamp sniff

    This new sniff adds a check for use of current_time() to retrieve a timestamp.
    
    A (fixable) `error` will be thrown when the `$gmt` parameter is set to `true` or `1`, a `warning` when it is not.
    
    Includes unit tests.
    Includes fixer.
    Includes documentation.
    
    This new sniff has been added to the `Core` ruleset.
    
    Fixes 1791
    jrfnl committed Oct 27, 2019
    Copy the full SHA
    e4f838c View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2019

  1. ValidHookName: improve error messages

    * Trim whitespace off the "expected" and "found" values which are used in the error messages.
    * Ignore comments and PHPCS annotations when building up the "expected" and "found" values.
    * Improve line precision by throwing the error on the line where the hook name starts, not the line containing the function call.
    
    Includes unit test.
    
    The unit test basically only tests part 3 of the change. The error message improvement needs visual inspection as the message content is not tested.
    jrfnl committed Oct 28, 2019
    Copy the full SHA
    52de928 View commit details
    Browse the repository at this point in the history
  2. PrefixAllGlobals: minor efficiency tweak

    Similar to 1815, but then for the `PrefixAllGlobals` sniff, allowing it to fail earlier for calls to deprecated hooks.
    jrfnl committed Oct 28, 2019
    Copy the full SHA
    ef7f86e View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2019

  1. Merge pull request #1820 from WordPress/feature/validhookname-improve…

    …-error-messages
    
    ValidHookName: improve error messages
    dingo-d committed Oct 29, 2019
    Copy the full SHA
    ce79334 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2019

  1. Merge pull request #1808 from WordPress/feature/new-currenttime-times…

    …tamp-sniff
    
    New DateTime.CurrentTimeTimestamp sniff
    dingo-d committed Oct 30, 2019
    Copy the full SHA
    b922e44 View commit details
    Browse the repository at this point in the history
  2. PrefixAllGlobals: minor efficiency tweak (#1822)

    PrefixAllGlobals: minor efficiency tweak
    GaryJones committed Oct 30, 2019
    Copy the full SHA
    981b7d4 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2019

  1. Update default minimum supported WP version

    What with the target release date for WPCS 2.2.0 being November 11 and the target release date of WP 5.3 being November 12, updating this property before the release is probably a good idea.
    jrfnl committed Nov 1, 2019
    Copy the full SHA
    c65d63b View commit details
    Browse the repository at this point in the history
  2. Adds documentation for WordPress.WP.CronInterval

    Update WordPress/Docs/WP/CronIntervalStandard.xml
    
    Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>
    
    Update WordPress/Docs/WP/CronIntervalStandard.xml
    
    Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>
    
    Update WordPress/Docs/WP/CronIntervalStandard.xml
    
    Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>
    
    Update WordPress/Docs/WP/CronIntervalStandard.xml
    
    Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>
    
    Update WordPress/Docs/WP/CronIntervalStandard.xml
    
    Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>
    
    Seperates function definition
    NielsdeBlaauw committed Nov 1, 2019
    Copy the full SHA
    86d7dbc View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2019

  1. ✨ New NamingConventions.ValidPostTypeSlug sniff

    Adds a new `WordPress.NamingConventions.ValidPostTypeSlug` sniff.
    
    Checks if the first parameter given to a register_post_type() call is actually a valid value.
    NielsdeBlaauw authored and jrfnl committed Nov 2, 2019
    Copy the full SHA
    ae449aa View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1829 from WordPress/feature/update-minimum-wp-ver…

    …sion-property
    
    Update default minimum supported WP version
    dingo-d committed Nov 2, 2019
    Copy the full SHA
    7a626f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2019

  1. Docs: Add PostsPerPage XML doc

    See #1722.
    GaryJones committed Nov 4, 2019
    Copy the full SHA
    9eeeb6c View commit details
    Browse the repository at this point in the history
  2. Adds documentation for WordPress.WP.CronInterval (#1823)

    Adds documentation for WordPress.WP.CronInterval
    GaryJones committed Nov 4, 2019
    Copy the full SHA
    5cc744f View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2019

  1. Copy the full SHA
    093a725 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2019

  1. Merge pull request #1732 from WordPress/docs/posts-per-page

    Docs: Add PostsPerPage XML doc
    jrfnl committed Nov 6, 2019
    Copy the full SHA
    ed52f7d View commit details
    Browse the repository at this point in the history
  2. Ini_set: add documentation (#1730)

    NielsdeBlaauw authored and jrfnl committed Nov 6, 2019
    Copy the full SHA
    e7560d1 View commit details
    Browse the repository at this point in the history
  3. Various minor documentation fixes

    ... picked up along the way.
    jrfnl committed Nov 6, 2019
    Copy the full SHA
    a2a32d1 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    9bd5f9c View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2019

  1. Various minor documentation fixes (#1831)

    Various minor documentation fixes
    GaryJones committed Nov 7, 2019
    Copy the full SHA
    31b8d9b View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1824 from NielsdeBlaauw/1722-WordPress.WP.Enqueue…

    …dResources
    
    Adds documentation for WordPress.WP.EnqueuedResources.
    GaryJones committed Nov 7, 2019
    Copy the full SHA
    e105835 View commit details
    Browse the repository at this point in the history
  3. Adds WP.Security.SafeRedirect documentation. (#1826)

    Adds WP.Security.SafeRedirect documentation.
    GaryJones committed Nov 7, 2019
    Copy the full SHA
    84033ee View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2019

  1. Changelog for WPCS 2.2.0

    * Release date set at this **Monday November 11th**.
    * Includes all currently merged changes.
    jrfnl committed Nov 8, 2019
    Copy the full SHA
    e004a3e View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2019

  1. Merge pull request #1833 from WordPress/feature/changelog-2.2.0

    Changelog for WPCS 2.2.0
    jrfnl committed Nov 11, 2019
    Copy the full SHA
    d45f5e5 View commit details
    Browse the repository at this point in the history