PHPackages                             expl0it3r/kirby-uniform-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. expl0it3r/kirby-uniform-recaptcha

ActiveKirby-plugin[Security](/categories/security)

expl0it3r/kirby-uniform-recaptcha
=================================

Kirby 3/4/5 reCAPTCHA guard for the Uniform plugin

1.0.2(5y ago)31813[1 issues](https://github.com/eXpl0it3r/kirby-uniform-recaptcha/issues)MITPHP

Since Jan 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/eXpl0it3r/kirby-uniform-recaptcha)[ Packagist](https://packagist.org/packages/expl0it3r/kirby-uniform-recaptcha)[ RSS](/packages/expl0it3r-kirby-uniform-recaptcha/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Uniform reCAPTCHA
=================

[](#uniform-recaptcha)

A [Kirby 3, 4 &amp; 5](https://getkirby.com/) plugin implementing a [Google reCAPTCHA v3](https://developers.google.com/recaptcha/docs/v3) guard for the [Uniform](https://github.com/mzur/kirby-uniform) plugin.

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

[](#installation)

### Download

[](#download)

- [Download](/archive/master.zip) the repository
- Extract the content to `site/plugins/uniform-recaptcha`

### Git Submodule

[](#git-submodule)

Add the plugin as Git submodule:

```
git submodule add https://github.com/eXpl0it3r/kirby-uniform-recaptcha.git site/plugins/uniform-recaptcha

```

### Composer

[](#composer)

Add the plugin to your repository:

```
composer require expl0it3r/kirby-uniform-recaptcha

```

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

[](#configuration)

Set the configuration in your `config.php` file:

```
return [
  'expl0it3r.uniform-recaptcha.siteKey' => 'my-site-key',
  'expl0it3r.uniform-recaptcha.secretKey' => 'my-secret-key',
  'expl0it3r.uniform-recaptcha.acceptableScore' => 0.5
];
```

- `siteKey` &amp; `secretKey` can be found on the [reCAPTCHA admin page](https://www.google.com/recaptcha/admin/)
- `acceptableScore` is the minimum score in range `0.0` to `1.0` (default `0.5`) required to accept the form submission, see the [reCAPTCHA documentation](https://developers.google.com/recaptcha/docs/v3)
- `hostname` is optional (default empty / disabled). When set, the guard additionally checks that the `hostname` returned by Google matches this value.

Usage
-----

[](#usage)

### Template

[](#template)

reCAPTCHA v3 runs invisibly and requires the form submission to happen through JavaScript. Add the `recaptchaField()` helper inside your `` and the `recaptchaScript()` helper somewhere on the page (e.g. before ``):

```

```

`recaptchaField()` outputs a hidden input and a small script that, on submit, obtains a reCAPTCHA token and resubmits the form. It binds to its own form via the `submit` event, so:

- It works no matter how the form is submitted (button click **or** the Enter key).
- You keep full control over your markup — use any `` you like.
- No form `id` is required, and it can be used for multiple forms on the same page.
- The original submit button's `name`/`value` is preserved (via `requestSubmit()`), so server-side form routing keeps working.

In order for reCAPTCHA to work, you need to load the reCAPTCHA JavaScript file from Google. Either include [the script](https://www.google.com/recaptcha/api.js?render=your-site-key) yourself (with the `render` parameter set to your site key) or use the helper function `recaptchaScript()`.

**Example**

```
 class="erroneous" name="name" type="text" value="
