Recaptcha

Time to read: 5 minutes


Introduction

With the help of the reCAPTCHA module, the human / machine query mechanism from reCAPTCHA can be integrated into the PepperShop in order to exclude spam bots, for example.

This makes it possible to keep bots off forms and thus avoid spam. The captcha (display of the verification question and evaluation) can be integrated anywhere into the PepperShop. This has already been implemented in the contact form, for the Tell-A-Friend ad and some other places.

‘reCAPTCHA’ is a captcha service from Google that offers a professional and secure captcha. The great advantage of reCAPTCHA is that you don’t have to worry about database integration, session management, development in captcha cracking and other factors in the captcha business, just insert two mini code blocks and you have a very good level of protection integrated. This philosophy is continued by the PepperShop module for reCAPTCHA, so that the administration of the Captcha locations is kept very simple.

Commissioning of the reCAPTCHA module

Create a Google account

If you already have a Google account, you can skip this point.

In order to use reCAPTCHA, you must have a Google account.

You can open a Google account using the following link: https://accounts.google.com/signup?hl=de

Register your domain to use reCAPTCHA

After you have successfully created your Google account or logged into your existing account, you can register your own domain for reCAPTCHA at https://www.google.com/recaptcha/admin.

It will also explain how to register your domain and how to get the different keys.

Figure 1: Domain registration mask

  1. Set a label for your website / shop. This makes them easier to recognize.
  2. Enter the domain of your website / shop here. Your registration is limited to the domains and associated subdomains entered here. When you register for ‘domain.ch’, for example, ‘subdomain.domain.com’ is also registered.
  3. Confirm the process by clicking ‘Register’. In the next step, the required keys (website key / secret key) for your website / shop are generated automatically. Figure 2: Window with automatically generated keys
  4. The website key and the secret key were generated automatically. You can then copy these two keys into the corresponding fields in the PepperShop reCAPTCHA module administration (point 4: Setting up the reCAPTCHA module in the shop administration)

Setting up the reCAPTCHA module in the shop administration

Figure 3: Module administration of reCAPTCHA

To access the reCAPTCHA module administration, go to the shop administration of your shop and click on ‘Module’‘reCAPTCHA ‘ in the left column

  1. Copy the website key / secret key (from the point above) and paste the key into the corresponding field in the PepperShop reCAPTCHA module administration
  2. Check the box ‘Activation’
  3. The appearance of the Captcha display can be adjusted under ‘Theme’. ‘light’ for lighter websites and ‘dark’ for dark pages.
  4. At the point ‘locations’, select where the captcha display should be activated in the shop. Important note: The Tell-A-Friend form is often misused by bots. We highly recommend that you activate Tell-A-Friend as the location!
  5. Finally, save to confirm the entered data and to activate the reCAPTCHA module.

New location for reCAPTCHA

Requirements

The requirements to define a new location for reCAPTCHA:

  • an installed and configured reCAPTCHA module
  • The reCAPTCHA module administration must be entered at least once in order to be able to generate the table contents

Define new location

Open the shop database via phpMyAdmin and then create a new entry in the `` recaptcha_ Einsatzorte '’ table.

  1. Enter the name of the new location in the name column. (Attention: please only use lowercase letters. Only ` is valid as a special character)
  2. In the Active column, enter whether Captcha is currently active for this location or not. (Y = active, N = inactive)

Technical integration of the reCAPTCHA service (for advanced users)

For advanced users: The technical integration of the reCAPTCHA service is implemented in the following two files:

  • shop/recaptcha.def.php
  • shop/recaptchalib.php

Where the captcha is to be displayed, insert the following code in the form:

if (modul_check('recaptcha')) {
    $recaptcha_pps = new recaptcha_pps('Einsatzort');
    $recaptcha_anzeige = $recaptcha_pps->recaptcha_get_html();
    if ($recaptcha_anzeige != '') echo $recaptcha_anzeige;
}

Wherever the success of customer input is to be evaluated, add the following code:

if (modul_check('recaptcha')) {
    $recaptcha_pps = new recaptcha_pps('Einsatzort');
    $resp = $recaptcha_pps->recaptcha_check_answer();
    if (!$resp->success) { /* Fehlerbehandlung. Z.B. mit vorbereiteter
         Fehlermeldung: show_customer_error(£('captcha_fehler')); */ }
}

runtime data

The runtime data are in two shop database tables:

  • recaptcha_config
  • recaptcha_ insert locations

reCAPTCHA v3

reCAPTCHA v3 automatically recognizes whether a bot or an actual person is at work. This check works on the basis of an automatic risk assessment carried out in the background and does not require any interaction by the website or shop visitor.

[Watch the video to learn more about reCAPTCHA v3] (https://www.youtube.com/watch?v=tbvxFW4UJdU&feature=emb_logo)

Installation

System Requirements

A PepperShop Professional or Enterprise is required to use the reCAPTCHA module. A Google account is also required.

Installation of the module in the PepperShop

Figure 4: Shop Administration: Install Module

To install the module in the PepperShop, go to the shop administration of your own PepperShop and select the menu item _‘Module’_> ‘Module management’.> Here you can see the entry ‘reCAPTCHA’ on the left side (modules not installed). Now select this entry and click on the ‘Install’ button below. If all tests are positive, you can confirm the next page and the module is now displayed installed on the right side. The reCAPTCHA module is now technically installed.

🌶️
🔥
🌶️