• Resolved JPecsenyicki

    (@jpecsenyicki)


    Page load speeds on cell phone are extremely slow with Wordfence activated (30 – 50 seconds per page).

    However, desktop load speeds are normal.

    When Wordfence is deactivated, page load speed on mobile increases to acceptable levels (2 – 3 seconds).

    Have deactivated / reactivated Wordfence 3 times now, with the same results each time.

    Am currently using WordPress 6.1.1, WooCommerce 7.1.1, and WP Fastest Cache 1.0.8.

    I don’t know whether I have an incorrect setting, or if this is a recent bug. (I don’t frequently check my site on mobile, but it was probably working fine there 6 months ago.)

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @jpecsenyicki, thanks for reaching out to us.

    I tried your site from a fresh desktop and mobile browsing session on separate devices and didn’t notice any loading delays via either method despite having never cached your site content before. I’m not sure if that’s because Wordfence is currently disabled or I’m just not experiencing the same issues.

    Usually with regards to site speed, some Wordfence customers can experience problems at times when intensive processes such as scans are running although shared hosting plans, size of website content, and number of installed plugins tend to be the deciding factors in this as the majority of our ~5m site installations work without issue.

    We do constantly work on making the plugin faster, perform better, and use less resources but there are not set amounts of RAM, CPU or database queries that we know Wordfence will definitely require in each use-case.

    For a screenshot of my recommended Performance setting options – Click Here.

    You could also set max_execution_time = 60 in php.ini, Wordfence’s scan only ever attempts to use half of this value by default.

    Your WP_MEMORY_LIMIT should be set to 128M or 256M 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 here could be reached fairly easily. Your PHP memory_limit value could also be adjusted to 128M or 256M to accommodate this change.

    Aside from this, if there are any load-balancers or other APIs running on your server such as Litespeed or Cloudflare, you could check if these (or their configuration with Wordfence) are contributing in any way to the slow loading times. Cloudflare for example requires a bespoke Wordfence IP detection option selecting, and whitelisting of your own server’s IP in their settings for scans to run correctly.

    You or your host could also check out your server/PHP error logs to see if anything is failing or causing a large number of errors in the background that could be delaying content from reaching the browser.

    Let me know what you find out!

    Peter.

    Thread Starter JPecsenyicki

    (@jpecsenyicki)

    Hello Peter,

    Thank you for getting back to me so quickly.

    Did the following:

    1) Changed maximum execution time in Wordfence settings from 30 to 20. No improvement.

    2) Could not find PHP.INI file on server. Added max_execution_time=60 to .USER.INI file, instead. No improvement.

    3) Checked WP-CONFIG.PHP file. Was already set to 256M in WP_MEMORY_LIMIT.

    4) Did not contact web host regarding Litespeed or errors in background.

    However, I did export my settings for Wordfence, then deleted the plugin (clicking the Delete All Tables etc option).

    Reinstalling Wordfence from scratch seemed to fix the problem. The site had a 4 second load time upon doing this, which is a great improvement over the 40 – 50 second load time before.

    Interestingly, when I imported my previous Wordfence settings, load times were terrible again on mobile.

    Therefore, a clean reinstall was performed again. Speed on mobile is normal once more.

    My plan is to slowly change the plugin settings back to what they were originally, until I find which setting slows mobile load time.

    (If you want to close this ticket, that’s fine. Or, if you want to wait a few days until I narrow the cause down, that OK too.)

    Thread Starter JPecsenyicki

    (@jpecsenyicki)

    All settings are now the same as previously, except there are no blocking rules now.

    Before, the site had a very long list of Custom Patterns used as Blocking Rules. Some of these rules were over 3 years old.

    As far as I can tell, the problem was either due to that, or the Settings file itself somehow became corrupted.

    (As stated in the previous message, page load speed on mobile is now 2 – 4 seconds, which is acceptable given the hosting account being used.)

    Plugin Support wfpeter

    (@wfpeter)

    Thanks @jpecsenyicki for the hugely detailed steps you went to in order to identify the source of the issue. I’m really pleased the loading speeds are now in a much more acceptable range.

    It is possible, depending on quantity, that extra checks like custom blocking patterns could slow the initial page-load speed but I’d not seen a case of it before myself. With regards to the age of some of them, my advice is that Wordfence does all of the important blocking for you automatically so you don’t have to implement a manual blocking regime – which can be time consuming to keep up with current IP ranges etc. The behavior or intent of the humans/bots making these requests is more important to Wordfence when making a decision on blocking.

    Thanks again,
    Peter.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wordfence slows page loads on mobile devices’ is closed to new replies.