PHPackages                             silverware/spam-guard - 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. [Security](/categories/security)
4. /
5. silverware/spam-guard

ActiveSilverstripe-vendormodule[Security](/categories/security)

silverware/spam-guard
=====================

SilverWare Spam Guard Module.

1.0.4(7y ago)039722BSD-3-ClausePHPPHP &gt;=5.6.0

Since May 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/praxisnetau/silverware-spam-guard)[ Packagist](https://packagist.org/packages/silverware/spam-guard)[ Docs](https://github.com/praxisnetau/silverware-spam-guard)[ RSS](/packages/silverware-spam-guard/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (1)Versions (7)Used By (2)

SilverWare Spam Guard Module
============================

[](#silverware-spam-guard-module)

[![Latest Stable Version](https://camo.githubusercontent.com/1aa811cbd5537d0620655b6e51319b74e95d5b6e94fe948a00a3d0a35ef4ef1f/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f7370616d2d67756172642f762f737461626c65)](https://packagist.org/packages/silverware/spam-guard)[![Latest Unstable Version](https://camo.githubusercontent.com/5573c63193b9528283e9b4bed71c76a1e9677cd0fb9ae1709980a33ba580d10a/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f7370616d2d67756172642f762f756e737461626c65)](https://packagist.org/packages/silverware/spam-guard)[![License](https://camo.githubusercontent.com/e2b136d66c3c4903451d092a138d2aed6b4a17f85a4a7d3a76912b9e3cc2e35d/68747470733a2f2f706f7365722e707567782e6f72672f73696c766572776172652f7370616d2d67756172642f6c6963656e7365)](https://packagist.org/packages/silverware/spam-guard)

A form spam protection module for [SilverStripe v4](https://github.com/silverstripe/silverstripe-framework).

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Issues](#issues)
- [Contribution](#contribution)
- [Attribution](#attribution)
- [Maintainers](#maintainers)
- [License](#license)

Requirements
------------

[](#requirements)

- [SilverStripe Framework v4](https://github.com/silverstripe/silverstripe-framework)

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

[](#installation)

Installation is via [Composer](https://getcomposer.org):

```
$ composer require silverware/spam-guard

```

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

[](#configuration)

As with all SilverStripe modules, configuration is via YAML. An extension to the base `Form` class is applied via `config.yml`. Configuration is also used to define the default Spam Guard instance via the SilverStripe dependency injector:

```
SilverStripe\Core\Injector\Injector:
  DefaultSpamGuard:
    class: SilverWare\SpamGuard\Guards\SimpleSpamGuard
```

The default instance `SimpleSpamGuard` uses a honeypot approach for preventing spam, combined with a minimum form submission time, defined by the `timeLimit` property.

Usage
-----

[](#usage)

Once installed, you can enable simple spam protection on your forms by using the following code:

```
$form = Form::create( ... );

if ($form->hasMethod('enableSpamProtection')) {
    $form->enableSpamProtection();
}
```

By using `hasMethod` to check for the spam protection method, instead of `hasExtension`, we enable interoperability between this extension and the SilverStripe SpamProtection extension with no changes required to the form code.

### Arguments

[](#arguments)

The `enableSpamProtection` method accepts an optional array of arguments with the following keys:

- `class` - class of the Spam Guard instance to use
- `name` - name of the Spam Guard form field
- `title` - title of the Spam Guard form field
- `insertBefore` - insert the Spam Guard form field before a field with this name
- `insertAfter` - insert the Spam Guard form field after a field with this name

For example:

```
if ($form->hasMethod('enableSpamProtection')) {
    $form->enableSpamProtection([
        'class' => CustomSpamGuard::class,
        'name' => 'CustomSpamGuard'
        'title' => 'Tasty Spam',
        'insertAfter' => 'Message'
    ]);
}
```

### Writing your own Spam Guard class

[](#writing-your-own-spam-guard-class)

Spam Guard instances must implement the `SilverWare\SpamGuard\Interfaces\SpamGuard` interface. Your implementation must include the following methods:

- `getFormField()` - answers the form field responsible for spam protection
- `getDefaultName()` - answers the default name for the form field
- `getDefaultTitle()` - answers the default title for the form field

Issues
------

[](#issues)

Please use the [GitHub issue tracker](https://github.com/praxisnetau/silverware-spam-guard/issues) for bug reports and feature requests.

Contribution
------------

[](#contribution)

Your contributions are gladly welcomed to help make this project better. Please see [contributing](CONTRIBUTING.md) for more information.

Attribution
-----------

[](#attribution)

- Inspired by the [SilverStripe SpamProtection module](https://github.com/silverstripe/silverstripe-spamprotection).

Maintainers
-----------

[](#maintainers)

[![Colin Tucker](https://avatars3.githubusercontent.com/u/1853705?s=144)](https://github.com/colintucker)[![Praxis Interactive](https://avatars2.githubusercontent.com/u/1782612?s=144)](http://www.praxis.net.au)[Colin Tucker](https://github.com/colintucker)[Praxis Interactive](http://www.praxis.net.au)License
-------

[](#license)

[BSD-3-Clause](LICENSE.md) © Praxis Interactive

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

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

Recently: every ~114 days

Total

6

Last Release

2800d ago

Major Versions

0.1.0 → 1.0.02017-06-15

### Community

Maintainers

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

---

Top Contributors

[![colintucker](https://avatars.githubusercontent.com/u/1853705?v=4)](https://github.com/colintucker "colintucker (12 commits)")

---

Tags

formssilverstripe-4silverwarespamspam-protectionsilverstripespamprotectionguardsilverware

### Embed Badge

![Health badge](/badges/silverware-spam-guard/health.svg)

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

###  Alternatives

[exadium/silverstripe-invisible-spam-protection

Very simple anti spam protection based on principle that automated spammers enter bogus information in all form fields. Field is added to form that is hidden using CSS hiding it from human users. Form is only allowed to be submitted if field is empty. Includes an EditableInvisibleSpamField to integrate with the UserForms module.

112.1k](/packages/exadium-silverstripe-invisible-spam-protection)[silverstripe/auditor

Adds security audit trail to SilverStripe.

10352.1k5](/packages/silverstripe-auditor)[bringyourownideas/silverstripe-composer-security-checker

Provides information if your SilverStripe application uses dependencies with known vulnerabilities.

10103.9k2](/packages/bringyourownideas-silverstripe-composer-security-checker)

PHPackages © 2026

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