Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing issues where CSS from the original page is not being applied to the translated pages for logged-out users when using LiteSpeed Cache, while logged-in users see the pages correctly styled, we have identified a solution.

Solution:
Step 1: Disable the "CSS Combine" setting in the LiteSpeed Cache plugin. This setting, when combined with the "Guest Optimization" feature, can cause the observed issue.
Step 2: Ensure that translations for all languages are complete. For incomplete translations:
- Edit the home page in the default language.
- Click the relevant icon (gear, plus or circular arrows) in Language section on the sidebar to access the incomplete language.
- Complete the translation in the Advanced Translation Editor (ATE), ensuring it reaches 100%.
- Click the "Complete" button.
- Clear the cache and check the frontend.

For more details on configuring LiteSpeed Cache, refer to the following documentation:

If these steps do not resolve your issue, or if the solution doesn't seem relevant, please open a new support ticket with us.

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.

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 3 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
January 3, 2024 at 12:09 pm #15146399

Alex

We have a WP site running on a Litespeed server and using Elementor. Originally it used another language plugin (Polylang) but we migrated to WPML.
When we made changes to the original page, we noticed it's css did not get copied into the translated page for logged out users. Logged in users see the translated page with css as it should look. But logged out regular website visitors see a page where the css did not cross over.

We set up a staging site to start testing. Here we noticed also a new similar page set up in Elementor and then translated gets translated and shows up normal for logged in users but again without the css styling for logged out regular site visitors.

I've checked all of your documentation and looked through similar reported cases. I found one where your support suggested changing the WPML settings fro the elementor_css field from non translatable to copy. This did not solve it for us.

Can you take a look at our staging site? Happy to provide in private the login credentials.
The staging site is hidden link
The original language is Dutch. The alternative language is English. For now I've hidden the other alternative languages French and German which did show the same error.

WPML debug info provided. Please let me know if you need more info. Hoping you can help us out asap...
Thanks.

January 3, 2024 at 12:44 pm #15146493

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Alex,

Thank you for contacting the support.

I can see the issue in your site when switched to English version of the home page. I compared both versions and see that in the default language version, there's this stylesheet loaded:

<link data-optimized="2" rel="stylesheet" href="<em><u>hidden link</u></em>" />

But in English version, there's no stylesheet found in the page source.

Before proceeding further, may I ask you to try the following?

IMPORTANT: Take full backup of your website and database beforehand. It is highly advised to try the following on a staging/dev site first, so your live website isn't compromised.

- Deactivate all plugins (including cache ones) except WPML and its addons and check for the issue.
- Activate each plugin one-by-one, while keeping check on the issue after a plugin is activated. This way you'll be able to pinpoint a plugin having a conflict (or problem), if any.
- If the problem persists, repeat the above steps with a default theme of WordPress (i.e. 2021 or 2023).

Please let me know and I'll try my best to help you further on the matter.

Regards.

January 3, 2024 at 1:43 pm #15146926

Alex

Thanks for the fast reply.
It looks like the litespeed cache plugin is causing the issues. How to solve this because I thought you considered Litespeed Cache plugin a certified plugin?

January 4, 2024 at 5:40 am #15149159

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your reply.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

January 4, 2024 at 11:53 am #15150383

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access and the details. I am working on it and 'll get back to you accordingly.

January 5, 2024 at 7:57 am #15153289

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I was able to find a setting which was conflicting in this case. Like if you enable Page Optimization -> CSS Settings -> CSS Combine along with General -> Guest Optimization, then problem occurs.

If you simply turn off "CSS Combine" setting then it works fine. Although this setting is still active for certain qualifying requests due to Guest Optimization.

So I believe this is about configuring LiteSpeed Cache properly, please see following for details on these 2 settings:
- hidden link
- hidden link

Screenshot 2024-01-05 124523.jpg
Screenshot 2024-01-05 124510.jpg
January 5, 2024 at 12:02 pm #15154239

Alex

Thank you for your suggestions.
To test these I now activated the hidden languages for French and German again. But as you can see, these are still showing with no css styling from elementor. What am I missing or what is still wrong that I can not get the French and German pages to look the same?

January 5, 2024 at 1:00 pm #15154456

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I'll look into it again, please allow me some time.

However, in the meanwhile can you just purge all caches and check again?

January 5, 2024 at 1:10 pm #15154510

Alex

Thanks for taking another look. I did purge all cache, did hard reloads but still...

January 8, 2024 at 6:28 am #15158155

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience, I was away for the weekend.

I just checked and found that translations for French and German were incomplete. I also noticed that both were set as "duplicate" of the default language, unlike English which was a translation.

So I simply tried these steps:

- Opened home page for editing in default language.
- Clicked "I understand - continue editing".
- Clicked "gear" icon from Language section on the sidebar, for French.
- Completed French translation in ATE (note that I didn't actually used French for translation but just kept copying the Dutch because there were lot of fields. So remember to correct the translation).
- Clicked "Complete" button after translations were marked 100%.
- Checked in frontend after clearing cache, and French page is working fine now (regardless of logged-in or not-logged-in).

So you'll have to repeat these steps for German. Also remember to correct French translation.

Attached are the images for reference.

P.S.: This issue isn't relevant to LiteSpeed cache or what was originally reported. I hope if you follow the above mentioned steps, the issue will be resolved. Otherwise, feel free to report in a separate ticket because as per forum policy we can only handle one issue per ticket. So you can get more to the point help, without mixing up several issues in one long ticket.

Screenshot 2024-01-08 112149.jpg
Screenshot 2024-01-08 112136.jpg
Screenshot 2024-01-08 112106.jpg