Defender high CPU usage when scanning files, turned off, now having PHP errors.

Hello,

When defender was running a scan of files on WordPress it was having very high CPU usage, way more than my cloud environment could handle. So, I turned off the scanning part and now I'm getting this error everywhere in the backend:

Warning: Missing argument 2 for wpdb::prepare() in /wp-includes/wp-db.php on line 1291

I also use WordFence as a WAF and file scanning which doesn't seem to have CPU issues performing similar functions.

Please advise. Thanks.

  • Cave Consulting
    • Google Cloud Partner

    Update for those who want to follow this bug, and for the staff here. The error occured because I turned off options inside file scanning without turning off the actual scanning service first. Once the service was turned off but the options inside remained on the error went away. I feel we still need to address the high CPU usage that leads me to turn this off though. Thank you.

  • Kasia Swiderska
    • Support nomad

    Hello Cave Consulting,

    Thank you for the additional info on the issue. Would you mind allowing support access so we can have a closer look at this?
    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    I checked Defender on m site and there was everything right - CPU usage did not peak up during the scan.

    Who is your hosting provider?

    kind regards,
    Kasia

  • Alex Stine
    • System Administrator

    Hello Cave Consulting
    Hope you're well!

    When I tried to access your site via support access, I got the following security error. Looks to be a miss configured SSL certificate or you are forcing SSL on the admin area without an SSL certificate.

    Could you please open up your /wp-config.php file and remove these lines if they exist.

    define('FORCE_SSL_LOGIN', true);
    define('FORCE_SSL_ADMIN', true);

    Hopefully this will allow us access to check your site.

    Awaiting your response.

    Cheers,
    Alex :smiley:

  • Cave Consulting
    • Google Cloud Partner

    Hello,

    This is just a domain mismatch, for now, we are using a certificate from another domain of ours and don't have one dedicated to that domain yet. We do encourage you to use SSL if you could please. You can click advance to view the Certificate, CA, and handshake encryption, it should be served over TLS 1.2. Then you should see the add exception button. We are not forcing HSTS headers so you will be able to add the exception in any modern browser. Thank you for understanding.

  • Alex Stine
    • System Administrator

    Hello Cave Consulting
    Hope you're well!

    Thanks for confirming about the error and I was able to check your site. From a quick look at your php limits, I recommend starting by raising your max_execution_time to a higher value. I recommend you try 300. To increase the limit, you can follow this article.
    https://premium.wpmudev.org/blog/increase-memory-limit/

    After increasing the max_execution_time you should check WPMU DEV --> Support --> SYSTEM INFO to see if the value has changed. If so, try running the Defender scan again and see what happens. It is important to remember not to run Wordfence Security at the same time since both plugins do a very thorough scan of your files.

    I didn't see Supercacher by SiteGround installed in the Network Admin --> Plugins list. Sometimes by using Memcached the same error can arise. Since the plugin does not seem to be in use, we should be able to rule this out.

    Hope this helps and looking forward to your response.

    Cheers,
    Alex :smiley:

  • Cave Consulting
    • Google Cloud Partner

    Hello,

    I did change the max_execution_time to 300, made sure WordFence wasn't running any scans or creating a conflict with Defender. I started a scan with Defender and as soon as it got to 0.44% (it is an incredibly slow scan) my CPU usage spiked. (see attached).

    I then canceled the scan and it leveled off. (see attached).

    Here is my current error log:
    https://docs.google.com/document/d/1x1rNRkPvMOOyZ1q7VSOg3oDCmGkfYEKMbntCeq-ATQ4/edit?usp=sharing

    Thanks.

  • Alex Stine
    • System Administrator

    Hello Cave Consulting
    Hope you're well!

    Could you please try a plugin/theme compatibility check just to rule out any compatibility issues?
    1. Deactivate all plugins but WP Defender Pro and WPMU DEV Dashboard.
    2. Try the scan.
    3. If the scan works, activate your plugins one by one until you find the plugin causing the issue.
    4. If it doesn't work, try switching to the Twenty Seventeen default WordPress theme.
    5. Try scanning again.

    I understand this may be a live site and if you cannot deactivate plugins or switch the theme, I recommend creating a staging site. Here are some guides to walk you through the process.
    https://premium.wpmudev.org/blog/set-up-staging-site-cheap-shared-hosting/
    &
    https://premium.wpmudev.org/blog/set-up-staging-site-cloner/

    Please let me know the results.

    Cheers,
    Alex :smiley:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.