PHPackages                             proxiblue/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. proxiblue/recaptcha

AbandonedMagento-module[Authentication &amp; Authorization](/categories/authentication)

proxiblue/recaptcha
===================

Clean integration of Google reCaptcha to OpenMage

2.5.3(5y ago)848.9kOSL-3.0

Since Mar 29Compare

[ Source](https://github.com/ProxiBlue/reCaptcha)[ Packagist](https://packagist.org/packages/proxiblue/recaptcha)[ Docs](https://github.com/ProxiBlue/reCaptcha)[ RSS](/packages/proxiblue-recaptcha/feed)WikiDiscussions Synced today

READMEChangelog (10)Dependencies (1)Versions (44)Used By (0)

ATTENTION:
==========

[](#attention)

I am currently considering archiving this module, as I no longer have the free time to continue supporting this code. as per ticket: #43, it seems there are issues in checkout with the validation of the invisible recapctha, which could be related to the usage of prototype 1.7.1

I simply don't have the time due to paid work with deadlines to work on this at present.

If you are using this module, I suggest looking for an alternative, or fork this and continue with it as a seperate project

reCaptcha
=========

[](#recaptcha)

Drop-In Replacement of OpenMage core Captcha system with Googles reCaptcha

Features:
=========

[](#features)

- Supports all native OpenMage captcha areas
- Supports placing captcha into

    - Contact Us form,
    - CMS pages (contact us in cms page),
    - Products Reviews
    - Customer Wishlist Sharing
    - Product 'Email a friend'
    - Newsletter Subscribe
- Supports Invisible reCaptcha (now the default) with option to set badge position
- Supports the 'I am not a robot' reCaptcha (just in case you don't want invisible)

Requirements
============

[](#requirements)

- Core onepage checkout for reCaptcha in Checkout.
- There is no plans to extend this extension to use 3rd party checkouts, however PRs are welcomed \*\* Works with FireCheckout - [\#40](https://github.com/ProxiBlue/reCaptcha/pull/40)
- Feel free to extend if you know how. PRs welcomed.
- You require a bit of knowledge on how to extend theme templates. This reCaptcha does not rewrite or extend core functionality, so it does not replace theme files. Clear instructions are given. It works 'out-the-box' in all areas where core OpenMage captcha works. It is more 'developer' centric, when you don't want a reCaptcha module to make major changes to core functionality, and allows your developer to integrate into your themes. Clear instructions are given.

Installing
==========

[](#installing)

**ATTENTION:**

Since 17/06/2021 google changed their invisible recaptcha code, which makes it incompatibile with the core version of prototype 1.7.0 which ships with vanilla magento 1. (ref: [\#56](https://github.com/ProxiBlue/reCaptcha/issues/56) ) This module has been adjusted to include prototype 1.7.1 as of version 2.5.1 (least compatible version required to fix issue) - Thank you to @empiricompany for this fix. You can see the adjsuted code in PR: [\#57](https://github.com/ProxiBlue/reCaptcha/pull/57)

OpenMage 19.4.12 (or the 20.x range) already ships with an updated version of Prototype. You *should* really be sporting that update on a live site.

**ADMIN LOGIN NEEDS MANUAL INTERVENTION**

Core magento hardcoded the inclusion of the default prototype 1.7.0 in the following admin files:

```
app/design/adminhtml/default/default/template/resetforgottenpassword.phtml
app/design/adminhtml/default/default/template/login.phtml
app/design/adminhtml/default/default/template/forgotpassword.phtml

```

You need to manually adjust these files to change the line:

```

```

Unfortunately magento core templates do not accommodate reloading the posted form data. This means that if the captcha was incorrect, the user will be given a new blank form. Obviously not ideal.

The captcha extension places the form data into the customer session, aptly named 'formData', using the following lines of code

```
$data = $controller->getRequest()->getPost();
Mage::getSingleton('customer/session')->setFormData($data);

```

You can re-populate the form data using the information stored in the session. This will require you to make some changes to the form.phtml file. It is really up to you how you will retrieve and use the session data. As an example, you can do this at the top of the template form.phtml:

```
$formData = new Varien_Object();
$formData->setData(Mage::getSingleton('customer/session')->getFormData());

```

The posted data is now held in the Varien Object called $formData You can pre-populate the data as such:

```
$_firstname = ($formData->getFirstname())?$formData->getFirstname():$this->helper('contacts')->getFirstName();
$_lastname = ($formData->getLastname())?$formData->getLastname():$this->helper('contacts')->getLastName();
$_email = ($formData->getEmail())?$formData->getEmail():$this->helper('contacts')->getEmail();
$_telephone = ($formData->getTelephone())?$formData->getTelephone():'';
$_suburb = ($formData->getSuburb())?$formData->getSuburb():'';
$_postcode = ($formData->getPostcode())?$formData->getPostcode():'';
$_comment = ($formData->getComment())?$formData->getComment():'';

```

and in the template, simply echo out the values held in the definded variables: An example is as such:

```
