Home > WordPress > wp-kumonosu のAkismet filter が利いてない

wp-kumonosu のAkismet filter が利いてない

  • 2007-04-18 (水) 17:43 | Visited 3273 times, 3 so far today
  • WordPress
  • add to hatena hatena.comment (1) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 1

WordPress を 2.1.x 系統にアップグレードした際に、同梱のAkismet プラグインが2.x にバージョンアップしたせいか、wp-kumonosu のAkismet filter が動作しなくなっていることに頭を悩ませていました。

一念発起、ソースを追ってみたら、wp-kumonosu 0.48 内の関数kumonosu_akismet_filter にて、Akismet プラグインの中にすでに存在しない関数ksd_auto_check_comment を呼び出しているのが問題の模様。関数の存在チェックで常にfalse が返る訳なので、その後のAkismet filter は動作しようがない、のかな?
同等の動作をするっぽい関数akismet_auto_check_comment をakismet.php 内で見つけたので、これを利用すればいいのかな?

ということで、投げやりなパッチ

 $ diff -c wp-kumonosu.php.org wp-kumonosu.php
*** wp-kumonosu.php.org 2007-04-18 17:35:00.000000000 +0900
--- wp-kumonosu.php     2007-04-18 17:34:41.000000000 +0900
***************
*** 904,916 ****
  }

  add_action('preprocess_comment', 'kumonosu_akismet_filter', 1);
! if(function_exists('ksd_auto_check_comment')) {
!       remove_action('preprocess_comment', 'ksd_auto_check_comment', 1);
  }

  function kumonosu_akismet_filter($comment) {

!       if(!function_exists('ksd_auto_check_comment'))
                return $comment;

        $wpKumonosu = & new WpKumonosu();
--- 904,916 ----
  }

  add_action('preprocess_comment', 'kumonosu_akismet_filter', 1);
! if(function_exists('akismet_auto_check_comment')) {
!       remove_action('preprocess_comment', 'akismet_auto_check_comment', 1);
  }

  function kumonosu_akismet_filter($comment) {

!       if(!function_exists('akismet_auto_check_comment'))
                return $comment;

        $wpKumonosu = & new WpKumonosu();
***************
*** 926,932 ****
        }

        if($do_akismet) {
!               $comment = ksd_auto_check_comment($comment);
        }

        return $comment;
--- 926,932 ----
        }

        if($do_akismet) {
!               $comment = akismet_auto_check_comment($comment);
        }

        return $comment;

自サイト内のTrackback はしっかりとデバッグログに記録されていたから、動作するようになったのは間違いなさそうですが、しばらくはこれで様子見です。

拍手する
この記事が参考になったり面白かったりしたらお気軽にご評価ください
1 Star2 Stars3 Stars4 Stars5 Stars(2 件の評価, 平均: 5.00 点 / 5 点満点中)
読み込み中 ... 読み込み中 ...

Comments:0

Comment Form
Remember personal info

Trackbacks:0

トラックバックURL
Listed below are links to weblogs that reference
wp-kumonosu のAkismet filter が利いてない from MOMENTS

Home > WordPress > wp-kumonosu のAkismet filter が利いてない

応援中
サイト内検索
フィード
メタ情報
広告
ブログパーツ
あわせて読みたい フィードメーター - MOMENTS

Return to page top