ultimatemember / recaptcha

GNU General Public License v2.0
0 stars 0 forks source link

New action hook "um_recaptcha_score_response" #15

Open MissVeronica opened 1 month ago

MissVeronica commented 1 month ago

Is your feature request related to a problem? Please describe. There are only filter hooks to adjust the current setting of the Google score number. There is no action hook to evaluate and log the returned score values from Google.

Describe the solution you'd like After each $response = wp_remote_get( "https://www.google.com/recaptcha/api/.... add an action hook like do_action( 'um_recaptcha_score_response', $response, $form_data ); the preferred solution

or later in the code after the json_decode a new action hook like do_action( 'um_recaptcha_score_response', $result->score );

With the first solution it will be possible to also save the error messages returned to the User.

Describe alternatives you've considered Patching the um-recaptcha-form.php file with the required action hooks

Support Forum issues https://wordpress.org/support/topic/recaptcha-v3-can-you-recommended-score-level-and-how-to-debug-false-positives/

MissVeronica commented 1 month ago

Patching the um-recaptcha-form.php file with the required action hooks:

line 834: do_action( 'um_recaptcha_score_response', $response, $form_data ); line 909: do_action( 'um_recaptcha_score_response', $response, $args );