Git Product home page Git Product logo

silverstripe-spamprotection-honeypot's Introduction

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.

silverstripe-spamprotection-honeypot's People

Contributors

mrsteveheyes avatar jakxnz avatar nedmas avatar andreassp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.