WooCommerce Order View crashes when Wordfence is active
-
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
- The topic ‘WooCommerce Order View crashes when Wordfence is active’ is closed to new replies.