Add --include-root parameter to also verify root directory#102
Add --include-root parameter to also verify root directory#102danielbachhuber merged 19 commits intowp-cli:mainfrom
Conversation
Allows warning for unexpected files in ABSPATH.
danielbachhuber
left a comment
There was a problem hiding this comment.
Thanks for the pull request!
Overall, this is headed in the right direction. Can you add some functional tests covering the change? Here is some guidance on our pull request best practices, if it's helpful.
|
@danielbachhuber I added a test to |
There was a problem hiding this comment.
I added a test to
features/checksum-core.feature. Is that what you wanted?
Yep, that's headed in the right direction.
It seems to flag plugins too. Is that expected?
$ wp core verify-checksums --include-root
Warning: File should not exist: wp-config.php
Warning: File should not exist: vanilla.wordpress.2023-01-24.000.xml
Warning: File should not exist: update.php
Warning: File should not exist: wp-cli.yml
Warning: File should not exist: white-150-square.jpg
Warning: File should not exist: mysitetitle.wordpress.2022-12-05.004.xml
Warning: File should not exist: vanilla.wordpress.2022-09-11.000.xml
Warning: File should not exist: test.jpg
Warning: File should not exist: mysitetitle.wordpress.2022-12-05.000.xml
Warning: File should not exist: wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-regex.php
Warning: File should not exist: wp-content/plugins/wordpress-importer/parsers/class-wxr-parser.php
Warning: File should not exist: wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-simplexml.php
We probably should allow wp-config.php.
Also, I didn't debug this, but wp-cli.yml is flagged for some reason without the flag included:
$ wp core verify-checksums
Warning: File should not exist: wp-cli.yml
Success: WordPress installation verifies against checksums.
Nope.
Yes. I fxied the above.
|
@paulschreiber, see: https://make.wordpress.org/cli/handbook/references/config/#config-files |
|
@chesio Would this file present on production deployments of WordPress? |
@paulschreiber Can you expand your tests to cover the expected behavior for |
Co-authored-by: Daniel Bachhuber <daniel@bachhuber.co>
… extra file checks
|
@danielbachhuber I've made changes you requested. I am not sure what tests you wanted for |
danielbachhuber
left a comment
There was a problem hiding this comment.
I am not sure what tests you wanted for 31f15fc
Specifically, to make sure there are some non-core files in wp-content and that it doesn't warn on them. We implicitly should have akismet installed, but it would be helpful to include an assertion that: 1) the directory exists, and 2) it's not included in warning output.
Co-authored-by: Daniel Bachhuber <daniel@bachhuber.co>
How do I assert the directory exists? I'm not familiar with this testing framework. Can you make that change? Also: is there a reason some |
Yep, I improved upon the tests with d755af7
I'm not sure why that happened. I removed with 63fd9e7 Thanks for your work on this, @paulschreiber ! I'll merge once the tests pass. |
|
Hm, not quite sure why this failure is happening:
|
Figured it out dc03bc8 |


Description
Add
--include-rootparameter. Allows warning for unexpected files inABSPATH.Related Issues
Fixes #81, Fixes #74.