WD Google Maps – Google Maps builder Plugin - Version 1.0.8

Version Description

  • Added: API Key option
Download this release

Release Info

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

Code changes from version 1.0.7 to 1.0.8

admin/controllers/GMWDControllerOptions_gmwd.php CHANGED
@@ -37,8 +37,7 @@ class GMWDControllerOptions_gmwd extends GMWDController{
37
  }
38
  }
39
 
40
- GMWDHelper::message(__("Options Succesfully Saved.","bwg_back"),'updated');
41
- $this->display();
42
 
43
  }
44
 
37
  }
38
  }
39
 
40
+ GMWDHelper::gmwd_redirect("admin.php?page=options_gmwd&message_id=10");
 
41
 
42
  }
43
 
admin/views/GMWDView.php CHANGED
@@ -28,7 +28,13 @@ class GMWDView {
28
  </script>
29
 
30
  <?php
31
- GMWDHelper::print_message();
 
 
 
 
 
 
32
  }
33
 
34
  }
28
  </script>
29
 
30
  <?php
31
+ GMWDHelper::print_message();
32
+
33
+ if(!gmwd_get_option("map_api_key")){
34
+ if(GMWDHelper::get('page') == "maps_gmwd" || GMWDHelper::get('page') == "options_gmwd" ){
35
+ echo '<div style="width:99%"><div class="error"><p><strong>'.__("Important. API key is required for Google Maps to work. Fill the key in ","gmwd").'<a href="admin.php?page=options_gmwd">'.__("Options menu","gmwd").'.</a></strong></p></div></div>';
36
+ }
37
+ }
38
  }
39
 
40
  }
