[Resolved] WordPress database error prevents WPML work properly
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing a 503 error or a timeout when trying to access the 'Translate texts in admin screens' link in their WordPress site using the WPML plugin. This issue is accompanied by multiple WordPress database errors indicating that the 'wp_icl_background_task' table does not exist. Solution: First, ensure you have a backup of your site. Then, attempt to recreate the missing table by running the following SQL commands in your database:
DROP TABLE IF EXISTS wp_icl_background_task;<br />CREATE TABLE wp_icl_background_task (task_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, task_type varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, task_status smallint(5) unsigned NOT NULL DEFAULT '0', starting_date datetime DEFAULT NULL, total_count int(10) unsigned NOT NULL DEFAULT '0', completed_count int(10) unsigned NOT NULL DEFAULT '0', completed_ids text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, payload text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, retry_count smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (task_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
If issues persist after these steps, it may be due to other underlying problems not directly related to WPML. In such cases, we recommend checking for 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 the problem still exists, please open a new support ticket for further assistance.
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.
Our next available supporter will start replying to tickets in about 6.14 hours from now. Thank you for your understanding.
Background of the issue:
I am experiencing issues with the WPML plugin on my WordPress site, specifically when trying to access the 'Translate texts in admin screens' link. This results in a 503 error or a timeout. I have deactivated all other plugins and themes except for WPML Multilingual CMS on my staging site and enabled the debug option.
Symptoms:
Multiple WordPress database errors indicating that the 'wp_icl_background_task' table does not exist. Errors include failure to select from or show full columns from the table, and issues counting task IDs from the same table.
Questions:
Can you help me resolve the issue where the 'wp_icl_background_task' table does not exist, which is preventing WPML from functioning properly?
What steps should I take next since deleting and reinstalling all WPML plugins did not resolve the issue?
I had to install All in One migration Plugin in order to install a copy of your site locally, this is to avoid affecting your live site while doing the debugging,
I tried using Duplicator instead as the other copy is not working for me,
However, the backup keeps failing because you do not have an enough execution time limit, could you please ask your team if they could provide us with a copy of your site using Duplicator? they will then see the errors I'm talking about and potentially know how to fix them,
It seams we can't use the Duplicator plugin due to large file and database sizes and limitation of our shared server, but we have a stage site already built and you can use it for any testing and debugging.
In WordPress, a "deprecated" error or warning indicates that a particular function, hook, or feature is outdated and will be removed in a future release. These warnings are intended to inform developers that they should update their code to use newer, supported functions or features to ensure compatibility with future versions of WordPress.
This is not an error, nor a show stopper, the PHP version 8.1.x + are currently not 100% compatible with many plugins, you could try to opt for PHP 8.0 or lower as a proof of concept,
In your case, I just advice you to either ignore it and disable the debug log to reduce the load (which is minimal, nothing serious), or opt for a different PHP version.
The deprecated error message is not a problem, the debug is disabled already and I can ignore it. but we are talking about the (Translate texts in admin screens) that is not able to open and gives the time out at the end, although I changed the php version to 8.0 but still I the link is not accessible.
We noticed one particularly big key - "hostinger_onboarding_steps" which seems to contain an array with 239427 elements. This surely will crash anything.
Here is a workaround, run this query in your database:
UPDATE `wp_options` SET
`autoload` = 'no'
WHERE `option_name` = 'hostinger_onboarding_steps';
This basically excludes the option 'hostinger_onboarding_steps' from the autoloading, hence it is not processed as an admin string, hence it does not crash anything.