• Resolved brogr

    (@brogr)


    We keep encountering the following fatal error at least once per day. Do you know why this is happening?

    Also noticing that the site is very slow, and I suspect Wordfence. Not sure the issues are related though.

    [09-Jan-2023 12:40:26 UTC] PHP Fatal error:  Uncaught Error: Call to a member function setRules() on null in /wp-content/plugins/wordfence/lib/wordfenceClass.php:1116
    Stack trace:
    #0 /wp-content/plugins/wordfence/lib/wordfenceClass.php(1878): wordfence::initProtection()
    #1 /wp-includes/class-wp-hook.php(303): wordfence::veryFirstAction('')
    #2 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
    #3 /wp-includes/plugin.php(470): WP_Hook->do_action(Array)
    #4 /wp-settings.php(441): do_action('plugins_loaded')
    #5 /wp-config.php(127): require_once('/home/...')
    #6 /wp-load.php(50): require_once('/home/...')
    #7 /wp-admin/admin.php(34): require_once('/home/...')
    #8 /wp-adm in /wp-content/plugins/wordfence/lib/wordfenceClass.php on line 1116
    
Viewing 1 replies (of 1 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @brogr, thanks for getting in touch!

    The Wordfence error there can occur when a database server is intermittently allowing or rejecting connections. Using Wordfence’s MySQL storage engine does require an extra connection, but it only lives for the duration of a request. You may need to either allow more concurrent connections, or provide more resources to the server/instance running the site.

    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 ensure max_execution_time = 60 in php.ini, Wordfence’s scan only ever attempts to use half of this value by default but there have been known problems with higher values being set.

    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 like 40M commonly seen here could be reached fairly easily. Your PHP memory_limit value could also be adjusted to match the above value.

    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 how you get on!
    Peter.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Fatal error: Uncaught Error: Call to a member function setRules() on null’ is closed to new replies.