[Resolved] Critical error when activating WPML Multilingual CMS
This thread is resolved. Here is a description of the problem and solution.
Problem: After moving a website to a new server, activating the WPML Multilingual CMS plugin resulted in a critical error, and the site appeared without translations.
Solution: First, we removed an outdated and incompatible version of the WPML String Translation plugin that was not supported by your Multilingual Blog license. Next, we addressed issues in the .htaccess file by renaming it and resaving permalinks to generate a fresh .htaccess file.
We then resolved PHP errors related to undefined functions and constants by updating WordPress to the latest version through https://www.optiparts.com/wp-admin/update-core.php. After updating, we successfully activated WPML and tested creating and translating posts in different languages.
We recommend activating other plugins one by one to identify any potential incompatibilities. Ensure to update all plugins and the theme to their latest versions.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. We highly recommend opening a new support ticket for further assistance 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.
Background of the issue:
I am trying to move a website from one server to another. On the new server, the WPML Multilingual CMS plugin gives errors. Link to a page where the issue can be seen: hidden link. The new website is only visible when the DNS is set to 178.21.116.53.
Symptoms:
When activating the WPML Multilingual CMS plugin, the whole site gives a critical error. Instead of a copy of the original site, I got a site without translations.
Questions:
Why does the WPML Multilingual CMS plugin cause a critical error on the new server?
How can I resolve the issue to see a copy of the original site with translations?
Reference to our recent chat, I added to my hosts file and was able to see the test site (see attached).
However, I can't access /opt-login, /wp-admin or /wp-login.php. All return with 404 page not found.
Further I checked the debug.log file and which is all filled with "Connection refused" errors only, no other detail.
Please check on your side and let me know how can I access the WP Admin. It'll be great if you can deactivate all the plugins and switch to a standard theme. So then I can try login via standard wp-admin and check for the issue.
Thank you for the details, I was able to login using /wp-admin, because /opti-login was still giving a critical error.
I noticed that you've Multilingual Blog license, which does not include WPML String Translation, on the other hand, you were also using a very old version of the string translation (see attached). In either case, this plugin 'll not work and you may have issues. I've removed the plugin from the site.
I also fixed .htaccess, which had some repeating directives, perhaps remnants of another plugin. I simply renamed it to another name and then resaved permalinks to generate the default and fresh .htaccess.
Further I found following errors when trying to create a post or page:
PHP Fatal error: Uncaught Error: Call to undefined function get_allowed_block_template_part_areas() in /home/optiparts/domains/optiparts.com/public_html/wp-includes/blocks/template-part.php:189
Stack trace:
#0 /home/optiparts/domains/optiparts.com/public_html/wp-includes/blocks/template-part.php(283): build_template_part_block_area_variations()
#1 /home/optiparts/domains/optiparts.com/public_html/wp-includes/class-wp-block-type.php(604): build_template_part_block_variations()
#2 /home/optiparts/domains/optiparts.com/public_html/wp-includes/class-wp-block-type.php(366): WP_Block_Type->get_variations()
#3 /home/optiparts/domains/optiparts.com/public_html/wp-admin/includes/post.php(2332): WP_Block_Type->__get()
#4 /home/optiparts/domains/optiparts.com/public_html/wp-admin/edit-form-blocks.php(110): get_block_editor_server_block_settings()
#5 /home/optiparts/domains/optiparts.com/public_html/wp-admin/post-new.php(72): require('/home/optiparts...')
#6 {main}
thrown in /home/optiparts/domains/optiparts.com/public_html/wp-includes/blocks/template-part.php on line 189
[24-Jan-2025 12:55:13 UTC] PHP Warning: Use of undefined constant WP_TEMPLATE_PART_AREA_HEADER - assumed 'WP_TEMPLATE_PART_AREA_HEADER' (this will throw an Error in a future version of PHP) in /home/optiparts/domains/optiparts.com/public_html/wp-includes/media.php on line 6049
Perhaps WordPress' files were corrupt or were not updated correctly (in a previous update). So I also updated WordPress from /wp-admin/update-core.php.
After that I was able activate WPML and was able to create and translate new post and page:
- hidden link
- hidden link
Now please activate other plugins one by one, while keep checking for the error, if and when it happens. So you can find if there's any incompatibility triggering by a plugin.
Please also remember to update the other plugins. Repeat the same for your theme. I've currently switched to 2021 theme.