01.24.07

SK2-WP-Cache-Compatibility plugin

Posted in wordpress at 9:00 pm

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, WP-Cache will not get notified.

I create a small plug-in for SK2, that 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 will be 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.

28 Comments »

  1. Scott said,

    01.29.07 at 10:31 pm

    Thanks for the plugin :)

  2. Everton said,

    02.02.07 at 2:37 am

    You’re a star priv!

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

    02.02.07 at 3:07 am

    [...] Priv has put together a fix. All you have to do is Download this zip, extract and drop the php into the sk2_plugins directory. [...]

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

    02.02.07 at 10:55 am

    [...] and … nada. Same problem. I posted a comment on the announcement and priv pointed me to his SK2-WP-Cache-Compatibility plugin. It “helps” SK2 notify WP-Cache when a comment is [...]

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

    02.07.07 at 3:42 pm

    [...] found a fix for the problem of WP-Cache not flushing the cache due to an issue with Spam Karma. The fix to flush the cache comes from Privism as a small PHP file to add to the Spam Karma WordPress Plugin [...]

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

    02.16.07 at 3:04 am

    [...] at How To Fix WP-Cache And Spam Karma 2 (SK2) Issues led me to Priv’s SK2-WP-Cache-Compatibility plugin which sucessfully fixed the case of the missing comments. So far, so good. Everything ought to be [...]

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

    02.17.07 at 1:55 am

    [...] However, Priv has a solution in the form of a SK2 Plugin. [...]

  8. Ajay said,

    02.17.07 at 4:07 pm

    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 said,

    02.17.07 at 10:21 pm

    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 said,

    05.04.07 at 6:45 am

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

  11. HTMLHelp.blog : The HTMLHelp.blog Theme and Plugin Page said,

    05.11.07 at 11:39 pm

    [...] SK2-WP-Cache-Compatibility plugin - When you use Spam Karma 2 with WP-Cache, cached files are not flushed after a successfully comment approval. This fixes that issue. By Priv. [...]

  12. Akismet False Positives & Spam Karma Configuration | Andy Beard - Niche Marketing said,

    05.31.07 at 4:36 pm

    [...] If you are using WP-Cache, it is advisable to also use this fix for Spam Karma with WP-Cache. [...]

  13. Quix0r's Personal Weblog said,

    06.15.07 at 9:39 pm

    CPR seems to conflict with WP-Cache?…

    WP-Cache is a really great plugin. It saves a lot rendering time for the pages Wordpress pulls out.
    But it seems to be incompatible with plugins like SK2 and even my CPR which are both inserting a hidden field into the comments field. I guess also the …

  14. creer-un-blog said,

    06.18.07 at 8:25 pm

    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. Wordpress plugins and hacks | ChillyCool Web Digger said,

    06.30.07 at 4:16 am

    [...] WP-Cache and Spam Karma 2 not playing well together? Here’s the fix [...]

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

    07.01.07 at 8:19 am

    [...] Plugins Page [...]

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

    08.09.07 at 4:56 pm

    [...] Qualcosa di più dettagliato sul conflitto che c’è tra i due plugin lo si trova sul blog di Priv che presenta anche una parziale [...]

  18. | Molrak.com said,

    01.13.08 at 3:13 pm

    [...] Priv’s Blog » SK2-WP-Cache-Compatibility plugin [...]

  19. MillionDollarJourney said,

    01.16.08 at 7:03 am

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

  20. priv said,

    01.16.08 at 10:57 am

    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. jim arnold : Fixing comments in Wordpress while running Spam Karma and WP-cache said,

    01.28.08 at 11:33 am

    [...] http://privism.org/blog/archives/12 [...]

  22. jim said,

    01.31.08 at 1:07 pm

    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 said,

    01.31.08 at 1:09 pm

    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 said,

    01.31.08 at 1:44 pm

    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 said,

    01.31.08 at 10:15 pm

    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 said,

    01.31.08 at 10:17 pm

    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 said,

    04.24.08 at 1:35 am

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

  28. The Law of Unintended Consequences at Center for REALTOR® Technology Web Log said,

    05.07.08 at 11:43 pm

    [...] some web searching I found two sets of directions to fix this. The first is a plugin from Priv for SK2 that makes SK2 notify WP-SuperCache when its updates things. The second was some code modifications [...]

RSS feed for comments on this post · TrackBack URL

Leave a Comment