ReCAPTCHA-2 (BSv1.2)
BS Edge Installation Instructions
OVERVIEW
This installation is pretty simple. There are 4 new files to upload and 2 module-dependent code adds. You can then select which site pages you want the reCAPTCHA on and install the code for those pages.

Each site page that you want to have a reCAPTCHA on, consists of 3 code adds.
  1. add the reCAPTCHA class
  2. add the reCAPTCHA template
  3. add error-checking
Although this instructions page is lengthy, the installation is not. There are three main sections in this document.

The first section includes installation instructions that are required for reCAPTCHA to work on any & all site pages that you want to have this feature on.

The second section includes the code changes for each individual site page that you select to have this feature on.

The third section includes details on adding & managing this module in your admin panel.

I tested most of these site pages, and they should all work the same way. The only difference (with several of the site pages) is the error validation code structure. Regardless, I suggest that you test each site page after installing the reCAPTCHA code changes. Errors in installation could occur and it's best to catch these errors ASAP.
I. REQUIRED FILE & CODE INSTALLATION
STEP 1:
Back-up your site and database!
STEP 2:
Install the following NEW files (new folders & files marked in red):

/includes/classes/recaptcha.php

/includes/languages/english/modules/content/forms/cm_forms_recaptcha.php

/includes/modules/content/forms/cm_forms_recaptcha.php

/includes/modules/content/forms/templates/recaptcha.php

STEP 3:
Install the following code additions:
1) /includes/languages/english.php

ADD at the end of the file:
// reCAPTCHA-2 for BS Edge
define('MODULE_CONTENT_RECAPTCHA_ERROR', 'reCAPTCHA Security Box requires verification.');
II. SITE PAGES CODE INSTALLATION
PAGE: login.php
back to top
1) /login.php

FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
2) /includes/modules/content/login/templates/login_form.php

FIND this code:
        <p class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_LOGIN, 'fa fa-sign-in', null, 'primary', NULL, 'btn-success btn-block'); ?></p>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
3) /includes/modules/content/login/cm_login_form.php

FIND this code:
      if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
        $email_address = tep_db_prepare_input($_POST['email_address']);
        $password = tep_db_prepare_input($_POST['password']);

// Check if email exists
        $customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
        if (!tep_db_num_rows($customer_query)) {
          $error = true;
        } else {
          $customer = tep_db_fetch_array($customer_query);

// Check that password is good
          if (!tep_validate_password($password, $customer['customers_password'])) {
            $error = true;
          } else {
// set $login_customer_id globally and perform post login code in catalog/login.php
            $login_customer_id = (int)$customer['customers_id'];

// migrate old hashed password to new phpass password
            if (tep_password_type($customer['customers_password']) != 'phpass') {
              tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int)$login_customer_id . "'");
            }
          }
        }
      }

      if ($error == true) {
        $messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
      }
REPLACE it with this:
// reCAPTCHA-2 for BS Edge - Start
      if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
	  
        if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
            $recaptcha = $_POST['g-recaptcha-response'];
            $object = new Recaptcha();
            $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
            if (isset($response['success']) and $response['success'] != true) {
                $messageStack->add('login', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
                $_POST['password'] = "";
            } else {
        
                $email_address = tep_db_prepare_input($_POST['email_address']);
                $password = tep_db_prepare_input($_POST['password']);

// Check if email exists
                $customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
                if (!tep_db_num_rows($customer_query)) {
                    $error = true;
                } else {
                    $customer = tep_db_fetch_array($customer_query);
		  
// Check that password is good
                    if (!tep_validate_password($password, $customer['customers_password'])) {
                        $error = true;
                    } else {
// set $login_customer_id globally and perform post login code in catalog/login.php
                        $login_customer_id = (int)$customer['customers_id'];

// migrate old hashed password to new phpass password
                        if (tep_password_type($customer['customers_password']) != 'phpass') {
                            tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int)$login_customer_id . "'");
                        }
                    }
                }
            }
        }

      } else { // reCAPTCHA module not enabled OR login page is not selected for it, use default validation code below

        if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
        $email_address = tep_db_prepare_input($_POST['email_address']);
        $password = tep_db_prepare_input($_POST['password']);

// Check if email exists
        $customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
        if (!tep_db_num_rows($customer_query)) {
          $error = true;
        } else {
          $customer = tep_db_fetch_array($customer_query);

// Check that password is good
          if (!tep_validate_password($password, $customer['customers_password'])) {
            $error = true;
          } else {
// set $login_customer_id globally and perform post login code in catalog/login.php
            $login_customer_id = (int)$customer['customers_id'];

// migrate old hashed password to new phpass password
            if (tep_password_type($customer['customers_password']) != 'phpass') {
              tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int)$login_customer_id . "'");
            }
          }
        }
      }
	  
      } // reCAPTCHA-2 for BS Edge closing bracket

      if ($error == true) {
        $messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
        $_POST['password'] = "";
      }
