Hello @adaml4458
I am sorry about the issue you are experiencing, and I am happy to assist you with this.
Can you please try and change the line 600 in /wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php
from:
esc_url_raw( stripslashes( $_SERVER['REQUEST_URI'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
to:
filter_var( stripslashes( $_SERVER['REQUEST_URI'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
Let em know if the problem persists after this.
THanks!
That produced the following error:
Parse error: syntax error, unexpected ‘&’, expecting ‘]’ in /home/customer/www/theminifigurestore.uk/public_html/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php on line 600
Hello @adaml4458
Thank you for your feedback.
Does this change removes the previous error or just add the one you mentioned?
Also, can you please share when have you started to experience this? Didi the problem occurred after some update?
Can you please also share which caching method you are using for Database caching?
Thanks!
Hello @adaml4458
I am reaching out again to check if there is any update.
Can you please share which caching method you are using for Database Caching and what is the WP version?
Thanks!
HI I did reply to this but it doesn’t seem to have posted!
After this change it prevents me from accessing the Points and Rewards section of woocommerce.
I only noticed this after I updated woocommerce, woo points and rewards and a few others but the functionality that causes the error is functionality that doesn’t get used much so could have been an issue for months beforehand without realising.
Database caching in w3 is: DISK
Wordpress version: 6.0.1
Hello @adaml4458
Thank you for the information.
This may be the problem with some recent updates of the other plugins.
This being said, I would recommend disabling Database Caching when caching to disk.
WordPress website utilizes database quite a lot. And database caching allows for decreasing database usage. Database caching allows cache database request results.
Database caching can make your site faster if the time needed to get data from the database is more than the time needed to get data from the cache.
So, if you are on shared hosting, then RAM-based caching is likely to be unavailable for you. And disk-based caching is not that efficient. In other words, if you are on shared hosting, it’s recommended not to use database caching. If you are on a VPS or dedicated server, you should consider using memory-based caching like Redis or Memcached.
Moreover, using disk-database caching can make your site slower. This is so because getting data from the database can be faster than getting cached data from the disk.
Thanks!
Is there going to be a W3 Total Cache fix for this issue? We’ve just had to disable W3 Total Cache to prevent the issue from giving a 500 server error
Hello, @andyroberts @adaml4458
Can you please replace the existing /wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php with the one you can download here and let me know if the problem persists?
Thanks!
Thanks Marko – I’ve just set this up on our development site and the 500 error no longer occurs.
Will this be in the next update to W3 Total Cache? I’m just concerned about the error reoccurring if the plugin is updated and this fix is not included.
Thanks
Amazing works perfect now, and also now got db cache back active everything is properly back up to speed as before
Hello @adaml4458 @andyroberts
Thank you for your feedback.
I am glad to know that the issue does not occur anymore.
This will be fixed in the next release.
Thanks!
Hello @adaml4458 @andyroberts
Thank you once again for your patience.
We have a fix for this issue and can you please make sure that you are using the latest release with which you’ve experienced the problem and make sure to implement the changes you can find in this pull request that should fix the problem?
This is different than the solution previously provided as we have to pay attention to wp guidelines.
Thank you in advance