wp-cli/checksum-command
WP-CLI command to verify WordPress core file integrity by comparing local files against published WordPress.org checksums. Supports version/locale selection, optional root checks, file exclusions, and multiple output formats.
--exclude parameter fix (PR #155) could enable granular exclusion of files/directories in hybrid Laravel-WordPress setups (e.g., ignoring Laravel’s storage/ while verifying WordPress plugins).wp-cli/wp-cli (no Laravel-native alternative).--exclude Whitespace Handling: Fixes edge cases where malformed paths could break verification. Mitigates risk for Laravel integrations using exclusions (e.g., skipping vendor/ or node_modules/).| Risk Area | Updated Assessment | Mitigation Strategy |
|---|---|---|
| WP-CLI Dependency | Unchanged. Still requires external setup. | Bundle WP-CLI as a dev dependency or use Docker. |
| WordPress-Specific | --exclude fix reduces risk of path-related failures in hybrid environments. |
Test exclusions for Laravel paths (e.g., --exclude=storage,bootstrap/cache). |
| Output Parsing | Unchanged. Still requires custom Laravel logic. | Use Laravel’s collect() to parse JSON/CSV outputs. |
| Performance | Unchanged. Large-scale verification may still be slow. | Implement async processing with Laravel Queues. |
| Security | Unchanged. --insecure flag remains a risk. |
Disable via Laravel config or override in Artisan commands. |
| Testing | --exclude fix may require retesting path-handling logic in hybrid setups. |
Validate exclusions in Dockerized WordPress + Laravel environments. |
Hybrid Exclusion Strategy
--exclude fix to skip Laravel-specific directories (e.g., storage/, vendor/) during WordPress checksum verification?wp core verify-checksums --exclude=storage,bootstrap/cache --format=json.CI/CD Workflow
deployed event)?Alternative Approaches
hash_file() or spatie/laravel-checksum replace WP-CLI for non-WordPress files (e.g., Laravel assets)?Maintenance Trade-offs
ChecksumService)?Documentation
--exclude fix does not add Laravel-native features.--exclude to filter out Laravel paths during WordPress verification (e.g., exclude storage/ or vendor/).Artisan::call('wp core verify-checksums --exclude=storage,bootstrap/cache --format=json');
wp-cli/wp-cli).| Step | Updated Action | Tools/Dependencies |
|---|---|---|
| 1. Assessment | Confirm if --exclude can reduce false positives by ignoring Laravel-specific paths. |
Test exclusions in hybrid environments. |
| 2. WP-CLI Setup | Install WP-CLI globally or via Composer (wp-cli/wp-cli). |
composer require wp-cli/wp-cli |
| 3. Laravel Integration | Extend previous approach to include --exclude for Laravel paths. |
Artisan commands or custom services |
| 4. File Path Abstraction | Use --exclude to whitelist only WordPress directories (e.g., wp-content/). |
Custom Artisan flags or config. |
| 5. Output Handling | Parse JSON/CSV output into Laravel collections (unchanged). | Laravel’s collect() |
| 6. Testing | Validate --exclude behavior with Laravel + WordPress hybrid paths. |
Dockerized setup with shared storage. |
| 7. CI/CD Integration | Add verification to pre-deployment (e.g., GitHub Actions) with exclusions. | Custom workflows |
--exclude can now safely ignore Laravel paths, reducing conflicts.public/), exclusions must be carefully configured.--exclude with Laravel paths (e.g., storage/, vendor/).wp core verify-checksums --exclude=storage,bootstrap/cache --format=json
namespace App\Services;
use Illuminate\Support\Facades\Artisan;
class WordPressChecksumVerifier {
public function verifyWithExclusions(array $exclusions): array {
$command = 'wp core verify-checksums --exclude=' . implode(',', $exclusions) . ' --format=json';
$output = Artisan::output();
return json_decode($output, true);
}
}
deployed event or a custom Artisan command.// config/checksum.php
'excluded_paths' => [
'storage',
'bootstrap/cache',
'vendor',
];
{
"scripts": {
"post-update-cmd": "composer require wp-cli/wp-cli --dev"
}
}
--exclude Fix:
--exclude skipped critical WordPress files.--exclude does not improve speed but reduces unnecessary checks.How can I help you explore Laravel packages today?