Google Maps Widget – Ultimate Google Maps Plugin - Version 2.60

Version Description

  • 2015/08/31
  • added data validation on input fields
  • minor CSS tweaks
Download this release

Release Info

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

Code changes from version 2.51 to 2.60

Files changed (4) hide show
  1. css/gmw-admin.css +8 -2
  2. gmw-widget.php +10 -10
  3. google-maps-widget.php +2 -2
  4. readme.txt +7 -2
css/gmw-admin.css CHANGED
@@ -19,7 +19,7 @@
19
  }
20
 
21
  .gmw-tabs input.small-text {
22
- width: 50px;
23
  padding: 1px 6px;
24
  }
25
 
@@ -139,6 +139,12 @@ option.promo {
139
  margin-top: 5px;
140
  }
141
 
 
 
 
 
 
 
142
  /*
143
  * jQuery UI Tabs 1.8.14
144
  *
@@ -194,5 +200,5 @@ ul.ui-tabs-nav{
194
  }
195
 
196
  .ui-state-hover a {
197
- color: #D54E21 !important;
198
  }
19
  }
20
 
21
  .gmw-tabs input.small-text {
22
+ width: 65px;
23
  padding: 1px 6px;
24
  }
25
 
139
  margin-top: 5px;
140
  }
141
 
142
+ input:required:invalid {
143
+ -moz-box-shadow: none;
144
+ box-shadow: none;
145
+ border-color: #D54E21;
146
+ }
147
+
148
  /*
149
  * jQuery UI Tabs 1.8.14
150
  *
200
  }
201
 
202
  .ui-state-hover a {
203
+ color: #0073aa !important;
204
  }
gmw-widget.php CHANGED
@@ -125,14 +125,14 @@ class GoogleMapsWidget extends WP_Widget {
125
  }
126
 
127
  echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" /></p>';
128
- echo '<p><label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label><input class="widefat" id="' . $this->get_field_id('address') . '" name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" /></p>';
129
 
130
  echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul><li><a href="#gmw-thumb">' . __('Thumbnail map', 'google-maps-widget') . '</a></li><li><a href="#gmw-lightbox">' . __('Lightbox map', 'google-maps-widget') . '</a></li><li><a href="#gmw-shortcode">' . __('Shortcode', 'google-maps-widget') . '</a></li><li><a href="#gmw-info">' . __('Info &amp; Support', 'google-maps-widget') . '</a></li></ul>';
131
  echo '<div id="gmw-thumb">';
132
 
133
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
134
- echo '<input class="small-text" id="' . $this->get_field_id('thumb_width') . '" name="' . $this->get_field_name('thumb_width') . '" type="text" value="' . esc_attr($thumb_width) . '" /> x ';
135
- echo '<input class="small-text" id="' . $this->get_field_id('thumb_height') . '" name="' . $this->get_field_name('thumb_height') . '" type="text" value="' . esc_attr($thumb_height) . '" />';
136
  echo ' px</p>';
137
 
138
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
@@ -169,7 +169,7 @@ class GoogleMapsWidget extends WP_Widget {
169
  echo '</select></p>';
170
 
171
  echo '<p class="gmw_thumb_link_section"><label class="gmw-label" for="' . $this->get_field_id('thumb_link') . '">' . __('Custom URL', 'google-maps-widget') . ':</label>';
172
- echo '<input class="regular-text" id="' . $this->get_field_id('thumb_link') . '" name="' . $this->get_field_name('thumb_link') . '" type="text" value="' . esc_attr($thumb_link) . '" /></p>';
173
 
174
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_color_scheme') . '">' . __('Color Scheme', 'google-maps-widget') . ':</label>';
175
  echo '<select class="gmw_thumb_color_scheme" id="' . $this->get_field_id('thumb_color_scheme') . '" name="' . $this->get_field_name('thumb_color_scheme') . '">';
@@ -189,8 +189,8 @@ class GoogleMapsWidget extends WP_Widget {
189
  echo '<div id="gmw-lightbox">';
190
 
191
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
192
- echo '<input class="small-text" id="' . $this->get_field_id('lightbox_width') . '" name="' . $this->get_field_name('lightbox_width') . '" type="text" value="' . esc_attr($lightbox_width) . '" /> x ';
193
- echo '<input class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="text" value="' . esc_attr($lightbox_height) . '" />';
194
  echo ' px</p>';
195
 
196
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
@@ -278,8 +278,8 @@ class GoogleMapsWidget extends WP_Widget {
278
  $instance['thumb_pin_color'] = $new_instance['thumb_pin_color'];
279
  $instance['thumb_pin_size'] = $new_instance['thumb_pin_size'];
280
  $instance['thumb_pin_img'] = trim($new_instance['thumb_pin_img']);
281
- $instance['thumb_width'] = (int) $new_instance['thumb_width'];
282
- $instance['thumb_height'] = (int) $new_instance['thumb_height'];
283
  $instance['thumb_zoom'] = $new_instance['thumb_zoom'];
284
  $instance['thumb_type'] = $new_instance['thumb_type'];
285
  $instance['thumb_link_type'] = $new_instance['thumb_link_type'];
@@ -287,8 +287,8 @@ class GoogleMapsWidget extends WP_Widget {
287
  $instance['thumb_header'] = trim($new_instance['thumb_header']);
288
  $instance['thumb_footer'] = trim($new_instance['thumb_footer']);
289
  $instance['thumb_color_scheme'] = $new_instance['thumb_color_scheme'];
290
- $instance['lightbox_width'] = (int) $new_instance['lightbox_width'];
291
- $instance['lightbox_height'] = (int) $new_instance['lightbox_height'];
292
  $instance['lightbox_type'] = $new_instance['lightbox_type'];
293
  $instance['lightbox_zoom'] = $new_instance['lightbox_zoom'];
294
  $instance['lightbox_bubble'] = $new_instance['lightbox_bubble'];
125
  }
126
 
127
  echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" /></p>';
128
+ echo '<p><label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label><input class="widefat" id="' . $this->get_field_id('address') . '" name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" required /></p>';
129
 
130
  echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul><li><a href="#gmw-thumb">' . __('Thumbnail map', 'google-maps-widget') . '</a></li><li><a href="#gmw-lightbox">' . __('Lightbox map', 'google-maps-widget') . '</a></li><li><a href="#gmw-shortcode">' . __('Shortcode', 'google-maps-widget') . '</a></li><li><a href="#gmw-info">' . __('Info &amp; Support', 'google-maps-widget') . '</a></li></ul>';
131
  echo '<div id="gmw-thumb">';
132
 
133
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
134
+ echo '<input min="50" max="640" step="1" class="small-text" id="' . $this->get_field_id('thumb_width') . '" name="' . $this->get_field_name('thumb_width') . '" type="number" value="' . esc_attr($thumb_width) . '" required /> x ';
135
+ echo '<input min="50" max="640" step="1" class="small-text" id="' . $this->get_field_id('thumb_height') . '" name="' . $this->get_field_name('thumb_height') . '" type="number" value="' . esc_attr($thumb_height) . '" required />';
136
  echo ' px</p>';
137
 
138
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
169
  echo '</select></p>';
170
 
171
  echo '<p class="gmw_thumb_link_section"><label class="gmw-label" for="' . $this->get_field_id('thumb_link') . '">' . __('Custom URL', 'google-maps-widget') . ':</label>';
172
+ echo '<input class="regular-text" id="' . $this->get_field_id('thumb_link') . '" name="' . $this->get_field_name('thumb_link') . '" type="url" value="' . esc_attr($thumb_link) . '" /></p>';
173
 
174
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_color_scheme') . '">' . __('Color Scheme', 'google-maps-widget') . ':</label>';
175
  echo '<select class="gmw_thumb_color_scheme" id="' . $this->get_field_id('thumb_color_scheme') . '" name="' . $this->get_field_name('thumb_color_scheme') . '">';
189
  echo '<div id="gmw-lightbox">';
190
 
191
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
192
+ echo '<input min="50" max="2000" step="1" class="small-text" id="' . $this->get_field_id('lightbox_width') . '" name="' . $this->get_field_name('lightbox_width') . '" type="number" value="' . esc_attr($lightbox_width) . '" required /> x ';
193
+ echo '<input min="50" max="2000" step="1" class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="number" value="' . esc_attr($lightbox_height) . '" required />';
194
  echo ' px</p>';
195
 
196
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
278
  $instance['thumb_pin_color'] = $new_instance['thumb_pin_color'];
279
  $instance['thumb_pin_size'] = $new_instance['thumb_pin_size'];
280
  $instance['thumb_pin_img'] = trim($new_instance['thumb_pin_img']);
281
+ $instance['thumb_width'] = min(640, max(50, (int) $new_instance['thumb_width']));
282
+ $instance['thumb_height'] = min(640, max(50, (int) $new_instance['thumb_height']));
283
  $instance['thumb_zoom'] = $new_instance['thumb_zoom'];
284
  $instance['thumb_type'] = $new_instance['thumb_type'];
285
  $instance['thumb_link_type'] = $new_instance['thumb_link_type'];
287
  $instance['thumb_header'] = trim($new_instance['thumb_header']);
288
  $instance['thumb_footer'] = trim($new_instance['thumb_footer']);
289
  $instance['thumb_color_scheme'] = $new_instance['thumb_color_scheme'];
290
+ $instance['lightbox_width'] = min(2000, max(50, (int) $new_instance['lightbox_width']));
291
+ $instance['lightbox_height'] = min(2000, max(50, (int) $new_instance['lightbox_height']));
292
  $instance['lightbox_type'] = $new_instance['lightbox_type'];
293
  $instance['lightbox_zoom'] = $new_instance['lightbox_zoom'];
294
  $instance['lightbox_bubble'] = $new_instance['lightbox_bubble'];
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 on click in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
- Version: 2.51
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
@@ -40,7 +40,7 @@ require_once 'gmw-tracking.php';
40
 
41
 
42
  class GMW {
43
- static $version = 2.51;
44
 
45
  // hook everything up
46
  static function init() {
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 on click in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
+ Version: 2.60
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
40
 
41
 
42
  class GMW {
43
+ static $version = 2.60;
44
 
45
  // hook everything up
46
  static function init() {
readme.txt CHANGED
@@ -5,8 +5,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?business=gordan@webfactoryltd
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.3
8
- Tested up to: 4.2
9
- Stable tag: 2.51
10
 
11
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
12
 
@@ -121,6 +121,11 @@ If you can't figure it out open a thread in the support forums.
121
  6. Widget options - info & support
122
 
123
  == Changelog ==
 
 
 
 
 
124
  = 2.51 =
125
  * 2015/07/27
126
  * updated PHP4 style class constructor to PHP5 one
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.3
8
+ Tested up to: 4.3
9
+ Stable tag: 2.60
10
 
11
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
12
 
121
  6. Widget options - info & support
122
 
123
  == Changelog ==
124
+ = 2.60 =
125
+ * 2015/08/31
126
+ * added data validation on input fields
127
+ * minor CSS tweaks
128
+
129
  = 2.51 =
130
  * 2015/07/27
131
  * updated PHP4 style class constructor to PHP5 one