• 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

    https://www.ads-software.com/extend/plugins/wp-super-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter 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
        }
    }

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

    Thread Starter Biranit

    (@biranit)

    Thanks ??

    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.