Skip to content

Add an option to skip additional files check #75

Closed

Description

@jasongill

We use wp-cli in production on multiple very large sites to check for WordPress updates & watch for modified files via our monitoring system. We regularly run into an issue where wp core verify-checksums takes many minutes to run, due to the fact that the code searches the entire website root recursively to make a list of files for the "File should not exist" check.

I know that there is already an open issue to add the ability to skip files which would help with this issue, but I believe that an easier solution for very large sites like ours would simply be to add a command line switch that would disable the "File should not exist" check entirely.

In our environment, we use a modified version of wp-cli with lines 106 through 114 of Checksum_Core_Command.php commented out, which works perfectly and the verify-checksums process takes just seconds to complete.

Since adding the ability to skip files is probably a larger and more far-reaching task (which comes with it's own downsides - for example, we would need to maintain a list of the subdirectories to skip), would it be possible to just have a flag to disable the "additional files" feature at runtime to at least satisfy the simple use case of not wanting all files recursively listed?

Thanks and thanks again for the hard work on this tool!

Activity

  1. jasongill commented on Nov 19, 2020

    @jasongill
    ContributorAuthor

    Actually, after reviewing the code while I wrote this issue, I realized that this is actually a bug, not a feature - the code recursively lists every file in ABSPATH, but then filters out and ignores all but the ones in wp-includes/ & wp-admin/. With smarter handling of the paths that are recursed, we wouldn't even need to disable this check. I will see if I can write a patch & pull request to resolve this.

  2. jasongill commented on Nov 19, 2020

    @jasongill
    ContributorAuthor

    I have submitted a pull request that fixes this bug and removes the need for us to skip this check entirely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions