Vai al contenuto Vai alla barra laterale

Questo thread è stato risolto. Ecco una descrizione del problema e della soluzione.

Problem:
After updating to WPML 4.9.0, several wp-admin pages cause PHP timeouts (504) or memory exhaustion. The issue is linked to the DebugBackTrace class being instantiated without a limit in multiple places, causing excessive memory usage. Additionally, a recursive loop triggered by _load_textdomain_just_in_time causes incorrect loading of WooCommerce translations when backtrace is disabled.
Solution:
Note that these known issues were solved in WPML 4.9.1 and 4.9.2.

We highly 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 issues persist, please open a new support ticket at WPML support forum for further assistance.

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Etichettato: 

Questo ticket contiene 13 risposte, ha 0 voci.

Ultimo aggiornamento da benedettoT-3 1 mese fa.

Assistito da: Andreas W..

Autore Post
Febbraio 20, 2026 alle 16:24 #17839022

benedettoT-3

Starting from WPML 4.9.0, several wp-admin pages cause PHP timeout (504) or memory exhaustion. Frontend works correctly.
Root causes identified:

classes/utilities/class-debug-backtrace.php — DebugBackTrace is instantiated without a limit (new \WPML\Utils\DebugBackTrace()) in two places:

addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids-factory.php line 6
menu/post-menus/post-edit-screen/wpml-meta-boxes-post-edit-html.class.php line 281
This causes debug_backtrace() to run without limit hundreds of times per page load, exhausting CPU until PHP timeout.

When backtrace is disabled, PHP exhausts 1GB RAM due to a recursive loop triggered by _load_textdomain_just_in_time called too early by WPML, causing WooCommerce translations to load incorrectly.
classes/url-handling/converter/class-wpml-url-cached-converter.php line 36 also causes independent timeouts.

Environment: PHP 8.1.34, WordPress 6.9.1, WooCommerce active, Elementor active, 1GB memory limit.

Febbraio 22, 2026 alle 2:12 #17840537

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

Thank you very much for reporting this issue!

Take kindly note that to investigate this issue, we need access to your site, as this issue can be very site-specific.

It would be ideal if you could provide access to a staging site. If you do not have a staging site available or can not provide one, I can offer to take a local copy of your site if you provide me with admin access. I would enable a private reply form in this case.

About the error:
DebugBackTrace is a utility class used by multiple parts of WPML.

The DebugBackTrace class provides a 'forensic map' of function calls to help WPML understand the current code context. In complex Elementor pages with many widgets, WPML is forced to generate hundreds of these massive 'maps'—often containing the same 150+ lines of history—faster than the server can clear the memory. This leads to the memory exhaustion you are seeing.

Diagnostic workaround:
Please note: This is a diagnostic workaround to verify the cause of the memory error. This change will be overwritten if you update the plugin, so please keep a backup of the modified file.

File to Edit: wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/WPML_Elementor_Translate_IDs.php

Task: Modify the should_translate_template method to capture the stack only once per check.

Replace the existing function with this code:

private function should_translate_template() {
    // 1. Manually update the backtrace exactly once for this check
    $this->debug_backtrace->get_backtrace();

    // 2. Perform all checks without refreshing the stack again (passing false)
    return $this->debug_backtrace->is_class_function_in_call_stack( 'ElementorPro\Modules\Library\WP_Widgets\Elementor_Library', 'widget', false )
        || $this->debug_backtrace->is_class_function_in_call_stack( 'ElementorPro\Modules\Library\Classes\Shortcode', 'shortcode', false )
        || $this->debug_backtrace->is_class_function_in_call_stack( 'ElementorPro\Modules\Library\Widgets\Template', 'render', false )
        || $this->debug_backtrace->is_class_function_in_call_stack( 'ElementorPro\Modules\Forms\Classes\Ajax_Handler', 'ajax_send_form', false );
}

It only affects how WPML handles Elementor IDs. If applying this workaround will solve the memory exhaustion issue, please let me know.

Final test:
Check a page that uses Elementor Global Widgets and Templates after applying the code. If the Global Widgets and Templates still translate correctly, the workaround is perfect.

Site access:

I will be glad to test this for you on a staging site or a local copy of your site and request temporary access (wp-admin and FTP) to the website to investigate the issue further.

You'll find the necessary fields below the comment section if you log in to leave the next reply. The information you provide will be private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to create a backup of the website and database before granting us access.

If you don't see the "wp-admin / FTP" fields, your login credentials for the post and website will be set to "PUBLIC." Do NOT publish the information unless you see the required wp-admin / FTP fields.

The private reply form looks like this:
link nascosto

When replying again, click "I still need assistance".

Video:
link nascosto

Please note that we are required to request this information individually on each ticket. We are not permitted to access any login information that was not specifically provided in the private reply form for this ticket.

Best regards
Andreas

Marzo 3, 2026 alle 14:55 #17869054

benedettoT-3

