Support » Plugin: GDPR Cookie Compliance » lity

  • Resolved Camilo

    (@camilo517)


    Once you accept the consent banner, lity.js and lity.css continues to load in the background

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @camilo517,

    Thanks for using our plugin.

    The lity.js and lity.css is required to show the cookie settings screen (modal) accessible from floating button or using as link #gdpr_cookie_modal

    If you prefer to remove the GDPR cookie banner and settings screen completely once it’s approved by users, please follow the steps from the following topic:
    https://support.mooveagency.com/topic/modal-after-pressed-the-allow-button/

    Hope this helps.

    I add the code and the styles continue loading
    http://prntscr.com/roh27t

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @camilo517,

    This will be fixed in the next release, in the current version you can force the Lity to be loaded via wp_enque_script hook.

    Thanks

    Plugin Author Moove Agency

    (@mooveagency)

    Hi @camilo517,

    Thanks for your patience on this.

    We have released the new version, please update your plugin to version 4.1.9 and you can use the following hooks:

    To remove the Lity assets completely:

    add_action('gdpr_enqueue_lity_nojs','__return_false');
    add_action('gdpr_disable_lity_enqueue','__return_true');

    To remove the main.js and main.css (core files) from GDPR:
    add_action('gdpr_disable_main_assets_enqueue', '__return_true');

    Hope this helps.

    Thanks, but I want it to be disabled(remove js and css) when accepted

    Plugin Author Moove Agency

    (@mooveagency)

    We have previously sent you the link:
    https://support.mooveagency.com/topic/modal-after-pressed-the-allow-button/

    So if you combine the scripts (requires some development knowledge) you should get the following snippet (should be added to functions.php):

    /**
     * Enable force reload
     */
    add_action( 'gdpr_force_reload', '__return_true' );
    
    /**
     * Overriding the default banner & modal HTML once the visitors saved preferences
     */
    add_action( 'gdpr_modal_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 ); 
    add_action( 'gdpr_infobar_base_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_branding_styles_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    add_action( 'gdpr_floating_button_module', 'gdpr_cc_remove_hidden_elements', 10, 1 );
    
    function gdpr_cc_remove_hidden_elements( $modal_html ) {
    	if ( function_exists( 'gdpr_cookie_is_accepted' ) ) :
    	  /* supported types: 'strict', 'thirdparty', 'advanced' */
    	  if ( gdpr_cookie_is_accepted( 'strict' ) && ( gdpr_cookie_is_accepted( 'thirdparty' ) || gdpr_cookie_is_accepted( 'advanced' ) ) ) :
    			// This means the user saved the preferences and you don't need to show the modal
    	  	return '';
    	  endif;
    	endif;
    	return $modal_html;
    };
    
    add_action( 'gdpr_enqueue_lity_nojs', '__return_false' );
    add_action( 'gdpr_disable_lity_enqueue', 'gdpr_check_cookies_to_disable_assets' );
    add_action( 'gdpr_disable_main_assets_enqueue', 'gdpr_check_cookies_to_disable_assets' );
    
    function gdpr_check_cookies_to_disable_assets() {
    	if ( function_exists( 'gdpr_cookie_is_accepted' ) ) :
    		/* supported types: 'strict', 'thirdparty', 'advanced' */
    	  if ( gdpr_cookie_is_accepted( 'strict' ) && ( gdpr_cookie_is_accepted( 'thirdparty' ) || gdpr_cookie_is_accepted( 'advanced' ) ) ) :
    			// This means the user saved the preferences and you don't need to show the modal
    	  	return true;
    	  endif;
    	endif;
    	return false;
    }

    Hope this helps.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.