Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 74 replies, has 3 voices.

Last updated by Sumit 6 months ago.

Assisted by: Sumit.

Author Posts
February 12, 2024 at 10:54 pm #15295112

louisN-4

i still need your assistance,

so litespeed copied my server to

hidden link
hidden link

hidden link
hidden link

hidden link
hidden link

hidden link
hidden link

hidden link
hidden link

the above links all load from cache in incognito, that means litespeed corrected things since the issue with:

https://wpml.org/forums/topic/wpml-latest-4-6-9-litespeed-issue/#post-15273277

but litespeed did something on their server, they only activated 11 plugins, instead of the 96 active on kideno, among those plugins is snippets, that we have from over the years, some of it from you, but its a good start, this is the server admin (i am not worried to send here, since its beta server and the links are hidden to oursiders)

hidden link

kideno secondary languages still don't load from cache for example

hidden link (secondary-miss)

vs

hidden link (primary language-hit)

that means the code of our functions.php doesn't pose any collision with wpml or litespeed

it means either plugins or something in our snippet, since wpml 4.6.9 is causing the secondary languages not to load from cache

you have permission get into the admin i gave you above and test by enabling plugins or observing the snippets or something

February 13, 2024 at 8:23 am #15295862

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. We have a request, can you please try the workaround suggested in the resolved summary of the following ticket after a backup on the staging site and check if is there any difference in the result?

https://wpml.org/forums/topic/follow-up-to-site-language-resetting-the-cache/page/2/

1) Set the following header via PHP or .htaccess to disable the cookie as a cache key.

X-litespeed-cache-control: no-vary

You can see how to set headers using .htaccess here - hidden link

2) Turn off the 'guest mode' in LiteSpeed to avoid setting this cookie, based on LiteSpeed's last response.

--
Thanks!

Bigul

February 13, 2024 at 10:14 am #15296622

louisN-4

Hi,

1. Guest mode is not enabled

and regarding
X-litespeed-cache-control: no-vary

2. indeed cache works with no-vary, but

a. you have issue with adding products to cart sometimes its not adding
b. when you go to other pages on the site they are not cached so they are slow
c. litespeed themselves claims that you will have issues if you don't add - which is what we are having

<IfModule LiteSpeed>
RewriteRule .? - [E=Cache-Vary:client_currency_cookie]
</IfModule>

HOWEVER, i just received confirmation from litespeed,
that the staging site i shared above that shows cache HIT

do have in their htaccess

<IfModule LiteSpeed>
RewriteRule .? - [E=Cache-Vary:client_currency_cookie]
</IfModule>

can you please open me here private box so i can also share with you kideno production admin access?

February 13, 2024 at 11:23 am #15297064

louisN-4

the hard fact and its worth mentioning again

that even with
<IfModule LiteSpeed>
RewriteRule .? - [E=Cache-Vary:client_currency_cookie]
</IfModule>

hebrew pages are cached !

its just the secondary languages that have issues

February 13, 2024 at 2:35 pm #15298151

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the details. I am enabling the private option for the next reply. Please check.

--
Thanks!

Bigul

February 13, 2024 at 4:58 pm #15299027

louisN-4

as you know i am also speaking to litespeed on ticket number: 558213

this is their latest answer (they also investigate this)

based on what I see with my test site that is copied for yours
they are getting cache hit even on the very first access which really against the fact of what I know for LSCWP

since I disabled so many plugins , my current guess is one or few of these plugins disabled , was interfering with cache somehow , it seems

I'm gonna set up another test site later tonight without disabling all the plugins , and see how it goes.

February 14, 2024 at 9:32 am #15300712

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for providing the details and login information. Just want to confirm: the access you've shared is for the admin account on the live site, am I correct?

--
Thanks!

Bigul

February 14, 2024 at 12:34 pm #15302164

louisN-4

1. in the private box, i gave you production kideno admin

2. in here - its the staging admin
https://wpml.org/forums/topic/wpml-latest-4-6-9-litespeed-issue/page/2/#post-15295112

February 15, 2024 at 6:24 am #15305012

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. I have shared it with our team. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

February 15, 2024 at 11:37 am #15306677

louisN-4

have you made any change on our site?

February 16, 2024 at 7:14 am #15310153

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Sorry for the delay. I was away. We haven't made any changes in the live or staging site. Only just login and go through the admin settings.

--
Thanks!

Bigul

February 17, 2024 at 5:08 am #15313379

louisN-4

hi,

1. any update from your end?

2. from the side of litespeed, i gave him our code for ?currency and his answer was:

"your code is not doing what I need it
I contacted WPML support, let's see if they can give me some magic code to achieve this"

this is our code:

add_filter( 'wcml_client_currency', 'modify_client_currency', 10, 1 );

function modify_client_currency( $current_currency ) {
if( !is_admin() ){
global $woocommerce;

if(isset($_GET['currency']) && !isset($_COOKIE['client_currency_cookie'])){
$currency = esc_attr( $_GET['currency'] );
$currency = strtoupper( $currency );
$currencies = get_woocommerce_currencies();
if ( array_key_exists($currency, $currencies)) {
if ( ! $woocommerce->session->has_session() ) {
$woocommerce->session->set_customer_session_cookie( true );
$woocommerce->session->set( 'client_currency', $currency );
} else {
$woocommerce->session->set( 'client_currency', $currency );
}
setcookie( "client_currency_cookie", $currency, 0, '/' );
} else {
return $current_currency;
}
}else{
if(isset($_COOKIE['client_currency_cookie'])){
$currency = $_COOKIE['client_currency_cookie'];
}else{
$currency = $current_currency;
}
}
return $currency;
}
}

add_action( 'wcml_switch_currency', 'my_custom_action_kideno', 10, 1 );
function my_custom_action_kideno( $new_currency ) {
global $woocommerce;
if ( !$woocommerce->session->has_session() ) {
$woocommerce->session->set_customer_session_cookie(true);
$woocommerce->session->set('client_currency', $new_currency);
}else{
$woocommerce->session->set('client_currency', $new_currency);
}
setcookie("client_currency_cookie", $new_currency,0,'/');
}

February 20, 2024 at 3:51 pm #15323964

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. I have shared it with our second-tier team and waiting for their feedback now. We will get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

February 21, 2024 at 12:48 pm #15327950

louisN-4

according to last night talk with litespeed, the ONLY and LAST obsticle, is that your WCML currency switcher, doesn't change URL

for example if i open
hidden link

and change currency from the top right icon, or the dropdown below the add-to-cart

it doesn't change to
hidden link

if for example i changed to AUD currency

they say if this is resolved, he has htaccess ready for tieing all the other parts, so multi language (wpml) + multi-currency(wcml)

would work

February 21, 2024 at 11:37 pm #15330727

louisN-4

can you ask your 2nd tier, is there a way to tell the WCML currency switcher, to change the url when changing currency

as i have explained above, even via a snippet

louisN-4 confirmed that the issue was resolved on 2024-03-20 12:12:05.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.