wp-cli / checksum-command
通过比较已发布的校验和来验证文件完整性。
Requires
- wp-cli/wp-cli: ^2.5
Requires (Dev)
- wp-cli/extension-command: ^1.2 || ^2
- wp-cli/wp-cli-tests: ^4
This package is auto-updated.
Last update: 2024-09-20 12:38:14 UTC
README
通过比较已发布的校验和来验证文件完整性。
使用
此包实现了以下命令
wp core verify-checksums
验证WordPress文件与WordPress.org的校验和。
wp core verify-checksums [--include-root] [--version=<version>] [--locale=<locale>] [--insecure] [--exclude=<files>]
从WordPress.org下载当前版本的md5校验和,并将这些校验和与当前已安装的文件进行比较。
出于安全考虑,在验证校验和时避免加载WordPress。
如果您在执行此命令时遇到问题,请确保您正在根据站点管理区域“仪表板->更新”菜单中的值传递相关的--locale
和--version
参数。
选项
[--include-root]
Verify all files and folders in the root directory, and warn if any non-WordPress items are found.
[--version=<version>]
Verify checksums against a specific version of WordPress.
[--locale=<locale>]
Verify checksums against a specific locale of WordPress.
[--insecure]
Retry downloads without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
[--exclude=<files>]
Exclude specific files from the checksum verification. Provide a comma-separated list of file paths.
示例
# Verify checksums
$ wp core verify-checksums
Success: WordPress installation verifies against checksums.
# Verify checksums for given WordPress version
$ wp core verify-checksums --version=4.0
Success: WordPress installation verifies against checksums.
# Verify checksums for given locale
$ wp core verify-checksums --locale=en_US
Success: WordPress installation verifies against checksums.
# Verify checksums for given locale
$ wp core verify-checksums --locale=ja
Warning: File doesn't verify against checksum: wp-includes/version.php
Warning: File doesn't verify against checksum: readme.html
Warning: File doesn't verify against checksum: wp-config-sample.php
Error: WordPress installation doesn't verify against checksums.
# Verify checksums and exclude files
$ wp core verify-checksums --exclude="readme.html"
Success: WordPress installation verifies against checksums.
wp plugin verify-checksums
验证插件文件与WordPress.org的校验和。
wp plugin verify-checksums [<plugin>...] [--all] [--strict] [--version=<version>] [--format=<format>] [--insecure] [--exclude=<name>]
选项
[<plugin>...]
One or more plugins to verify.
[--all]
If set, all plugins will be verified.
[--strict]
If set, even "soft changes" like readme.txt changes will trigger
checksum errors.
[--version=<version>]
Verify checksums against a specific plugin version.
[--format=<format>]
Render output in a specific format.
---
default: table
options:
- table
- json
- csv
- yaml
- count
---
[--insecure]
Retry downloads without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
[--exclude=<name>]
Comma separated list of plugin names that should be excluded from verifying.
示例
# Verify the checksums of all installed plugins
$ wp plugin verify-checksums --all
Success: Verified 8 of 8 plugins.
# Verify the checksums of a single plugin, Akismet in this case
$ wp plugin verify-checksums akismet
Success: Verified 1 of 1 plugins.
安装
此包包含在WP-CLI本身中,无需额外安装。
要安装此包的最新版本(超过WP-CLI中包含的版本),请运行
wp package install [email protected]:wp-cli/checksum-command.git
贡献
我们感谢您主动为这个项目做出贡献。
贡献不仅限于代码。我们鼓励您以最适合您能力的方式做出贡献,例如编写教程、在您当地的聚会中演示、帮助其他用户解决支持问题或修订我们的文档。
对于更详细的介绍,请查看WP-CLI的贡献指南。此包遵循那些政策和指南。
报告一个错误
认为您发现了一个错误?我们非常希望您能帮助我们将其修复。
在创建新问题之前,您应该搜索现有问题,以查看是否已存在针对该问题的解决方案,或者它是否已在较新版本中修复。
一旦您进行了搜索并发现没有针对您的错误的开放或已修复问题,请创建一个新问题。请提供尽可能多的详细信息,并在可能的情况下提供明确的复现步骤。有关更多指导,请查看我们的错误报告文档。
创建一个pull request
想要贡献一个新功能?请首先打开一个新问题,讨论该功能是否适合本项目。
一旦您决定投入时间来通过您的pull request,请遵循我们创建pull request的指南,以确保这是一个愉快的体验。有关在本地工作于此包的具体信息,请参阅"设置"。
支持
GitHub问题不是用于一般支持问题,但您还可以尝试其他方式: https://wp-cli.org/#support
本 README.md 文件是使用 wp scaffold package-readme
(有关文档,请参阅 此处) 从项目的代码库动态生成的。若要提出修改建议,请针对代码库的相应部分提交 pull request。