Sauter la navigation

Ce sujet est résolu. Voici une description du problème et de la solution.

Problem:
You are experiencing PHP fatal errors related to memory exhaustion on your website after upgrading to WPML. The errors occur inconsistently across different pages but only in the original language. Despite increasing the memory limit, the issue persists, suggesting a potential loop causing the memory exhaustion.
Solution:
First, try the following steps:
1. Navigate to WPML → Languages.
2. Locate the option **"Adjust IDs for multilingual functionality"** and disable it.
3. Save the changes to apply them.
If the problem continues, implement this code snippet to modify the behavior of the Hummingbird plugin's persistent cache:

add_filter( 'wphb_persistent_cache_groups', function( $persistent_groups ) {<br />    if ( false !== ( $key = array_search( 'terms', $persistent_groups ) ) ) {<br />        unset( $persistent_groups[ $key ] );<br />    }<br />    return $persistent_groups;<br />} );

This code removes the 'terms' group from the cache, which might be contributing to the memory exhaustion.

If these solutions do not resolve the issue or seem outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.

Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.

Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.

Marqué : 

Ce sujet contient 0 réponse, a 0 voix.

Dernière mise à jour par Bruno Kos Il y a 1 mois et 2 semaines.

Assisté par: Bruno Kos.

Auteur Articles
janvier 29, 2025 at 8:03 am #16644710

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

Ok, we added this only:

/*define( 'WPMUDEV_HOSTING_OBJECT_CACHE_ENABLED', false ); */

I created a new user/pass for the site which I will share in the next reply. Can you see if you can reproduce the issue now?

janvier 31, 2025 at 2:12 pm #16656040

juliaZ-6

Dear Bruno,

Thank you for your feedback.

I logged in in your test site but I can't reproduce the issue.

So, in order to reproduce, we tried again in our production website by :

1) Commented the object cache in wp-config
2) Cleared static server cache & object cache.

After crawl, these errors appeared again:

[31-Jan-2025 13:50:00 UTC] PHP Fatal error: Uncaught WPMLTranslationProxyApiException: Cannot communicate with the remote service | url: `lien caché` method: `GET` param: `{"method":"GET","sslverify":true,"timeout":60,"headers":"Content-type: application\/json"}` response: `{"headers":[],"body":"{\"status\":{\"code\":2,\"message\":\"Invalid params for project - expecting [:accesskey]\",\"debug\":\"\"},\"response\":null}","response":{"code":422,"message":"Unprocessable Entity"},"cookies":[{"name":"_translation_proxy_session","value":"vPeuq9SM++Xoa5oa7a7c9d6LkadGHP5UJ55B\/TReKORIcT+2gXphpCWHkIPuaGcamjdMuuAcQdHxivJUhqRYyNB5Ys65s0P6ILevCbTzypQhw4nLzKDe9rJa8Yr3oJ6MvxYArz\/erGV+iJ25S5e2glEXQx8+CbbOYxml0dlZm9MdVhQFwX1\/xi0kZbj\/4TAV1n4=--EbPkkzvLJYnMQ+k3--FHFBtJkJ9e3RO0Elk+B0\/Q==","expires":null,"path":"\/","domain":"tp.wpml.org","port":null,"host_only":true}],"filename":null,"http_response":{"data":null,"headers":null,"status":null}}` in /var/web/site/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translation-proxy/class-wpml-translation-proxy-networking.php:130

[31-Jan-2025 13:51:40 UTC] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/web/site/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-debug-backtrace.php on line 133

[31-Jan-2025 13:53:57 UTC] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/web/site/public_html/wp-includes/class-wp-term-query.php on line 731

[31-Jan-2025 14:00:47 UTC] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/web/site/public_html/wp-includes/class-wp-term-query.php on line 731

[31-Jan-2025 14:00:56 UTC] PHP Warning: Attempt to read property "ID" on null in /var/web/site/public_html/wp-content/plugins/wp-hummingbird/core/modules/class-critical-css.php on line 1601

[31-Jan-2025 14:01:04 UTC] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/web/site/public_html/wp-includes/class-wp-term-query.php on line 731

[31-Jan-2025 14:01:06 UTC] PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/web/site/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-debug-backtrace.php on line 133

So may be your ‘test’ server is not replicating 100% of the things, including the fact that our licenses with elementor are not in activated or else. Is there a way where you could test and search on our production website ?

On our side we can afford some malfunctioning website during 1 hour or 2, and more specifically during European CET night time (or early morning or end of day?), depending of your timezone.

We could for instance agree on a time/day so we can de-activate again the object cache in our production, then you can catch the issue.

Do you have specific debugging tools you need to put in place?

février 3, 2025 at 7:08 am #16661101

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

I asked our 2nd tier if they have some new ideas on the matter, I will keep the ticket updated.

février 3, 2025 at 2:32 pm #16663379

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

Can you please try the following:

1. Go to WPML → Languages

2. Look for **"Adjust IDs for multilingual functionality"** and turn it off.

3. After disabling the setting, make sure to save the changes to apply them.

Let me know if the issue persists, if you still get memory exhausted error.

If this doesn't help, can you try with this:

add_filter( 'wphb_persistent_cache_groups', function( $persistent_groups ) {
    // Remove the 'terms' group if it exists in the persistent list.
    if ( false !== ( $key = array_search( 'terms', $persistent_groups ) ) ) {
        unset( $persistent_groups[ $key ] );
    }
    return $persistent_groups;
} );

This code snippet modifies the behavior of the Hummingbird plugin's persistent cache by removing the 'terms' group from the cache.

février 11, 2025 at 10:02 am #16690736

juliaZ-6

Dear Bruno,

I'll try this and get back to with the result

février 11, 2025 at 12:45 pm #16691642

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

Ok, let me know about the results.

février 12, 2025 at 10:07 am #16695395

juliaZ-6

Dear Bruno,

**"Adjust IDs for multilingual functionality"** was indeed already deactivated so I add this in my functions.php file as request :

add_filter( 'wphb_persistent_cache_groups', function( $persistent_groups ) {
// Remove the 'terms' group if it exists in the persistent list.
if ( false !== ( $key = array_search( 'terms', $persistent_groups ) ) ) {
unset( $persistent_groups[ $key ] );
}
return $persistent_groups;
} );

However, the php errors occurred again afterward as you can see in the log attached. I did a roll back to fix the issue.

Capture d’écran 2025-02-12 à 11.09.02.png
février 12, 2025 at 1:35 pm #16696852

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

We just published new version of WPML, String Translation, etc.

They bring lots of new things under the hood, but also the visual part.
https://wpml.org/download/wpml-multilingual-cms/?section=changelog

Can you update and observe the site if this helps?

check for updates.png
février 20, 2025 at 3:08 pm #16730444

juliaZ-6

Hello Bruno,

I did the updates you mentioned unfortunately it generated some issues on the translations, such as the footer or some CTA that are no longer correctly translated. I need to correct of all those before proceed to the check of our bug being resolved or not. I'll be in touch.

bug translation.png
février 21, 2025 at 7:03 am #16732255

Bruno Kos
Supporter

Les langues: Anglais (English ) Allemand (Deutsch ) Français (Français )

Fuseau horaire: Europe/Zagreb (GMT+02:00)

If you need help with these translations, please open a new ticket so we could have a look (being a different issue than the one discussed here, so for our support rules to handle one issue per time).

But if the issue is styling only, you can try this:
lien caché