// reCAPTCHA-2 for BS Edge - End
PAGE: create_account.php
back to top
1) /create_account.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-user', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (ACCOUNT_GENDER == 'true') {
      if ( ($gender != 'm') && ($gender != 'f') ) {
        $error = true;

        $messageStack->add('create_account', ENTRY_GENDER_ERROR);
      }
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      $recaptcha = $_POST['g-recaptcha-response'];
      $object = new Recaptcha();
      $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
      if (isset($response['success']) and $response['success'] != true) {
          $error = true;
          $messageStack->add('create_account', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
          $_POST['password'] = "";
          $_POST['confirmation'] = "";
      }
  }
// reCAPTCHA-2 for BS Edge - End
PAGE: account_pwa.php (part of Purchase Without Account add-on)
back to top
1) /account_pwa.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-user', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (ACCOUNT_GENDER == 'true') {
      if ( ($gender != 'm') && ($gender != 'f') ) {
        $error = true;

        $messageStack->add('create_account', ENTRY_GENDER_ERROR);
      }
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & account_pwa page enabled
      $recaptcha = $_POST['g-recaptcha-response'];
      $object = new Recaptcha();
      $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
      if (isset($response['success']) and $response['success'] != true) {
          $error = true;
          $messageStack->add('create_account', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
      }
  }
// reCAPTCHA-2 for BS Edge - End
PAGE: account_edit.php
back to top
1) /account_edit.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-angle-left', tep_href_link('account.php', '', 'SSL')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (ACCOUNT_GENDER == 'true') {
      if ( ($gender != 'm') && ($gender != 'f') ) {
        $error = true;

        $messageStack->add('account_edit', ENTRY_GENDER_ERROR);
      }
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & account_edit page enabled
      $recaptcha = $_POST['g-recaptcha-response'];
      $object = new Recaptcha();
      $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
      if (isset($response['success']) and $response['success'] != true) {
          $error = true;
          $messageStack->add('account_edit', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
      }
  }
// reCAPTCHA-2 for BS Edge - End
PAGE: account_password.php
back to top
1) /account_password.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-angle-left', tep_href_link('account.php', '', 'SSL')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
      $error = true;

      $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
    } elseif ($password_new != $password_confirmation) {
      $error = true;

      $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & account_password page enabled
      $recaptcha = $_POST['g-recaptcha-response'];
      $object = new Recaptcha();
      $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
      if (isset($response['success']) and $response['success'] != true) {
          $error = true;
          $messageStack->add('account_password', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
          $_POST['password_new'] = "";
          $_POST['password_confirmation'] = "";
      }
  }
// reCAPTCHA-2 for BS Edge - End
PAGE: password_forgotten.php (see Admin > Modules > Action Recorder)
back to top
1) /password_forgotten.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-angle-left', tep_href_link('login.php', '', 'SSL')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
  if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
    $email_address = tep_db_prepare_input($_POST['email_address']);

    $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
    if (tep_db_num_rows($check_customer_query)) {
      $check_customer = tep_db_fetch_array($check_customer_query);

      $actionRecorder = new actionRecorder('ar_reset_password', $check_customer['customers_id'], $email_address);

      if ($actionRecorder->canPerform()) {
        $actionRecorder->record();

        $reset_key = tep_create_random_value(40);

        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set password_reset_key = '" . tep_db_input($reset_key) . "', password_reset_date = now() where customers_info_id = '" . (int)$check_customer['customers_id'] . "'");

        $reset_key_url = tep_href_link('password_reset.php', 'account=' . urlencode($email_address) . '&key=' . $reset_key, 'SSL', false);

        if ( strpos($reset_key_url, '&amp;') !== false ) {
          $reset_key_url = str_replace('&amp;', '&', $reset_key_url);
        }

        tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_RESET_SUBJECT, sprintf(EMAIL_PASSWORD_RESET_BODY, $reset_key_url), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

        $password_reset_initiated = true;
      } else {
        $actionRecorder->record(false);

        $messageStack->add('password_forgotten', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES') ? (int)MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES : 5)));
      }
    } else {
      $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
    }
  }
