WD Google Maps – Google Maps builder Plugin - Version 1.0.54

Version Description

  • Added: Option to add GDPR compliance required checkbox on the front end.
  • Fixed: Bug on multisite.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Maps – Google Maps builder Plugin
Version 1.0.54
Comparing to
See all releases

Code changes from version 1.0.53 to 1.0.54

.gitignore DELETED
@@ -1,2 +0,0 @@
1
- # Created by .ignore support plugin (hsz.mobi)
2
- .idea/*
 
 
admin/views/GMWDViewOptions_gmwd.php CHANGED
@@ -53,7 +53,7 @@ class GMWDViewOptions_gmwd extends GMWDView{
53
  <tr>
54
  <td width="30%"><label for="map_api_key" title="<?php _e("Set your map API key","gmwd");?>"><?php _e("Map API Key","gmwd"); ?>:</label></td>
55
  <td>
56
- <input type="text" name="map_api_key" id="map_api_key" value="<?php echo $options->map_api_key;?>" >
57
  </td>
58
  </tr>
59
  <tr>
@@ -123,7 +123,22 @@ class GMWDViewOptions_gmwd extends GMWDView{
123
  <input type="radio" class="inputbox" id="map_draggable1" name="map_draggable" <?php echo (($options->map_draggable) ? 'checked="checked"' : ''); ?> value="1" >
124
  <label for="map_draggable1"><?php _e("Yes","gmwd"); ?></label>
125
  </td>
126
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  </table>
128
  </div>
129
  <!-- <div id="global" class="wd-options-container">
53
  <tr>
54
  <td width="30%"><label for="map_api_key" title="<?php _e("Set your map API key","gmwd");?>"><?php _e("Map API Key","gmwd"); ?>:</label></td>
55
  <td>
56
+ <input type="text" name="map_api_key" id="map_api_key" value="<?php echo $options->map_api_key;?>" style="width:400px" >
57
  </td>
58
  </tr>
59
  <tr>
123
  <input type="radio" class="inputbox" id="map_draggable1" name="map_draggable" <?php echo (($options->map_draggable) ? 'checked="checked"' : ''); ?> value="1" >
124
  <label for="map_draggable1"><?php _e("Yes","gmwd"); ?></label>
125
  </td>
126
+ </tr>
127
+ <tr>
128
+ <td ><label title="<?php _e("Enable or Disable Privacy/GDPR","gmwd");?>"><?php _e("Privacy/GDPR","gmwd"); ?>:</label></td>
129
+ <td>
130
+ <input type="radio" class="inputbox" id="gdpr0" name="gdpr" <?php echo (($options->gdpr) ? '' : 'checked="checked"'); ?> value="0" >
131
+ <label for="gdpr0"><?php _e("No","gmwd"); ?></label>
132
+ <input type="radio" class="inputbox" id="gdpr1" name="gdpr" <?php echo (($options->gdpr) ? 'checked="checked"' : ''); ?> value="1" >
133
+ <label for="gdpr1"><?php _e("Yes","gmwd"); ?></label>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <td><label for="gdpr_text" title="<?php _e("Content for privacy","gmwd");?>"><?php _e("Privacy content","gmwd");?>:</label></td>
138
+ <td>
139
+ <textarea name="gdpr_text" id="gdpr_text" cols="60" rows="5"> <?php echo $options->gdpr_text; ?></textarea>
140
+ </td>
141
+ </tr>
142
  </table>
143
  </div>
144
  <!-- <div id="global" class="wd-options-container">
frontend/controllers/GMWDControllerFrontendMap.php CHANGED
@@ -47,7 +47,12 @@ class GMWDControllerFrontendMap extends GMWDControllerFrontend{
47
 
48
  echo json_encode($markers);
49
  die();
50
- }
 
 
 
 
 
51
 
52
  ////////////////////////////////////////////////////////////////////////////////////////
53
  // Getters & Setters //
47
 
48
  echo json_encode($markers);
49
  die();
50
+ }
51
+
52
+ public function ajax_accept_gdpr(){
53
+ setcookie('gmwd_gdpr_accept', '1', 2147483647, "/");
54
+ die();
55
+ }
56
 
57
  ////////////////////////////////////////////////////////////////////////////////////////
58
  // Getters & Setters //
frontend/models/GMWDModelFrontendMap.php CHANGED
@@ -112,6 +112,23 @@ class GMWDModelFrontendMap extends GMWDModelFrontend{
112
  $theme = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "gmwd_themes WHERE `default`='1'");
113
  return $theme;
114
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  ////////////////////////////////////////////////////////////////////////////////////////
117
  // Getters & Setters //
112
  $theme = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "gmwd_themes WHERE `default`='1'");
113
  return $theme;
114
  }
115
+
116
+ public function get_options(){
117
+ global $wpdb;
118
+
119
+ $query = "SELECT * FROM ". $wpdb->prefix . "gmwd_options ";
120
+ $rows = $wpdb->get_results($query);
121
+
122
+ $options = new stdClass();
123
+ foreach ($rows as $row) {
124
+ $name = $row->name;
125
+ $value = $row->value !== "" ? $row->value : $row->default_value;
126
+ $options->$name = $value;
127
+ }
128
+
129
+ return $options;
130
+
131
+ }
132
 
133
  ////////////////////////////////////////////////////////////////////////////////////////
134
  // Getters & Setters //
frontend/views/GMWDViewFrontendMap.php CHANGED
@@ -22,8 +22,46 @@ class GMWDViewFrontendMap extends GMWDViewFrontend{
22
  $params = $this->model->params;
23
  $shortcode_id = $params["id"];
24
  $row = $this->model->get_map();
 
25
 
26
- if($row){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  $overlays = $this->model->get_overlays($row->id);
28
  $theme_id = GMWDHelper::get("f_p") == 1 ? GMWDHelper::get("theme_id") : $row->theme_id;
29
  $theme = $this->model->get_theme($theme_id);
22
  $params = $this->model->params;
23
  $shortcode_id = $params["id"];
24
  $row = $this->model->get_map();
25
+ $options = $this->model->get_options();
26
 
27
+ if($options->gdpr == 1 && empty($_COOKIE["gmwd_gdpr_accept"])){
28
+ ?>
29
+ <div style="padding:11px;border: 1px solid #f5f5f5;">
30
+ <div><?php echo str_replace('[your site]', get_bloginfo(), $options->gdpr_text);?></div>
31
+ <div style="text-align:center;">
32
+ <label for="gmwd_accept_privacy<?php echo $shortcode_id;?>"><?php _e("I accept", "gmwd"); ?>
33
+ &nbsp;<input type="checkbox" name="gmwd_accept_privacy<?php echo $shortcode_id;?>" id="gmwd_accept_privacy<?php echo $shortcode_id;?>" value="1">
34
+ </label>
35
+ <button class="gmwd_policy_continue<?php echo $shortcode_id;?> gmwd-btn" style="display:none"><?php _e("Continue", "gmwd"); ?></button>
36
+ </div>
37
+ </div>
38
+ <script>
39
+ jQuery( document ).ready(function() {
40
+ jQuery("[name=gmwd_accept_privacy<?php echo $shortcode_id;?>]").change(function(){
41
+ if(jQuery(this).is(":checked")){
42
+ jQuery(".gmwd_policy_continue<?php echo $shortcode_id;?>").show();
43
+ } else{
44
+ jQuery(".gmwd_policy_continue<?php echo $shortcode_id;?>").hide();
45
+ }
46
+ });
47
+ jQuery(".gmwd_policy_continue<?php echo $shortcode_id;?>").click(function(){
48
+ if(jQuery("[name=gmwd_accept_privacy<?php echo $shortcode_id;?>]").is(":checked")){
49
+ var data = {};
50
+ data["page"] = "map";
51
+ data["action"] = "ajax_accept_gdpr";
52
+ data["task"] = "ajax_accept_gdpr";
53
+ jQuery.post("<?php echo admin_url('admin-ajax.php');?>", data, function (response){
54
+ location.reload();
55
+ });
56
+ }
57
+ })
58
+ });
59
+
60
+ </script>
61
+ <?php
62
+
63
+ }
64
+ else if($row){
65
  $overlays = $this->model->get_overlays($row->id);
66
  $theme_id = GMWDHelper::get("f_p") == 1 ? GMWDHelper::get("theme_id") : $row->theme_id;
67
  $theme = $this->model->get_theme($theme_id);
gmwd_admin_class.php CHANGED
@@ -12,7 +12,7 @@ class GMWDAdmin
12
  // Variables //
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  protected static $instance = null;
15
- private static $version = '1.0.53';
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
  // Constructor & Destructor //
18
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -135,7 +135,7 @@ class GMWDAdmin
135
  {
136
  if (function_exists('is_multisite') && is_multisite()) {
137
  // Check if it is a network activation - if so, run the activation function for each blog id.
138
- if ($networkwide) {
139
  global $wpdb;
140
  // Get all blog ids.
141
  $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
@@ -146,7 +146,7 @@ class GMWDAdmin
146
  }
147
 
148
  return;
149
- }
150
  } else {
151
  self::activate();
152
  }
12
  // Variables //
13
  ////////////////////////////////////////////////////////////////////////////////////////
14
  protected static $instance = null;
15
+ private static $version = '1.0.54';
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
  // Constructor & Destructor //
18
  ////////////////////////////////////////////////////////////////////////////////////////
135
  {
136
  if (function_exists('is_multisite') && is_multisite()) {
137
  // Check if it is a network activation - if so, run the activation function for each blog id.
138
+ //if ($networkwide) {
139
  global $wpdb;
140
  // Get all blog ids.
141
  $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
146
  }
147
 
148
  return;
149
+ //}
150
  } else {
151
  self::activate();
152
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,wdsupport
3
  Tags: google map, google maps, map, map markers, maps, directions, google map plugin, google maps plugin, map plugin, wp google map, wp google maps, google map widget
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
- Stable tag: 1.0.53
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -144,6 +144,10 @@ Activate WD Google Maps by going to Plugins and pressing Activate button.
144
 
145
  == Changelog ==
146
 
 
 
 
 
147
  = 1.0.53 =
148
  * Changed: Open generate key in new tab
149
 
3
  Tags: google map, google maps, map, map markers, maps, directions, google map plugin, google maps plugin, map plugin, wp google map, wp google maps, google map widget
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
+ Stable tag: 1.0.54
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
144
 
145
  == Changelog ==
146
 
147
+ = 1.0.54 =
148
+ * Added: Option to add GDPR compliance required checkbox on the front end.
149
+ * Fixed: Bug on multisite.
150
+
151
  = 1.0.53 =
152
  * Changed: Open generate key in new tab
153
 
update/gmwd_update.php CHANGED
@@ -21,7 +21,18 @@ function gmwd_update(){
21
  $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `info_window_info` VARCHAR(32) NOT NULL ");
22
  $wpdb->query("UPDATE `" . $wpdb->prefix . "gmwd_maps` SET info_window_info='title,address,desc,pic'");
23
 
24
- }
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
 
21
  $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `info_window_info` VARCHAR(32) NOT NULL ");
22
  $wpdb->query("UPDATE `" . $wpdb->prefix . "gmwd_maps` SET info_window_info='title,address,desc,pic'");
23
 
24
+ }
25
+ $gdpr = $wpdb->get_var('SELECT id FROM ' . $wpdb->prefix . 'gmwd_options WHERE name="gdpr"');
26
+ if(!$gdpr){
27
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "gmwd_options` (`id`, `name`, `value`, `default_value`) VALUES ('', 'gdpr', '0', '0' ) ");
28
+ }
29
+
30
+ $gdpr_text = $wpdb->get_var('SELECT id FROM ' . $wpdb->prefix . 'gmwd_options WHERE name="gdpr_text"');
31
+ if(!$gdpr_text){
32
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "gmwd_options` MODIFY `value` LONGTEXT");
33
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "gmwd_options` MODIFY `default_value` LONGTEXT");
34
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "gmwd_options` (`id`, `name`, `value`, `default_value`) VALUES ('', 'gdpr_text', 'This content will be available if you accept Google privacy policy. Google has its own privacy policies over which we have no control. There is no installation of cookies from Google until you consent to Google policies. By accepting you will be accessing a service provided by a third party external to [your site].', 'This content will be available if you accept Google privacy policy. Google has its own privacy policies over which we have no control. There is no installation of cookies from Google until you consent to Google policies. By accepting you will be accessing a service provided by a third party external to [your site].' ) ");
35
+ }
36
  }
37
 
38
 
wd-google-maps.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WD Google Maps
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: WD Google Maps is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.53
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -41,6 +41,8 @@ add_action('wp_ajax_get_ajax_markers', array('GMWD','gmwd_frontend'));
41
  add_action('wp_ajax_nopriv_get_ajax_markers', array('GMWD','gmwd_frontend'));
42
  add_action('wp_ajax_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
43
  add_action('wp_ajax_nopriv_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
 
 
44
 
45
  function gmwd_map($shortcode_id, $map_id ){
46
  GMWD::gmwd_get_instance();
4
  * Plugin Name: WD Google Maps
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: WD Google Maps is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.54
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
41
  add_action('wp_ajax_nopriv_get_ajax_markers', array('GMWD','gmwd_frontend'));
42
  add_action('wp_ajax_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
43
  add_action('wp_ajax_nopriv_get_ajax_store_loactor', array('GMWD','gmwd_frontend'));
44
+ add_action('wp_ajax_ajax_accept_gdpr', array('GMWD','gmwd_frontend'));
45
+ add_action('wp_ajax_nopriv_ajax_accept_gdpr', array('GMWD','gmwd_frontend'));
46
 
47
  function gmwd_map($shortcode_id, $map_id ){
48
  GMWD::gmwd_get_instance();
widgets.php CHANGED
@@ -188,7 +188,10 @@ class GMWD_Widget extends WP_Widget {
188
 
189
  }
190
 
191
- add_action('widgets_init', create_function('', 'register_widget("GMWD_Widget");'));
 
 
 
192
 
193
 
194
 
188
 
189
  }
190
 
191
+ add_action('widgets_init', 'gmwd_widget_init');
192
+ function gmwd_widget_init(){
193
+ register_widget("GMWD_Widget");
194
+ }
195
 
196
 
197