Support » Plugin: Wordfence Security - Firewall & Malware Scan » WooCommerce Order View crashes when Wordfence is active

  • Resolved touchestudio

    (@boulosblack)


    Hello,

    We got complaints recently that when viewing WooCommerce orders, we get an error establishing database connection. After doing all kinds of tests, we saw that the issue only happens when WF is active.

    Here is an error we found in our logs:

    [Thu Jun 04 23:40:19.498273 2020] [proxy_fcgi:error] [pid 2229] [client 97.102.198.242:56342] AH01071: Got error ‘PHP message: WC_Log_Handler_File::get_log_file_path was called incorrectly. This method should not be called before plugins_loaded. Backtrace: WooCommerce->log_errors, WC_Logger->critical, WC_Logger->log, WC_Log_Handler_File->handle, WC_Log_Handler_File->add, WC_Log_Handler_File->should_rotate, WC_Log_Handler_File::get_log_file_path, wc_doing_it_wrong. This message was added in version 3.0.\nPHP message: WC_Log_Handler_File::get_log_file_path was called incorrectly. This method should not be called before plugins_loaded. Backtrace: WooCommerce->log_errors, WC_Logger->critical, WC_Logger->log, WC_Log_Handler_File->handle, WC_Log_Handler_File->add, WC_Log_Handler_File->open, WC_Log_Handler_File::get_log_file_path, wc_doing_it_wrong. This message was added in version 3.0.\n’, referer: https://hiddendomain.com/wp-admin/admin.php?page=WordfenceTools

    I contacted WC support and they referred me to you. Here is what they advised:

    The WC_Logger class is defined by the WooCommerce plugin to enable other plugins to log errors to “WooCommerce > Status > Log”

    You can learn about it here – https://docs.woocommerce.com/wc-apidocs/class-WC_Logger.html

    The error indicates that your WordFence plugin may incorrectly be calling that function.

    It isn’t that the error is caused by WooCommerce.

    It is instead a case of WordFence incorrect using the class resulting in your WooCommerce order page to fail.

    Hoping you can help us resolve this issue. The website is currently running without security 😮

    Best regards,

    Paul

Viewing 6 replies - 1 through 6 (of 6 total)
  • WFGerroald

    (@wfgerald)

    Hey @boulosblack,

    Thanks for the information.

    Can you please switch the Wordfence Firewall into Learning Mode and let me know if it helps? If it doesn’t help I’ll bump the developers for their thoughts.

    https://www.wordfence.com/help/firewall/learning-mode/

    Please let me know.

    Thanks,

    Gerroald

    touchestudio

    (@boulosblack)

    Hi @wfgerald,

    So i put the WAF in learning mode, and it’s still crashing. Here is one of the error messages I found:

    [Fri Jun 05 13:52:09.685286 2020] [proxy_fcgi:error] [pid 16542] [client 144.202.57.138:53821] AH01071: Got error ‘PHP message: PHP Warning: mysqli_query(): MySQL server has gone away in /home/189712.cloudwaysapps.com/hidden/public_html/wp-includes/wp-db.php on line 2024\nPHP message: PHP Warning: mysqli_query(): Error reading result set’s header in /home/189712.cloudwaysapps.com/hidden/public_html/wp-includes/wp-db.php on line 2024\n’, referer: https://hidden.com/?wordfence_syncAttackData=1591365121.4823

    AND

    according to the hosting company, the server is running out of memory… But only when WF is active, and checking WC orders. Otherwise, you can do whatever you want and the website is nowhere near using all the server and app memory. It literally goes from 2-4GB or free memory to 500MB.

    WFGerroald

    (@wfgerald)

    Hey @boulosblack,

    Thanks for the update.

    Can you send me a Diagnostics report so I can get a better overview of your environment? Please navigate to Wordfence > Tools > Diagnostics. Here you can select SEND REPORT BY EMAIL. Please include your WordPress.org username and update this thread after you’ve sent it.

    Thanks,

    Gerroald

    touchestudio

    (@boulosblack)

    Hi @wfgerald ,

    Just a quick note. Going to diagnostics crashed the database as well. Refresh and it works.

    The diagnostics report has been sent.

    Best regards,

    Paul

    Hey @boulosblack,

    I’ve looked through our codebase and I can’t find any reference to the WC_Logger.

    Firstly, can you try completely resetting Wordfence and let me know if it helps?

    https://www.wordfence.com/help/advanced/remove-or-reset/#remove-or-reset

    If that doesn’t help can you ask your host to increase the MySQL limit to see if it helps? This could be the problem, but the MySQL error could also be due to the memory spike creating the site to crash.

    Please let me know how the reset goes.

    Thanks,

    Gerroald

    Hi @wfgerald ,

    The issue got resolved with your latest update. I didn’t have to do anything else.

    Thanks for following up!

    Best regards,

    Paul

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.