Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 7:00 – 12:00 -
- 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 13:00 – 15:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

This topic contains 67 replies, has 0 voices.

Last updated by Carlos Rojas 5 months, 3 weeks ago.

Assisted by: Carlos Rojas.

Author Posts
September 24, 2025 at 10:38 am #17428721

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Great! I'm happy to hear that you solved the problem with the flags.

Regarding the clicks, it seems I failed to click the currency switcher the first time. I'm visiting the site right now, and it works correctly. If you see any problem when clicking on the currency switcher, and it disappears if you deactivate LiteSpeed, then the problem lies in the LiteSpeed configuration.

September 24, 2025 at 11:12 am #17428838

rhettY

Just tried twice again. It can't switch back to USD at the first click, need to click second time to take effect. In fact, I can live with that for now.

These 2 in ticket: https://wpml.org/forums/topic/php-fatal-error-uncaught-invalidargumentexception-4/ seem to be more annoying

1. sitekey not found, though I've unregistered and re-registered several time.
2. PHP Fatal error: Uncaught InvalidArgumentException: Argument $language_code must be a non empty string.

September 24, 2025 at 11:49 am #17428967

rhettY

Please check the video: hidden link

I need to click twice to return to default USD. Switching between other currency is not an issue.

ChatGPT said LS cache has in-built mechanism that would not cache files like admin-ajax.php.

September 24, 2025 at 11:54 am #17429060

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Thank you for sharing the video.

If LS indeed does not cache files like admin-ajax.php, then you must contact them and ask them for a workaround on how to exclude this file from cache.

September 24, 2025 at 1:32 pm #17429304

rhettY

I found this arcitle: hidden link

and have disabled it.

September 25, 2025 at 7:20 am #17430818

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Good morning!

This article explain how the LS cache options work. If you have any questions about these settings you must contact their support service. This is the WPML support service and the configuration of LS Cache falls outside of our scope.

Thank you very much for your understanding!

September 25, 2025 at 7:29 am #17430847

rhettY

I am a bit confused. So you have found the issue is caused by litespeed caching admin-ajax.php, right? Or just wanna confirm it's not been cached?

September 25, 2025 at 9:35 am #17431629

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Hi,

We have found that the issue is caused by the configuration of the LS Cache plugin, because disabling it solves the problem. Our 2nd-tier specialists recommended excluding the admin-ajax.php file from cache.

If the LS Cache plugin indeed excludes the admin-ajax.php file (this is something you need to ask them), then you must contact them to get the correct configuration for their plugin so the currency switcher can work as expected.

September 25, 2025 at 9:44 am #17431653

rhettY

Ok. I will consult them and get back to you

September 25, 2025 at 12:00 pm #17432263

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Excellent! I will be waiting for your message.

September 25, 2025 at 4:17 pm #17433527

rhettY

Please check this post thread: https://wordpress.org/support/topic/admin-ajax-php-cache-2/#post-18656230

I've turned off rest api cache

September 26, 2025 at 7:32 am #17434705

rhettY

Hi after turning off rest api cache, the issue still happens.

I compared the /wp-json load before and after turning off the rest api cache. Now it's "no-cache" in response header.

September 26, 2025 at 10:32 am #17435455

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

Hi there,
Thank you for your message

The Rest API has no impact on the language switcher. The site/WPML is not fetching any info from an external server via the Rest API when switching currencies.

September 26, 2025 at 10:34 am #17435463

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

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

I'd recommend explaining to them that if LS Cache is deactivated, the currency switcher works correctly, so there must be another configuration causing this behavior.

September 26, 2025 at 10:39 am #17435479

rhettY

Ok. I'll check with them