SK2-WP-Cache-Compatibility plugin

When you use Spam Karma 2 with WP-Cache, cached files are not flushed after a successfully comment approval.

That’s basically because SK2 intercepts some actions, so WP-Cache will not get notified.

I create a small plug-in for SK2, which will directly call wp-cache to flush cache, after a comment is approved.

Download this zip, extract and drop the php into sk2_plugins directory, it should just work.

Note:

  1. wp-cache 2.1.0 is out, please install 2.1.0 and delete old cache before you complain this compatibility plug-in is not working.
  2. Turn off ‘encrypted payload’ check in sk2, see the reason updated below.

Updated: There’s a problem discovered by Reiner, sk2 generates some dynamic hidden field to check if the page is really loaded by a browser before the comment is posted.

The ‘encrypted payload’ plug-in will cause the biggest problem, since it contains an ‘ip’ field that generated base upon client’s ip.

With wp-cache, encrypted payload is fixed, so the ip will not match the real commenter’s ip.  IP mismatch will cause a minus 2.5 karma, which will prevent many normal comments comes in.

This entry was posted in wordpress. Bookmark the permalink.

34 Responses to SK2-WP-Cache-Compatibility plugin

  1. Scott says:

    Thanks for the plugin :)

  2. Everton says:

    You’re a star priv!

  3. Pingback: How To Fix WP-Cache And Spam Karma 2 (SK2) Issues » Connected Internet

  4. Pingback: WordPress: WP-Cache acting funny? » Solo Technology

  5. Pingback: WordPress Wednesday: Custom Fields Contest and Lots of WordPress.com News at The Blog Herald

  6. Pingback: Reiner Saddey’s Place » Why WP-Cache and Spam Preventers like Spam Karma 2.1 will never work in harmony

  7. Pingback: Making SK2 and WP-Cache play together » Ajay - On the Road called Life!

  8. Ajay says:

    Hi,

    I’m facing one problem. I have comment moderation enabled and when I approve a comment, the cache doesn’t seem to get flushed.
    The flushing works only on unmoderated comments.

    Ajay

  9. priv says:

    Strange since I cannot reproduce.

    There happens to be a comment is awaiting moderation just a few minutes ago, so I approve it in comment->awaiting moderation, the cache gets flushed.

    And I tried more way to do that, when I approve/unapprove/delete in comments->comments, or select recover comments in sk2->recent spam harvest, the cache also gets flushed.

    Currently the only problem I see is when I do ‘moderate selected’ in sk2->Approved Comments, the cache will not be flushed so the spam will not gone in post.

    If you still get this problem please help me with more detailed reproducing steps then I can help.

  10. Max Thrane says:

    Worked just great at my site! Thanks for this fix! =)

  11. Pingback: HTMLHelp.blog : The HTMLHelp.blog Theme and Plugin Page

  12. Pingback: Akismet False Positives & Spam Karma Configuration | Andy Beard - Niche Marketing

  13. Pingback: Quix0r's Personal Weblog

  14. you don’t have to turn off completely encrypted payload. Also if you do it you’ll be breaking the stopwatch plugin too.
    Here is demonstrated how to keep those two plugins active:
    http://mu.wordpress.org/forums/topic.php?id=2296&page=2&replies=45#post-31086

  15. Pingback: Wordpress plugins and hacks | ChillyCool Web Digger

  16. Pingback: Spam Karma 2 And WP-Cache Compatibility Issues! And How To Solve Them? » D’ Technology Weblog: Technology News & Reviews

  17. Pingback: Usare Spam Karma 2 e WP-Cache assieme e senza problemi | Davide Salerno

  18. Pingback: | Molrak.com

  19. Hey Priv, great patch. Will this plugin work with SK2 and WP SUPER CACHE?

  20. priv says:

    No I don’t think so. This plug-in directly calls WP-Cache function to flush. It’s unlikely that other cache plug-ins will have same function name all calling convention.

  21. Pingback: jim arnold : Fixing comments in Wordpress while running Spam Karma and WP-cache

  22. jim says:

    I thought I had this fixed and posted a blog entry about it (actually that’s me above), but it turns out what I did has not fixed the delay in comments being posted to our blogs. I have the latest versions of WP-Cache and SK2, deleted old cache and turned off ‘encrypted payload’ check in sk2.

    If you see my blog entry above I’ve even made the changes mentioned by the user Quenting about half way down on this page: http://mu.wordpress.org/forums/topic.php?id=2296&page=2&replies=45

    Sometimes the comments show up immediately and other times they take a half hour. I am also running Akismet. Should I not be running that along with SK2 and WP-cache?

    I’m ready to give up on either WP-cache or SK2 just to get comments to appear when posted by the user.

    Any thoughts?

    Thanks,
    Jim

  23. jim says:

    Priv,

    FYI, when I submitted my previous comment on this site it did not appear. Looks like your fix is not working on your site either. :(

  24. priv says:

    Well I have no idea, I haven’t tested it with the latest version of WP for a long time, it might works, it might not.

    Sometimes ISP’s transparent proxy interfere the behavior, I need to shift-reload to get the latest page, but I’m actually haven’t run into real problem about the comments for long on my Chinese blog(which is more commented)

  25. jim says:

    Priv,

    I’m running 5 or 6 blogs where I’ve tried the commenting fix. I’ve noted that it’s inconsistent as to whether you will see your comment right away once you click the submit button.

    As you noted, doing a super reload to will get the page to reload to show the comment, but to the ordinary person they don’t know to do this and to them their comment was not left.

  26. jim says:

    Just to prove my point, when I left the message above I saw it immediately after hitting the submit button.

    The message I left at 01.31.08 at 1:07 pm was not seen immediately when I submitted it.

    You may need to update your page to reflect we still have a conflict between SK2 and WP-cache.

  27. Milan says:

    Thanks a lot for the assistance in getting SK2 and WP Cache to play along.

  28. Pingback: The Law of Unintended Consequences at Center for REALTOR® Technology Web Log

  29. Gunawan says:

    Before I have same problem with you. And thanks you for your post.

  30. This is a big problem when comments are coming in full steam ahead. Caching has its goods and bads…and unfortunately caching and comments don’t co-exist well. I hope this plugin helps.

    Thanks for the info,
    Richard

  31. Pingback: Wordpress Plugin Center - Priv s Blog SK2-WP-Cache-Compatibility plugin (WP Comment Plugin)

  32. Pingback: Priv s Blog SK2-WP-Cache-Compatibility (WP Comment Plugin) plugin | www.TheWordpressPlugin.com

  33. Hi! Good post! I needed to know such kind of information to update myself. I’m into Real Estate and need to know what’s new in the market. Thanks for the information.

  34. Pingback: Wordpress plugins and hacks — Blog a Living

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>