Skip Navigation

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

Problem:
The client encountered a fatal error related to the WPML String Translation plugin when calling the

get_language_codes()

function.
Solution:
1. We recommended that the client updates the WPML plugin to the latest version (4.6.10 at the time) along with all its add-ons to ensure they have the latest bug fixes and improvements.
2. We provided instructions for updating WPML, which can be found at http://wpml.org/faq/install-wpml/, and emphasized the importance of backing up the database before proceeding, suggesting the use of a plugin like Duplicator (http://wordpress.org/plugins/duplicator/).
3. We asked the client to inform us if the issue persists after the update.
4. For the separate performance issues, we requested the client to open a new support ticket and provided general guides to prevent performance issues with WPML at https://wpml.org/faq/prevent-performance-issues-with-wpml/ and https://wpml.org/tutorials/2022/03/boosting-the-performance-of-your-multilingual-wordpress-site/.

Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, 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 you need further assistance, please don't hesitate to open a new support ticket in our forum at https://wpml.org/forums/forum/english-support/.

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 Andrey 1 year ago.

Assisted by: Andrey.

Author Posts
April 8, 2024 at 10:25 am #15493615

nicoM-5
Fatal error: Uncaught Error: Call to a member function get_language_codes() on bool in /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/wpml-string-translation/classes/slug-translation/class-wpml-slug-translation-records.php:233
Stack trace:
#0 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/wpml-string-translation/classes/slug-translation/class-wpml-slug-translation.php(226): WPML_Slug_Translation_Records->get_all_slug_translations(Array)
#1 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/wpml-string-translation/classes/slug-translation/class-wpml-slug-translation.php(269): WPML_Slug_Translation->get_all_post_slug_translations()
#2 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(324): WPML_Slug_Translation->filter_pre_get_posts(Object(WP_Query))
#3 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#4 /home/cosmos/public_html/steuerportal.ch/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#5 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-query.php(1881): do_action_ref_array('pre_get_posts', Array)
#6 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-query.php(3824): WP_Query->get_posts()
#7 /home/cosmos/public_html/steuerportal.ch/wp-includes/post.php(2452): WP_Query->query(Array)
#8 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/advanced-custom-fields-pro/includes/class-acf-internal-post-type.php(399): get_posts(Array)
#9 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/advanced-custom-fields-pro/includes/class-acf-internal-post-type.php(357): ACF_Internal_Post_Type->get_raw_posts()
#10 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/advanced-custom-fields-pro/includes/post-types/class-acf-taxonomy.php(126): ACF_Internal_Post_Type->get_posts(Array)
#11 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(324): ACF_Taxonomy->register_taxonomies(6)
#12 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#13 /home/cosmos/public_html/steuerportal.ch/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/advanced-custom-fields-pro/acf.php(391): do_action('acf/init', 6)
#15 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(324): ACF->init('')
#16 /home/cosmos/public_html/steuerportal.ch/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#17 /home/cosmos/public_html/steuerportal.ch/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#18 /home/cosmos/public_html/steuerportal.ch/wp-settings.php(643): do_action('init')
#19 <em><u>hidden link</u></em>): require('/home/cosmos/pu...')
#20 <em><u>hidden link</u></em>): WP_CLI\Runner->load_wordpress()
#21 <em><u>hidden link</u></em>): WP_CLI\Runner->start()
#22 <em><u>hidden link</u></em>): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#23 <em><u>hidden link</u></em>): WP_CLI\bootstrap()
#24 <em><u>hidden link</u></em>): include('<em><u>hidden link</u></em>...')
#25 /home/cosmos/bin/wp(4): include('<em><u>hidden link</u></em>...')
#26 {main}
 thrown in /home/cosmos/public_html/steuerportal.ch/wp-content/plugins/wpml-string-translation/classes/slug-translation/class-wpml-slug-translation-records.php on line 233
April 8, 2024 at 10:43 am #15493697

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Could you please update your WPML plugin to the latest version 4.6.10 and add-ons to benefit from the latest bug fixes and improvements? This may not necessarily resolve your problem, however, in order to troubleshoot the issue best we need to work on the latest code available.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

Please remember to backup your database first before you proceed. You can use a plugin for this if you like (example: http://wordpress.org/plugins/duplicator/)

Let me know if the issue persists after an update has been done.

April 8, 2024 at 10:54 am #15493753

nicoM-5

There were (are) no pending plugin updates visible in WordPress admin, for this or any other plugin. I therefore downloaded the latest versions of the two WPML plugins and updated the site manually. The error is still showing.

April 8, 2024 at 12:54 pm #15494177

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Could you provide information on where the issue occurs? Have you tested if the problem persists with all plugins disabled and WPML enabled, as well as with any default theme?

Before proceeding with any changes, please make sure to back up your database first.

April 8, 2024 at 12:57 pm #15494178

nicoM-5

I cannot change the theme or disable any plugins, because by doing so, the entire website will then break and produce dozens of server-side error messages because of missing code.

The fatal error is visible in any of the cron emails I receive (every five minutes), in WordPress admin when trying to update anything, and on every command which uses WordPress CLI.

April 8, 2024 at 1:09 pm #15494217

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Can you set up a test environment where we can test this? I didn't find similar issues, so this issue is probably an edge case, and we have to start from the basic troubleshooting steps.

April 8, 2024 at 1:11 pm #15494220

nicoM-5

That would depend on what actions you need to take. Setting up a duplicate live site would take a couple of hours, so please list in detail what steps you will be taking to troubleshoot your code.

April 8, 2024 at 1:18 pm #15494243

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I need a way to replicate the issue you mentioned earlier. As I mentioned, we also need to check whether the problem exists without any third-party plugins and on the default theme.

I can set up a fresh staging site for you. Would it be helpful for you to reproduce the issue on the fresh installation?

April 9, 2024 at 9:11 am #15497631

nicoM-5

I am continuing to debug this issue and will give a further update as soon as possible. However, I have found out that all of our sites which are running WordPress 6.5 are currently throwing this fatal error. All of the plugins and themes are different in each installation.

April 9, 2024 at 11:52 am #15498886

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the updates. Let me know if there is something we need to look into further. We'll need a way to replicate the issue to ensure it gets the attention it deserves.

April 12, 2024 at 12:33 pm #15512941

nicoM-5

I am continuing to debug this error. As it affects multiple sites, we're currently in discussion with our clients to stop using WMPL on our projects. This error, and the increasingly unsupportable performance on all installations which is caused by the WPML plugins, makes WPML unsuitable for our client sites.

April 12, 2024 at 12:45 pm #15512996

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback. If you can provide us with a way to replicate the issue with the fatal error, I will escalate it to our team for handling.

Regarding the performance issues, please open a new support ticket detailing the problem so we can better help. We have a general guide to prevent performance issues with WPML. Please have a look here:
https://wpml.org/faq/prevent-performance-issues-with-wpml/
https://wpml.org/tutorials/2022/03/boosting-the-performance-of-your-multilingual-wordpress-site/