Recaptcha causing contribution forms to fail due to duplicate recaptcha submission.
I’ve tracked down the captcha issue on the contribution form, it is related to the fact that the recaptcha rules are being set twice, so the first one succeed, but the second one fails. What I’ve found is in this file:
./wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Main.php starting at line 284 $this->buildCustom($this->_values['custom_pre_id'], 'customPre'); $this->buildCustom($this->_values['custom_post_id'], 'customPost');
These functions reference the buildCustom function found in: ./wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/ContributionBase.php at line 612
At the bottom of this function (around line 766) there is the following logic
if ($addCaptcha && !$viewOnly) { $this->enableCaptchaOnForm(); }
The function this references is just a few lines below this call.
Since Civicrm seems to store the rules in a non-associative array you can have multiple rules with the same name, and it ends up checking each one of them, and due to the nature of recaptcha, a validation is only good once, so when it tries to validate the second time it will inevitably fail and throw the captcha error.