Failed Captcha & Custom Success Message
-
Hi,
I came across a couple issues with the plugin.
1. When testing locally without an ssl certificate reCaptcha fails:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in ....\wp-content\plugins\constant-contact-forms\vendor\recaptcha\src\ReCaptcha\RequestMethod\Post.php on line 68
This is because with allow_url_fopen enabled the request method is not set to CurlPost. To fix it I removed the if block in class-process-form.php line 217:
// if ( ! ini_get( 'allow_url_fopen' ) ) { // <--- Commented Out $method = new \ReCaptcha\RequestMethod\CurlPost(); // } // <--- Commented Out
Is there any reason to not always use CurlPost to avoid errors?
2. With ‘No page refresh’ enabled under ‘Submission behavior’ the custom ‘Success message’ under ‘Form Options’ is not displayed.
This is because the ctct_process_form_success filter is not applied in the ajax process function process_form_ajax_wrapper. Here is the fix in class-process-form.php line 118:
// $message = __( 'Your information has been submitted.', 'constant-contact-forms' ); // <--- Commented Out $form_id = $json_data['ctct-id']; // <--- Added $message = apply_filters( 'ctct_process_form_success', __( 'Your information has been submitted.', 'constant-contact-forms' ), $form_id ); // <--- Added
-Brian
- The topic ‘Failed Captcha & Custom Success Message’ is closed to new replies.