WP Google Maps - Version 7.10.17

Version Description

  • 2018-06-29 :- Medium Priority =
  • Fixed country restriction broken in store locator
  • Added dismissable admin GDPR warning when GDPR compliance has been switched off
  • Fixed GDPR settings blank by default on some installations
Download this release

Release Info

Developer perryrylance
Plugin Icon 128x128 WP Google Maps
Version 7.10.17
Comparing to
See all releases

Code changes from version 7.10.16 to 7.10.17

html/gdpr-compliance-settings.html.php CHANGED
@@ -11,7 +11,7 @@
11
  <i class="fa fa-question-circle"
12
  title="<?php _e('Disabling will disable all GDPR related options, this is not advised.', 'wp-google-maps'); ?>"/>
13
  </label>
14
- <input name="wpgmza_gdpr_enabled" type="checkbox" checked="checked"/>
15
  </fieldset>
16
 
17
  <fieldset>
11
  <i class="fa fa-question-circle"
12
  title="<?php _e('Disabling will disable all GDPR related options, this is not advised.', 'wp-google-maps'); ?>"/>
13
  </label>
14
+ <input name="wpgmza_gdpr_enabled" type="checkbox"/>
15
  </fieldset>
16
 
17
  <fieldset>
includes/class.gdpr-compliance.php CHANGED
@@ -13,25 +13,15 @@ class GDPRCompliance
13
 
14
  add_action('wp_ajax_wpgmza_gdpr_privacy_policy_notice_dismissed', array($this, 'onPrivacyPolicyNoticeDismissed'));
15
 
16
- /*$wpgmza_other_settings = get_option('WPGMZA_OTHER_SETTINGS');
 
17
 
18
- if(!isset($wpgmza_other_settings['wpgmza_gdpr_notice']))
19
- {
20
- if(!is_array($wpgmza_other_settings))
21
- $wpgmza_other_settings = array();
22
-
23
- $wpgmza_other_settings = apply_filters('wpgmza_plugin_get_default_settings', $wpgmza_other_settings);
24
-
25
- // TODO: Remove this after performance enhancements permit
26
- $wpgmza_other_settings['wpgmza_settings_marker_pull'] = '0';
27
-
28
- update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_other_settings);
29
- }*/
30
  }
31
 
