The Blog

Check out our brand new Joomla! Template Club:
InspireTheme.com

Strange, ReCaptcha Just Stopped Working

Strange, ReCaptcha Just Stopped Working - 5.0 out of 5 based on 1 vote

Today one of our dear customers opened a Discussion in the Support Forum regarding a problem with the reCaptcha. He said that the reCaptcha box does not appear on his Contact Form.

In the beginning I thought he has not properly configured the reCaptcha Settings. 99% of the reCaptcha problems come from improper configuration or a conflict with the K2 reCaptcha setting as we mentioned before.

Yes, but no! I was not right this time :) Actually, it was a real problem. It turned out that it is a quite frustrating Joomla Bug which is affecting a lot of websites. While troubleshooting the problem with his website and wondering why the reCaptcha doesn't work (eventhough it was properly configured) I decided to check my reCaptcha on www.joomfx.com. And guess what - it was not working either. I was really surprised but at the same time it was a sign that there is a "global" issue.

After a quite extensive research on the Web I found out what the root cause of the problem is - Google has changed the reCaptch URL.

So Joomla is trying to load the reCaptch from an invalid URL:

Wrong (Old) URL: http://api.recaptcha.net
Correct (New) URL: https://www.google.com/recaptcha/api

Here is the solution:

1. Open the "recaptcha.php" file (root/plugins/captcha/recaptcha) and find the following code starting on line 22:

    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 the above code with this one:

    const RECAPTCHA_API_SERVER = "https://www.google.com/recaptcha/api";
const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api";
const RECAPTCHA_VERIFY_SERVER = "www.google.com";

2. Save the file, clear the Joomla Cache and refresh.

Now your reCaptcha should be working again. You can also check the official code change request here.

This Bug will be solved in Joomla 2.5.17 and in Joomla 3.2.1. Until then, you will need to use the above solution.

Also, if your are using an older version of the K2 Component, your Comments reCaptcha might not be working. Make sure you are using K2 v2.6.7 or newer. Otherwise the K2 Component will be trying to load the reCaptcha from the old URL :)

Ivo Valkov

I'm a front end developer. I love creating things, playing football, snowboarding and so on. I also hope you like all our stuff. We started using Gantry for our projects and honestly, we love it!

Website: joomfx.com