Saturday, November 23, 2013

Joomla 2.5 and 3.0 Recaptcha Plugin Suddenly Not working!

We have been using the Recaptcha Plugin on all our Joomla Sites to filter out spam registrations on the sites, and up until last week everything was working without any issues. Last week however all of the sudden ALL Recaptcha Plugins on ALL our Joomla Sites stopped working at the same time.

After some head scratching, we came across the following announcement by the Google Recaptcha Team, which basically said the Recaptcha URL's have all changed. 

To their credit they did announce the change, but they announced it in a Google Group that no one ever checks or reads! This should have been front page news on the Recaptcha Home Page.

To put this in terms everyone understands, here is basically what you have to do to get your Joomla Recaptcha working again:


  1. Go to "/plugins/captcha/recaptcha" folder of your Joomla installation, and open the file "recaptcha.php". 
  2. In the file, find this code block:
  3. const RECAPTCHA_API_SERVER = "http://api.recaptcha.net";
    const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api"; 
    const RECAPTCHA_VERIFY_SERVER = "api-verify.recaptcha.net";
    
    Replace it with this:
    const RECAPTCHA_API_SERVER = "http://www.google.com/recaptcha/api";
    const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api"; 
    const RECAPTCHA_VERIFY_SERVER = "www.google.com";
    
  4. Next, find line 118, which looks like this:

    $response = $this->_recaptcha_http_post(self::
    RECAPTCHA_VERIFY_SERVER, "/verify",
    

    And replace it with this:

    $response = $this->_recaptcha_http_post(self::
    RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
    

That's all you have to do to get things back up and working! Credit for this fix goes to "SniperSister" on Github who posted this solution in THIS GIT Commit as well as THIS Bug Ticket he opened on JoomlaCode.

Enjoy!
Pete Soheil
DigiOz Multimedia, Inc.
www.digioz.com

No comments: