PHPackages                             groundsix/akismet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. groundsix/akismet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

groundsix/akismet
=================

A PHP akismet wrapper

033PHP

Since Jun 24Pushed 13y ago4 watchersCompare

[ Source](https://github.com/GroundSix/php5-akismet)[ Packagist](https://packagist.org/packages/groundsix/akismet)[ RSS](/packages/groundsix-akismet/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
============

[](#introduction)

This is a simple little PHP5 class that enables you use the Akismet anti-spam service in your PHP5 application.

Download
========

[](#download)

Check out the git repository:

```
git clone git@github.com:achingbrain/php5-akismet.git

```

Installation
============

[](#installation)

Once you have cloned the repo (see Download, above) copy the file at src/main/php/net/achingbrain/Akismet.class.php to somewhere accessible to your scripts. Use include or a derivative to import it into your script.

Alternatively if you are running a version of PHP greater than 5.3, grab the [phar file](http://achingbrain.github.com/maven-repo/releases/net/achingbrain/php5-akismet/0.5/php5-akismet-0.5.phar) and use the following code:

```

```

Documentation
=============

[](#documentation)

See the [PHPDocs](http://achingbrain.github.com/maven-repo/documentation/php5-akismet/apidocs).

Usage
=====

[](#usage)

Before you can use Akismet, you need a WordPress API key (they are free and getting one takes about five minutes). Once you have one, take a look at the code below:

```
$WordPressAPIKey = 'aoeu1aoue';
$MyBlogURL = 'http://www.example.com/blog/';

$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey);
$akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL($url);
$akismet->setCommentContent($comment);
$akismet->setPermalink('http://www.example.com/blog/alex/someurl/');

if($akismet->isCommentSpam())
  // store the comment but mark it as spam (in case of a mis-diagnosis)
else
  // store the comment normally

```

That's just about it. In the event that the filter wrongly tags messages, you can at a later date create a new object and populate it from your database, overriding fields where necessary and then use the following two methods to train it:

```
$akismet->submitSpam();

```

and

```
$akismet->submitHam();

```

to submit mis-diagnosed spam and ham, which improves the system for everybody. See the included documentation for a complete run-down of all available methods.

Changelog
---------

[](#changelog)

### Version 0.5

[](#version-05)

- Deployed to GitHub instead of achingbrain.net for better collaboration in future
- Converted project to use Maven for unit testing and documentation generation
- Unit tests &amp; documentaiton
- Allowed overriding of user agent when submitting ham/spam (thanks Steven)

### Version 0.4

[](#version-04)

- Performance – changed HTTP version from 1.1 to 1.0 (with thanks to Jan De Poorter).
- Performance – No longer issues a separate HTTP request to check validity of the API key with every instantiation.
- Added a new public method 'isKeyValid' to manually check validity of the API key passed to the constructor.
- The method 'isCommentSpam' (rather than the constructor) will now throw an exception if the API key is invalid.
- Tidied up internal structure a bit.

### Version 0.3

[](#version-03)

Internal testing version

### Version 0.2

[](#version-02)

Initial release

### Version 0.1

[](#version-01)

Internal testing version

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fd7a1a7df5ea6be3e43ddf493224da1145132a079e2d6668a9f91f20793855e?d=identicon)[2bard](/maintainers/2bard)

---

Top Contributors

[![achingbrain](https://avatars.githubusercontent.com/u/665810?v=4)](https://github.com/achingbrain "achingbrain (3 commits)")

### Embed Badge

![Health badge](/badges/groundsix-akismet/health.svg)

```
[![Health](https://phpackages.com/badges/groundsix-akismet/health.svg)](https://phpackages.com/packages/groundsix-akismet)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
