You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verification checks skipped when plugin missing main PHP file #121
Recently ran into a situation where a website had malware reinfection issues which required a bit of a deep dive to resolve. During the process I discovered that wp plugin verify-checksums --all will only check plugins which have their main plugin.php file. For example, let's install a plugin then break the main file by renaming:
Now if we try and run wp plugin verify-checksums wordfence we'll get the following:
Warning: The 'wordfence' plugin could not be found.
Error: You need to specify either one or more plugin slugs to check or use the --all flag to check all plugins.
Also if we run wp plugin verify-checksums --all it will say success and not even attempt to run any checks on the /wordfence/ directory. This is a problem as bad actors can use this method to hide files in these shadow plugin folders. Also there is no indication that these PHP files exist from /wp-admin/plugins.php.
I think the solution should be to run checksums verifications based solely on the directory names. If a plugin directory matches a wordpress.org plugin then maybe run the verification checks?
#143 is an attempt at this. The checksum verification requires a plugin version though, and if the main PHP file is missing, there's usually no version information. One workaround is to fetch the latest version from dotorg and use that (assuming you have the latest version installed), but that's fragile. Of course one could provide --version manually.
Worth keeping in mind that if a main plugin file is missing or renamed, the plugin won't be active anyway.
Activity
danielbachhuber commentedon Jan 22, 2024
Interesting report!
I agree, this is worth putting together an enhancement for.
swissspidy commentedon May 27, 2026
#143 is an attempt at this. The checksum verification requires a plugin version though, and if the main PHP file is missing, there's usually no version information. One workaround is to fetch the latest version from dotorg and use that (assuming you have the latest version installed), but that's fragile. Of course one could provide
--versionmanually.Worth keeping in mind that if a main plugin file is missing or renamed, the plugin won't be active anyway.