PHPackages                             kmedia/silverstripe-recaptcha - 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. kmedia/silverstripe-recaptcha

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

kmedia/silverstripe-recaptcha
=============================

A spam protector extension using Google's reCAPTCHA 2

0541[5 PRs](https://github.com/kMediaGbR/silverstripe-recaptcha/pulls)PHP

Since Mar 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kMediaGbR/silverstripe-recaptcha)[ Packagist](https://packagist.org/packages/kmedia/silverstripe-recaptcha)[ RSS](/packages/kmedia-silverstripe-recaptcha/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Silverstripe reCAPTCHA FormField Module
=======================================

[](#silverstripe-recaptcha-formfield-module)

[![license - bsd 3 clause](https://camo.githubusercontent.com/9d4639fbdd7887da91bc176d2a45f957d39e5e142fc4e8e2e74d1278dac2cef9/68747470733a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d425344253230332d2d436c617573652d626c75652e737667)](https://opensource.org/licenses/BSD-3-Clause)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4929603e6a267a2d757924c01dde053683e2b215f653c2a953bde98741618a45/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b4d656469614762522f73696c7665727374726970652d7265636170746368612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kMediaGbR/silverstripe-recaptcha/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c3c9f550b34763d0458c14059a0618dd91095084a46558e4504e984aeb35a8bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b4d656469614762522f73696c7665727374726970652d7265636170746368612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kMediaGbR/silverstripe-recaptcha/?branch=master)[![Build Status](https://camo.githubusercontent.com/2a081094b9e63b1517588567684d9466f0b884f86934fbaeac91ed6ab330fa55/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b4d656469614762522f73696c7665727374726970652d7265636170746368612f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kMediaGbR/silverstripe-recaptcha/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/ade49100cbd2ac4c80e1d1dfe273dd3f1323f860236443d4698ffeaf2238fa67/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b4d656469614762522f73696c7665727374726970652d7265636170746368612f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)

Introduction
------------

[](#introduction)

Provides a FormField which allows form to validate for non-bot submissions using Google's [reCAPTCHA v2](https://developers.google.com/recaptcha/docs/display) service.

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

[](#requirements)

- SilverStripe Framework 4.0 or newer

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

[](#installation)

Best installed via composer. You may clone the repo or download the zip, however you should find a directory called `recaptcha` with all files in your silverstripe root folder.

### Using Composer

[](#using-composer)

```
composer require kmedia/silverstripe-recaptcha
```

After installing the module via composer or manual install you must set the spam protector to ReCaptchaProtector, this needs to be set in your site's config file normally this is `app/_config/mysite.yml`.

```
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: Kmedia\ReCaptcha\ReCaptchaProtector
```

Finally, add the "spam protection" field to your form fields.

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

[](#configuration)

You have to create your `sitekey` and `secretkey` in the environments (`.env`) file, which you can get from the [reCAPTCHA page](https://www.google.com/recaptcha). These configuration options must be added to your site's yaml config typically this is `app/_config/mysite.yml`.

```
Kmedia\ReCaptcha\ReCaptchaField:
  theme: "light" #Default theme color (optional, light or dark, defaults to light)
  size: "normal" #Default size (optional, normal, compact or invisible, defaults to normal)
  badge: "bottomright" #Default badge position (bottomright, bottomleft or inline, defaults to bottomright)
```

Adding field labels
-------------------

[](#adding-field-labels)

If you want to add a field label or help text to the Captcha field you can do so like this:

```
$form->enableSpamProtection()
    ->fields()->fieldByName('Captcha')
    ->setTitle("Spam protection")
    ->setDescription("Please tick the box to prove you're a human and help us stop spam.");
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/761259?v=4)[Sebastian Kalicki](/maintainers/kalicki2k)[@kalicki2k](https://github.com/kalicki2k)

---

Top Contributors

[![skalicki](https://avatars.githubusercontent.com/u/155432417?v=4)](https://github.com/skalicki "skalicki (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

### Embed Badge

![Health badge](/badges/kmedia-silverstripe-recaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/kmedia-silverstripe-recaptcha/health.svg)](https://phpackages.com/packages/kmedia-silverstripe-recaptcha)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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