Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1133307

    on former version – the script only loads if there is a form – in conjunction with the presence of the avia shortcode for that: [av_contact

    in the class-grecaptcha.php the public function is_recaptcha_active() { is for that.
    Another advantage was that I could extend the regex to contact-form 7. :
    $regex = "!\[contact-form-7|\[av_contact!";

    i do not want to load on all pages the recaptcha script – especially not for DSGVO reasons

    class av-recaptcha-enabled is allways there on body.

    #1133312

    Allthough i see in your : avia_google_recaptcha_api.js

    As first step we limit this to contact forms (context av_contact_form) – but it can be extended in future

    but it does not work in this manner!
    and if it works – how to extend it to contact form 7 ?

    i think the other way round to prohibit on default and permit for some pages would be the better way.

    #1133465

    Hey!

    reCaptcha V2 is only loaded on pages where an Enfold contact form is used.

    The idea of reCaptcha V3 is to monitor user behaviour and decide if he is a human or a bot (this is done by Google script).. Google is creating a score in background and this is used to decide if we make a fallback to V2.The more info Google has the better the score.

    Therefore by default V3 is loaded on every page to get a better score.

    Besides the filter avf_load_google_recaptcha_api_prohibited there is also another filter: avf_disable_recaptchaV3_for_post
    called in handler_body_class() (WP body_class filter).

    At this point you can access all info you need to decide if you want to skip V3 for that page.
    If you know the pagi ID’s you can return false for these pages and true for the others or you can scan page content.

    But in my opinion using V3 in a DSGVO/GDPR environment is critical, as nobody knows what Google is collecting.

    The implementation logic for reCaptcha is currently only for Enfold contact form as there is logic behind that cannot be transferred to other plugins 1:1. This has to be checked for each plugin if it is possible to integrate it at all.

    Do you need an example for avf_disable_recaptchaV3_for_post ?

    Regards,
    Günter

    #1133497

    Do you need an example for avf_disable_recaptchaV3_for_post ?

    Yes please – for both new filters a little example code.
    By the way: the new: avf_copyright_info does it replace : kriesi_backlink

    #1133838

    Hi,

    Examples:

    https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/External%20Services/avf_disable_recaptchaV3_for_post.php
    https://github.com/KriesiMedia/enfold-library/blob/master/actions%20and%20filters/External%20Services/avf_load_google_recaptcha_api_prohibited.php

    avf_copyright_info is located after kriesi_backlink and only allows to modify the stored theme options copyright string but not kriesi_backlink string (enfold\footer.php line 184).

    Best regards,
    Günter

    #1133893

    thanks – !!! what is the difference between these two filters?

    for me seems to be that what i need:

    
    function my_avf_disable_recaptchaV3_for_post( $disable ){
    	global $post;
    	if( ! $post instanceof WP_Post ){
    		return $disable;
    	}
    	/*** Get content to check (ALB or normal content) ***/
    	$content = Avia_Builder()->get_post_content( $post->ID );
    	$disable = ( false !== strpos( $content, '[contact-form-7 ' ) ) ? false : true;
    
    	return $disable;
    }
    	
    add_filter( 'avf_disable_recaptchaV3_for_post', 'my_avf_disable_recaptchaV3_for_post', 10, 1 );

    works great !

    How
    would i combine if i want to check if either [av_contact or [contact-form-7 is there ?

    #1134294

    Hi,

    
    $disable = ( false !== strpos( $content, '[contact-form-7 ' ) || false !== strpos( $content, '[av_contact ' ) ) ? false : true;
    

    Best regards,
    Günter

    #1134398

    Danke – kann geschlossen werden!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Google Recaptcha – DSGVO’ is closed to new replies.