Support » Plugin: Simple Custom Post Order » refresh function dealcok

  • Resolved Sociality

    (@sociality)


    We use the plugin in a big db (100.000<posts) and we got deadlock in the sql due to the refresh function of your plugin and particularly the query

        // Here's the optimization
                    $wpdb->query("SET @row_number = 0;");
                    $wpdb->query("UPDATE $wpdb->posts as pt JOIN (
                      SELECT ID, (@row_number:=@row_number + 1) AS <code>rank</code>
                      FROM $wpdb->posts
                      WHERE post_type = '$object' AND post_status IN ( 'publish', 'pending', 'draft', 'private', 'future' )
                      ORDER BY menu_order ASC
                    ) as pt2
                    ON pt.id = pt2.id
                    SET pt.menu_order = pt2.<code>rank</code>;");

    I just commented out the action refresh for the admin hook. Is that OK? It seems that the plugin still works.

Viewing 1 replies (of 1 total)
  • Plugin Support mplusb

    (@mplusb)

    Hello @sociality,

    Thank you for reaching out to us!
    Yes, removing that piece of code is ok.
    We only added it in the first because it was a suggestion from one of our users.

    All the best,
    Mihaela

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.