Skip to content

unibz/silverstripe-spamprotection-honeypot

This branch is 3 commits ahead of, 3 commits behind studiobonito/silverstripe-spamprotection-honeypot:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a5520b4 · Jun 8, 2017

History

44 Commits
Sep 9, 2014
Feb 17, 2016
Dec 17, 2015
Dec 17, 2015
Sep 25, 2015
Sep 25, 2015
Sep 25, 2015
Sep 25, 2015
Feb 17, 2016
Sep 25, 2015
Sep 25, 2015
Feb 17, 2016
Jun 8, 2017
Sep 25, 2015

Repository files navigation

SpamProtection Honeypot Module

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Overview

Provide Honeypot spam protection for SilverStripe CMS. Create a form field hidden from users that invalidates submission if it contains any data. Also invalidate submissions that respond to quickly.

Requirements

  • SilverStripe 3.1.0 and newer or 3.2 and newer.
  • SilverStripe SpamProtection 1.2 or newer.

Install

Via Composer

Run the following to add this module as a requirement and install it via composer.

$ composer require studiobonito/silverstripe-spamprotection-honeypot

Manually

Copy the 'silverstripe-spamprotection-honeypot' folder to the root of your SilverStripe installation.

Usage

Create a configuration file spamprotection.yml in mysite/_config with the following configuration.

---
name: spamprotection
---
FormSpamProtectionExtension:
  default_spam_protector: '\StudioBonito\SilverStripe\SpamProtection\Honeypot\SpamProtector\HoneypotSpamProtector'

Then enable spam protection on your form by calling Form::enableSpamProtection().

public function ExampleForm()
{
    $form = new ExampleForm($this, 'Example');

    $form->enableSpamProtection();

    return $form;
}

You can change the amount time that is checked to see if the response is made too quickly with the following configuration.

StudioBonito\SilverStripe\SpamProtection\Honeypot\FormField\HoneypotField:
  time_limit: 1

This example changes the time to 1 second. The default is set to 5 seconds.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The BSD-2-Clause License. Please see License File for more information.

About

Provide Honeypot spam protection for SilverStripe CMS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%