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.

Our next available supporter will start replying to tickets in about 4.29 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by Prosenjit Barman 4 weeks, 1 day ago.

Assisted by: Prosenjit Barman.

Author Posts
March 26, 2024 at 3:22 pm #15451984

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi,

During the investigation, our team found that "Cloudflare" is mentioned as a Server header in the header list. Please check this screenshot: hidden link

The issue could also stem from Cloudflare caching the queries, which are then served from its cache. Could you please disable Cloudflare's caching feature? This will help us narrow down the problem more efficiently.

You can disable Cloudflare caching by logging in to the Cloudflare Portal.

Let me know when it is done. Looking forward to your response.

Best regards,
Prosenjit

March 26, 2024 at 7:49 pm #15453016

gabeS-4

Hi Prosenjit:

Unfortunately, it is very difficult to turn off Cloudflare caching on our end, as its part of WPEngine's advanced network that protects us from DDOS attacks.

Instead we had WPEngine create a cache exclusion for /lhjmq, so that site should not be cached at all.

Please let me know if that helps with your testing.

Thanks

March 27, 2024 at 3:22 am #15453465

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi,

Thank you for the update. I hope that excluding the cache will be enough for for further testing. Rest assured, I'll reach out if I need anything more on your part.

I truly appreciate your patience and cooperation during this process.

Best regards,
Prosenjit

March 28, 2024 at 5:44 am #15458698

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for your patience.

After conducting a detailed examination, we identified the primary cause of the problem, which was linked to the "the7-tmp" cache group. By disabling the relevant code in the group definition, the menu issue didn't happen again. The testing was done ensuring the object cache is enabled.

Here are the steps we took:

- Accessed the `menu.php` file located in "wp-content/themes/dt-the7/inc/helpers/"
- Navigated to line 280 and modified the code from

$html = wp_cache_get( the7_get_menu_cache_key( $args ), 'the7-tmp' );

to

$html = false; // wp_cache_get( the7_get_menu_cache_key( $args ), 'the7-tmp' );

- Cleared the caches from the site and browser.

We have commented out the function call that retrieves cached data for the Menu, thereby bypassing the caching mechanism that was causing the issue.

Please check and let me know the update. We will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

March 28, 2024 at 8:15 am #15459240

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Another update!

We found a more resilient approach that doesn't involve altering the theme code. We added a PHP file named `fix_the_7_cache_menu.php` in the `/wp-content/mu-plugins` directory. In this file, we included the cache group that was causing problems in the non-persistent cache function group. The following is the code contained in the file:

<?php
wp_cache_add_non_persistent_groups( [
		'the7-tmp',
] );

The menu also works fine with this solution. If you're having the issue on any other site, you can simply download the file and upload it into the mu-plugins folder of the other site.

Let me know the update. We will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

March 28, 2024 at 7:39 pm #15462455

gabeS-4

Hi Prosenjit:

Thanks for the update. We have done some testing as well. It seems your last plugin fix for the7-tmp non-persistent cache group already exists. Its in dt-the7/inc/theme-setup.php line 154. It seems the combination of your fix in the menu.php file of the same folder, and the other non-persistent cache plugin have solved this.

The problem is this is still just a workaround, as we could still have issues once the theme gets updated.

Will there be a possible permanent solution implemented for this in the future? Or should we be reaching out to the company that provided the theme (the7)?

Thanks.

March 29, 2024 at 7:51 am #15463262

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

Upon checking, I noticed that the cache group is already included in the non-persistent cache group function within the specified file. However, the non-persistent cache group operates more efficiently when it's added to the mu-plugin folder. Therefore, moving it to the mu-plugins folder helps to solve the issue. Since the cache group is located in the mu-plugins folder within a different file, it will remain in the non-persistent cache group even if you update the theme, as the theme update will not impact this file.

Just to let you know, our development team is actively working on resolving the issues we've identified with object caching. As part of this process, we recommend the plugin I mentioned in one of my previous messages(https://wpml.org/forums/topic/object-cache-changes-main-language-and-affects-menu/#post-15377738). If we can pinpoint the Cache group that's causing the problem, we suggest adding the cache group to the plugin, which should effectively address the issue.

We hope to resolve the issues with object caching in future updates. Until then, we recommend using the plugin solution. If you want, you can also notify the Theme support or developers about this issue, so they can explore more efficient ways to manage object caching.

I hope you can understand. Please feel free to let me know if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

The topic ‘[Closed] Object Cache changes main language and affects menu’ is closed to new replies.