Skip Navigation

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

Problem:
The client is unable to log into the WordPress admin panel due to a PHP Fatal error caused by the WPML plugin. Deactivating WPML restores access but cripples the site functionality.
Solution:
We recommend the following steps to diagnose and potentially resolve the issue:
1. Ensure you have a backup of your website. Alternatively, perform these tests on a staging version to avoid disrupting a live site.
2. Switch to a default theme like 'TwentyTwenty' via 'WordPress Dashboard > Appearance > Themes'.
3. Deactivate all plugins except for WPML and its add-ons through 'WordPress Dashboard > Plugins'.
4. Try to log in to see if the issue persists. If it does not, reactivate your plugins one by one to identify the problematic plugin.
5. Ensure that WPML and its add-ons are up to date by checking for updates in 'WordPress Dashboard > Plugins > Add new > Commercial (tab)' and clicking the 'Check for Updates' button. For automated updates, visit https://wpml.org/faq/install-wpml/#automated-updates.
6. If you regain dashboard access, provide debug information following the steps at https://wpml.org/faq/provide-debug-information-faster-support/.

If these steps do not resolve the issue or if the solution seems outdated or irrelevant 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 2 replies, has 1 voice.

Last updated by anthony pezzullo 1 month, 2 weeks ago.

Assisted by: Christopher Amirian.

Author Posts
April 17, 2025 at 3:11 am #16941645

anthony pezzullo

Background of the issue:
I am trying to log in to the WordPress admin panel, but I am unable to do so. Deactivating the WPML plugin restores access, but it leaves the site crippled. Here is the link to the page where the issue can be seen: hidden link. PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php:154.

Symptoms:
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php:154. The error occurs when trying to log in to the admin panel, and deactivating the plugin restores access but leaves the site crippled.

Questions:
How can I resolve the PHP Fatal error related to the WPML plugin?
What steps should I take to restore full functionality to my site without deactivating the plugin?

April 17, 2025 at 4:07 am #16941691

anthony pezzullo

Sorry I had to move my domain to my backup site since this issue took down the live site.

The url is now jp2025clone.mystagingwebsite.com

April 17, 2025 at 2:40 pm #16944668

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support. Would you please do a test to see if the same problem happens on a minimal installation?

- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except WPML and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.

If you use any WPML related addon, try by only having WPML Multilingual CMS and WPML String Translation enabled.

Finally, as I guess you did not have access to the dashboard to provide the debug info you could not. but if you have access, please provide following the steps below:

https://wpml.org/faq/provide-debug-information-faster-support/

Is there a chance that the WPMLs plugin might not be updated?

- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Go to "WordPress Dashboard > Plugins > Add new > Commercial (tab)".
- Click the "Check for Updates" button.
- Update WPML and its addons there.

For more information:
https://wpml.org/faq/install-wpml/#automated-updates

Thanks.

April 17, 2025 at 6:52 pm #16945639

anthony pezzullo

It's ok, im deleting the site. i used an old backup to restore my site.

This time, im keeping the automatic translation disabled as its not reliable as the classic translator.