Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 18 replies, has 2 voices.

Last updated by Kor 1 day, 21 hours ago.

Assisted by: Kor.

Author Posts
October 7, 2024 at 2:30 pm #16262165

juergenS-23

Background of the issue:
I am trying to save a new menu item and sync it into other languages on my WordPress site. The issue can be seen at hidden link.

Symptoms:
It takes more than 4 minutes to save a new menu item and even longer to sync it into other languages. This is a speed issue on my backend.

Questions:
How do I improve my speed when working with Menus

October 7, 2024 at 4:36 pm #16262973

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

I've converted the chat into a ticket since I'm not getting any response from your end. I've checked your Website and I can see that you've so many navigation menus and languages.

It will take some time for WPML to sync the navigations but you can try this method to debug the performance https://wpml.org/faq/how-to-debug-performance-problems/ . Could you check?

October 17, 2024 at 2:23 pm #16300955

juergenS-23

I have implemented the above and the speed hasn't changed like we intend it to be. Any more recommendations ?

October 17, 2024 at 3:54 pm #16301358

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

October 18, 2024 at 10:30 am #16303778

juergenS-23

Is it okay if you looked into this ticket too since you are at it?
https://wpml.org/forums/topic/i-have-translated-strings-which-are-not-showing-on-frontend-under-respective-languages/

October 18, 2024 at 11:15 am #16304105

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your response.

I encounter an issue when attempting to access the menu sync option; it displays a "A timeout occurred" page when it fails to load. Could you please reach out to your hosting provider to check the error logs? Additionally, ask them to increase the server resources as much as possible and temporarily disable the CloudFlare CDN.

Currently, I am unable to open any pages in the backend of the site, as it continuously shows "A timeout occurred."

October 21, 2024 at 12:47 pm #16312373

juergenS-23

Hello,
I disabled cloudflare on the server, kindly attempt to access the pages now.

October 21, 2024 at 5:55 pm #16313927

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

It looks like every time I open the menu sync feature, the Website crashes due to insufficient resources.

I regret any inconvenience caused, but to proceed with troubleshooting, I kindly ask for a snapshot of the site. Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.

To guide you further, please adhere to these instructions:

1. View the Duplicator instructions video: hidden link

2. Consult WPML's instructions on providing supporters with a copy of your site: https://wpml.org/faq/provide-supporters-copy-site/

3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.

Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.

Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.

October 22, 2024 at 3:13 pm #16318292

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I've escalated this to our 2nd Tier Support and they will check and revert to us as quickly as possible.

October 23, 2024 at 6:11 am #16319959

juergenS-23

Okay thanks ,
Can I continue working on the website or will any change on the site affect this ticket ?

October 23, 2024 at 8:30 am #16320604

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Yes, you may work on the Website. I'm still waiting for a response from our 2nd Tier Support.

October 24, 2024 at 7:19 am #16324522

juergenS-23

Still no response on this issue ?

October 24, 2024 at 11:59 am #16325975

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I have feedback and our 2nd Tier Support shared some workarounds.

The issues is caused by \WPML_Menu_Sync_Functionality::get_page_orphan_sql in wp-content/plugins/sitepress-multilingual-cms/inc/wp-nav-menus/wpml-menu-sync-functionality.class.php

rewriting the function to the below should help a bit. Menu sync should be run with patience as the logic is a bit old. Maybe a better alternative is to manually translate the menus. Anyhow, this is escalated to our devs for further investigation.

private function get_page_orphan_sql( $existing_languages, $menu_item_id ) {
    $wpdb = &$this->wpdb;

    // Prepare the NOT IN list
    $existing_languages_in_clause = wpml_prepare_in( $existing_languages );

    // Build the SQL query with early filtering and improved structure
    return $wpdb->prepare(
        "SELECT it.element_id, it.language_code
        FROM {$wpdb->prefix}icl_translations it
        JOIN {$wpdb->posts} pt
            ON pt.ID = it.element_id
            AND pt.post_type = 'nav_menu_item'
            AND it.element_type = 'post_nav_menu_item'
            AND it.language_code NOT IN ($existing_languages_in_clause)
        JOIN {$wpdb->prefix}icl_translations io
            ON io.trid != it.trid
        JOIN {$wpdb->posts} po
            ON po.ID = io.element_id
            AND po.post_type = 'nav_menu_item'
        JOIN {$wpdb->postmeta} mo
            ON mo.post_id = po.ID
            AND mo.meta_key = '_menu_item_object_id'
        JOIN {$wpdb->postmeta} mt
            ON mt.post_id = pt.ID
            AND mt.meta_key = '_menu_item_object_id'
        JOIN {$wpdb->prefix}icl_translations page_t
            ON mt.meta_value = page_t.element_id
            AND page_t.element_type = 'post_page'
        WHERE io.element_id = %d
        AND EXISTS (
            SELECT 1
            FROM {$wpdb->prefix}icl_translations count
            WHERE count.trid = it.trid
            HAVING COUNT(count.element_id) = 1
        )",
        $menu_item_id
    );
}

I've applied the fix to your Website and I can load the menu sync within 2-3 minutes now. It would help a bit but there will be a better solution soon in the future.

October 29, 2024 at 1:53 pm #16342607

juergenS-23

the problem is not just with the fact that the synchronizing of the menus is next to impossible. The main issue is that loading a page or post, saving changes etc. takes up to 4 minutes, which makes it extremely difficult to manage the site.
Even the frontend seems to be affected, especially when multiple visitors interact with the site, when multiple pages are opened in new tabs etc.
We urgently need a resolution for this issue!

October 29, 2024 at 3:22 pm #16343238

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I apologize for the issues. I've rechecked the report and our 2nd Tier Support has already escalated this to our devs for further review. We are still waiting for their feedback and I've also shared your feedback on the report. I will come back to you once I hear from them.