Andy Nicol
asked 8 years ago

Hi all, I installed DWQA on my test site, configured it to my satisfaction and started to load it onto my live site, all well and good so far and I’m very happy with the plugin.

However, when I activated the plugin my on my live site, the site went down with the following message:

Fatal error: Cannot redeclare _recaptcha_qsencode() (previously declared in /home/radbc803/public_html/wp-content/plugins/dw-question-answer/inc/lib/recaptcha-php/recaptchalib.php:47) in /home/radbc803/public_html/wp-content/plugins/wp-recaptcha/recaptchalib.php on line 55

It looks to me as if there’s a conflict with a plugin which is already using recaptcha. For info I have WP-reCAPTCHA running on my live site already but not on my test site (a defect I will resolve)

Incidentally, like most plug-in problems the site is quickly and easily restored to normal operation by going through cpanel and file manager to disable access to the plugin directory.

Please advise how best to deal with this as I need recaptcha to block automated registrations.

Andy Nicol
replied 8 years ago

Interestingly if I try to activate WP ReCaptcha on my test site (with DWQA already installed) the installation stops rather more gracefully with the message "Plugin could not be activated because it triggered a fatal error."

Error details: "Fatal error: Cannot redeclare _recaptcha_qsencode() (previously declared in /home/andyn624/public_html/StRadDemo/wp-content/plugins/dw-question-answer/inc/lib/recaptcha-php/recaptchalib.php:47) in /home/andyn624/public_html"

Andy Nicol
replied 8 years ago

Next attempt: Installed BWS Plugins Google ReCaptcha to replace WP ReCaptcha, installation and activation were successful but when I attempted to register with Google ReCAptcha enabled I got this error message in the registration dialogue:

"Fatal error: Cannot redeclare _recaptcha_qsencode() (previously declared in /home/andyn624/public_html/StRadDemo/wp-content/plugins/dw-question-answer/inc/lib/recaptcha-php/recaptchalib.php:47) in /home/andyn624/public_html/StRadDemo/wp-content/plugins/google-captcha/lib/recaptchalib.php on line 55"

So no joy there. And the irony is I don't even need the ReCaptcha feture on DWQA because I'm restricting access to members only.

Andy Nicol
replied 8 years ago

I seem to have selected the wrong tag for this question, it should be DWQA not DW Embed Qestion. Unfortunately I can't find a way to change it, happy for admins to do so.

1 Answers
BigHug
answered 8 years ago

Hi Andy,
Please go to <plugin-folder>/dw-question-answer/dw-question-answer.php, remove lines 46 to 48

if( ! defined('RECAPTCHA_VERIFY_SERVER') ) {
require_once DWQA_DIR . 'inc/lib/recaptcha-php/recaptchalib.php';
}

Both plugins are using the same library for captcha and this causes the conflict, that’s why we remove the library from DWQA to make it work.
Regards

Andy Nicol
replied 8 years ago

Many thanks for this, it worked a treat. Line numbers differed for me, 39..41

Which brings me to another question, will this break when an admin (not necessarily me) upgrades the DWQA plugin? Are there plans for a work-around, or at least a more graceful error report, which doesn't involve bringing the whole website down until the plugin can be disabled via Cpanel?

BigHug
replied 8 years ago

Hi Andy,
Apologize for my late reply. I have been busy with release schedule and did not follow your issue properly.
I’m aware of the conflict issue of captcha library and working on a better solution for it. Since the version 1.2.8 was out, we will add the solution to version 1.2.9

Powered by DW Question & Answer Pro