• Resolved bertamarie

    (@bertamarie)


    Hello,

    thank you for the really cool plugin. It is only a while that our page has a problem with WP Go Maps (formerly WP Google Maps) and google maps pro. Whenever somenon consents to marketing cookies, the google maps in the sidebars disappear. in Complianz -> integrations google maps appears in 2 places: 1. under Services and 2. under Plugins

    whenever I activate one of them the plugin is blocked. But as soon as people consent to google maps the map behing the overlay as well as the overlay itself disappears. This means there is a void spot where the map is supposed to be. Coud you pleas support me with that?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor jarnovos

    (@jarnovos)

    Hi @bertamarie,

    I assume that the WP Google Maps integration is currently deactivated, would it be possible to re-enable it and let us know; so that we’re able to see the error occur?

    That would give us some further pointers as to the most-likely cause of the behavior.

    Kind regards, Jarno

    Thread Starter bertamarie

    (@bertamarie)

    Hello Jarno,

    thank you for your reply. I have reactivated the overlay so you can have a look.

    Best

    Christine

    • This reply was modified 1 year, 8 months ago by bertamarie.
    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @bertamarie,

    Could you navigate to the following location on your website: /wp-content/plugins/complianz-gdpr/integrations/plugins/

    And then replace the current contents of the wp-google-maps.php file with the code attached below?

    <?php
    defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
    if ( !defined('CMPLZ_GOOGLE_MAPS_INTEGRATION_ACTIVE') ) define('CMPLZ_GOOGLE_MAPS_INTEGRATION_ACTIVE', true);
    
    function cmplz_wp_google_maps_whitelist($tags){
    	$tags[] = 'WPGMZA_localized_data';
    	$tags[] = 'maps.google.com';
    	$tags[] = 'openstreetmap.org';
    
    	return $tags;
    }
    add_filter( 'cmplz_whitelisted_script_tags', 'cmplz_wp_google_maps_whitelist');
    
    /**
     * Declare a placeholder
     *
     */
    function cmplz_wp_google_maps_placeholder(){}
    
    
    add_filter( 'cmplz_known_script_tags', 'cmplz_wp_google_maps_script' );
    function cmplz_wp_google_maps_script( $tags ) {
    	$tags[] = array(
    			'name' => 'google-maps',
    			'category' => 'marketing',
    			'placeholder' => 'google-maps',
    			'urls' => array(
    					'wp-google-maps/js/',
    					'wp-google-maps-pro',
    			),
    			'enable_placeholder' => '1',
    			'placeholder_class' => 'wpgmza_map',
    	);
    	return $tags;
    }
    
    /**
     * Force the Wp Google Maps GDPR option to be disabled, as it's handled by Complianz
     *
     * @param $settings
     *
     * @return mixed
     */
    function cmplz_wp_google_maps_settings() {
    	if ( is_admin() && cmplz_user_can_manage() ) {
    		$settings = json_decode( get_option( 'wpgmza_global_settings' ) );
    		if ( property_exists($settings, 'wpgmza_gdpr_require_consent_before_load') && $settings->wpgmza_gdpr_require_consent_before_load === 'on' ) {
    			$settings->wpgmza_gdpr_require_consent_before_load = false;
    			update_option( 'wpgmza_global_settings', json_encode( $settings ) );
    		}
    	}
    }
    add_action( 'admin_init', 'cmplz_wp_google_maps_settings' );
    
    
    /**
     * Add cookie that should be set on consent
     *
     * @param $cookies
     *
     * @return mixed
     */
    
    
    function cmplz_wp_google_maps_add_cookie( $cookies ) {
    	$cookies['wpgmza-api-consent-given'] = array( '1', 0 );
    	return $cookies;
    }
    add_filter( 'cmplz_set_cookies_on_consent', 'cmplz_wp_google_maps_add_cookie' );
    
    /**
     * Add services to the list of detected items, so it will get set as default, and will be added to the notice about it
     *
     * @param $services
     *
     * @return array
     */
    function cmplz_wp_google_maps_detected_services( $services ) {
    	if ( ! in_array( 'google-maps', $services ) ) {
    		$services[] = 'google-maps';
    	}
    
    	return $services;
    }
    add_filter( 'cmplz_detected_services', 'cmplz_wp_google_maps_detected_services' );

    After making the change, ensure that the WP Google Maps integration is activated under Complianz > Integrations > Plugins, and check the behavior of your Google Map once more.

    Kind regards, Jarno

    Thread Starter bertamarie

    (@bertamarie)

    Hello @jarnovos,

    I did as you requested. Unluckily nothing changed. I found our though that we have an outdatet php-version (7.2.34-28+0) running. Might that conflict with the code? And also I found a file thats name is: wp-google-map-plugin.php as well. Looks like there are two files handling the same plugin.

    Thank you for your help so far.

    Best

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @bertamarie,

    Strange, I would’ve expected that one to work. We recently came across a WP Google Maps Pro user where this exact integration did the trick, so I’m wondering what the difference might be.

    Would it be possible for you to send us a message directly via support(at)complianz.io? We’d gladly investigate further.

    Just to clarify: the other ‘wp-google-map-plugin’ file is unrelated, it is intended for a different plugin, but with a very similar name.

    Kind regards, Jarno

    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @bertamarie,

    We have made some further adjustments to the WP Go Maps integration, which I expect to resolve the issue. Could you install the plugin version attached below?

    https://github.com/Really-Simple-Plugins/complianz-gdpr/tree/wp-go-maps

    Download it by clicking the green “Code” button, then select “Download .zip”. This will yield the file that you can upload as a plugin on your WordPress site.

    Kind regards, Jarno

    Thread Starter bertamarie

    (@bertamarie)

    Hello again,

    I downloaded and installed the plugin form github. Nothing changed. I’m sorry.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Maps disappear after consent’ is closed to new replies.