• Resolved bluantinoo

    (@bluantinoo)


    Hello,

    while in main language it’s allright, when visiting posts of second language the server boils and hangs like it’s doing something very hard.

    This is the part that fries my Local machine:

    foreach ($languages as $code => $l) {
    if (!$l['active']) {
    $otherID = apply_filters('wpml_object_id', $post_ID, $type, false, $l['language_code']);
    // add condition to prevent $otherID returning
    null
    if ($otherID) {
    $othercomments = get_comments(array('post_id' => $otherID, 'status' => 'approve', 'order' => 'ASC'));
    $comments = array_merge($comments, $othercomments);
    }
    }
    }
    • This topic was modified 7 months, 3 weeks ago by bluantinoo.
    • This topic was modified 7 months, 3 weeks ago by bluantinoo.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Pieter Bos

    (@senlin)

    Hello,

    Haven’t received any similar reports of that issue; do you have more details please?

    Is it loading eventually or never? Any error reports when you turn WP_DEBUG on? Any errors in the browser?

    Thread Starter bluantinoo

    (@bluantinoo)

    Hi Peter, thanks for interest.

    it looks like it’s just the array_merge($comments, $othercomments);

    Debug log is clean, I don’t think there are any errors. It’s just my machine that can’t handle an array_merge of 5k comments… but just in second language. weird.

    • This reply was modified 7 months, 3 weeks ago by bluantinoo.
    Plugin Author Pieter Bos

    (@senlin)

    Perhaps it’s the number of comments that is a bit too much?

    Maybe ask your host?

    Thread Starter bluantinoo

    (@bluantinoo)

    I think I’m getting close.
    Don’t know why, but pagination is not working on second language.

    It tries to list all 5k comments in one page.

    Plugin Author Pieter Bos

    (@senlin)

    I made a separate branch of the code on Github and opened an issue for this ticket.

    Can we continue the discussion there please?

    Thread Starter bluantinoo

    (@bluantinoo)

    Yes, and thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘In second language page hangs’ is closed to new replies.