REPLACE it with this:
// reCAPTCHA-2 for BS Edge - Start
if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & password_forgotten page enabled
	  
  if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
    $email_address = tep_db_prepare_input($_POST['email_address']);

    $recaptcha = $_POST['g-recaptcha-response'];
    $object = new Recaptcha();
    $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
    if (isset($response['success']) and $response['success'] != true) {
        $messageStack->add('password_forgotten', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
    } else {
		
        $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
        if (tep_db_num_rows($check_customer_query)) {
            $check_customer = tep_db_fetch_array($check_customer_query);

            $actionRecorder = new actionRecorder('ar_reset_password', $check_customer['customers_id'], $email_address);

            if ($actionRecorder->canPerform()) {
                $actionRecorder->record();

                $reset_key = tep_create_random_value(40);

                tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set password_reset_key = '" . tep_db_input($reset_key) . "', password_reset_date = now() where customers_info_id = '" . (int)$check_customer['customers_id'] . "'");

                $reset_key_url = tep_href_link('password_reset.php', 'account=' . urlencode($email_address) . '&key=' . $reset_key, 'SSL', false);

                if ( strpos($reset_key_url, '&amp;') !== false ) {
                    $reset_key_url = str_replace('&amp;', '&', $reset_key_url);
                }

                tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_RESET_SUBJECT, sprintf(EMAIL_PASSWORD_RESET_BODY, $reset_key_url), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

                $password_reset_initiated = true;
            } else {
                $actionRecorder->record(false);

                $messageStack->add('password_forgotten', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES') ? (int)MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES : 5)));
            }
        } else {
            $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
        }
    } // reCAPTCHA
  }

} else { // reCAPTCHA module not enabled OR password_forgotten page is not selected for it, use default validation code below

  if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
    $email_address = tep_db_prepare_input($_POST['email_address']);

    $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
    if (tep_db_num_rows($check_customer_query)) {
      $check_customer = tep_db_fetch_array($check_customer_query);

      $actionRecorder = new actionRecorder('ar_reset_password', $check_customer['customers_id'], $email_address);

      if ($actionRecorder->canPerform()) {
        $actionRecorder->record();

        $reset_key = tep_create_random_value(40);

        tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set password_reset_key = '" . tep_db_input($reset_key) . "', password_reset_date = now() where customers_info_id = '" . (int)$check_customer['customers_id'] . "'");

        $reset_key_url = tep_href_link('password_reset.php', 'account=' . urlencode($email_address) . '&key=' . $reset_key, 'SSL', false);

        if ( strpos($reset_key_url, '&amp;') !== false ) {
          $reset_key_url = str_replace('&amp;', '&', $reset_key_url);
        }

        tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_RESET_SUBJECT, sprintf(EMAIL_PASSWORD_RESET_BODY, $reset_key_url), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

        $password_reset_initiated = true;
      } else {
        $actionRecorder->record(false);

        $messageStack->add('password_forgotten', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES') ? (int)MODULE_ACTION_RECORDER_RESET_PASSWORD_MINUTES : 5)));
      }
    } else {
      $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
    }
  }

} // reCAPTCHA-2 for BS Edge closing bracket
// reCAPTCHA-2 for BS Edge - End
PAGE: contact_us.php (see Admin > Modules > Action Recorder)
back to top
1) /contact_us.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-send', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (!tep_validate_email($email_address)) {
      $error = true;

      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
    if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & contact_us page enabled
        $recaptcha = $_POST['g-recaptcha-response'];
        $object = new Recaptcha();
        $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
        if (isset($response['success']) and $response['success'] != true) {
            $error = true;
            $messageStack->add('contact', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
        }
    }
