This documentation is only valid for older versions of Wordfence. If you are using Wordfence 7 or later, please visit our new documentation.

My scans don't finish. What would cause that?

From Wordfence Documentation
Revision as of 15:09, 8 July 2016 by WFMattr (Talk | contribs)

Jump to: navigation, search

The following solutions have worked for some users:

Check your Wordfence version

First make sure you are running the newest version of Wordfence.

Adjusting the max execution time

Go to wordfence “options” page
Scroll to the bottom Set “Maximum execution time for each scan stage” to 15 seconds. Don’t forget to “Save”.
Try another scan.
If the scan does not complete, try this instead:
Go to the bottom of Wordfence “diagnostics” page.
Click the option to view your configuration.
Look for max_execution_time
Set the “Maximum execution time for each scan stage” to about 80% of that value. So if it’s 90, try setting the option to 75.
Try another scan and see if that works.

Explanation: Wordfence scans run for a few seconds up to several minutes. Most web servers don’t allow processes that run for several minutes. So the way we get around that is that we start a scan, and then after “Maximum execution time for each scan stage” we pause the scan and launch another process and pick up where we left off. We try to auto-detect what the max execution time should be for your server, but sometimes we get it wrong. So we've added this advanced config parameter to allow you to tell us how long a process should be allowed to run on your server.
When you set this value, you must make sure it’s not greater than the maximum execution time that PHP allows. That is the value set in “max_execution_time”. If your web host has set an Apache config variable that limits process execution time or if they have a “killer daemon” that kills long running processes, you also need to make sure that your “Max execution time” is shorter than the max process time that these allow.
However, you don’t want to set this value too low because it will increase load on your server as Wordfence pauses and restarts every time it hits the time limit. So the trick is to find a happy medium. Often this seems to be around 15 seconds, so try that first.

Handling memory errors

If you see an error about running out of memory, you can try the following:

  • Go to the Wordfence Diagnostics page.
  • Scroll toward bottom where you’ll see an option to specify the maximum memory that Wordfence uses.
  • Try increasing this to 300 Megabytes (the default is 256 megs)
  • Do another scan.
  • If you still get an out of memory error, try increasing by another 50 and re-scan.
  • You can keep increasing by 50 megabytes, but be careful that your web server does not run out of memory, because this may cause the operating system to behave unpredictably. You can refer to your web host’s documentation to find out what the maximum memory is that you’ve been allocated.

Plugin conflicts

Two plugins have been known to cause issues with scans, with certain settings:

  • W3 Total Cache - The "Database cache" can return outdated database records during a scan. All other cache options in W3 Total Cache should be ok if the database cache is disabled. (The database cache can cause issues with some other plugins as well.)
  • Query Monitor - This plugin is helpful for query troubleshooting, but it causes all database queries to be saved, which uses lot of memory during Wordfence scans. We recommend disabling it when you are not actively using it.

Scan process ended after forking

If you get the 'Scan process ended after forking' check and make sure you have not blocked the wp-admin folder with a .htaccess file or limited access to it for the same. Make sure and allow your server's IP address access to this folder.
Shout out to Mike S who helped find this one!
Also check if you have the memcache or object-cache on the site. Memcache may have to be restarted twice in order for the object-cache to get rid of the saved cron key.

LiteSpeed web server settings

If your site is running on a LiteSpeed web server, you will need to adjust settings to prevent the server from aborting long scans:

LiteSpeed aborts Wordfence scans and updates. How do I prevent that?

Report any additional problems

Check the Wordfence activity log, which you can get to by clicking the “Wordfence” menu, then clicking the “Activity Log” tab.

Look for any errors in red that may indicate the reason for the problem. Then report this issue in our support forum with as much detail as you can, including any errors in your site's error log file. Please make sure any errors you include don’t contain sensitive information like usernames or passwords from your site.