Search

If the team finally finds the time to mount a donate button, I will be glad to pay for the wine!

After playing with this today, I found the spam checking very slow (up to 10 seconds for a one line comment) which is clearly unacceptable. After a bit of poking and reading around, I found suggestions that the default Akismet code using fsockopen was a lot slower than using something like cURL.

I found akismet-php-curl-class which is a LOT faster. After integrating into the current extension, comments are processed in almost real time.

Drop the attached into the /lib/ folder of the Akismet extension and modify extension.driver.php thusly:

Original:

        include_once(EXTENSIONS . '/akismet/lib/class.akismet.php');
        $Server = new Akismet(URL, $this->getWordpressApiKey());

        $Server->setCommentContent(implode($context['fields']));
        $Server->setCommentAuthor($mapping['author']);
        $Server->setCommentAuthorEmail($mapping['email']);
        $Server->setCommentAuthorURL($mapping['url']);
        $Server->setPermalink(URL . $_REQUEST['page']);

        $valid = !$Server->isCommentSpam();

Becomes:

        include_once(EXTENSIONS . '/akismet/lib/class.akismet.curl.php');

        $comment = array(
            'comment_type' => 'comment',
            'comment_author' => $mapping['author'],
            'comment_author_email' => $mapping['email'],
            'comment_author_url' => $mapping['url'],
            'comment_content' => implode($context['fields']),
            'permalink' => URL . $_REQUEST['page']
        );

        $akismet = new akismet($this->getWordpressApiKey(), URL);
        if(!$akismet->error) {
            $valid = !$akismet->is_spam($comment);
        }

Hope someone finds this useful :)

Will give it a whirl... thanks nickdunn...

Thanks Nick.

I've posted an update above.

I'm having issues saving comments to a post of mine.

The comments are saving, but they aren't showing up in my comments ds. even in my <events> node in my page source, it passes the askimet and all that jazz.

I have the 1.2 version of this. Could it be that the section i have my comments form is in isn't name Articles or should the askimet form be independent from whatever section it is in?

On another note, I noticed that in the admin where you can approve/reject comments, you cant' tell which comments are approved or rejected.

I guess there's a problem at line #92 of extension.driver.php. Every time I try to add "Akismet Spam Filtering" to "Save Comment" filter rules I get a PHP error.

I replaced:

<input name="akismet[email]" value="'."\'".'literal@email.com'."\'".'" type="hidden" />

with:

<input name="akismet[email]" value="\'literal@email.com\'" type="hidden" />

Now it works.

Simone

Thanks Simone. I will add your fix and release an update.

Done. I've also put this extension under git control. Have a look here

I installed this extension a few days ago, but after working with it and researching it for an hour or two on about four days I failed to get it to work. My test comment was always identified as spam although it contained no links and I was using my own username, email address and website. So I thought there had to be something wrong with my implementation.

Then I came across a blogger that scores short comments as likely being spam. I changed the body of my comment to several sentences, resubmitted it and it worked. Now I’m thinking this is not good because I often get ham comments that contain only two or three words. So I started experimenting with different comments containing only one or two words. None of them were labeled as spam.

What the heck!

I then tried my original two-word test comment again. Spam! The two words were “testing akismet.” I tried “testing” by itself and “akismet” by itself. Both passed as ham. I spent several days on this problem because I chose the wrong two-word combination for my test comment.

If someone who is using Akismet would like to test the words on their implementation I would be interested in hearing the result.

I don’t know how, but this extension should be added to the official list here:

http://akismet.com/development/

Emailed them.

There seems to be a bug with this extension and the latest stable version of Symphony. Is anybody here experiencing the same problem?

I’ve replied.

Do you have to pass a website url to Askimet in order to check comments? I would like to just include name, email & comments within my section.

I don’t believe Akismet’s API requires the commenter’s URL, but the extension may. Have you tried simply excluding it?

Oops yea that works, feel stupid now :) Thanks for your help.

Has anyone forked this extension to provide “this is not spam”, and “this is spam” functionality?

If not, how do you think this should be implemented? Should all “spam” results make it through to the backend, but be hidden by default? Should the spam results be submitted to another section?

For my client I will need the “this is spam” button more urgently than the “this is not spam” button, so I might just deny all spam results, and delete every spam result when it is marked as a temp solution.

Akismet Spam Filtering updated to version 1.4 on 23rd of March 2011

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details