Skip to content Skip to sidebar

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

Problem:
When using WPML 4.8 together with a page builder (e.g., Elementor), attempting to open the Translation Editor may result in a PHP fatal error similar to:

PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given
in .../sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php:82

This occurs when the page includes an image that lacks metadata (i.e., no title, caption, description, or alt text).
Solution:
We published an errata for this issue. The issue was fixed in WPML 4.8.1, which can be downloaded at Plugins > Add new on the "Commercial" tab or from https://wpml.org/account/downloads/.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, 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 problems persist, please open a new support ticket at WPML support forum.

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 11 replies, has 2 voices.

Last updated by Andreas W. 1 month ago.

Assisted by: Andreas W..

Author Posts
August 27, 2025 at 7:44 pm #17352895

mulhamZ-2

Background of the issue:
I am trying to switch the site language from Arabic to English or Turkish on my website. I have confirmed that all server and WordPress requirements are met, and the REST API endpoint is reachable. The URL for the REST API endpoint is hidden link.

Symptoms:
When I switch the site language, I see the message: "Your site doesn't meet WPML's minimum requirements. The WordPress REST API must be enabled for WPML to work correctly." Additionally, when I save a translated page or post, I get the error message: "There has been a critical error on this website." However, the changes appear to be saved. This issue only occurs with translated content.

Questions:
Why am I seeing a message about WPML's minimum requirements when switching languages?
What causes the critical error message when saving translated pages or posts?

August 28, 2025 at 7:45 am #17353591

Dražen
Supporter

Languages: English (English )

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

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

To allow us to see if any PHP errors are being produced, please provide the WordPress debug.log. More Info: https://wordpress.org/support/article/debugging-in-wordpress/

To enable debug.log, open your wp-config.php file and look for:

define('WP_DEBUG', false);

And change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

Then try to reproduce the issue and check if any errors were saved to the debug.log log file inside the “.../wp-content/” directory.

Regards,
Drazen

August 28, 2025 at 7:49 am #17353651

mulhamZ-2

An error of type E_ERROR was caused in line 82 of the file /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php. Error message: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php:82
Stack trace:
#0 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php(82): array_merge(NULL, Array)
#1 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/media-translation/AddMediaDataToTranslationPackage.php(26): WPML\MediaTranslation\AddMediaDataToTranslationPackage->get_bundled_media_to_translate(Object(WP_Post))
#2 /home/goldmast/public_html/wp-includes/class-wp-hook.php(326): WPML\MediaTranslation\AddMediaDataToTranslationPackage->add_media_strings(Array, Object(WP_Post))
#3 /home/goldmast/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#4 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/translation-jobs/class-wpml-element-translation-package.php(166): apply_filters('wpml_tm_transla...', Array, Object(WP_Post), false)
#5 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-action-helper.class.php(13): WPML_Element_Translation_Package->create_translation_package(Object(WP_Post))
#6 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/actions/wpml-tm-post-actions.class.php(72): WPML_TM_Action_Helper->create_translation_package('20')
#7 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/functions-load-tm.php(941): WPML_TM_Post_Actions->save_post_actions(575, Object(WP_Post), false)
#8 /home/goldmast/public_html/wp-includes/class-wp-hook.php(324): wpml_tm_save_post(575, Object(WP_Post), false)
#9 /home/goldmast/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#10 /home/goldmast/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#11 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-post-translation.class.php(213): do_action('wpml_tm_save_po...', 575, Object(WP_Post), false)
#12 /home/goldmast/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/post-translation/wpml-admin-post-actions.class.php(123): WPML_Post_Translation->after_save_post('20', Array, 'en', 'ar')
#13 /home/goldmast/public_html/wp-includes/class-wp-hook.php(326): WPML_Admin_Post_Actions->save_post_actions('575', Object(WP_Post))
#14 /home/goldmast/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#15 /home/goldmast/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#16 /home/goldmast/public_html/wp-includes/post.php(5110): do_action('save_post', 575, Object(WP_Post), true)
#17 /home/goldmast/public_html/wp-includes/post.php(5212): wp_insert_post(Array, false, true)
#18 /home/goldmast/public_html/wp-admin/includes/post.php(453): wp_update_post(Array)
#19 /home/goldmast/public_html/wp-admin/post.php(227): edit_post()
#20 {main}
thrown

