PHPackages                             isometriks/spam-bundle - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. isometriks/spam-bundle

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

isometriks/spam-bundle
======================

Provides spam protection for Symfony forms

v1.2.0(2y ago)46200.6k↓10.3%14[7 issues](https://github.com/isometriks/IsometriksSpamBundle/issues)[6 PRs](https://github.com/isometriks/IsometriksSpamBundle/pulls)1PHPPHP &gt;=7.4

Since Jul 16Pushed 1y ago6 watchersCompare

[ Source](https://github.com/isometriks/IsometriksSpamBundle)[ Packagist](https://packagist.org/packages/isometriks/spam-bundle)[ RSS](/packages/isometriks-spam-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (20)Used By (1)

Symfony SpamBundle
==================

[](#symfony-spambundle)

Please feel free to send pull requests. I would like to incorporate a bunch of spam methods into this project.

### Installation

[](#installation)

Install via Composer:

```
$ composer require isometriks/spam-bundle
```

If you're not using Symfony Flex, add the bundle to your `config/bundles.php` file:

```
// config/bundles.php

return [
    // ...
    Isometriks\Bundle\SpamBundle\IsometriksSpamBundle::class => ['all' => true],
];
```

Currently we have:

### Timed Spam Prevention

[](#timed-spam-prevention)

Requires forms to be sent after a certain amount of time. Most bots won't wait to submit your forms, so requiring an amount of time between render and submit can help deter these bots.

*A side affect of this spam prevention is that you won't be able to refresh a page to resubmit data UNLESS the view is rendered again `$form->createView()`This is because the event listener removes the start time of the form and when it can't find it, will cause the form to be invalid. You could set your min time to 0 to just make use of this feature*

*Also note that this spam protection will also apply this limit to forms that are not filled in correctly and need to be resubmitted. A high minimum time could affect those users who only need to fix one field quickly*

Configuration:

```
# config/packages/isometriks_spam.yaml

# Copying this config is not necessary. These are defaults, only copy
# what you'd like to change.
isometriks_spam:
    timed:
        min: 7 # seconds
        max: 3600
        global: false
        # message also takes translator strings.
        message: You're doing that too quickly.
```

Usage:

```
$this->createForm(MyType:class, null, [
    'timed_spam' => true, // Just this line is required to enable this feature, the rest is to override settings
    'timed_spam_min' => 3,
    'timed_spam_max' => 40,
    'timed_spam_message' => 'Please wait 3 seconds before submitting',
]);
```

Or

```
public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'timed_spam' => true,
        // ...
    ]);
}
```

### Honeypot Spam Prevention

[](#honeypot-spam-prevention)

A honeypot is a way to trick bots into filling out a field that should not be filled out. It is hidden and can be named something usual so that any bots / crawlers will think it is a real field.

If the field is filled out, then the form is invalid. You can optionally choose to use a class name to hide the form element as well in case the bot tries to check the style attribute.

```
# Copying this config is not necessary. These are defaults, only copy
# what you'd like to change.
isometriks_spam:
    honeypot:
        field: email_address
        use_class: false
        hide_class: hidden
        global: false
        message: Form fields are invalid
```

Usage:

```
// Only honeypot = true is required to enable, the rest are to override settings
$this->createForm(MyType::class, null, [
    'honeypot' => true,
    'honeypot_field' => 'email_address',
    'honeypot_use_class' => false,
    'honeypot_hide_class' => 'hidden',
    'honeypot_message' => 'Form fields are invalid',
]);
```

Or

```
public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'honeypot' => true,
        // ...
    ]);
}
```

### Twig Form Error Message Rendering

[](#twig-form-error-message-rendering)

Form errors come from the form itself, so if you want to display the errors you'll need to make sure this is in your template.

```
{% if form.vars.errors is not empty %}
    {{ form_errors(form) }}
{% endif %}
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 70.2% 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 ~225 days

Recently: every ~311 days

Total

18

Last Release

862d ago

Major Versions

v0.3.2 → v1.0.02016-09-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1325995?v=4)[Craig Blanchette](/maintainers/isometriks)[@isometriks](https://github.com/isometriks)

---

Top Contributors

[![isometriks](https://avatars.githubusercontent.com/u/1325995?v=4)](https://github.com/isometriks "isometriks (33 commits)")[![ThomasLandauer](https://avatars.githubusercontent.com/u/1054469?v=4)](https://github.com/ThomasLandauer "ThomasLandauer (4 commits)")[![maelanleborgne](https://avatars.githubusercontent.com/u/11990607?v=4)](https://github.com/maelanleborgne "maelanleborgne (3 commits)")[![TomaszGasior](https://avatars.githubusercontent.com/u/1395027?v=4)](https://github.com/TomaszGasior "TomaszGasior (2 commits)")[![junowilderness](https://avatars.githubusercontent.com/u/1977311?v=4)](https://github.com/junowilderness "junowilderness (1 commits)")[![javer](https://avatars.githubusercontent.com/u/591296?v=4)](https://github.com/javer "javer (1 commits)")[![curry684](https://avatars.githubusercontent.com/u/1455673?v=4)](https://github.com/curry684 "curry684 (1 commits)")[![insekticid](https://avatars.githubusercontent.com/u/177340?v=4)](https://github.com/insekticid "insekticid (1 commits)")[![aeyoll](https://avatars.githubusercontent.com/u/1472285?v=4)](https://github.com/aeyoll "aeyoll (1 commits)")

---

Tags

honeypotphpspamspam-preventionsymfony-bundlesymfonybundlespamform

### Embed Badge

![Health badge](/badges/isometriks-spam-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[a2lix/translation-form-bundle

Translate your doctrine objects easily with some helpers

3376.9M38](/packages/a2lix-translation-form-bundle)

PHPackages © 2026

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