Code Monkey home page Code Monkey logo

Comments (10)

danielbachhuber avatar danielbachhuber commented on May 26, 2024

Hi @ericgopak,

Thanks for the report. This should already be accommodated for with https://github.com/wp-cli/wp-cli/pull/3268/files. Is there additional detail you can provide that might explain how your configuration is different?

from checksum-command.

ericgopak avatar ericgopak commented on May 26, 2024

Hi @danielbachhuber ,
The fix looks good by the look of it :) It seems to take care of both wp-admin/ and wp-includes/, which was exactly the problem.

I don't currently have a setup to check out WP-CLI from Git, so I can't actually test it. But I think it's fine.

Thanks! I think you can close this issue for now.

from checksum-command.

danielbachhuber avatar danielbachhuber commented on May 26, 2024

@ericgopak To clarify, that change was implemented in v0.25.0. WP-CLI is currently at v1.5.0.

If the issue still manifests itself for you locally, then we'll need more detail on how to reproduce in order to help resolve. Our bug reporting guidelines offer a template you can follow.

from checksum-command.

ericgopak avatar ericgopak commented on May 26, 2024

@danielbachhuber Sorry for taking so long to respond. A quick peek into the issue has shown that the issue might be Windows-specific (my current working OS), and is still present in the latest WP-CLI version (v1.5.0). I want to help you out on this. I guess I should write a more detailed bug report and then I could fix it myself and submit a pull request.

I'm new to WP-CLI codebase, but I'm happy to submit my first pull request in the upcoming days.

If you agree, then we can re-open the issue and I'll proceed as described above.

from checksum-command.

florianbrinkmann avatar florianbrinkmann commented on May 26, 2024

I have the same problem (does not work via CMD, but works with the Windows Subsystem for Linux). I think the problem is that in the filter_file() method (https://github.com/wp-cli/checksum-command/blob/master/src/Checksum_Core_Command.php#L140) there is a check for /, but Windows has \ (so for example, $filepath could be wp-content\index.php), so the ^wp-(?!config\.php)([^\/]*)$ regex matches everything with wp- at the beginning on Windows.

Unfortunately, I have no idea how to check if another regex would work, because I cannot edit the content of wp-cli.phar in PhpStorm… Btw: would be great if there would be some post on how to develop for the WP-CLI (how to open the .phar for debugging/testing (if that is the right way to do it), …) :)

from checksum-command.

danielbachhuber avatar danielbachhuber commented on May 26, 2024

Thanks for the additional detail, @florianbrinkmann. It makes sense that this is a bug specific to Windows.

Btw: would be great if there would be some post on how to develop for the WP-CLI

See https://make.wordpress.org/cli/handbook/

from checksum-command.

florianbrinkmann avatar florianbrinkmann commented on May 26, 2024

Thanks @danielbachhuber, found it – I already was aware of the handbook and searched there, but not in the Pull Requests chapter…

from checksum-command.

ericgopak avatar ericgopak commented on May 26, 2024

Thank you, @danielbachhuber and @florianbrinkmann, I've followed the guidelines for setting up WP-CLI for development locally.

Indeed, the issue was with the regex, which assumed only regular (*nix-style) slashes. Adding the backslash (escaped as \\\\) solved the problem for me.

And to make it all a somewhat better bug report, here are steps to reproduce the issue:

  1. Have a fresh WordPress installation
  2. Create a new file under /wp-content/ so that the path to the file includes either /wp-admin/ or /wp-includes/, e.g. wordpress/wp-content/themes/MyTheme/wp-includes/some_file.php
  3. Run wp core verify-checksums from the root of this WordPress installation

Notes on the tested environment:

$ wp --info
OS:     Windows NT 6.3 build 9600 (Windows 8.1 Professional Edition) AMD64
Shell:  /bin/bash
PHP binary:     /XXX/WAMP/bin/php/php7.0.10/php
PHP version:    7.0.10
php.ini used:   X:\XXX\WAMP\bin\php\php7.0.10\php.ini
WP-CLI root dir:        X:\XXX\wp-cli
WP-CLI vendor dir:      X:\XXX\wp-cli/vendor
WP_CLI phar path:
WP-CLI packages dir:    X:\XXX\home\XXX/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.0.0-alpha

from checksum-command.

ericgopak avatar ericgopak commented on May 26, 2024

Update: actually, it seems that the issue was more generic - with that bug in the regex expression any paths in any wp-*\ folders were reported as File should not exist. With the changes from the pull request above this is no longer happening.

from checksum-command.

gitlost avatar gitlost commented on May 26, 2024

Closing this via #39

from checksum-command.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.