August 29, 2025 at 1:53 am #17356566

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

Hello,

Note that the REST API is not available in language directories like /en in second languages.

You can only access it at:
hidden link

To access the English data, use a language parameter:
hidden link

About the error:

1) It seems the minimum requirements on the server are not met:
https://wpml.org/en/home/minimum-requirements/

Could you please increase the WordPress memory limit (WP Memory Limit) to at least 256 MB? WPML requires at least 128 MB.
Your current values ​​are:

PHP Memory Limit 512 MB
WP Memory Limit 40 MB

To do this, you need to connect to your website's server and open the wp-config.php file in a text editor. The file is located in the WordPress root directory.

Add this code to the wp-config.php file to increase WordPress memory:

define ('WP_MEMORY_LIMIT', '256M');

Add this just before this comment:

// That's all, stop editing! Happy blogging.

The current values ​​can be viewed under WPML > Support > WordPress.

These settings can be restricted directly by your hosting provider. Therefore, I recommend contacting them and asking them to change them directly if the changes are not applied immediately.

2) Now, please edit the original post or page, save it again and complete the translation again. Do you still get the same error?

If so, does the error disappear if you disable "EWWW Image Optimizer" and test again?

Also, please make sure ot run WPML > Settings > Media Translation > Start. This dialog will sync the media into all languages inside the media library. Then test again.

If these adjustments will not solve the issue, please let me know.

Best regards
Andreas

August 29, 2025 at 8:48 am #17357155

mulhamZ-2

Dear Andreas,

Thank you for your reply and suggestions.

Here is what I have done so far:

I increased the WordPress memory limit to 256 MB as advised.

I edited and saved the original page, then tried saving the translated page again, but the same critical error occurred.

I deactivated the EWWW Image Optimizer plugin and also ran the Media Translation > Start synchronization process, but unfortunately the issue still persists.

The problem remains the same: translated pages trigger the critical error upon saving, while standalone pages work without issues.

Please advise on the next steps.

Best regards,
Mulham

Screenshot 2025-08-29 114704.jpg
Screenshot 2025-08-29 114650.jpg
August 29, 2025 at 5:51 pm #17358619

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to take a closer look and request temporary access (wp-admin and FTP) to the website to investigate the issue further.

The required fields are located below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data 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 so I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/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:
hidden link

Click "I still need assistance" the next time you reply.

Video:
hidden link

Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.

Best regards,
Andreas

August 30, 2025 at 1:02 pm #17359332

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

I took a visit to your site and made some random tests, but could not see the error.

Can you please name an example (title or permalink) where I can see the issue?

August 30, 2025 at 1:18 pm #17359477

mulhamZ-2

You can visit "About us" English page and press on "update" to see the error

August 30, 2025 at 4:05 pm #17359714

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

It looks like this error occurs if the option WPML > Settings > Media Translation > Automatically detect best options for translating image texts (alt, caption, title) is enabled while the content is actually getting translated with the WordPress Editor.

Usually, you would duplicate or copy from the original content and then edit the translation when using the "WordPress Editor" as a translation method. I suppose you would not need to enable the above-mentioned option in this case.

I have disabled the option now. Please proceed with your translation and let me know if you spot any issues.

Note that this issue has been escalated to our development team.

August 30, 2025 at 4:10 pm #17359715

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

This issue will be solved in WPML 4.8.1:
https://wpml.org/errata/wpml-4-8fatal-error-when-translating-pages-containing-images-without-metadata/

August 30, 2025 at 4:18 pm #17359717

mulhamZ-2

Thank you Andreas.

October 1, 2025 at 6:22 pm #17450065

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

Hello,

I am glad to inform you that the reported issue was fixed in WPML 4.8.1, which can be downloaded at Plugins > Add new on the "Commercial" tab or at:
https://wpml.org/account/downloads/

Best regards
Andreas