Malware scanning
What WP Waterfall scans for malware in your files and your database, when, what happens when it finds something, and how to tell support a finding is wrong.
WP Waterfall scans every file that enters your site with two scanners together: ClamAV, an open source antivirus engine whose database updates several times a day, and WP Waterfall's own rules, which look for what antivirus databases often miss in WordPress sites, such as PHP backdoors that hide their code, known web shell file names, PHP files in uploads, PHP code behind the name of a picture or a style sheet, PHP files in hidden folders, and a .user.ini that runs another file before every page.
WP Waterfall also scans the database of every running site once a day, because malware that is removed from the files often comes back from a row in the database. See The database scan.
The scanners run on WP Waterfall's own servers. Your files and your database rows are never sent to another company.
What is scanned
| What enters your site | When it is scanned | If something looks like malware |
|---|---|---|
| A migration from another host | Every file of the backup, before anything is copied | The migration stops and waits for you. See Migrate a site. |
| A database import | While it uploads | The import is refused with the reason. |
| A deploy (a Git push, a deploy, a promote to live, or an update that WP Waterfall commits) | Every new or changed file of the release, after the build and before it goes live | The deploy stops. The release that was running keeps running. |
| A plugin or theme you install from the WordPress directory | The whole package, before it is unpacked into the site | Nothing is installed. |
| Files that arrive another way: SFTP uploads, pictures uploaded in WordPress, files a plugin writes, and updates in SFTP mode | Code (PHP, JavaScript, .htaccess, and the like) within minutes of arriving, every other new or changed file by itself in every environment (see below), and everything new when you choose Scan now |
The file is moved to quarantine (see below). |
| A plugin or theme you activate with WP Waterfall in SFTP mode (the dashboard, the API, an assistant, or WP-CLI) | The files of its folder that no scan has read yet, right before it is activated | It is not activated. See Activating a plugin or theme that holds malware. |
| Rows in the database of a running site: settings, posts, comments, meta, links, and administrator accounts | Once a day in every running environment, and when you choose Scan now | The row is listed. It is never moved, changed, or deleted. See The database scan. |
Pictures, video, and fonts over 1 MB are not sent to ClamAV in the scans of a whole site or release, because they are most of a site's size and rarely carry malware. Smaller ones are scanned. A file over 100 MB is scanned in part.
Your database is read in three cases: a database import file is scanned while it uploads, the check of a migration reads the rows of the backup's database (see Migrate a site), and the database scan reads the rows of a running site.
The database scan
The database scan reads the WordPress tables of a running site with the same rules that check the database of a migration. It only reads. It never changes, moves, or deletes a row.
What it reads. The tables WordPress itself makes, with your table prefix, and the first ten sites of a Multisite network:
- settings (
options), posts and pages, and post meta; - comments, comment meta, term meta, and links;
- the accounts that have an administrator's powers, and the list of super administrators of a network.
It reads a part of each table that the rules can use: the newest rows first, no spam, no trash, no revisions, and no values too short to hold a web address. The accounts of your customers and subscribers are not read at all, so their email addresses and password hashes stay in your site.
What it looks for. The database signs listed under What the rules look for: a script or a hidden frame from an address that is not yours in a setting, a post, or a comment, a script added to many posts, ad code with switches that hide it from administrators, a stored entry that pretends to be a saved video embed, and an administrator that looks like a back door. When a row has a finding, the other rows that name the same outside address and the settings that sit with a flagged setting are listed with it.
What you see. A flagged row is in the same list as the files, on the Scans card. It shows the table, the row, the reason, and a short piece of the matched text. Secrets, password hashes, and email addresses are cut from that text. The Owners and Admins of the business, and the people added to the site, get a notice in the bell and an email when the scan flags a row it had not flagged before. A scan that finds the same row again the next day does not tell you again.
What to do about a flagged row. WP Waterfall does not edit your database. You can remove the row yourself in WordPress or in the database tools, restore a backup from before the row appeared (see Backups), or ask support to look at it. When a later scan reads the whole database and no longer flags the row, it leaves the list on its own.
When a database is too big to read in one scan. One scan reads up to 300 MB of rows and stops each table at a size and a time limit, so a scan never slows your site. If a table was cut, the card says Nothing found in what was scanned. Part of the database was too big to scan. WP Waterfall never calls such a scan clean. The newest rows are the ones that were read.
What it does not read. Tables that a plugin made for itself, such as order tables. An environment that is asleep is not woken for a scan: its database is read with the first scan after it wakes. A test site has no database scan.
What the rules look for
Beside ClamAV, WP Waterfall's own rules read what files do, not only what they are called. In a migration they look for:
- a plugin that hides itself from the plugin list, removes security plugins from the active list, or replaces its own file with code it downloads;
- a script, frame, or hidden 1x1 image loaded from an address that is not yours and not a service sites use on purpose, from PHP, a theme template, a script file, or a style sheet, and a script added to the end of a file;
- an administrator made by code, login names written to a file, and output that depends on a search engine referrer;
- a drop-in or must-use plugin that rewrites every page, and settings (
.htaccess,.user.ini) that run a file before every page or send a hidden address to a PHP file in uploads; - a PHP file in uploads that another file loads, and files of WordPress core, or of a plugin or theme from wordpress.org, that differ from the official copy;
- in the database, of a backup and of a running site: a setting that holds a web address where a cache entry should be, ad code with switches that hide it from administrators, a script added to many posts, a script or frame in a visitor comment, a stored entry that pretends to be a saved video embed, and an administrator that looks like a back door;
- in the database too: the settings and the packed data that a known backdoor leaves behind, a setting that holds nothing but the address of a public blockchain service (some malware reads its orders from one), and an administrator whose name a program made, such as
adm_and a row of random characters, more so when the account was made within the hour of another finding; - the same outside address in a file and in the database: when a file with a finding uses an address, a setting or a row that holds only that address is part of the same infection, and so are the settings that sit with a flagged setting (the same name prefix, or added next to it);
- a hidden file in the top folders of
wp-content, the plugins, the themes, or the uploads that no plugin owns, such as a hidden log of login names.
Each sign alone is only worth a look. Several in the same place make a finding known bad.
Files that belong to a plugin
Some plugins hold text that looks like an attack because they do the same work on purpose. Firewall plugins such as Wordfence and Really Simple Security write a setting that runs a file before every page, so their own code contains that setting. WPForms, All-in-One WP Migration, Shield, and WP STAGING write a small index.php into their folders in uploads that only hides the folder's listing. All In One Security and Sucuri keep their settings and logs in PHP files in uploads that start with a line that stops PHP, so the data after it never runs.
WP Waterfall does not trust a file because of its name or its folder. A file in a plugin from the WordPress directory is left out of the findings only when it is exactly the file that WordPress.org publishes for that plugin and version. An index.php in uploads is left out only when it holds nothing but a comment or is exactly the small file that the plugin writes. A data file of All In One Security or Sucuri is left out only when it is in that plugin's folder, starts with the exact first lines that plugin writes, and holds plain text after them. A file with the same name and any other content is still listed. A plugin that is not in the WordPress directory, such as a premium plugin, has no official copy to compare with, so a finding in it stays until support has looked at it. If you know it is safe, message Nami from the chat button.
Each scan also looks again at the files of the findings that are still listed. If the file is now fine, because WP Waterfall learned about the plugin or because the file is gone, the finding leaves the list with the next scan. You do not need to ask. A finding about a deploy that was stopped because a plugin file quotes request code in a comment leaves the list the same way, once the file is read again with the comments left out and no rule flags it. The same text in code stays flagged. A finding that support is looking at, or that WP Waterfall moved to quarantine, stays until support decides.
Changed and nulled plugins and themes
The same scans also list two things that are not malware. A file of a plugin or theme from wordpress.org that is not the file its authors published is listed as Differs from the official copy. A file that carries a sign of a nulled copy, such as a license check that always answers yes, is listed as May be a nulled copy. Both are only worth a look: they never stop a deploy, and the file stays where it is. WP Waterfall does not support nulled plugins and themes, because most carry a backdoor. See Nulled plugins and themes for what the signs are and what to do.
When it scans by itself
The malware scan has no switch. It is not a tool you turn on or off, and no plan or setting stops it. WP Waterfall scans every running environment on its own, so nothing depends on you opening the page:
- Code that arrives outside a deploy: within minutes, in every environment. Every 5 minutes the server counts the code files that no scan has read yet (PHP, JavaScript,
.htaccess,.user.ini, and the like) in the folders a scan reads, without opening them, and a scan of the new and changed files starts when it finds any. It does not matter how the file came: an SFTP upload of any length, a plugin uploaded in WordPress, or a file the site wrote. The time a file says it was last changed does not matter either: an SFTP program can keep a file's old date, so the scan goes by when the file arrived on the server, which nobody can set. - Live: every 6 hours. Visitors, plugins, and cron write to a live site all day, in Git mode too (the uploads folder is writable even when the code is not).
- Staging, previews, and branches: every 24 hours. Only your team writes there, and code your team adds is read within minutes, as above.
- The database: once a day in every running environment, with one of the scans above. The scans are spread over the day, so yours does not run at a set hour.
- Right after a scan, when there is more to read: one scan reads up to 5,000 new or changed files. If more are waiting, for example after a large SFTP upload, the next scan starts at once and reads the next part, up to 10 times in a row. After that the schedule above reads the rest.
- Right after a scan finds malware: when a scan moves a file to quarantine and had not read the database, WP Waterfall scans every file of the environment and its database at once, changed or not. It does this one time for each chain of scans.
Each scan reads only files that are new or changed since the last one, apart from the scan of every file after a finding, and WP Waterfall starts a few at a time, so it does not slow your site. When WP Waterfall adds signatures, and at least once every 30 days, the files already on your site are read again, a few thousand in each scan. An environment that is asleep is not woken for a scan, and it is scanned within 15 minutes of waking. The code of a Git mode environment is scanned when it is built, and its uploads folder is scanned by the schedule.
What quarantine means
When a scan finds a file that looks like malware in a file the site can change, WP Waterfall moves it out of the site into a quarantine folder on the server, where nothing can run it. It is never deleted. The Owners and Admins of the business, and the people added to the site, get a notice in the bell and an email that name the files, and WP Waterfall support is told.
Files that are only worth a look, such as a PHP file in uploads that matches no malware pattern, stay where they are and are listed so you can check them.
Activating a plugin or theme that holds malware
In SFTP mode, files can reach a plugin or theme folder without a deploy, so WP Waterfall checks before it activates one. It reads the files of the folder that were added or changed since the last scan (and of the parent theme of a child theme) with the same scanners, which takes seconds. It does not activate the plugin or theme when:
- a file it read now looks like malware. The sentence names the file, and the scan that follows within minutes moves it to quarantine and lists it under Scans;
- a scan already moved a file of the folder to quarantine, and no other file of the folder changed since. The rest of a plugin that came with a known bad file can hold more.
You read one sentence, such as: "WP Waterfall did not activate old-slider because wp-content/plugins/old-slider/inc/cache.php looks like malware (Php.Webshell.Generic): a scan moves it to quarantine within minutes and lists it on the Protection tab, under Scans." Nothing changes on your site.
What to do: read the finding on the Protection tab, under Scans, delete the plugin or theme, and install a clean copy from the WordPress directory or its vendor. Once a clean copy is in place, it activates. If you think the finding is wrong, message Nami from the chat button; when support puts the file back, the plugin activates too.
This check covers WP Waterfall's dashboard, the API, an assistant over MCP, and WP-CLI commands you run through WP Waterfall. Deactivating is never checked. In Git mode the code is checked when it is built, so there is nothing new to read. A plugin activated from wp-admin is not stopped by this check, and the scan within minutes still moves a known bad file. If the scanner is not answering and the folder has files no scan has read, the activation waits: try again in a few minutes.
See what was found
Open your site, pick the environment, and choose Protection. The Scans card lists the files and the database rows with the reason each was listed, and Scan now scans the new and changed files and the database right away. The malware scan and the integrity check share the card. See Protection.
You can read the same list with GET /v1/environments/{id}/malware and start a scan with POST /v1/environments/{id}/malware/scan. A database row has source: database_scan and a database object with the table, the row, and the excerpt, and last_database_scan says when the database was last scanned and whether all of it was read. An assistant connected over MCP uses list_malware_findings and scan_for_malware, in the security toolset.
If a finding is wrong
Scanners can be wrong, especially about plugin files that do unusual things on purpose. WP Waterfall checks a plugin file against the official copy of that plugin and version, and a file that matches is not listed. If a file still looks wrong to you, message Nami from the chat button and name the file. Nothing is charged.
Support then either puts the file back where it was (it was a false alarm, and later scans leave that exact file alone) or confirms that it is malware. If you change the file afterwards, it is scanned again.
A database row works the same way, with one difference: the row was never moved, so there is nothing to put back. Support marks it safe, and the scan does not list that row again for the same reason.
The API call is POST /v1/malware-findings/{id}/dispute, and the MCP tool is dispute_malware_finding, which asks you in the chat first.
If the scanner is not answering
If the scanner itself is down, WP Waterfall does not let files in unscanned. Uploads, database imports, deploys, and plugin installs are refused with a message that says so, and nothing changes on your site. Try again in a few minutes. Support is told at once.
What it does not do
- It does not clean a hacked site. If your site is already infected, the scans find files as they change, and support can help you clean it.
- It does not change your database. The database scan lists a row and leaves it where it is. In a migration, our team cleans any flagged rows by hand before the site is handed over.
- It does not read tables that a plugin made for itself, and it reads a large table in part. See The database scan.
- It does not look at visitors or block attacks. For that, see Bot protection and IP deny.
- It does not block attacks on known plugin vulnerabilities. Patchstack does that on every live site with its own domain, and it works on requests, not on files. See Vulnerability protection.
- It cannot catch every nulled plugin or theme. It lists the signs it knows, and a copy with no sign is not listed. See Nulled plugins and themes.
- It cannot catch every backdoor. ClamAV and the rules know many web shells and the usual ways of hiding code, and a PHP file added to a plugin or theme from the WordPress directory is listed as Differs from the official copy. A new or well hidden backdoor in a plugin that is not in the WordPress directory, such as a premium plugin, has no official copy to compare with and can pass every scanner. Install plugins and themes only from the WordPress directory or from their vendor.
- A clean result is not a promise that a site is safe. The integrity check is a second, different check of your WordPress core and plugin files.
Still stuck?
Email support at wpwaterfall dot com with your site name and what you tried, or send us a message.