CrazySerb
Forum Replies Created
-
Did you push this change on your end to your core code as well?
I think I got an update pushed on my end and it didn’t have this code in place, so I had to re-apply this fix all over again.Yeah, that fixes the 1st one, definitely.
Now, as far as that 2nd one, it has something to do with Elementor Pro plugin, as if I turn off either one (Elementor or Shoplentor) of the plugins the problem goes away. Obviously, kinda need both, so… any idea on how to go about fixing that query?
Hmm, nope. Those errors are still coming up, hundreds per second.
In the case of the first one reported I only see this variation of it now:2024-10-24 4:00:38 user @ localhost [] WARNING 1292: Truncated incorrect DECIMAL value: '' : SELECT MIN( CAST( meta_value AS DECIMAL(10, 2) ) ) FROM wp_postmeta WHERE meta_key = '_price'
where the value is empty. I guess you fixed the issue for non-empty values.
Taking a look at your code, I can assume that the full fix for that query would look something like thisSELECT MAX( CAST( meta_value AS DECIMAL(10, 2) ) ) FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value != '' ...
However, the 2nd error reported, with the long query, that one is still being logged over and over. And I can’t figure out where that’s coming from either from which specific function/code…
- This reply was modified 1 month ago by CrazySerb.
Well, whether that’s a conflict with another plugin (maybe Elementor / Elementor Pro or Rank Math / Rank Math Pro?) or not, it’s somehow caused by this plugin, because with it turned OFF, we don’t have any of these issues… but yeah, if you can take a look at it, and I can send you a list of plugins we’re using on our end to test with, if you want, that’d be great.
Yeah, we’re on PHP 8.3…
Just add these two lines:
/checkout
^/checkout
To Cache -> 4. Excludes -> Do Not Cache URIs section.
That should do it.I just added an exception for /checkout page in LS cache, and that somehow fixed it.
That integration between WooCommerce and Litespeed Cache should have more options, such as this one – to exclude specific WooCommerce pages from being cached and so on.Hmm, that did not work for me at all – I can’t even get anything to print out from that function lscwp_esi_test() itself, before apply_filters echo statement…
Is there anything else in LS Cache plugin that I need to turn ON or OFF to make this work, other than turning ESI to ON that I might be missing somehow?I have tried using this approach as well:
https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-urlbut I can’t just print out a content from another, external PHP file in function my_esi_block_esi_load() by using require_once(“/home/domain/file.php”); as that does nothing (doesn’t print out the contents of that file at all).
So that round-about solution still doesn’t work for what I’m dealing with here, which is exclude a whole .php file and its contents (that gets inserted into certain templates) from being cached, along with certain variables I set dynamically before including that file, as they are unique to each visitor.Again, that does nothing to demonstrate how it’s possible to exclude a certain php code from being cached in a regular php template.
All I have been seeing so far from you and from my search results is these references to apply_filters, functions.php or custom plugin through which I have to create that specific block of text/code that can then somehow be excluded.
I am not in a position to do that, and just need to exclude a block of variables and one require_once() line from a php template like this:<?php
... some PHP code that needs to be cached...
$var1 = "...";
$var2 = "...";
require_once("/home/file.php");
...some more PHP code that needs to be cached...
?>And I just need the code in the middle excluded from caching, including that /home/file.php and all the code inside it, as that’s where all sorts of dynamic variables are set for each unique user.
HOW do I accomplish that with Litespeed Cache without having to create additional plugins, re-declare all this code as some sort of a custom widget, block or a plugin?@qtwrk, ok so how would I use it otherwise then, around a block of PHP code in a PHP template?
I still don’t get it.
Can you give me an example of that, without it referring to any shortcodes, functions.php or widgets?
Thanks!@qtwrk yeah, it’s not a shortcode, it’s just straight up PHP code section or two, some having include_once() and require_once() PHP file includes (files that we would like to avoid caching, but I can’t add them in LS Cache configuration as URIs).
So any other suggestions, as that page you referenced seems to work only with functions.php file and shortcodes/blocks/widgets. We can’t just convert this code of ours to shortcode/block/widget as it’s unique to each template we have it on and it’s not feasible to do so.Forum: Plugins
In reply to: [Admin and Site Enhancements (ASE)] Redirect After Logout URL doesn’t workNever mind, we’re handling this redirection some other way. But still, double check the code on your end… just to make sure it works as expected.
Doesn’t sound right at all, I know, as none of the pages/posts even had the comment form enabled until I turned this plugin and this setting on.
I’ll send you the login and details in a minute.
Forum: Plugins
In reply to: [Yoast SEO] How to disable Schema in Yoast SEO?@suascat_wp you guys could just as easily add a single checkbox option in plugin’s settings to control this too, you know…