Google Maps Widget – Ultimate Google Maps Plugin - Version 3.03

Version Description

  • 2016/02/17
  • added more detailed instructions on how to generate the API key
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Google Maps Widget – Ultimate Google Maps Plugin
Version 3.03
Comparing to
See all releases

Code changes from version 3.0 to 3.03

Files changed (3) hide show
  1. gmw-widget.php +5 -10
  2. google-maps-widget.php +5 -5
  3. readme.txt +15 -2
gmw-widget.php CHANGED
@@ -457,8 +457,8 @@ class GoogleMapsWidget extends WP_Widget {
457
  echo 'Pitch: <input data-title="Streetview Camera Pitch" data-tooltip="Specifies the angle, up or down, of the camera. The pitch is specified in degrees from -90° to 90°. Positive values will angle the camera up, while negative values will angle the camera down." class="small-text" id="' . $this->get_field_id('lightbox_pitch') . '" name="' . $this->get_field_name('lightbox_pitch') . '" type="number" step="1" min="-90" max="90" type="text" value="' . esc_attr($lightbox_pitch) . '" required="required"> degrees';
458
  echo '</p>';
459
 
460
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
461
- echo '<select data-tooltip="Controls the map layers shown." id="' . $this->get_field_id('lightbox_type') . '" name="' . $this->get_field_name('lightbox_type') . '">';
462
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
463
  echo '</select></p>';
464
 
@@ -535,15 +535,10 @@ class GoogleMapsWidget extends WP_Widget {
535
  echo '<p>It won\'t take you more than a minute, but it will help us immensely. So please - <a href="https://wordpress.org/support/view/plugin-reviews/google-maps-widget" target="_blank">rate the plugin</a>. Or spread the word by <a href="https://twitter.com/intent/tweet?via=WebFactoryLtd&amp;text=' . urlencode('I\'m using the #free Google Maps Widget for #wordpress. You can grab it too at http://goo.gl/2qcbbf') . '" target="_blank">tweeting about it</a>. Thank you!</p>';
536
  echo '</div>';
537
  // end - info tab
538
-
539
  echo '</div><p></p>'; // tabs
540
 
541
  if (!GMW::is_activated()) {
542
- if (date('d') % 2 && (username_exists('admin') || get_userdata(1))) {
543
- echo '<p>' . __('We have detected at least one <span class="gmw-pro-red">security issue</span> on this site related to user accounts. Don\'t become a statistic! Protect your site with <a href="http://security-ninja-plugins-bundle.webfactoryltd.com/?ref=gmw" target="_blank">Security Ninja</a>.', 'google-maps-widget') . '</p>';
544
- } else {
545
- echo '<p>' . __('Upgrade to Google Maps Widget <span class="gmw-pro-red">PRO</span> to get more than 50 extra options available immeditely. <a class="open_promo_dialog" href="#">Upgrade now</a>.', 'google-maps-widget') . '</p>';
546
- }
547
  } else {
548
  echo '<p>' . sprintf(__('Additional options are available in <a href="%s" title="Settings">settings</a>. ', 'google-maps-widget'), admin_url('options-general.php?page=gmw_options')) . __('If you experience any problems or need help, please contact <a href="mailto:gmw@webfactoryltd.com?subject=GMW%20support">support</a>.', 'google-maps-widget') . '</p>';
549
  }
@@ -728,11 +723,11 @@ class GoogleMapsWidget extends WP_Widget {
728
  if (!empty($instance['lightbox_title']) && !in_array('title', $instance['lightbox_feature'])) {
729
  $instance['lightbox_feature'][] = 'title';
730
  }
731
-
732
  // map type values changed
733
  if (isset($instance['lightbox_map_type']) && $instance['lightbox_map_type'] == 'k') {
734
  $instance['lightbox_map_type'] = 'satellite';
735
- } else {
736
  $instance['lightbox_map_type'] = 'roadmap';
737
  }
738
 
457
  echo 'Pitch: <input data-title="Streetview Camera Pitch" data-tooltip="Specifies the angle, up or down, of the camera. The pitch is specified in degrees from -90° to 90°. Positive values will angle the camera up, while negative values will angle the camera down." class="small-text" id="' . $this->get_field_id('lightbox_pitch') . '" name="' . $this->get_field_name('lightbox_pitch') . '" type="number" step="1" min="-90" max="90" type="text" value="' . esc_attr($lightbox_pitch) . '" required="required"> degrees';
458
  echo '</p>';
459
 
460
+ echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_map_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
461
+ echo '<select data-tooltip="Controls the map layers shown." id="' . $this->get_field_id('lightbox_map_type') . '" name="' . $this->get_field_name('lightbox_map_type') . '">';
462
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
463
  echo '</select></p>';
464
 
535
  echo '<p>It won\'t take you more than a minute, but it will help us immensely. So please - <a href="https://wordpress.org/support/view/plugin-reviews/google-maps-widget" target="_blank">rate the plugin</a>. Or spread the word by <a href="https://twitter.com/intent/tweet?via=WebFactoryLtd&amp;text=' . urlencode('I\'m using the #free Google Maps Widget for #wordpress. You can grab it too at http://goo.gl/2qcbbf') . '" target="_blank">tweeting about it</a>. Thank you!</p>';
536
  echo '</div>';
537
  // end - info tab
 
538
  echo '</div><p></p>'; // tabs
539
 
540
  if (!GMW::is_activated()) {
541
+ echo '<p>' . __('Upgrade to Google Maps Widget <span class="gmw-pro-red">PRO</span> to get more than 50 extra options available immeditely. <a class="open_promo_dialog" href="#">Upgrade now</a>.', 'google-maps-widget') . '</p>';
 
 
 
 
542
  } else {
543
  echo '<p>' . sprintf(__('Additional options are available in <a href="%s" title="Settings">settings</a>. ', 'google-maps-widget'), admin_url('options-general.php?page=gmw_options')) . __('If you experience any problems or need help, please contact <a href="mailto:gmw@webfactoryltd.com?subject=GMW%20support">support</a>.', 'google-maps-widget') . '</p>';
544
  }
723
  if (!empty($instance['lightbox_title']) && !in_array('title', $instance['lightbox_feature'])) {
724
  $instance['lightbox_feature'][] = 'title';
725
  }
726
+
727
  // map type values changed
728
  if (isset($instance['lightbox_map_type']) && $instance['lightbox_map_type'] == 'k') {
729
  $instance['lightbox_map_type'] = 'satellite';
730
+ } elseif ($instance['lightbox_map_type'] != 'satellite') {
731
  $instance['lightbox_map_type'] = 'roadmap';
732
  }
733
 
google-maps-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Maps Widget
4
  Plugin URI: http://www.googlemapswidget.com/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available as an image replacement or in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
- Version: 3.0
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
@@ -46,7 +46,7 @@ if (file_exists(GMW_PLUGIN_DIR . 'gmw-pro-license.php')) {
46
 
47
 
48
  class GMW {
49
- static $version = '3.0';
50
  static $options = 'gmw_options';
51
 
52
 
@@ -339,7 +339,7 @@ class GMW {
339
 
340
  if ($widget['lightbox_mode'] == 'place') {
341
  $map_params['q'] = $widget['address'];
342
- $map_params['attribution_source'] = get_bloginfo('name');
343
  $map_params['attribution_web_url'] = get_bloginfo('url');
344
  $map_params['attribution_ios_deep_link_id'] = 'comgooglemaps://?daddr=' . $widget['address'];
345
  $map_params['maptype'] = $widget['lightbox_map_type'];
@@ -936,8 +936,8 @@ class GMW {
936
  <th scope="row"><label for="api_key">' . __('Google Maps API Key', 'google-maps-widget') . '</label></th>
937
  <td><input name="' . GMW::$options . '[api_key]" type="text" id="api_key" value="' . esc_attr($options['api_key']) . '" class="regular-text" placeholder="Google Maps API key" oninput="setCustomValidity(\'\')" oninvalid="this.setCustomValidity(\'Please use Google Developers Console to generate an API key and enter it here. It is completely free.\')">
938
  <p class="description">New Google Maps usage policy dictates that everyone using the maps should register for a free API key.<br>
939
- Please create a key using <a href="https://console.developers.google.com/project" target="blank">Google Developers Console</a> or use this <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_embed_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">wizard</a>.
940
- Detailed video instructions coming soon.</p></td>
941
  </tr>';
942
  if (GMW::is_activated()) {
943
  echo '<tr>
4
  Plugin URI: http://www.googlemapswidget.com/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available as an image replacement or in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
+ Version: 3.03
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
46
 
47
 
48
  class GMW {
49
+ static $version = '3.03';
50
  static $options = 'gmw_options';
51
 
52
 
339
 
340
  if ($widget['lightbox_mode'] == 'place') {
341
  $map_params['q'] = $widget['address'];
342
+ $map_params['attribution_source'] = get_bloginfo('name')? get_bloginfo('name'): 'Google Maps Widget';
343
  $map_params['attribution_web_url'] = get_bloginfo('url');
344
  $map_params['attribution_ios_deep_link_id'] = 'comgooglemaps://?daddr=' . $widget['address'];
345
  $map_params['maptype'] = $widget['lightbox_map_type'];
936
  <th scope="row"><label for="api_key">' . __('Google Maps API Key', 'google-maps-widget') . '</label></th>
937
  <td><input name="' . GMW::$options . '[api_key]" type="text" id="api_key" value="' . esc_attr($options['api_key']) . '" class="regular-text" placeholder="Google Maps API key" oninput="setCustomValidity(\'\')" oninvalid="this.setCustomValidity(\'Please use Google Developers Console to generate an API key and enter it here. It is completely free.\')">
938
  <p class="description">New Google Maps usage policy dictates that everyone using the maps should register for a free API key.<br>
939
+ Please create a key for "Google Static Maps API" and "Google Maps Embed API" using the <a href="https://console.developers.google.com/project" target="blank">Google Developers Console</a>.<br>
940
+ Or use <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_embed_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">wizard step #1</a> - login, click next a few times &amp; copy the key. Then use <a href="https://console.developers.google.com/flows/enableapi?apiid=static_maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">wizard step #2</a> and select the same "My Project".</p></td>
941
  </tr>';
942
  if (GMW::is_activated()) {
943
  echo '<tr>
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.8
8
  Tested up to: 4.4
9
- Stable tag: 3.0
10
 
11
  Displays a single image, super-fast loading Google map in a widget. A larger map with all interactive features is available on click in a lightbox.
12
 
@@ -84,8 +84,11 @@ http://www.youtube.com/watch?v=y1siX9ha7Pw&hd=1
84
 
85
 
86
  **License info**
 
87
  * Parts of export & import code are based on <a href="https://wordpress.org/plugins/widget-importer-exporter/">Widget Importer & Exporter</a> plugin, (c) Steven Gliebe
88
- * Most icons are created by Nicolas Mollet under the Creative Commons Attribution-Share Alike 3.0 Unported license. You can find them on https://mapicons.mapsmarker.com/
 
 
89
 
90
 
91
  == Installation ==
@@ -115,6 +118,11 @@ For anyone who needs a map on their site in 5 seconds.
115
 
116
  Write the address differently, or more precisely. Make sure you enter the street, town and country name. If necessary enter lat/lng coordinates instead of the address. Use the numeric notation, eg: "40.7127, 74.0059"
117
 
 
 
 
 
 
118
  = Thumbnail map works but lightbox won't open on click =
119
 
120
  You probably have Fancybox JS and CSS files included twice; once by the theme and second time by GMW plugin. Remove one instance of files. If that's not the case then you have a fatal JS error that's preventing execution of other JS code. Hit F12 in Firefox or Chrome and have a look at the debug console. If there are any red lines - it's a fatal error.
@@ -133,6 +141,11 @@ Read the <a href="http://wordpress.org/support/plugin/google-maps-widget">suppor
133
  5. Widget options - Shortcode
134
 
135
  == Changelog ==
 
 
 
 
 
136
  = 3.0 =
137
  * 2016/02/16
138
  * huge upgrade - numerous functions added
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.8
8
  Tested up to: 4.4
9
+ Stable tag: 3.03
10
 
11
  Displays a single image, super-fast loading Google map in a widget. A larger map with all interactive features is available on click in a lightbox.
12
 
84
 
85
 
86
  **License info**
87
+
88
  * Parts of export & import code are based on <a href="https://wordpress.org/plugins/widget-importer-exporter/">Widget Importer & Exporter</a> plugin, (c) Steven Gliebe
89
+ * Most <a href="https://mapicons.mapsmarker.com/">icons</a> are created by Nicolas Mollet under the Creative Commons Attribution-Share Alike 3.0 Unported license
90
+ * <a href="https://select2.github.io/">Select2 v4</a>, licensed under MIT
91
+ * <a href="http://www.jacklmoore.com/colorbox">Colorbox 1.6</a>, licensed under MIT
92
 
93
 
94
  == Installation ==
118
 
119
  Write the address differently, or more precisely. Make sure you enter the street, town and country name. If necessary enter lat/lng coordinates instead of the address. Use the numeric notation, eg: "40.7127, 74.0059"
120
 
121
+ = How to generate the API key =
122
+
123
+ We understand that creating an API key is frustrating but it takes less than a minute and it's something Google requires.
124
+ Follow <a href="https://console.developers.google.com/flows/enableapi?apiid=maps_embed_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">wizard step #1</a> - login with any Gmail account, click next/confirm a few times with the default settings &amp; copy the key you see on the screen; it's the key you need. Then use <a href="https://console.developers.google.com/flows/enableapi?apiid=static_maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">wizard step #2</a>, select the same "My Project" project from the list and that's it. Save the key in GMW settings.
125
+
126
  = Thumbnail map works but lightbox won't open on click =
127
 
128
  You probably have Fancybox JS and CSS files included twice; once by the theme and second time by GMW plugin. Remove one instance of files. If that's not the case then you have a fatal JS error that's preventing execution of other JS code. Hit F12 in Firefox or Chrome and have a look at the debug console. If there are any red lines - it's a fatal error.
141
  5. Widget options - Shortcode
142
 
143
  == Changelog ==
144
+
145
+ = 3.03 =
146
+ * 2016/02/17
147
+ * added more detailed instructions on how to generate the API key
148
+
149
  = 3.0 =
150
  * 2016/02/16
151
  * huge upgrade - numerous functions added