Hi,
the issue was fixed with the latest update 4.9.2. I haven't checked the changelog. Have you made any fixes to this version?
Thanks a lot.
Walter

Marzo 4, 2026 alle 5:41 #17870528

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

I am glad to hear that the issue appears to be solved!

The latest update WPML 4.9.2 fixed an issue with missing custom fields in translations and an issue where Full Site Editing templates were not applied to translated pages.

In your case the issue seems to have been related to Elementor and the prior WPML 4.9.1 update had various fixes for Elementor:

https://wpml.org/it/download/wpml-multilingual-cms/?section=changelog

Marzo 4, 2026 alle 13:16 #17872043

benedettoT-3

I looked at the changelog for version 4.9.1, but I don't see anything that addresses the problem I was having.
But it works now, so that's good.

Marzo 4, 2026 alle 18:42 #17872819

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Indeed, but this function that is mentioned in your error could be connected to one of the fixed issues in the last two updates for WPML.

In case the issue occurs again, just reach out to us and we will be glad to look into this.

Marzo 6, 2026 alle 16:11 #17878210

benedettoT-3

After checking further, I noticed that the problem is still partially present. Basically, when I generate an invoice from WooCommerce (using the WooCommerce Italian Add-on Plus and PDF Invoices & Packing Slips for WooCommerce plugins),
Example of the page that opens and causes the problem
link nascosto
If I disable WPML, it loads immediately again.
I also tried changing the function you suggested in previous posts, but it didn't solve the problem.

Marzo 6, 2026 alle 17:15 #17878255

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

Hello,

I'd like to request temporary access (wp-admin and FTP) to the website to investigate the issue further.

You'll find the necessary fields below the comment section if you log in to leave the next reply. The information you provide will be private, meaning only you and I will be able to see and access it.

IMPORTANT
Please be sure to create a backup of the website and database before granting us access.

If you don't see the "wp-admin / FTP" fields, your login credentials for the post and website will be set to "PUBLIC." Do NOT publish the information unless you see the required wp-admin / FTP fields.

I may need to install a plugin called "All In One WP Migration" to create a copy of the website on which I can investigate the problem more thoroughly.

I would also be very grateful if you could provide a staging site on your server for this purpose.

If you have any questions about creating such a staging site, please contact your hosting provider. Please ensure that WPML is also registered on this staging site at https://wpml.org/de/account/websites/.

If you are unable to provide such a copy of the website for testing, please let me know on this ticket.

The private reply form looks like this:
link nascosto

When replying again, click "I still need assistance".

Video:
link nascosto

Please note that we are required to request this information individually on each ticket. We are not permitted to access any login information that was not specifically provided in the private reply form for this ticket.

Best regards
Andreas

Marzo 12, 2026 alle 23:35 #17894095

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

I can sadly not reach the site:
ERR_CONNECTION_TIMED_OUT

I would need FTP/SFTP access to investigate this further. Please also check with your hosting support regarding any server issues that occur.

The private reply form is enabled again.

Marzo 14, 2026 alle 10:02 #17897238

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

The staging lost its database connections. It looks like someone recently edited the wp-config.php file. Please verify and let me know once the site is running again.

Marzo 16, 2026 alle 13:25 #17900509

benedettoT-3

can you try now?
thanks a lot

Marzo 17, 2026 alle 15:56 #17905501

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

On this staging site, WordPress was not updated, and there were 22 plugin updates available. This seems to have solved the issue.

Please, before reporting an issue, always make sure that all components are updated.

Marzo 18, 2026 alle 14:07 #17908416

benedettoT-3

you see the wrong site
the staging site had only 4 plugins to update but now I updated the ones that could be updated
link nascosto is the url of staging site

Marzo 18, 2026 alle 23:41 #17909551

Andreas W.
Sostenitore di WPML dal 12/2018

Lingue: Inglese (English ) Spagnolo (Español ) Tedesco (Deutsch )

Fuso orario: America/Lima (GMT-05:00)

My apologies for the misunderstanding, but I did not see the wrong website.

I said:
On this staging site, WordPress was not updated, and there were 22 plugin updates available. This seems to have solved the issue.

What I am trying to say here is that I ran the updates already, and the issue does not occur anymore.

Am I misunderstanding the issue?

1) Go to WooCommerce > Ordini
2) Open an order that has "Fattura Numero"
3) Click on "PDF Fattura" in the right sidebar

This works without any 504 error on the staging now.

The only thing unexpected is how the preview of this email is rendered, but this is not related to WPML.

Marzo 20, 2026 alle 13:51 #17914382

benedettoT-3

It actually works now. In my tests, I had to disable WPML to get that page to work. However, I've now also tried it in Prod, and it actually works. Could there have been a conflict with another plugin they updated?
Keep in mind that I had performed the updates about 1-2 weeks ago, at most, so the updates you saw needed to be made were new subversions.
The important thing is that it works now. Thanks so much for the support.