the_lar
Forum Replies Created
-
Forum: Plugins
In reply to: [LiteSpeed Cache] Bug with ESI block@hailite could you tell me how to require this package via composer please?
@femiyb – apologies, I sent the report from our production site, I’ve now correctly sent the one from staging which is where the updated plugin is installed, so please discard the first one.
Thanks
@femiyb – I’ve sent that.
Thanks
Forum: Plugins
In reply to: [LiteSpeed Cache] Litespeed ESI block – how to remove HTML comment?Hi @qtwrk, thank you for the reply. We use roots/bedrock as our base so that composer manages all of our WordPress and Plugin updates, that means that wp-config.php will constantly get overwritten with updates, so we have a /config folder in the level above /public_html. I’ve tried adding
Config::define('LSCACHE_ESI_SILENCE', true);
to /config/application.php but it didn’t work. Adding to /public_html/wp/wp-config.php did work but this isn’t really maintainable going forward because as I said, it will keep getting overwrittenForum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginUgh… images expired in previous messages, here is the firefox console again –
And here is the Litespeed debug config as I’ve set it up –
Hope these help
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginHi, on the debug settings, I have set it up like this:
But as you can see it’s saying Invalid IP when I add ALL to the field – but maybe that’s not what you meant?? Also, should
lsesi
be in the Debug URI includes field like that?Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginOK I will do that now.
I may have had a bit of breakthrough – I have just triggered the error myself and captured this screenshot of the Firefox console which gives some additional information:
Does this help?
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginHi there,
Do you mean the one that starts with ‘4×4’ which is 3rd in the list?
That’s the same one from where I am doing this in my code:
do_action('litespeed_nonce', '<my_nonce_name>');
but I’ve removed the actual name and replaced it with
<my_nonce_name>
– I wasn’t sure if it needed to be in the ESI nonces list so that is why I put it in there.Could you explain the process of enabling the debug log using
lsesi
to me please – is it something I add to the URL? And where do I see the log once it has been activated?Many thanks
Kevin
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginHi there, report number is LCFHTFTM
Kevin
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginHi again,
Just picking this up again as I have had a re-occurrance of the issue and I managed to get the user to give me some screenshots which I’d like to share.
Firstly, just a bit of background on my setup – our site is based on roots/sage theme 9.0.9. In my setup.php file I have the following code snippet:
/** * Theme assets */ add_action('wp_enqueue_scripts', function () { wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), false, null); wp_enqueue_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, false); // Litespeed do_action('litespeed_nonce', '<my_nonce_name>'); $ajax_params = array( 'ajax_url' => admin_url('admin-ajax.php'), 'ajax_nonce' => wp_create_nonce('<my_nonce_name>'), 'asset_path' => asset_path(''), ); wp_localize_script('sage/main.js', 'ajax_object', $ajax_params); ... }
Obviously I’ve changed my actual nonce name to <my_nonce_name> in the code above.
As you can see, I’m calling
litespeed_nonce
before callingwp_create_nonce()
as instructed here – https://docs.litespeedtech.com/lscache/lscwp/api/#convert-custom-nonce-to-esiMy Javascript code where the ajax call is made is:
$button.bind('click', function(){ console.log('size search button click'); $button.addClass('loading'); let data = { action: 'postcode_check', // eslint-disable-next-line no-undef nonce: ajax_object.ajax_nonce, postcode: $tyre_postcode.val(), } $.ajax({ // eslint-disable-next-line no-undef url: ajax_object.ajax_url, type: 'POST', data: data, dataType: 'json', success: function (response) { ... } }); }
As you can see I’m accessing the ajax_object that was registered when localizing the script in setup.
Finally, my PHP script for postcode_check has
check_ajax_referer
as the first line of the function and looks like this:add_action('wp_ajax_nopriv_postcode_check', [$this, 'postcode_check']); add_action('wp_ajax_postcode_check', [$this, 'postcode_check']); public function postcode_check() { check_ajax_referer('<my_nonce_name>', 'nonce'); ... }
The part of the site where the issue occured for this particular user is on our homepage, interacting with the Tyre Search widget which is at the top of the page:
When the user selects a tyre width, tyre profile and tyre size, then enters their postcode – clicking ‘See Products’ performs an ajax request to the above
postcode_check
function. It is this ajax request that is failing for the user.I have managed to capture the following screenshots of the request in Firefox web console from their laptop.
Request headers:
Request:
Response:
As you can see, the request to
postcode_check
is giving me a 403 error.Notably when I tried just clearing the Litespeed cache alone, the users error persisted. It wasn’t until I commented out the
check_ajax_referer
code in the PHP function that I was able to clear the users error.Hope that the details above will enable me to get an idea of what is causing these intermittent issues.
Many thanks
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginPerfect, thank you! As I say, haven’t had any re-occurance since I put this in place 2 days ago… fingers crossed!
Forum: Plugins
In reply to: [LiteSpeed Cache] Intermittent ajax issues using pluginHi there,
I found this in the documentation – https://docs.litespeedtech.com/lscache/lscwp/api/#convert-custom-nonce-to-esi – so I’ve now added
do_action('litespeed_nonce', 'my_nonce_name');
just above where I callwp_create_nonce()
as it says.Is that all I need to do or is there more to it? I only did this late last night, but I have had no more reports of the issue since.
Thanks
Forum: Plugins
In reply to: [WooCommerce PayPal Payments] Fatal error after upgrading to 2.0.1To confirm, no errors now having downgraded to 1.9.5
Forum: Plugins
In reply to: [WooCommerce PayPal Payments] php errorSame error on very latest version – see seperate thread here https://www.ads-software.com/support/topic/fatal-error-after-upgrading-to-2-0-1/#new-topic-0
@jamieburchell yeah but I can temporarily make it false, do the signup then switch it back – it’s workable!