Support » Plugin: WP Super Cache » Possible bug in WordPress Super Cache preloading process

  • In the Preload Tab of WP Super Cache it says “Caching is done from the newest post to the oldest so please consider only caching the newest if you have lots (10,000+) of posts.”

    However in the function wp_cron_preload_cache(), located in file wp-cache.php, I found the following code at line 3244:

    $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE ( post_type IN ( $types ) ) AND post_status = 'publish' ORDER BY ID ASC LIMIT $c, 100" );

    As I understand, this line selects posts from oldest to newest given the use of ASC in the ORDER BY clause.

    In my opinion, to select posts from newest to oldest as stated in the Preload tab, we should use DESC and not ASC:

    $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE ( post_type IN ( $types ) ) AND post_status = 'publish' ORDER BY ID DESC LIMIT $c, 100" );

    Is this really a bug or I have missed something?

    I am using WP Super Cache 1.4.7.

    https://wordpress.org/plugins/wp-super-cache/

Viewing 1 replies (of 1 total)
  • Hello, thank you for the info.
    Now, Version: 1.4.9 is still using “ORDER BY ID ASC”.
    So, we should do manually edit if we want to preload News Post.
    And, edit manual again if this plugin has updates.

Viewing 1 replies (of 1 total)
  • The topic ‘Possible bug in WordPress Super Cache preloading process’ is closed to new replies.