Download the PHP package expl0it3r/kirby-uniform-recaptcha without Composer
On this page you can find all versions of the php package expl0it3r/kirby-uniform-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download expl0it3r/kirby-uniform-recaptcha
More information about expl0it3r/kirby-uniform-recaptcha
Files in expl0it3r/kirby-uniform-recaptcha
Package kirby-uniform-recaptcha
Short Description Kirby 3 reCAPTCHA guard for the Uniform plugin
License MIT
Informations about the package kirby-uniform-recaptcha
Uniform reCAPTCHA
A Kirby 3 & 4 plugin implementing a Google reCAPTCHA v3 guard for the Uniform plugin.
Installation
Download
- Download the repository
- Extract the content to
site/plugins/uniform-recaptcha
Git Submodule
Add the plugin as Git submodule:
Composer
Add the plugin to your repository:
Configuration
Set the configuration in your config.php
file:
siteKey
&secretKey
can be found on the reCAPTCHA admin pageacceptableScore
is the minimum score in range0.0
to1.0
(default0.5
) required to accept the form submission, see the reCAPTCHA documentation
Usage
Template
reCAPTCHA v3 requires the form submission to happen through JavaScript.
You can use the provided helper function, which creates a JavaScript callback function and an HTML <button
>:
Where the parameters are in order:
- The text on the button itself
- Additional CSS classes
- The ID of the form
If you want full control, you can write something like the following:
Note: The data-action
is critical as it will be checked in the backend as well.
In order for reCAPTCHA to work, you need to provide the reCAPTCHA JavaScript file from Google.
Either include the script yourself or use the helper function recaptchaScript()
in your template.
Example
Controller
In your controller you can use the magic method recaptchaGuard()
to enable the reCAPTCHA guard:
Credits
- Thanks to Johannes Pichler for the Kirby 2 plugin!
- A million thanks to the whole Kirby Team! ❤