Support » Plugin: WP Super Cache » Published-to-draft bug

  • Resolved Biranit

    (@biranit)


    Hi Donncha,

    I think there’s a bug in the way WPSC behaves:

    – When in Preload mode, when a post is published it gets cached indefinitely (unless updated).

    – When that post is changed from “published” to “draft”, the cached version is NOT deleted. Therefore, the post remains public and accessible – even though it no longer is.

    – The only way of getting rid that post online, is to manually delete the cached page.

    I tested this on a clean WordPress installation to verify this is indeed what happens regardless of my system.

    Cheers,

    Bira

    http://wordpress.org/extend/plugins/wp-super-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Biranit

    (@biranit)

    FYI, I added a function to fix this:

    // delete posts cache when a post is unpublished
    function rgbtoi_post_unpublished( $new_status, $old_status, $post ) {
        if ( $old_status == 'publish' && $new_status != 'publish' ) {
            // Post is unpublished
            prune_super_cache ( get_supercache_dir() . '/' . $post->post_name . '/', true );
            // add here whatever other actions needed
        }
    }
    Plugin Author Donncha O Caoimh

    (@donncha)

    Thanks for spotting that. I’m surprised that it occurs but I’ll add a similar fix to the plugin before the next release.

    Thanks 🙂

    Plugin Author Donncha O Caoimh

    (@donncha)

    As I said on another thread, I just checked in code that will fix this. Check out the development version in about 20 minutes!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Published-to-draft bug’ is closed to new replies.