Skip to content Skip to sidebar

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

Problem:
The client is unable to use the auto-translate feature. After adding items to the translation queue, the translation does not proceed, and the status remains as "Refreshing Translation Status".
Solution:
We recommend the following steps:
1. Back up your database to ensure that you can restore your site if necessary.
2. Delete the

wpml.ate_sync.lock

key from the

wp_options

table in your database.
This action should resolve the issue with the stuck translation status.

Please note that this solution might be outdated or not applicable to your case. If the problem persists, we encourage you to check the related known issues and verify that you have the latest versions of themes and plugins installed. If you still need assistance, please open a new support ticket with us.

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

Last updated by Osama Mersal 1 year, 6 months ago.

Assisted by: Osama Mersal.

Author Posts
April 15, 2024 at 6:15 pm #15521549

Masaki Nagashima

I pushed it like you said and now it can translate automatically.
Thank you very much.

I am not sure what was the cause of the problem and I am worried that I will not be able to translate again.
Please let me know if there is any possible cause.

Also, I can now auto-translate, but the header display does not disappear.
Is this a different problem from the automatic translation?

スクリーンショット 2024-04-16 030933.png
April 16, 2024 at 7:47 am #15523054

Masaki Nagashima

The original site is no longer translating again.
I have not rewritten the code or anything, so the cause is unknown.
I've asked the client for permission and will give you the access information.
I would appreciate it if you could check the original site.

April 16, 2024 at 9:08 am #15523689

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Sure, I'll enable the private reply so you can share the live site's access details.

Please make sure that you have a backup before sharing the details.

Best regards,
Osama

April 16, 2024 at 3:42 pm #15526939

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

1) Thanks for the access details. Do you have a firewall on the server, or are you using a CDN?

I tested with this post. (hidden link)

2) I checked with our ATE system and the site is repeated twice. One is moved, and one is copied, so this could be the cause of the issue.

Would you please unregister WPML, delete this site's key, and reregister it with a new key?

Best regards,
Osama

April 17, 2024 at 3:03 am #15528853

Masaki Nagashima

Thank you for your checking.
I tried registering a new key, but the translation did not work.

The client provided the following response to the first question.
-----------
There is no in-OS Firewall, but because it is an AWS EC2 server, there is a security group (rule that only restricted IPs can communicate).
*WordPress web ports (80/443) are not restricted, but there is Basic authentication.
By the way, do you want to communicate with a specific port?
If necessary, we will receive your IP and add rules.
Also, we do not have a CDN specifically set up here.
-----------

https://wpml.org/forums/topic/include-basic-auth-in-loopback-requests/

The code listed in this topic has been removed once.
Is this code necessary?

April 17, 2024 at 8:26 am #15530110

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

The REST API is disabled on the site. Could you please enable it and check the translation?

Best regards,
Osama

April 17, 2024 at 11:03 am #15531115

Masaki Nagashima

The site itself can use the REST API, but if WPML cannot use the REST API, is it still because of Basic authentication?

I have just added the following code.
Still no translation is available.
Is there something wrong with the code or is there another way?

function wpbp_http_request_args( $r, $url ) {
$r['headers']['Authorization'] = 'Basic ' . base64_encode( USERNAME . ':' . PASSWORD );

return $r;
}
add_filter( 'http_request_args', 'wpbp_http_request_args', 10, 2);

April 17, 2024 at 11:25 am #15531452

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please try the following code.

function wpbp_http_request_args($r, $url) {
    // Define API domains where Auth should be added
    $api_domains = ['api.example.com', 'secure.example2.com'];

    // Check if the URL belongs to one of the defined API domains
    foreach ($api_domains as $domain) {
        if (strpos($url, $domain) !== false) {
            // Securely fetch the username and password stored in wp-config.php or database
            $username = defined('API_USERNAME') ? API_USERNAME : get_option('api_username');
            $password = defined('API_PASSWORD') ? API_PASSWORD : get_option('api_password');

            // Add the Authorization header
            $r['headers']['Authorization'] = 'Basic ' . base64_encode($username . ':' . $password);
            break;
        }
    }

    return $r;
}
add_filter('http_request_args', 'wpbp_http_request_args', 10, 2);

Also, please add the following code in wp-config.php

define('API_USERNAME', 'your_username');
define('API_PASSWORD', 'your_password');

Best regards,
Osama

April 17, 2024 at 12:33 pm #15532063

Masaki Nagashima

I have added the code you gave me.
Only 'your_username' and 'your_password' need to be rewritten, right?
The translation still doesn't work, but the REST API seems to be working in the WPML support menu view.

スクリーンショット 2024-04-17 213019.png
April 17, 2024 at 1:46 pm #15532684

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I still see it as not enabled on the support page. (hidden link)

I'll consult our 2nd tier support team and update you as soon as I get their update.

Best regards,
Osama

April 18, 2024 at 9:38 am #15536797

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Could you please delete the "wpml.ate_sync.lock" key from the "wp_options" table and check the issue?

❌ Please backup your database before performing the above test ❌

Best regards,
Osama

April 18, 2024 at 11:06 am #15537813

Masaki Nagashima

Thank you for your investigation.
I checked the database and found the following two keys

wpml.ate_sync.lock
wpml.ate_sync.lock.key

May I delete both of them?

April 18, 2024 at 11:12 am #15537858

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please back up the database before deleting them Both.

Best regards,
Osama

April 18, 2024 at 11:47 am #15538073

Masaki Nagashima

I removed the key and now I can translate!
Thank you for your persistent support.