32
- public function onPluginGetDefaultSettings($settings)
33
  {
34
- return array_merge($settings, array(
35
  'wpgmza_gdpr_enabled' => 1,
36
  'wpgmza_gdpr_notice' => apply_filters('wpgmza_gdpr_notice',
37
  __('I agree for my personal data to be processed by {COMPANY_NAME}.
@@ -47,7 +37,27 @@ Please <a href="https://developers.google.com/maps/terms">see here</a> and <a hr
47
  Where this notice is displayed in place of a map, agreeing to this notice will store a cookie recording your agreement so you are not prompted again.'), 'wp-google-maps'),
48
 
49
  'wpgmza_gdpr_retention_purpose' => 'presenting the data you have submitted on the map.'
50
- ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  public function onPrivacyPolicyNoticeDismissed()
@@ -66,11 +76,13 @@ Where this notice is displayed in place of a map, agreeing to this notice will s
66
 
67
  protected function getSettingsTabContent()
68
  {
69
- $wpgmza_other_settings = get_option('WPGMZA_OTHER_SETTINGS');
 
 
70
 
71
  $document = new DOMDocument();
72
  $document->loadPHPFile(plugin_dir_path(__DIR__) . 'html/gdpr-compliance-settings.html.php');
73
- $document->populate($wpgmza_other_settings);
74
 
75
  return $document;
76
  }
@@ -130,6 +142,57 @@ Where this notice is displayed in place of a map, agreeing to this notice will s
130
  return $input . $document->saveInnerBody();
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  public function onPOST()
134
  {
135
  $document = $this->getSettingsTabContent();
@@ -150,9 +213,13 @@ Where this notice is displayed in place of a map, agreeing to this notice will s
150
  {
151
  case 'checkbox':
152
  if($input->getValue())
 
153
  $wpgmza_other_settings[$name] = 1;
 
154
  else
 
155
  unset($wpgmza_other_settings[$name]);
 
156
  break;
157
 
158
  default:
13
 
14
  add_action('wp_ajax_wpgmza_gdpr_privacy_policy_notice_dismissed', array($this, 'onPrivacyPolicyNoticeDismissed'));
15
 
16
+ add_action('admin_notices', array($this, 'onAdminNotices'));
17
+ add_action('admin_post_wpgmza_dismiss_admin_gdpr_warning', array($this, 'onDismissAdminWarning'));
18
 
19
+ $this->setDefaultSettings();
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
 
22
+ public function getDefaultSettings()
23
  {
24
+ return array(
25
  'wpgmza_gdpr_enabled' => 1,
26
  'wpgmza_gdpr_notice' => apply_filters('wpgmza_gdpr_notice',
27
  __('I agree for my personal data to be processed by {COMPANY_NAME}.
37
  Where this notice is displayed in place of a map, agreeing to this notice will store a cookie recording your agreement so you are not prompted again.'), 'wp-google-maps'),
38
 
39
  'wpgmza_gdpr_retention_purpose' => 'presenting the data you have submitted on the map.'
40
+ );
41
+ }
42
+
43
+ public function setDefaultSettings()
44
+ {
45
+ $settings = get_option('WPGMZA_OTHER_SETTINGS');
46
+
47
+ if(empty($settings))
48
+ $settings = array();
49
+
50
+ if(isset($settings['wpgmza_gdpr_notice']))
51
+ return;
52
+
53
+ $settings = array_merge($settings, $this->getDefaultSettings());
54
+
55
+ update_option('WPGMZA_OTHER_SETTINGS', $settings);
56
+ }
57
+
58
+ public function onPluginGetDefaultSettings($settings)
59
+ {
60
+ return array_merge($settings, $this->getDefaultSettings());
61
  }
62
 
63
  public function onPrivacyPolicyNoticeDismissed()
76
 
77
  protected function getSettingsTabContent()
78
  {
79
+ global $wpgmza;
80
+
81
+ $settings = get_option('WPGMZA_OTHER_SETTINGS');
82
 
83
  $document = new DOMDocument();
84
  $document->loadPHPFile(plugin_dir_path(__DIR__) . 'html/gdpr-compliance-settings.html.php');
85
+ $document->populate($settings);
86
 
87
  return $document;
88
  }
142
  return $input . $document->saveInnerBody();
143
  }
144
 
145
+ public function onAdminNotices()
146
+ {
147
+ global $wpgmza;
148
+
149
+ $settings = get_option('WPGMZA_OTHER_SETTINGS');
150
+
151
+ if(!empty($settings->wpgmza_gdpr_enabled))
152
+ return;
153
+
154
+ if(!empty($_COOKIE['wpgmza-gdpr-user-has-dismissed-admin-warning']))
155
+ return;
156
+
157
+ echo '
158
+ <div class="notice admin-notice notice-error">
159
+ <p>
160
+ <strong>
161
+ ' . __('WP Google Maps - Warning - GDPR Compliance Disabled - Action Required', 'wp-google-maps') . '
162
+ </strong>
163
+ </p>
164
+ <p>
165
+ ' . __('GDPR compliance has been disabled, read more about the implications of this here: ', 'wp-google-maps') . '
166
+ <a href="https://www.eugdpr.org/" target="_blank">' . __('EU GDPR', 'wp-google-maps') . '</a>
167
+ </p>
168
+ <p>
169
+ ' . __('Additionally please take a look at WP Google Maps <a href="https://www.wpgmaps.com/privacy-policy">Privacy Policy</a>') . '
170
+ </p>
171
+ <p>
172
+ ' . __('It is highly recommended that you enable GDPR compliance to ensure your user data is regulated.') . '
173
+ </p>
174
+
175
+ <form action="' . admin_url('admin-post.php') . '" method="POST">
176
+ <input type="hidden" name="action" value="wpgmza_dismiss_admin_gdpr_warning"/>
177
+ <input type="hidden" name="redirect" value="' . $_SERVER['REQUEST_URI'] . '"/>
178
+
179
+ <p>
180
+ <a href="' . admin_url('admin.php?page=wp-google-maps-menu-settings') . '" class="button button-secondary">' . __('Privacy Settings', 'wp-google-maps') . '</a>
181
+
182
+ <button type="submit" class="button button-primary" style="background-color: #DC3232 !important; border: none !important; box-shadow: 0 1px 0 #DA2825; text-shadow: 0px -1px 1px #DA2825">' . __('Dismiss & Accept Responsibility', 'wp-google-maps') . '</button>
183
+ </p>
184
+ </form>
185
+ </div>
186
+ ';
187
+ }
188
+
189
+ public function onDismissAdminWarning()
190
+ {
191
+ setcookie('wpgmza-gdpr-user-has-dismissed-admin-warning', 'true', 2147483647);
192
+ wp_redirect($_POST['redirect']);
193
+ exit;
194
+ }
195
+
196
  public function onPOST()
197
  {
198
  $document = $this->getSettingsTabContent();
213
  {
214
  case 'checkbox':
215
  if($input->getValue())
216
+ {
217
  $wpgmza_other_settings[$name] = 1;
218
+ }
219
  else
220
+ {
221
  unset($wpgmza_other_settings[$name]);
222
+ }
223
  break;
224
 
225
  default:
js/wpgmaps.js CHANGED
@@ -185,7 +185,9 @@ function wpgmza_create_places_autocomplete() {
185
  var restriction = wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_store_locator_restrict'];
186
 
187
  if(restriction)
188
- options.componentRestrictions.country = restriction;
 
 
189
 
190
  autocomplete = new google.maps.places.Autocomplete(element, options);
191
  google.maps.event.addListener(autocomplete, 'place_changed', function() {
@@ -789,7 +791,9 @@ function searchLocations(map_id) {
789
 
790
  var restrict = wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_store_locator_restrict'];
791
  if(restrict && restrict.length)
792
- options.componentRestrictions = restrict;
 
 
793
 
794
  geocoder.geocode(options, function(results, status) {
795
 
185
  var restriction = wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_store_locator_restrict'];
186
 
187
  if(restriction)
188
+ options.componentRestrictions = {
189
+ country: restriction
190
+ };
191
 
192
  autocomplete = new google.maps.places.Autocomplete(element, options);
193
  google.maps.event.addListener(autocomplete, 'place_changed', function() {
791
 
792
  var restrict = wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_store_locator_restrict'];
793
  if(restrict && restrict.length)
794
+ options.componentRestrictions = {
795
+ country: restrict
796
+ };
797
 
798
  geocoder.geocode(options, function(results, status) {
799
 
readme.txt CHANGED
@@ -215,6 +215,15 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
215
 
216
  == Changelog ==
217
 
 
 
 
 
 
 
 
 
 
218
  = 7.10.15 - 2018-06-14 :- Medium priority =
219
  * Fixed GDPR consent notice bypassed when "prevent other plugins and theme enqueueing maps API" is not set
220
 
215
 
216
  == Changelog ==
217
 
218
+ = 7.10.17 - 2018-06-29 :- Medium Priority =
219
+ * Fixed country restriction broken in store locator
220
+ * Added dismissable admin GDPR warning when GDPR compliance has been switched off
221
+ * Fixed GDPR settings blank by default on some installations
222
+
223
+ = 7.10.16 - 2018-06-21 :- Medium priority =
224
+ * Fixed global settings lost
225
+ * Fixed whitespace matched in version variable
226
+
227
  = 7.10.15 - 2018-06-14 :- Medium priority =
228
  * Fixed GDPR consent notice bypassed when "prevent other plugins and theme enqueueing maps API" is not set
229
 
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
- Version: 7.10.16
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
@@ -11,6 +11,11 @@ Domain Path: /languages
11
  */
12
 
13
  /*
 
 
 
 
 
14
  * 7.10.16 - 2018-06-21 :- Medium priority
15
  * Fixed global settings lost
16
  * Fixed whitespace matched in version variable
@@ -764,7 +769,7 @@ function wpgmaps_init() {
764
  update_option("WPGMZA_OTHER_SETTINGS",$wpgmza_settings);
765
 
766
  } else {
767
- /* previous users - set it to XML (what they were using originally) */
768
  $wpgmza_settings['wpgmza_settings_marker_pull'] = "1";
769
  update_option("WPGMZA_OTHER_SETTINGS",$wpgmza_settings);
770
  }
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
+ Version: 7.10.17
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
11
  */
12
 
13
  /*
14
+ * 7.10.17 - 2018-06-29 :- Medium Priority
15
+ * Fixed country restriction broken in store locator
16
+ * Added dismissable admin GDPR warning when GDPR compliance has been switched off
17
+ * Fixed GDPR settings blank by default on some installations
18
+ *
19
  * 7.10.16 - 2018-06-21 :- Medium priority
20
  * Fixed global settings lost
21
  * Fixed whitespace matched in version variable
769
  update_option("WPGMZA_OTHER_SETTINGS",$wpgmza_settings);
770
 
771
  } else {
772
+ /* previous users - set it to XML (what they were using originally) */
773
  $wpgmza_settings['wpgmza_settings_marker_pull'] = "1";
774
  update_option("WPGMZA_OTHER_SETTINGS",$wpgmza_settings);
775
  }