Pyetro
Forum Replies Created
-
Forum: Plugins
In reply to: [Safe SVG] Breaking behavior in 2.3.0 – height / width attributes inheritanceI kind of solved by specifying the image size:
wp_get_attachment_image_src($id, 'full');
otherwise, as @martinplr pointed out, it will just inherit the default dimensions, ‘thumbnail’, instead of always get the right SVG dimensions, which would be the expected behaviour.
Indeed I suddenly found all those SVG set to 150x150px!- This reply was modified 20 hours, 54 minutes ago by Pyetro.
Forum: Plugins
In reply to: [Safe SVG] Breaking behavior in 2.3.0 – height / width attributes inheritancehello there, I have a similar breaking issue. I had to revert to previous version 2.2.6!
Please revert this behaviour as suggested by @martinplrForum: Plugins
In reply to: [Simple Custom Post Order] Editor can’t order posts anymore+1!
Adding my voice to this issue. Looking forward for a fix!Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cached@litetim thank you for directly dealing with Iubenda about this!
I hope that your collaboration avoid possible future issues.Everything else is running smooth, but thanks for asking.
Enjoy the rest of your day ??
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedDefinitely weird! But I found what was causing the problem!
Thanks a lot for letting me focus on the real problem: there was sth else parsing the code before rendering, that’s why the include tag was mispelled…
Well the problem was entirely caused by Iubenda plugin, and this is not the first time they make changes to the plugin, wasting tons of my time! I kind of hate them, day after day a bit more.
I tweaked into that plugin settings setting them like this:
I think it was the script blocker prior the cookie consent, kind of required by law, and often messing up JS scripts, but this is the first time it messes up PHP code! It was totally unexpected.
So, thanks a lot @qtwrk and @litetim for your super fast and kind support, in the end, even if not directly, this interaction made me think laterally and I found out what other parser was messing up the code.
I hope this thread could be useful for future Iubenda (or cookie solution plugin in general) haters ??
- This reply was modified 3 months, 4 weeks ago by Pyetro.
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cached@qtwrk tried to change my plugin as you said
but I stil get the same <include>
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedError log successfully created, but I still see only <include… in the HTML source code:
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedYes it’s the Homepage and it’s unlikely the optimal solution to disable the cache in favor of the slider.
I thought about replacing the PHP in JS but the problem is that the main array comes from a group of Custom Fields, where I only get the image ID, then the wp_get_attachment_image is crucial to render the proper <img> tag with all the proper srcset/sizes which are different from image to image.
PHP renders all these information way before the JS can do anything, that’s why it’s important to find a way to exclude Litespeed from caching that random value.
I want to avoid to load all the slides, then pick one with JS, it’s still a waste of resources, and in case the client adds too many slides, it’s going to affect loading time in any case…
Why ESI it’s simply not working as expected?
On top of all of it, why the heck sometimes works and other times is not, the lack of a clear pattern is driving me crazy!!Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedHello there, it’s getting more weird.
Yesterday night I tried again and the function perfectly worked, as you can see from the screenshot:
then after a while, even when I was still working on refining the code, suddenly stopped to work, again, giving me the same weird <include> tag. The weird part is that I didn’t modify any of the ESI settings, nor the code of the filter… Of course neither the basic example with rand() works anymore:
And above all, the most worrying thing is that having ESI enabled and loading any page with that apply_filters code, takes ages to load, like forever, any other page without it just work as expected, but ONLY if logged in! Logged out users can load the page in a decent time, still with the <include> tag instead of the rendered code…
In the meanwhile, the /esi-test/ out-of-wp perfectly works! so the server is properly accepting and making work ESI… the problem only happen within WP environment, so it’s probably a faulty Plugin feature.
Looks like the ESI feature is quite buggy and unresponsive, even plenty of other post I read here about, underline how broken is this thing.
How is supposed to work? Does exist any positive proof that this feature actually work?
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedOk it worked now, here is the report number: ZSCHJOWN
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedIt works!
Looks like it’s not working in the WP installation (even if once worked)…I am trying to send the report, but as soon as I press “Send to Litespeed” I got the following error message on reload:
Failed to request via WordPress: No longer supported. please upgrade your plugin. [server] https://api.quic.cloud [service] wp/report
And I have the latest LS Cache version: 6.3.0.1
Edit: retrying sendind the report I also get this:
Cloud Error: Please try after 3m for service wp/report
- This reply was modified 3 months, 4 weeks ago by Pyetro.
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cached@qtwrk thanks for the help!
Unluckily still does not work.
Accordingly to the linked guide, I tried both the method of setting the header (via htaccess and PHP), regardless of the header setting I also see
x-litespeed-cache: hit
in the page headers, so I guess Litespeed and ESI are properly set, still I see the following HTML piece of code:<include src="/?lsesi=my_esi_block&_control=private%2Cno-vary&_hash=9a2f73c5b904f7d204deefa0ac1f0999" cache-control="private,no-vary"></include>
I also remember that in one of my first attempts, the Random code worked, then suddenly printing the above piece of HTML.
I really can’t understand the pattern…
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cached@qtwrk I tried exactly what the first example the guide suggests, and what I have in result is:
<include src="/?lsesi=my_esi_block&_control=private%2Cno-vary&_hash=9a2f73c5b904f7d204deefa0ac1f0999" cache-control="private,no-vary"></include>
No way to output the rendered content.
@litetim I even tried the other example passing parameters, and a var_dump before gives me the correct data (of course), but a second var_dump after the
apply_filters
results in a similar code as the above: a string 2XXX characters long.string(2493) "<!-- lscwp Custom ESI block --><esi:include src='/?lsesi=my_esi_block&_control=private%2Cno-vary&esi=W1t7ImltYWdlIjoyMzYyLCJjb250ZW50IjoiQXJjaGl0ZWN0dXJlIGFuZCBpbnRlcmlvciBkZXNpZ24gcHJvamVjdHMgPGJyIFwvPlxyXG50YWtlbiBvbiB3aXRoIHRoZSBzYW1lIGF0dGVudGlvbiB0byBkZXRhaWwuICIsIm92ZXJsYXlfb3BhY2l0eSI6IjEiLCJsaW5rIjp7InRpdGxlIjoiUHJvZHVjdCIsInVybCI6Imh0dHBzOlwvXC9kZXYuc3BhZ251bG9hbmRwYXJ0bmVycy5pdFwvaW50ZXJpb3ItZGVzaWduLXByb2plY3RcL3ZpbGxhLWx1eHVyeS1yZXNpZGVuY2Utc3QtbW9yaXR6XC8iLCJ0YXJnZXQiOiIifX0seyJpbWFnZSI6MjM1OCwiY29udGVudCI6IlNwYWdudWxvICY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55IGFyY2hpdGVjdHVyZSA8YnIgXC8%2BXHJcbmFuZCBpbnRlcmlvciBkZXNpZ24gcHJvamVjdC4iLCJvdmVybGF5X29wYWNpdHkiOiIxIiwibGluayI6eyJ0aXRsZSI6IlRoZSBSb21hbiBQZW50aG91c2UgUm9tZSIsInVybCI6Imh0dHBzOlwvXC9kZXYuc3BhZ251bG9hbmRwYXJ0bmVycy5pdFwvaW50ZXJpb3ItZGVzaWduLXByb2plY3RcL2hvdGVsLWV4Y2x1c2l2ZS1wZW50aG91c2Utcm9tZVwvIiwidGFyZ2V0IjoiIn19LHsiaW1hZ2UiOjIzNjAsImNvbnRlbnQiOiJUaGUgbWF0ZXJpYWwgY3VsdHVyZSBvZiB0aGUgcGVvcGxlIHdlIHdvcmsgPGJyIFwvPlxyXG53aXRoIG91dGxpbmVzIGEgdGltZWxlc3MgY2hyb25pY2xlLiIsIm92ZXJsYXlfb3BhY2l0eSI6IjEiLCJsaW5rIjp7InRpdGxlIjoiUmVzdGF1cmFudCBHaWFubmlubyBNaWxhbiIsInVybCI6Imh0dHBzOlwvXC9kZXYuc3BhZ251bG9hbmRwYXJ0bmVycy5pdFwvaW50ZXJpb3ItZGVzaWduLXByb2plY3RcL3Jlc3RhdXJhbnQtZ2lhbm5pbm8tbWlsYW5cLyIsInRhcmdldCI6IiJ9fV1d&_hash=b80bd7fa01d76834a49345ef7111276a' cache-control='private,no-vary' /><!-- lscwp Custom ESI block esi end -->"
I double checked on cPanel and the server is enabled, otherwise neither the <include> block wouldn’t be render like that.
Maybe some wrong ESI setting? “Enable ESI” in Cache > ESI was the only thing I did, other than making sure it’s a Litespeed Enterprise server, which I can manage via cPanel.
Any idea about why the content of the filter does not render properly?
Forum: Plugins
In reply to: [LiteSpeed Cache] array_rand/shuffle result is being cachedHello, thanks for your reply.
Here is the code:
shuffle($covers);
$cover = reset($covers);So I have one variable as argument and one variable to return.
I tried with ESI, but it’s not returning the variable.
Here the code I tried instead:echo apply_filters('litespeed_esi_url', 'my_esi_block', 'Custom ESI block', $covers);
Together with what I put in my
functions.php
using a slightly different approach (array_rand insted of shuffle, still the same result expected):add_action('litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load');
function my_esi_block_esi_load($params) {
do_action('litespeed_control_set_nocache');
$param_index = array_rand($params);
return $params[$param_index];
}- This reply was modified 4 months ago by Pyetro.
Forum: Plugins
In reply to: [LiteSpeed Cache] CSS Combine and @import ruleGreat!
Can you please let me know here what they say about my request, and if they plan to integrate this feature in some upcoming release?
Thanks!