• Hi Stéphane,

    I’m currently testing Falang with the Elementor lite add-on. My server spec is 1 CPU, and 2GB memory.

    When I translate in Elementor editor, all is working well. I can also translate menu just fine. The issue starts when I try to translate a single page/post/product (I use WooCommerce, and I have around 7000+ products). E.g. link:

    https://www.mydomain.com/wp-admin/admin.php?page=falang-translation&language=id_ID&action=edit&post_id=2217670

    I got a memory exhausted error log. So I increase the max memory limit to 1024M, and execution time to 3600 sec (this is not normal, but just to test). I still get the exhausted memory error log.

    I changed to Twenty Twenty Three theme, and deactivated all plugins, except WooCommerce and Falang. When I open the link above, it took almost 20 secs to load.

    I don’t understand why this happens, because the site was working normally, was using Shoptimizer theme, with some other plugins.

    Do you have any idea or ever came across similar experience like this? How does Falang handle a site with 7000+ posts and probably quite a lot post meta?

    Thanks in advance,
    Dicko

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author sbouey

    (@sbouey)

    Hi,

    I haven’t of course not try with 7000 produduct, i will look on the query to besure it’s limitted but can you translate the product directly from the woocommerce product page , on the right you can translate it ?

    All is working fine in front-end ?

    Stéphane

    Thread Starter Dicko Mas Soebekti

    (@dickoms)

    I’ve tried from the product edit page, on the languages section (right side bar), same result. Also same result when I open this link directly from Falang section in wp-admin:

    https://www.mydomain.com/wp-admin/admin.php?page=falang-translation

    On front-end side, all is working fine, I can open the English and Indonesian (if available) version of the product.

    I checked in SQL, show full processlist, there’s 1 query that seemed to stuck:

    SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN ( *lists ALL post ids: page, product, variation, etc, so this is a very long list, spanning several pages of PuTTY screen ) ORDER BY meta_id ASC

    I’m not sure where this query comes from (or why), but I can see this might need a long processing time.

    Thanks,
    Dicko

    Plugin Author sbouey

    (@sbouey)

    I have found the problem it’s due to a Falang query in the falang-translation page. even if i display 20 posts, the full list is loaded in backend.

    I will update Falang to fix this and publish a new version , can send you a pre release version if you want.

    Stéphane

    Thread Starter Dicko Mas Soebekti

    (@dickoms)

    Sure! Let me know when you’ve got a pre release version. I’ll test that get back to you.

    Thanks,
    Dicko

    Plugin Author sbouey

    (@sbouey)

    The change are not quick because the WP_List_Table i use need the full list to make the pagination. But you can try a quick (and dirty small fix)

    wp-content/plugins/falang/admin/class-falang-admin.php line 323make the change like this, this will limite the display of 100 items with pagination of 20, you have to use the filter to get the right item

                case 'translation':
                    $post_list_table = new \Falang\Table\Post($this->model);
    
                    $per_page = (int) get_user_option( 'falang_post_per_page' );
                    if ( empty( $per_page ) || $per_page < 1 ) {
                        $per_page = 100;
                    }
                    if ((isset($_REQUEST['pt-filter']) && $_REQUEST['pt-filter'])) {
    
                        $translable_post_list = get_posts(array(
                            'post_type' => $_REQUEST['pt-filter'],
                            'post_status' => array('publish', 'pending', 'draft', 'future', 'private','inherit'),
                            'orderby' => 'post_title',
                            'order' => 'ASC',
                            'posts_per_page' => $per_page
                        ));
                    } else {
                        $translable_post_list = get_posts(array(
                            'post_type' => $this->model->get_transtable_post_types(true),
                            'post_status' => array('publish', 'pending', 'draft', 'future', 'private','inherit'),
                            'orderby' => 'post_title',
                            'order' => 'ASC',
                            'posts_per_page' => $per_page
                        ));
                    }
    
                    $post_list_table->prepare_items($translable_post_list);
    
    
    Thread Starter Dicko Mas Soebekti

    (@dickoms)

    Just tested the snippet, yep, that’s it, you’ve found the cause. Now it loads instantly (single post translation or the full list), even with me activating several other plugins, and using my usual theme.

    Not sure if this question is relevant in our case, but I found this on SO:

    https://stackoverflow.com/questions/24838864/how-do-i-get-pagination-to-work-for-get-posts-in-wordpress

    Thanks,
    Dicko

    Plugin Author sbouey

    (@sbouey)

    Perfect, the problem is found, i will make the right code now. i keep you informed when the new Falang version is done for test.

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    Hi,

    I have fixed the problem when a lot of post/products exist in the database. I will publish the new version today, i don’t know how i can send you a pre release version.

    Stéphane

    Thread Starter Dicko Mas Soebekti

    (@dickoms)

    Hi Stéphane,

    No worries, if you’ll release it today, I’ll wait for it. Or if you want me to test it first, you can upload it to Dropbox, or Google Drive, etc, and I’ll test it.

    Thanks,
    Dicko

    Plugin Author sbouey

    (@sbouey)

    I have published the 1.3.32 version.

    I leave you put this thread as resolved when you have checked the last version.

    Thread Starter Dicko Mas Soebekti

    (@dickoms)

    All good now Stéphane, thanks for the very fast fix. Marking this as resolved.

    Thanks,
    Dicko

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Issue translating product in site with 7000+ products’ is closed to new replies.