// reCAPTCHA-2 for BS Edge - End
PAGE: tell_a_friend.php (see Admin > Modules > Action Recorder)
back to top
1) /tell_a_friend.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-angle-left', tep_href_link('product_info.php', 'products_id=' . (int)$_GET['products_id'])); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-send', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (empty($from_name)) {
      $error = true;

      $messageStack->add('friend', ERROR_FROM_NAME);
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
    if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & tell_a_friend page enabled
        $recaptcha = $_POST['g-recaptcha-response'];
        $object = new Recaptcha();
        $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
        if (isset($response['success']) and $response['success'] != true) {
            $error = true;
            $messageStack->add('friend', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
        }
    }
// reCAPTCHA-2 for BS Edge - End
PAGE: product_reviews_write.php
back to top
1) /product_reviews_write.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-angle-left', tep_href_link('product_reviews.php', tep_get_all_get_params(array('reviews_id', 'action')))); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) {
      $error = true;

      $messageStack->add('review', JS_REVIEW_TEXT);
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
    if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & product_review_write page enabled
        $recaptcha = $_POST['g-recaptcha-response'];
        $object = new Recaptcha();
        $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
        if (isset($response['success']) and $response['success'] != true) {
            $error = true;
            $messageStack->add('review', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
        }
    }
// reCAPTCHA-2 for BS Edge - End
PAGE: product_reviews_write_pwa.php (part of Purchase Without Account add-on)
back to top
1) /product_reviews_write_pwa.php

   a) FIND this code:
  require('includes/application_top.php');
ADD this just AFTER it:
// reCAPTCHA-2 for BS Edge - Start  
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { 
      require(DIR_WS_CLASSES . 'recaptcha.php');
  }
// reCAPTCHA-2 for BS Edge - End
   b) FIND this code:
  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'fa fa-chevron-left', tep_href_link('product_reviews.php', tep_get_all_get_params(array('reviews_id', 'action')))); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-chevron-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
ADD just ABOVE it:
<?php 
// reCAPTCHA-2 for BS Edge - Start
  if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') {
      echo $oscTemplate->getContent('forms');
  }
// reCAPTCHA-2 for BS Edge - End
?>
   c) FIND this code:
    if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) {
      $error = true;

      $messageStack->add('review', JS_REVIEW_TEXT);
    }
ADD just ABOVE it:
// reCAPTCHA-2 for BS Edge - Start
    if (MODULE_CONTENT_RECAPTCHA_STATUS == 'True') { // reCAPTCHA module & product_review_write_pwa page enabled
        $recaptcha = $_POST['g-recaptcha-response'];
        $object = new Recaptcha();
        $response = $object->verifyResponse($recaptcha);

// Check if reCaptcha is correct
        if (isset($response['success']) and $response['success'] != true) {
            $error = true;
            $messageStack->add('review', MODULE_CONTENT_RECAPTCHA_ERROR . ' (Error: ' . $response['error-codes'] . ')');
        }
    }
// reCAPTCHA-2 for BS Edge - End
III. AFTER INSTALLING ALL FILES & CODE CHANGES
STEP 1:
Install the BS Edge reCAPTCHA module from the Admin Panel:

1) Log into your admin panel and go to Modules > Content

2) Click on the button at the top right called Install Module

3) Select the reCAPTCHA Form Validation module from the list

4) Install the module by clicking the Install Module button on the right side of the screen

STEP 2:
Enter your reCAPTCHA keys:

You'll need to enter & save your Public and Private keys. If you have not already registered with Google reCAPTCHA, you'll need to go to the following link and register. The Google reCAPTCHA service is free.

https://www.google.com/recaptcha/admin/

STEP 3:
Configure your reCAPTCHA module:

You can now configure your BS Edge reCAPTCHA module as you want based on available options.

That's it! Good Job!
back to top