Title: Infinite loop on file scan
Last modified: May 4, 2023

---

# Infinite loop on file scan

 *  [scott8035](https://wordpress.org/support/users/scott8035/)
 * (@scott8035)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/)
 * Hi all. I’m having a problem finishing scans on one site I manage. I turned debugging
   on so I could see what files were being scanned, and it appears to be stuck in
   a loop when scanning the plugins starting at the beginning of the alphabet and
   ending with file <homedir-omitted>/wp-content/plugins/admin-columns-pro/addons/
   gravityforms/classes/Search/Comparison/Entry/Checkbox.php. In the small snippet
   of the log that I gathered, 6,000+ lines, each file was scanned 13 times, and
   the scan ran through 3.5 million files (even though there are only 25,000 files
   in the site)…so there’s a lot of repetition happening.
 * I’ll have sent the diagnostic info in, with user ID “scott8035”.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/#post-16713206)
 * Hi [@scott8035](https://wordpress.org/support/users/scott8035/), thanks for sending
   your diagnostic over.
 * In addition to that information, it’d be good to see the precise scan lines you
   speak of. You can get that information by following these steps for me:
    - Go to the **Wordfence > Tools > Diagnostics** page
    - In the “Debugging Options” section check the circle “Enable debugging mode”
    - Click to “Save Changes”.
    - **CANCEL** any current scan and start a **NEW** scan
    - Copy the last 20 lines from the Log (click the “Show Log” link) or so of the
      activity log **once the scan finishes/fails** and paste them in this post.
 * [Wordfence > Tools > Diagnostic > Debugging Screenshot](https://www.wordfence.com/wp-content/uploads/2021/09/enabledebuggingmode.png)
 * Thanks,
   Peter.
 *  Thread Starter [scott8035](https://wordpress.org/support/users/scott8035/)
 * (@scott8035)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/#post-16714617)
 * Hi Peter. I sent the debugging log info to [wftest@wordfence.com](https://wordpress.org/support/topic/infinite-loop-on-file-scan/wftest@wordfence.com?output_format=md)
   on behalf of forum user “scott8035”. The last couple dozen lines are:
   SITE: [https://dev.acornfinance.dev](https://dev.acornfinance.dev)
   PLUGIN VERSION: 7.9.2WORDPRESS VERSION: 6.2LICENSE KEY: 8cce28ec0a5485825aef30968dd23cd63a3f1861f5ca7468b48900a7b6e9396d46032b9877294f3b4d4c5be4fe075e203140dc22379c92431c8abe900c094639ADMIN
   EMAIL: [it@acornfinance.com](https://wordpress.org/support/topic/infinite-loop-on-file-scan/it@acornfinance.com?output_format=md)
   LOG:Fri, 05 May 23 09:54:15 +0000::1683305655.1022:4:info::Calling Wordfence 
   API v2.26:[https://noc1.wordfence.com/stats.json](https://noc1.wordfence.com/stats.json)
   Fri, 05 May 23 09:52:09 +0000::1683305529.4071:2:error::Scan terminated with 
   error: The scan time limit of 1 hour has been exceeded and the scan will be terminated.
   This limit can be customized on the options page. <a href=”[https://www.wordfence.com/help/?query=scan-time-limit](https://www.wordfence.com/help/?query=scan-time-limit)“
   >Get More Information (opens in new tab)</a>Fri, 05 May 23 09:52:09 +0000::1683305529.4058:
   2:info::Wordfence used 190.52 MB of memory for scan. Server peak memory usage
   was: 220.52 MBFri, 05 May 23 09:52:09 +0000::1683305529.0375:4:info::Calling 
   Wordfence API v2.26:[https://noc1.wordfence.com/v2.26/?k=8cce28ec0a5485825aef30968dd23cd63a3f1861f5ca7468b48900a7b6e9396d46032b9877294f3b4d4c5be4fe075e203140dc22379c92431c8abe900c094639&amp;s=eyJ3cCI6IjYuMiIsIndmIjoiNy45LjIiLCJtcyI6ZmFsc2UsImgiOiJodHRwczpcL1wvZGV2LmFjb3JuZmluYW5jZS5kZXYiLCJzc2x2IjoyNjk0ODgyMzksInB2IjoiOC4wLjIyIiwicHQiOiJmcG0tZmNnaSIsImN2IjoiNy42OC4wIiwiY3MiOiJPcGVuU1NMXC8xLjEuMWYiLCJzdiI6Im5naW54XC8xLjIxLjUiLCJkdiI6IjEwLjUuMTctTWFyaWFEQi0xOjEwLjUuMTcrbWFyaWF-dWJ1MjAwNCIsImxhbmciOiIifQ&amp;action=record_scan_metrics](https://noc1.wordfence.com/v2.26/?k=8cce28ec0a5485825aef30968dd23cd63a3f1861f5ca7468b48900a7b6e9396d46032b9877294f3b4d4c5be4fe075e203140dc22379c92431c8abe900c094639&s=eyJ3cCI6IjYuMiIsIndmIjoiNy45LjIiLCJtcyI6ZmFsc2UsImgiOiJodHRwczpcL1wvZGV2LmFjb3JuZmluYW5jZS5kZXYiLCJzc2x2IjoyNjk0ODgyMzksInB2IjoiOC4wLjIyIiwicHQiOiJmcG0tZmNnaSIsImN2IjoiNy42OC4wIiwiY3MiOiJPcGVuU1NMXC8xLjEuMWYiLCJzdiI6Im5naW54XC8xLjIxLjUiLCJkdiI6IjEwLjUuMTctTWFyaWFEQi0xOjEwLjUuMTcrbWFyaWF-dWJ1MjAwNCIsImxhbmciOiIifQ&action=record_scan_metrics)
   Fri, 05 May 23 09:52:09 +0000::1683305529.0075:10:info::SUM_FINAL:Scan interrupted.
   You have 1 new issue to fix. See below.Fri, 05 May 23 09:52:09 +0000::1683305529.0068:
   1:info::Scan interrupted. Scanned 958553 files, 49 plugins, 3 themes, 0 posts,
   0 comments and 0 URLs in 1 hour 6 seconds.Fri, 05 May 23 09:52:09 +0000::1683305529.0060:
   1:info::——————-Fri, 05 May 23 09:52:08 +0000::1683305528.9988:4:info::Scanning:/
   www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/
   gravityforms/classes/Column/EntryConfigurator.php (Mem:46.0M)Fri, 05 May 23 09:
   52:08 +0000::1683305528.9953:4:info::Scanning: /www/dev2acornfinancedev_548/public/
   wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/Entry.
   php (Mem:46.0M)Fri, 05 May 23 09:52:08 +0000::1683305528.9916:4:info::Scanning:/
   www/dev2acornfinancedev_548/public/wp-content/plugins/admin-columns-pro/addons/
   gravityforms/classes/Column/Entry/ProductSelect.php (Mem:46.0M)Fri, 05 May 23
   09:52:08 +0000::1683305528.9881:4:info::Scanning: /www/dev2acornfinancedev_548/
   public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/
   Entry/Product.php (Mem:46.0M)Fri, 05 May 23 09:52:08 +0000::1683305528.9845:4:
   info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-
   columns-pro/addons/gravityforms/classes/Column/Entry/Original/UserIp.php (Mem:
   46.0M)Fri, 05 May 23 09:52:08 +0000::1683305528.9808:4:info::Scanning: /www/dev2acornfinancedev_548/
   public/wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Column/
   Entry/Original/User.php (Mem:46.0M)Fri, 05 May 23 09:52:08 +0000::1683305528.9766:
   4:info::Scanning: /www/dev2acornfinancedev_548/public/wp-content/plugins/admin-
   columns-pro/addons/gravityforms/classes/Column/Entry/Original/TransactionId.php(
   Mem:46.0M)
 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/#post-16723380)
 * Hi [@scott8035](https://wordpress.org/support/users/scott8035/), thanks for sending
   that over.
 * Since we allow Premium licenses to be shared between corresponding dev, staging,
   and test domains you _could_ reach out for support on this issue in our Premium
   support ticketing system at [https://support.wordfence.com](https://support.wordfence.com).
   Please notify them of the information you’ve already sent to wftest if you do,
   so you don’t need to duplicate anything you’ve done so far.
 * Scan timeouts can be caused by server platform (such as Litespeed that needs 
   to be told not to abort), or other factors such as excessively large files or
   just a large number of files rather than the individual sizes. Have you already
   attempted to increase the scan duration as mentioned in the error?
 * I see `max_execution_time = 300` in your **php.ini**. Wordfence’s scan only ever
   attempts to use half of this value by default but there have been known problems
   with timeouts when higher values than `60` are set, so it could be worth making
   this change for sure.
 * For a screenshot of my recommended Performance setting options too – [Click Here](https://www.wordfence.com/wp-content/uploads/2021/09/maxexescanperformance.png).
 * Your `WP_MEMORY_LIMIT` could be set to `256M` or `512M` in **wp-config.php**.
   WooCommerce, for example, recommend 64M minimum, so if you also have many hits
   on the site at once especially during a Wordfence scan, a lower limit (like the
   40M I see here currently) could be reached fairly easily. Also check your PHP`
   memory_limit` value matches when making this change.
 * Thanks again,
   Peter.
 *  Thread Starter [scott8035](https://wordpress.org/support/users/scott8035/)
 * (@scott8035)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/#post-16723903)
 * You must have forgotten about the original description…the reason the scan stops
   is because the scan limit was reached, so it self-terminates. The reason it reaches
   the scan limit is because it’s in an infinite loop going over the same range 
   of files again and again. It never makes it completely through the plugin directory,
   it restarts while still in the range of plugins starting with an “A”.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Infinite loop on file scan’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [scan](https://wordpress.org/support/topic-tag/scan/)

 * 4 replies
 * 2 participants
 * Last reply from: [scott8035](https://wordpress.org/support/users/scott8035/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/infinite-loop-on-file-scan/#post-16723903)
 * Status: not resolved