admin/views/GMWDViewOptions_gmwd.php CHANGED
@@ -51,6 +51,13 @@ class GMWDViewOptions_gmwd extends GMWDView{
51
  <div class="wd-options-tabs-container wd-left">
52
  <div id="general" class="wd-options-container" style="width:500px">
53
  <table class="gmwd_edit_table" style="width:100%;">
 
 
 
 
 
 
 
54
  <tr>
55
  <td width="30%"><label for="map_language" title="<?php _e("Choose Your Map Language","gmwd");?>"><?php _e("Map Language","gmwd"); ?>:</label></td>
56
  <td>
51
  <div class="wd-options-tabs-container wd-left">
52
  <div id="general" class="wd-options-container" style="width:500px">
53
  <table class="gmwd_edit_table" style="width:100%;">
54
+ <tr>
55
+ <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>
56
+ <td>
57
+ <input type="text" name="map_api_key" id="map_api_key" value="<?php echo $options->map_api_key;?>" > &nbsp;
58
+ <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank"><?php _e("Get Key","gmwd");?></a>
59
+ </td>
60
+ </tr>
61
  <tr>
62
  <td width="30%"><label for="map_language" title="<?php _e("Choose Your Map Language","gmwd");?>"><?php _e("Map Language","gmwd"); ?>:</label></td>
63
  <td>
admin/views/GMWDViewShortcode_gmwd.php CHANGED
@@ -31,6 +31,10 @@ class GMWDViewShortcode_gmwd extends GMWDView{
31
  if(gmwd_get_option("map_language")){
32
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
33
  }
 
 
 
 
34
  ?>
35
 
36
  <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?> /wp-includes/js/tinymce/tiny_mce_popup.js"></script>
31
  if(gmwd_get_option("map_language")){
32
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
33
  }
34
+
35
+ if(gmwd_get_option("map_api_key")){
36
+ $map_api_url .= "&key=" . gmwd_get_option("map_api_key");
37
+ }
38
  ?>
39
 
40
  <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?> /wp-includes/js/tinymce/tiny_mce_popup.js"></script>
framework/GMWDHelper.php CHANGED
@@ -286,7 +286,10 @@ class GMWDHelper {
286
  case "9":
287
  echo '<div style="width:99%"><div class="error"><p><strong>'.__("Unexepted File.","gmwd").'</strong></p></div></div>';
288
  break;
289
-
 
 
 
290
 
291
  }
292
 
286
  case "9":
287
  echo '<div style="width:99%"><div class="error"><p><strong>'.__("Unexepted File.","gmwd").'</strong></p></div></div>';
288
  break;
289
+
290
+ case "10":
291
+ echo '<div style="width:99%"><div class="updated"><p><strong>'.__("Options Succesfully Saved.","gmwd").'</strong></p></div></div>';
292
+ break;
293
 
294
  }
295
 
gmwd_admin_class.php CHANGED
@@ -11,7 +11,7 @@ class GMWDAdmin{
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
- private static $version = '1.0.7';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -193,6 +193,9 @@ class GMWDAdmin{
193
  if(gmwd_get_option("map_language")){
194
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
195
  }
 
 
 
196
  wp_enqueue_script('gmwd_map-js', $map_api_url);
197
  wp_enqueue_script( 'gmwd_admin_main_map-js', GMWD_URL . '/js/main_map.js');
198
  wp_enqueue_script('gmwd_jscolor-js', GMWD_URL . '/js/jscolor/jscolor.js', array(), true );
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.8';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
193
  if(gmwd_get_option("map_language")){
194
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
195
  }
196
+ if(gmwd_get_option("map_api_key")){
197
+ $map_api_url .= "&key=" . gmwd_get_option("map_api_key");
198
+ }
199
  wp_enqueue_script('gmwd_map-js', $map_api_url);
200
  wp_enqueue_script( 'gmwd_admin_main_map-js', GMWD_URL . '/js/main_map.js');
201
  wp_enqueue_script('gmwd_jscolor-js', GMWD_URL . '/js/jscolor/jscolor.js', array(), true );
gmwd_class.php CHANGED
@@ -92,6 +92,9 @@ class GMWD{
92
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
93
  }
94
 
 
 
 
95
  if (isset($wp_scripts->registered['jquery'])) {
96
  $jquery = $wp_scripts->registered['jquery'];
97
  if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
92
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
93
  }
94
 
95
+ if(gmwd_get_option("map_api_key")){
96
+ $map_api_url .= "&key=" . gmwd_get_option("map_api_key");
97
+ }
98
  if (isset($wp_scripts->registered['jquery'])) {
99
  $jquery = $wp_scripts->registered['jquery'];
100
  if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
google-maps-setup.php CHANGED
@@ -57,6 +57,9 @@ class GMWDSetupWizard {
57
  if(gmwd_get_option("map_language")){
58
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
59
  }
 
 
 
60
  wp_register_script ('google_map-js', $map_api_url, array ('jquery'), '' );
61
  wp_enqueue_script('google_map-js');
62
 
@@ -266,6 +269,13 @@ class GMWDSetupWizard {
266
  <div class="gmwd_wizard_container gmwd_wizard_general_container">
267
  <h2><?php _e("General Options","gmwd");?></h2>
268
  <table class="gmwd_edit_table" style="width: 100%;">
 
 
 
 
 
 
 
269
  <tr>
270
  <td><label for="map_language" title="<?php _e("Choose Your Map Language","gmwd");?>"><?php _e("Map Language","gmwd"); ?>:</label></td>
271
  <td>
57
  if(gmwd_get_option("map_language")){
58
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
59
  }
60
+ if(gmwd_get_option("map_api_key")){
61
+ $map_api_url .= "&key=" . gmwd_get_option("map_api_key");
62
+ }
63
  wp_register_script ('google_map-js', $map_api_url, array ('jquery'), '' );
64
  wp_enqueue_script('google_map-js');
65
 
269
  <div class="gmwd_wizard_container gmwd_wizard_general_container">
270
  <h2><?php _e("General Options","gmwd");?></h2>
271
  <table class="gmwd_edit_table" style="width: 100%;">
272
+ <tr>
273
+ <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>
274
+ <td>
275
+ <input type="text" name="map_api_key" id="map_api_key" value="" > &nbsp;
276
+ <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank"><?php _e("Get Key","gmwd");?></a>
277
+ </td>
278
+ </tr>
279
  <tr>
280
  <td><label for="map_language" title="<?php _e("Choose Your Map Language","gmwd");?>"><?php _e("Map Language","gmwd"); ?>:</label></td>
281
  <td>
preview.php CHANGED
@@ -42,6 +42,9 @@ class GMWDPreview {
42
  if(gmwd_get_option("map_language")){
43
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
44
  }
 
 
 
45
  wp_register_script ('google_map-js', $map_api_url, array ('jquery'), '' );
46
  wp_enqueue_script('google_map-js');
47
 
42
  if(gmwd_get_option("map_language")){
43
  $map_api_url .= "&language=" . gmwd_get_option("map_language");
44
  }
45
+ if(gmwd_get_option("map_api_key")){
46
+ $map_api_url .= "&key=" . gmwd_get_option("map_api_key");
47
+ }
48
  wp_register_script ('google_map-js', $map_api_url, array ('jquery'), '' );
49
  wp_enqueue_script('google_map-js');
50
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: address, cross-browser, custom google map, custom google maps, easy map, geo, geocoder, gmaps, google, google earth, google map, google map plugin, google map widget, google maps, google maps plugin, googlemaps, gps, gpx, kml, latitude, location, longitude, map, map markers, map plugin, map styles, map widget, maps, marker, openstreetmap, path, pin, place, polygons, polylines, post map, routes, store locator, streetview, widget map, wp google map, wp google maps, wp map, wp maps, directions, widget, layers, circles, responsive
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
- Stable tag: 1.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -108,6 +108,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 1.0.7 =
112
  * Changed: Order in which the classes loaded
113
 
4
  Tags: address, cross-browser, custom google map, custom google maps, easy map, geo, geocoder, gmaps, google, google earth, google map, google map plugin, google map widget, google maps, google maps plugin, googlemaps, gps, gpx, kml, latitude, location, longitude, map, map markers, map plugin, map styles, map widget, maps, marker, openstreetmap, path, pin, place, polygons, polylines, post map, routes, store locator, streetview, widget map, wp google map, wp google maps, wp map, wp maps, directions, widget, layers, circles, responsive
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
+ Stable tag: 1.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
108
 
109
  == Changelog ==
110
 
111
+ = 1.0.8 =
112
+ * Added: API Key option
113
+
114
  = 1.0.7 =
115
  * Changed: Order in which the classes loaded
116
 
sql/sql.php CHANGED
@@ -316,6 +316,7 @@ function gmwd_create_tables(){
316
  $exist_options = $wpdb->get_var('SELECT COUNT(id) FROM ' . $wpdb->prefix . 'gmwd_options');
317
  if(!$exist_options){
318
  $gmwd_options_insert = "INSERT INTO `" . $wpdb->prefix . "gmwd_options` (`id`, `name`, `value`, `default_value`) VALUES
 
319
  ('', 'map_language', '', '' ),
320
  ('', 'choose_marker_icon', '', '1' ),
321
  ('', 'marker_default_icon', '', '' ),
316
  $exist_options = $wpdb->get_var('SELECT COUNT(id) FROM ' . $wpdb->prefix . 'gmwd_options');
317
  if(!$exist_options){
318
  $gmwd_options_insert = "INSERT INTO `" . $wpdb->prefix . "gmwd_options` (`id`, `name`, `value`, `default_value`) VALUES
319
+ ('', 'map_api_key', '', '' ),
320
  ('', 'map_language', '', '' ),
321
  ('', 'choose_marker_icon', '', '1' ),
322
  ('', 'marker_default_icon', '', '' ),
update/gmwd_update.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
  function gmwd_update($version){
3
  global $wpdb;
4
-
 
 
 
5
  }
6
 
7
 
1
  <?php
2
  function gmwd_update($version){
3
  global $wpdb;
4
+ $api_key = $wpdb->get_var('SELECT id FROM ' . $wpdb->prefix . 'gmwd_options WHERE name="map_api_key"');
5
+ if(!$api_key){
6
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "gmwd_options` (`id`, `name`, `value`, `default_value`) VALUES ('', 'map_api_key', '', '' ) ");
7
+ }
8
  }
9
 
10
 
wd-google-maps.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.7
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.8
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html