PHPackages                             cmdz/spam-canner - 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. [Search &amp; Filtering](/categories/search)
4. /
5. cmdz/spam-canner

ActiveLibrary[Search &amp; Filtering](/categories/search)

cmdz/spam-canner
================

Extensible Spam Detection Filters based on snook.ca post

0.2.1(11y ago)35MITPHPPHP &gt;=5.4.0

Since Apr 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/AndyWendt/spam-canner)[ Packagist](https://packagist.org/packages/cmdz/spam-canner)[ Docs](https://github.com/AndyWendt/spam-canner)[ RSS](/packages/cmdz-spam-canner/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Spam Canner
===========

[](#spam-canner)

[![Build Status](https://camo.githubusercontent.com/f6a7c59b4648b1efe86237c145a66cb512ae4332acf9c48a6c7a178502af87fb/68747470733a2f2f7472617669732d63692e6f72672f416e647957656e64742f7370616d2d63616e6e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AndyWendt/spam-canner) [![Coverage Status](https://camo.githubusercontent.com/2a96d762fba48eb2c30faa026a1b4be12630ed27aff22eb661b14deadd1851c8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f416e647957656e64742f7370616d2d63616e6e65722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/AndyWendt/spam-canner?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/94511a81f30f35bdb51ae60560492d603ad23124dcd70e510e810d1585c22f25/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f416e647957656e64742f7370616d2d63616e6e65722f6261646765732f7175616c6974792d73636f72652e706e673f733d63306266643230383735353761323339313634666134353166333533643532613832613833643830)](https://scrutinizer-ci.com/g/AndyWendt/spam-canner/)

Extensible Spam Detection Filters based on this [snook.ca post](http://snook.ca/archives/other/effective_blog_comment_spam_blocker)

Installation
------------

[](#installation)

Available on [Packagist](https://packagist.org/packages/cmdz/spam-canner). Autoloading is PSR-4 compatible.

`composer require cmdz/spam-canner`

Usage
-----

[](#usage)

Filters are located in the `src/Filters` directory. You can add your own filters as well, they just need to implement `CmdZ\SpamCanner\Filters\FilterInterface` and then add them to the `$filters` array that you pass to `Score()`

```
$spamScoreIncrease = 1;
$currentCommentBody = 'abcd';
$previousCommentBody = 'abcd';

$testLink = 'http://www.site.de';
$spammyTlds = ['de'];
$domainParser = new \CmdZ\SpamCanner\Utilities\DomainParser;

$filters = [
  new BodyInPreviousComment($spamScoreIncrease, $currentCommentBody, $previousCommentBody),
  new Tlds($spamScoreIncrease, $testLink, $spammyTlds, $domainParser)
];

$utils = new \CmdZ\SpamCanner\Utilities\Utilities;
$score    = new Score($filters, $utils);
$result   = $score->getScore();
$expected = 2;
```

Available Filters
-----------------

[](#available-filters)

See [snook.ca post](http://snook.ca/archives/other/effective_blog_comment_spam_blocker) for the ideas behind each filter.

- [Body in Previous Comment](tests/Filters/BodyInPreviousCommentTest.php)
- [Body Length](tests/Filters/BodyLengthTest.php)
- [Check Auth Name for Link](tests/Filters/CheckAuthorNameForLinkTest.php)
- [Consonants](tests/Filters/ConsonantsTest.php)
- [First Word](tests/Filters/FirstWordTest.php)
- [Links in Body](tests/Filters/LinksInBodyTest.php)
- [Status of Previous Comment](tests/Filters/StatusOfPreviousCommentTest.php)
- [Tlds](tests/Filters/TldsTest.php)
- [Url Length](tests/Filters/UrlLengthTest.php)
- [Words Characters in Url](tests/Filters/UrlWordsCharactersTest.php)

Testing
-------

[](#testing)

```
$ phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see the License File for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~142 days

Total

3

Last Release

4171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6b92405460991d20f4fb1745206bfa7bce163be347ea33c0f91c521552b44f8?d=identicon)[AndyWendt](/maintainers/AndyWendt)

---

Top Contributors

[![AndyWendt](https://avatars.githubusercontent.com/u/6130713?v=4)](https://github.com/AndyWendt "AndyWendt (14 commits)")

---

Tags

filterspamdetection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cmdz-spam-canner/health.svg)

```
[![Health](https://phpackages.com/badges/cmdz-spam-canner/health.svg)](https://phpackages.com/packages/cmdz-spam-canner)
```

###  Alternatives

[clue/stream-filter

A simple and modern approach to stream filtering in PHP

1.7k271.5M8](/packages/clue-stream-filter)[laminas/laminas-filter

Programmatically filter and normalize data and files

9529.5M173](/packages/laminas-laminas-filter)[friendsofcake/search

CakePHP Search plugin using PRG pattern

1712.1M47](/packages/friendsofcake-search)[htmlawed/htmlawed

Official htmLawed PHP library for HTML filtering

411.2M12](/packages/htmlawed-htmlawed)[outl1ne/nova-input-filter

An input filter for Laravel Nova

24952.5k](/packages/outl1ne-nova-input-filter)[vria/nodiacritic

Tiny helper function that removes all diacritical signs from characters

113.2M13](/packages/vria-nodiacritic)

PHPackages © 2026

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