PHPackages                             perf/spam-detection - 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. perf/spam-detection

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

perf/spam-detection
===================

Allows spam detection from suspicious form submissions.

2.0.0(2y ago)039MITPHPPHP &gt;=8.2

Since Feb 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jmfeurprier/perf-spam-detection)[ Packagist](https://packagist.org/packages/perf/spam-detection)[ RSS](/packages/perf-spam-detection/feed)WikiDiscussions 2.0 Synced 1mo ago

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

Spam detection
==============

[](#spam-detection)

Allows detection of spam from contact forms, etc.

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

[](#installation)

```
composer require perf/spam-detection
```

Configuration
-------------

[](#configuration)

Implement a spam key word repository, such as this one:

```
use perf\SpamDetection\SpamKeyword;
use perf\SpamDetection\SpamKeywordRepositoryInterface;

class SpamKeywordRepository implements SpamKeywordRepositoryInterface
{
    public function getSpamKeywords(): iterable
    {
        return [
            new SpamKeyword('viagra', 150),
            new SpamKeyword('casino', 100),
        ];
    }
}
```

Usage
-----

[](#usage)

Now you can detect spam:

```
use perf\SpamDetection\SpamEvaluator;

$spamEvaluator = new SpamEvaluator(
    new SpamKeywordRepository(),
    100 // Threshold
);

$submittedContent = 'Buy Viagra, and then go to the casino.'

$outcome = $spamEvaluator->evaluate($submittedContent);

if ($outcome->isSpam()) {
    echo "This is definitely spam.";
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~211 days

Total

4

Last Release

928d ago

Major Versions

1.0.x-dev → 2.0.02023-11-01

PHP version history (2 changes)1.0.0PHP &gt;=7.4

2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b08b8105ec8bc88d1c911e10dbf156814769650a67960e2f3d71ed6d2417f0d?d=identicon)[jmfeurprier](/maintainers/jmfeurprier)

---

Top Contributors

[![jmfeurprier](https://avatars.githubusercontent.com/u/8434690?v=4)](https://github.com/jmfeurprier "jmfeurprier (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/perf-spam-detection/health.svg)

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

PHPackages © 2026

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