Google Maps Widget – Ultimate Google Maps Plugin - Version 3.83

Version Description

  • 2018/02/26
  • pushing strong on translations!
  • added Gowalla thumbnail color scheme
Download this release

Release Info

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

Code changes from version 3.80 to 3.83

Files changed (3) hide show
  1. gmw-widget.php +44 -41
  2. google-maps-widget.php +49 -22
  3. readme.txt +14 -8
gmw-widget.php CHANGED
@@ -155,7 +155,7 @@ class GoogleMapsWidget extends WP_Widget {
155
  array('val' => '-1', 'label' => __('Apple', 'google-maps-widget')),
156
  array('val' => '-1', 'label' => __('Blue', 'google-maps-widget')),
157
  array('val' => '-1', 'label' => __('Bright', 'google-maps-widget')),
158
- array('val' => '-1', 'label' => __('Gowalla', 'google-maps-widget')),
159
  array('val' => '-1', 'label' => __('Gray', 'google-maps-widget')),
160
  array('val' => '-1', 'label' => __('Gray #2', 'google-maps-widget')),
161
  array('val' => '-1', 'label' => __('Light', 'google-maps-widget')),
@@ -171,7 +171,7 @@ class GoogleMapsWidget extends WP_Widget {
171
 
172
  $thumb_langs = array(array('val' => 'en', 'label' => 'English'),
173
  array('val' => '-1', 'label' => __('Add auto-detection and 50 more languages', 'google-maps-widget')));
174
-
175
  $thumb_powered_bys = array(array('val' => '0', 'label' => __('No, I do not want to do that', 'google-maps-widget')),
176
  array('val' => '1', 'label' => __('Please, let us show a tiny link below the map so that others can learn about GMW too', 'google-maps-widget')));
177
 
@@ -186,12 +186,12 @@ class GoogleMapsWidget extends WP_Widget {
186
  $lightbox_units = array(array('val' => 'auto', 'label' => __('Detect automatically', 'google-maps-widget')),
187
  array('val' => 'imperial', 'label' => __('Imperial', 'google-maps-widget')),
188
  array('val' => 'metric', 'label' => __('Metric', 'google-maps-widget')));
189
-
190
  $lightbox_clustering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')),
191
  array('val' => '-1', 'label' => __('Small cluster radius', 'google-maps-widget')),
192
  array('val' => '-1', 'label' => __('Medium cluster radius', 'google-maps-widget')),
193
  array('val' => '-1', 'label' => __('Large cluster radius', 'google-maps-widget')));
194
-
195
  $lightbox_filtering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')),
196
  array('val' => '-1', 'label' => __('Enabled', 'google-maps-widget')));
197
 
@@ -203,21 +203,21 @@ class GoogleMapsWidget extends WP_Widget {
203
  echo '<p><a href="' . esc_url($update_url) . '" class="button button-primary">Update Google Maps Widget</a></p>';
204
  echo '<style type="text/css"> #widget-' . $this->id . '-savewidget { display: none; } </style>';
205
  echo '<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="hidden" value="' . esc_attr($title) . '">';
206
-
207
  return true;
208
  } // is_activated
209
-
210
- // upgrade ad if plugin used > 60 days
211
- if (!GMW::is_activated() && ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 60))) {
212
- echo '<p class="gmw-upgrade-notice-widget">A <a class="open_promo_dialog" href="#">special offer</a> for users like <b>you</b> who\'ve been using GMW for over two months: a <b>one time payment</b>, lifetime license for <b>only $19</b>! No nonsense! <a class="open_promo_dialog" href="#">Upgrade now</a> to <span class="gmw-pro-red">PRO</span> &amp; get more than 50 extra options &amp; features.</p>';
213
  }
214
-
215
  // api key warning
216
  if (!GMW::get_api_key('test')) {
217
  echo '<p class="gmw-api-key-error"><b>Important!</b> ';
218
  echo 'Please go to <a href="' . admin_url('options-general.php?page=gmw_options') . '" title="Google Maps Widget settings">settings</a> &amp; follow simple instructions to get a <b>free Google Maps API key</b>. It only takes a minute. Without a key your maps will stop working. This rule is enforced by Google. Sorry for the inconvenience.</p>';
219
  }
220
-
221
  // widget options markup
222
  // title & address
223
  echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label>';
@@ -226,10 +226,10 @@ class GoogleMapsWidget extends WP_Widget {
226
  echo '<label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label>';
227
  echo '<div class="input-address-group">';
228
  echo '<input name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" required="required" class="widefat" id="' . $this->get_field_id('address') . '" placeholder="' . __('Address / location to show', 'google-maps-widget') . '" data-tooltip="' . htmlspecialchars('Address or location shown on both maps. Coordinates can be used as well. Write them in a numerical fashion, not in degrees, ie: 40.70823, -74.01052.') . '">';
229
- echo '<a data-target="address" href="#" class="button-secondary gmw-pick-address"><span class="dashicons dashicons-location"></span></a>';
230
  echo '</div>';
231
  // end - title & address
232
-
233
  // tabs
234
  echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul>';
235
  echo '<li><a href="#gmw-thumb">' . __('Thumbnail Map', 'google-maps-widget') . '</a></li>';
@@ -260,13 +260,13 @@ class GoogleMapsWidget extends WP_Widget {
260
  echo '<select data-tooltip="Zoom varies from the lowest level, in which the entire world can be seen, to highest, which shows streets and individual buildings. Building outlines, where available, appear on the map around zoom level 17. This value differs from area to area." class="gmw_thumb_zoom" id="' . $this->get_field_id('thumb_zoom') . '" name="' . $this->get_field_name('thumb_zoom') . '">';
261
  GMW::create_select_options($zoom_levels_thumb, $thumb_zoom);
262
  echo '</select></p>';
263
-
264
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_type') . '">' . __('Pin Type', 'google-maps-widget') . ':</label>';
265
  echo '<select data-tooltip="Predefined pin can be adjusted in terms of color, size and one letter label.
266
  Custom pin can be any custom image stored on a publically available server (HTTPS is not supported)." class="gmw_thumb_pin_type" id="' . $this->get_field_id('thumb_pin_type') . '" name="' . $this->get_field_name('thumb_pin_type') . '">';
267
  GMW::create_select_options($thumb_pin_types, $thumb_pin_type);
268
  echo '</select></p>';
269
-
270
  echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_color') . '">' . __('Pin Color', 'google-maps-widget') . ':</label>';
271
  echo '<select data-tooltip="Choose one of the predefined pin colors, or upgrade to <b class=\'gmw-pro-red\'>PRO</b> to have an unlimited choice of colors." id="' . $this->get_field_id('thumb_pin_color') . '" name="' . $this->get_field_name('thumb_pin_color') . '">';
272
  GMW::create_select_options($thumb_pin_colors, $thumb_pin_color);
@@ -286,7 +286,7 @@ class GoogleMapsWidget extends WP_Widget {
286
  echo '<p class="gmw_thumb_pin_type_custom"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_img') . '">' . __('Pin Image URL', 'google-maps-widget') . ':</label>';
287
  echo '<input data-tooltip="Enter the full URL to the image, starting with http://. Image has to be publicly accessible and with size up to 64x64px. Https and localhosts are *not* supported." placeholder="http://" type="url" class="regular-text" id="' . $this->get_field_id('thumb_pin_img') . '" name="' . $this->get_field_name('thumb_pin_img') . '" value="' . esc_attr($thumb_pin_img) . '">';
288
  echo '</p>';
289
-
290
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_link_type') . '">' . __('Link To', 'google-maps-widget') . ':</label>';
291
  echo '<select data-tooltip="Choose what happens when the map is clicked. Clicks are tracked in Google Analytics if that option is enabled in settings (PRO only). Please configure interactive map\'s settings in its tab." class="gmw_thumb_link_type" id="' . $this->get_field_id('thumb_link_type') . '" name="' . $this->get_field_name('thumb_link_type') . '">';
292
  GMW::create_select_options($thumb_link_types, $thumb_link_type);
@@ -305,7 +305,7 @@ class GoogleMapsWidget extends WP_Widget {
305
  echo '<select data-tooltip="Not all map labels and texts have translations. Everything is controlled by Google at their discretion. If you choose the auto-detect mode language will be detected from the users browser settings." id="' . $this->get_field_id('thumb_lang') . '" name="' . $this->get_field_name('thumb_lang') . '">';
306
  GMW::create_select_options($thumb_langs, $thumb_lang);
307
  echo '</select></p>';
308
-
309
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_powered_by') . '">' . __('Show Appreciation', 'google-maps-widget') . ':</label>';
310
  echo '<select data-tooltip="Please help others learn about GMW by placing a tiny link below the map. Thank you very much!" id="' . $this->get_field_id('thumb_powered_by') . '" name="' . $this->get_field_name('thumb_powered_by') . '">';
311
  GMW::create_select_options($thumb_powered_bys, $thumb_powered_by);
@@ -340,17 +340,17 @@ class GoogleMapsWidget extends WP_Widget {
340
  Street View provides panoramic views on the designated location. Please note that it\'s not available on all locations." class="gmw_lightbox_mode" id="' . $this->get_field_id('lightbox_mode') . '" name="' . $this->get_field_name('lightbox_mode') . '">';
341
  GMW::create_select_options($lightbox_modes, $lightbox_mode);
342
  echo '</select></p>';
343
-
344
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_map_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
345
  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') . '">';
346
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
347
  echo '</select></p>';
348
-
349
  echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_clustering') . '">' . __('Pins Clustering', 'google-maps-widget') . ':</label>';
350
  echo '<select data-tooltip="Clustering enables pins grouping depending on their distances on the current view. It declutters the map when multiple pins are displayed. See it on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Starbucks locations example</a>." id="' . $this->get_field_id('lightbox_clustering') . '" name="' . $this->get_field_name('lightbox_clustering') . '">';
351
  GMW::create_select_options($lightbox_clustering_options, $lightbox_clustering);
352
  echo '</select></p>';
353
-
354
  echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_filtering') . '">' . __('Pins Filtering', 'google-maps-widget') . ':</label>';
355
  echo '<select data-tooltip="Filtering gives users the ability to show/hide pins based on group name(s) set for each pin. Additional GUI is displayed in the upper right corner of the map. See it in action on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Restaurants in Manhattan</a>." id="' . $this->get_field_id('lightbox_filtering') . '" name="' . $this->get_field_name('lightbox_filtering') . '">';
356
  GMW::create_select_options($lightbox_filtering_options, $lightbox_filtering);
@@ -400,12 +400,12 @@ class GoogleMapsWidget extends WP_Widget {
400
  echo '<li>unlimited pins import</li>';
401
  echo '<li>numerous "on pin click" actions including custom HTML info boxes</li>';
402
  echo '</ul>';
403
-
404
  echo '<p>If one location per map is all you need, please enter the address in the address field above.</p>';
405
  echo '<p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>';
406
  echo '</div>';
407
  // end - pins tab
408
-
409
  // shortcode tab
410
  echo '<div id="gmw-shortcode">';
411
  echo '<p>Shortcode support is a <span class="gmw-pro-red">PRO</span> feature. It enables you to place maps anywhere in content; including pages, posts and custom post types. Besides the shortcode feature you will get 50 extra options and features.</p><p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>';
@@ -417,13 +417,13 @@ class GoogleMapsWidget extends WP_Widget {
417
  echo '<h4>' . __('Support', 'google-maps-widget') . '</h4>';
418
  echo '<p>If you have any problems, questions or would like a new feature added post it on the <a href="https://wordpress.org/support/plugin/google-maps-widget" target="_blank">official support forum</a>. It\'s the only place to get support. Since it\'s free and community powered please be patient.<br>';
419
  echo 'If you <a href="#" class="open_promo_dialog">upgrade</a> to <span class="gmw-pro-red">PRO</span> you will get instant access to premium, prioritised support via email.</p>';
420
-
421
  echo '<h4>' . __('Activate <span class="gmw-pro-red">PRO</span> features', 'google-maps-widget') . '</h4>';
422
  echo '<p><span class="gmw-pro-red">PRO</span> features give you access to priority support and more than 50 extra options &amp; features including shortcode support, additional map types, more map skins and a host of other additional features.';
423
  echo ' <a class="open_promo_dialog" href="#">Activate PRO features NOW</a>';
424
  echo '</p>';
425
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
426
- 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>';
427
  echo '</div>';
428
  // end - info tab
429
  echo '</div><p></p>'; // tabs
@@ -441,7 +441,7 @@ class GoogleMapsWidget extends WP_Widget {
441
 
442
  $instance['title'] = $new_instance['title'];
443
  $instance['address'] = strip_tags(trim($new_instance['address']));
444
-
445
  $instance['thumb_pin_type'] = $new_instance['thumb_pin_type'];
446
  $instance['thumb_pin_color'] = GMW::sanitize_hex_color($new_instance['thumb_pin_color']);
447
  $instance['thumb_pin_size'] = $new_instance['thumb_pin_size'];
@@ -480,20 +480,23 @@ class GoogleMapsWidget extends WP_Widget {
480
 
481
  // output widget
482
  function widget($widget, $instance) {
 
 
483
  // no user key and installed +3 months ago -> disable map
484
- if (!GMW::get_api_key('test') && ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 100))) {
485
  echo $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open your map settings to configure the Google Maps API key. The map can\'t work without it.</div>' . $widget['after_widget'];
486
  return;
487
  }
488
-
489
-
490
  $out = $widget_content = $style = '';
491
  $map_params = array();
492
  $instance = $this->upgrade_wiget_instance($instance);
493
  $map_styles = array(
494
  'ultra_light' => 'style=feature:water|element:geometry|color:0xe9e9e9|lightness:17|&style=feature:landscape|element:geometry|color:0xf5f5f5|lightness:20|&style=feature:road.highway|element:geometry.fill|color:0xffffff|lightness:17|&style=feature:road.highway|element:geometry.stroke|color:0xffffff|lightness:29|weight:0.2|&style=feature:road.arterial|element:geometry|color:0xffffff|lightness:18|&style=feature:road.local|element:geometry|color:0xffffff|lightness:16|&style=feature:poi|element:geometry|color:0xf5f5f5|lightness:21|&style=feature:poi.park|element:geometry|color:0xdedede|lightness:21|&style=feature:all|element:labels.text.stroke|visibility:on|color:0xffffff|lightness:16|&style=feature:all|element:labels.text.fill|saturation:36|color:0x333333|lightness:40|&style=feature:all|element:labels.icon|visibility:off|&style=feature:transit|element:geometry|color:0xf2f2f2|lightness:19|&style=feature:administrative|element:geometry.fill|color:0xfefefe|lightness:20|&style=feature:administrative|element:geometry.stroke|color:0xfefefe|lightness:17|weight:1.2|',
 
495
  'mapbox' => 'style=feature:water|element:all|saturation:43|lightness:-11|hue:0x0088ff|&style=feature:road|element:geometry.fill|hue:0xff0000|saturation:-100|lightness:99|&style=feature:road|element:geometry.stroke|color:0x808080|lightness:54|&style=feature:landscape.man_made|element:geometry.fill|color:0xece2d9|&style=feature:poi.park|element:geometry.fill|color:0xccdca1|&style=feature:road|element:labels.text.fill|color:0x767676|&style=feature:road|element:labels.text.stroke|color:0xffffff|&style=feature:poi|element:all|visibility:off|&style=feature:landscape.natural|element:geometry.fill|visibility:on|color:0xb8cb93|&style=feature:poi.park|element:all|visibility:on|&style=feature:poi.sports_complex|element:all|visibility:on|&style=feature:poi.medical|element:all|visibility:on|&style=feature:poi.business|element:all|visibility:simplified|');
496
-
497
  $map_src = '//maps.googleapis.com/maps/api/staticmap';
498
 
499
  // make sure all params are defined
@@ -557,7 +560,7 @@ class GoogleMapsWidget extends WP_Widget {
557
  $widget_content .= '<a class="gmw-thumbnail-map" title="' . esc_attr($instance['address']) . '" href="' . $instance['thumb_link'] . '">';
558
  } elseif ($instance['thumb_link_type'] == 'custom_blank') {
559
  $map_alt = esc_attr($instance['address']);
560
- $widget_content .= '<a class="gmw-thumbnail-map" title="' . esc_attr($instance['address']) . '" target="_blank" href="' . $instance['thumb_link'] . '">';
561
  } elseif ($instance['thumb_link_type'] == 'map_blank') {
562
  $map_alt = __('Click to open the interactive map in a new window', 'google-maps-widget');
563
  $map_url = GMW::build_lightbox_url($instance);
@@ -571,8 +574,8 @@ class GoogleMapsWidget extends WP_Widget {
571
  $map_src = apply_filters('gmw_thumb_map_src', $map_src, $instance);
572
  $widget_content .= '<img width="' . $instance['thumb_width'] . '" height="' . $instance['thumb_height'] . '" alt="' . $map_alt . '" title="' . $map_alt . '" src="' . $map_src . '">';
573
 
574
- if ($instance['thumb_link_type'] == 'lightbox' ||
575
- $instance['thumb_link_type'] == 'replace' ||
576
  $instance['thumb_link_type'] == 'custom' ||
577
  $instance['thumb_link_type'] == 'custom_blank' ||
578
  $instance['thumb_link_type'] == 'map_blank') {
@@ -585,7 +588,7 @@ class GoogleMapsWidget extends WP_Widget {
585
  $tmp = str_ireplace(array('{address}'), array($instance['address']), $instance['thumb_footer']);
586
  $widget_content .= wpautop(do_shortcode($tmp));
587
  }
588
-
589
  if (!empty($instance['thumb_powered_by'])) {
590
  $widget_content .= '<small>We use the fastests <a href="https://wordpress.org/plugins/google-maps-widget/" target="_blank">free maps plugin for WordPress</a></small>';
591
  }
@@ -595,23 +598,23 @@ class GoogleMapsWidget extends WP_Widget {
595
 
596
  echo $out;
597
  } // widget
598
-
599
-
600
  // compatibility fixes for widgets prior to v3.0
601
  function upgrade_wiget_instance($instance) {
602
  $instance = wp_parse_args((array) $instance, self::$defaults);
603
-
604
  if (isset($instance['core_ver']) && version_compare($instance['core_ver'], '3.0', '>=')) {
605
- return $instance;
606
  }
607
-
608
  // pin color is now in hex
609
  if ($instance['thumb_pin_color'][0] != '#') {
610
  $instance['thumb_pin_color'] = GMW::convert_color($instance['thumb_pin_color']);
611
  } elseif (empty($instance['thumb_pin_color'])) {
612
  $instance['thumb_pin_color'] = '#ff0000';
613
  }
614
-
615
  // if we had title before, we need it now too
616
  if (!empty($instance['lightbox_title']) && !in_array('title', $instance['lightbox_feature'])) {
617
  $instance['lightbox_feature'][] = 'title';
@@ -623,8 +626,8 @@ class GoogleMapsWidget extends WP_Widget {
623
  } elseif ($instance['lightbox_map_type'] != 'satellite') {
624
  $instance['lightbox_map_type'] = 'roadmap';
625
  }
626
-
627
- return $instance;
628
  } // upgrade_widget_instance
629
  } // class GoogleMapsWidget
630
  }
155
  array('val' => '-1', 'label' => __('Apple', 'google-maps-widget')),
156
  array('val' => '-1', 'label' => __('Blue', 'google-maps-widget')),
157
  array('val' => '-1', 'label' => __('Bright', 'google-maps-widget')),
158
+ array('val' => 'gowalla', 'label' => __('Gowalla', 'google-maps-widget')),
159
  array('val' => '-1', 'label' => __('Gray', 'google-maps-widget')),
160
  array('val' => '-1', 'label' => __('Gray #2', 'google-maps-widget')),
161
  array('val' => '-1', 'label' => __('Light', 'google-maps-widget')),
171
 
172
  $thumb_langs = array(array('val' => 'en', 'label' => 'English'),
173
  array('val' => '-1', 'label' => __('Add auto-detection and 50 more languages', 'google-maps-widget')));
174
+
175
  $thumb_powered_bys = array(array('val' => '0', 'label' => __('No, I do not want to do that', 'google-maps-widget')),
176
  array('val' => '1', 'label' => __('Please, let us show a tiny link below the map so that others can learn about GMW too', 'google-maps-widget')));
177
 
186
  $lightbox_units = array(array('val' => 'auto', 'label' => __('Detect automatically', 'google-maps-widget')),
187
  array('val' => 'imperial', 'label' => __('Imperial', 'google-maps-widget')),
188
  array('val' => 'metric', 'label' => __('Metric', 'google-maps-widget')));
189
+
190
  $lightbox_clustering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')),
191
  array('val' => '-1', 'label' => __('Small cluster radius', 'google-maps-widget')),
192
  array('val' => '-1', 'label' => __('Medium cluster radius', 'google-maps-widget')),
193
  array('val' => '-1', 'label' => __('Large cluster radius', 'google-maps-widget')));
194
+
195
  $lightbox_filtering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')),
196
  array('val' => '-1', 'label' => __('Enabled', 'google-maps-widget')));
197
 
203
  echo '<p><a href="' . esc_url($update_url) . '" class="button button-primary">Update Google Maps Widget</a></p>';
204
  echo '<style type="text/css"> #widget-' . $this->id . '-savewidget { display: none; } </style>';
205
  echo '<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="hidden" value="' . esc_attr($title) . '">';
206
+
207
  return true;
208
  } // is_activated
209
+
210
+ // upgrade ad if plugin used > 45 days
211
+ if (!GMW::is_activated() && ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 45))) {
212
+ echo '<p class="gmw-upgrade-notice-widget">A <a class="open_promo_dialog" href="#">special offer</a> for users like <b>you</b> who\'ve been using GMW for nearly two months: a <b>one time payment</b>, lifetime license for <b>only $23</b>! No nonsense! <a class="open_promo_dialog" href="#">Upgrade now</a> to <span class="gmw-pro-red">PRO</span> &amp; get more than 50 extra options &amp; features.</p>';
213
  }
214
+
215
  // api key warning
216
  if (!GMW::get_api_key('test')) {
217
  echo '<p class="gmw-api-key-error"><b>Important!</b> ';
218
  echo 'Please go to <a href="' . admin_url('options-general.php?page=gmw_options') . '" title="Google Maps Widget settings">settings</a> &amp; follow simple instructions to get a <b>free Google Maps API key</b>. It only takes a minute. Without a key your maps will stop working. This rule is enforced by Google. Sorry for the inconvenience.</p>';
219
  }
220
+
221
  // widget options markup
222
  // title & address
223
  echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label>';
226
  echo '<label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label>';
227
  echo '<div class="input-address-group">';
228
  echo '<input name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" required="required" class="widefat" id="' . $this->get_field_id('address') . '" placeholder="' . __('Address / location to show', 'google-maps-widget') . '" data-tooltip="' . htmlspecialchars('Address or location shown on both maps. Coordinates can be used as well. Write them in a numerical fashion, not in degrees, ie: 40.70823, -74.01052.') . '">';
229
+ echo '<a data-target="address" href="#" class="button-secondary gmw-pick-address"><span class="dashicons dashicons-location"></span></a>';
230
  echo '</div>';
231
  // end - title & address
232
+
233
  // tabs
234
  echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul>';
235
  echo '<li><a href="#gmw-thumb">' . __('Thumbnail Map', 'google-maps-widget') . '</a></li>';
260
  echo '<select data-tooltip="Zoom varies from the lowest level, in which the entire world can be seen, to highest, which shows streets and individual buildings. Building outlines, where available, appear on the map around zoom level 17. This value differs from area to area." class="gmw_thumb_zoom" id="' . $this->get_field_id('thumb_zoom') . '" name="' . $this->get_field_name('thumb_zoom') . '">';
261
  GMW::create_select_options($zoom_levels_thumb, $thumb_zoom);
262
  echo '</select></p>';
263
+
264
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_type') . '">' . __('Pin Type', 'google-maps-widget') . ':</label>';
265
  echo '<select data-tooltip="Predefined pin can be adjusted in terms of color, size and one letter label.
266
  Custom pin can be any custom image stored on a publically available server (HTTPS is not supported)." class="gmw_thumb_pin_type" id="' . $this->get_field_id('thumb_pin_type') . '" name="' . $this->get_field_name('thumb_pin_type') . '">';
267
  GMW::create_select_options($thumb_pin_types, $thumb_pin_type);
268
  echo '</select></p>';
269
+
270
  echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_color') . '">' . __('Pin Color', 'google-maps-widget') . ':</label>';
271
  echo '<select data-tooltip="Choose one of the predefined pin colors, or upgrade to <b class=\'gmw-pro-red\'>PRO</b> to have an unlimited choice of colors." id="' . $this->get_field_id('thumb_pin_color') . '" name="' . $this->get_field_name('thumb_pin_color') . '">';
272
  GMW::create_select_options($thumb_pin_colors, $thumb_pin_color);
286
  echo '<p class="gmw_thumb_pin_type_custom"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_img') . '">' . __('Pin Image URL', 'google-maps-widget') . ':</label>';
287
  echo '<input data-tooltip="Enter the full URL to the image, starting with http://. Image has to be publicly accessible and with size up to 64x64px. Https and localhosts are *not* supported." placeholder="http://" type="url" class="regular-text" id="' . $this->get_field_id('thumb_pin_img') . '" name="' . $this->get_field_name('thumb_pin_img') . '" value="' . esc_attr($thumb_pin_img) . '">';
288
  echo '</p>';
289
+
290
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_link_type') . '">' . __('Link To', 'google-maps-widget') . ':</label>';
291
  echo '<select data-tooltip="Choose what happens when the map is clicked. Clicks are tracked in Google Analytics if that option is enabled in settings (PRO only). Please configure interactive map\'s settings in its tab." class="gmw_thumb_link_type" id="' . $this->get_field_id('thumb_link_type') . '" name="' . $this->get_field_name('thumb_link_type') . '">';
292
  GMW::create_select_options($thumb_link_types, $thumb_link_type);
305
  echo '<select data-tooltip="Not all map labels and texts have translations. Everything is controlled by Google at their discretion. If you choose the auto-detect mode language will be detected from the users browser settings." id="' . $this->get_field_id('thumb_lang') . '" name="' . $this->get_field_name('thumb_lang') . '">';
306
  GMW::create_select_options($thumb_langs, $thumb_lang);
307
  echo '</select></p>';
308
+
309
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_powered_by') . '">' . __('Show Appreciation', 'google-maps-widget') . ':</label>';
310
  echo '<select data-tooltip="Please help others learn about GMW by placing a tiny link below the map. Thank you very much!" id="' . $this->get_field_id('thumb_powered_by') . '" name="' . $this->get_field_name('thumb_powered_by') . '">';
311
  GMW::create_select_options($thumb_powered_bys, $thumb_powered_by);
340
  Street View provides panoramic views on the designated location. Please note that it\'s not available on all locations." class="gmw_lightbox_mode" id="' . $this->get_field_id('lightbox_mode') . '" name="' . $this->get_field_name('lightbox_mode') . '">';
341
  GMW::create_select_options($lightbox_modes, $lightbox_mode);
342
  echo '</select></p>';
343
+
344
  echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_map_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
345
  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') . '">';
346
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
347
  echo '</select></p>';
348
+
349
  echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_clustering') . '">' . __('Pins Clustering', 'google-maps-widget') . ':</label>';
350
  echo '<select data-tooltip="Clustering enables pins grouping depending on their distances on the current view. It declutters the map when multiple pins are displayed. See it on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Starbucks locations example</a>." id="' . $this->get_field_id('lightbox_clustering') . '" name="' . $this->get_field_name('lightbox_clustering') . '">';
351
  GMW::create_select_options($lightbox_clustering_options, $lightbox_clustering);
352
  echo '</select></p>';
353
+
354
  echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_filtering') . '">' . __('Pins Filtering', 'google-maps-widget') . ':</label>';
355
  echo '<select data-tooltip="Filtering gives users the ability to show/hide pins based on group name(s) set for each pin. Additional GUI is displayed in the upper right corner of the map. See it in action on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Restaurants in Manhattan</a>." id="' . $this->get_field_id('lightbox_filtering') . '" name="' . $this->get_field_name('lightbox_filtering') . '">';
356
  GMW::create_select_options($lightbox_filtering_options, $lightbox_filtering);
400
  echo '<li>unlimited pins import</li>';
401
  echo '<li>numerous "on pin click" actions including custom HTML info boxes</li>';
402
  echo '</ul>';
403
+
404
  echo '<p>If one location per map is all you need, please enter the address in the address field above.</p>';
405
  echo '<p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>';
406
  echo '</div>';
407
  // end - pins tab
408
+
409
  // shortcode tab
410
  echo '<div id="gmw-shortcode">';
411
  echo '<p>Shortcode support is a <span class="gmw-pro-red">PRO</span> feature. It enables you to place maps anywhere in content; including pages, posts and custom post types. Besides the shortcode feature you will get 50 extra options and features.</p><p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>';
417
  echo '<h4>' . __('Support', 'google-maps-widget') . '</h4>';
418
  echo '<p>If you have any problems, questions or would like a new feature added post it on the <a href="https://wordpress.org/support/plugin/google-maps-widget" target="_blank">official support forum</a>. It\'s the only place to get support. Since it\'s free and community powered please be patient.<br>';
419
  echo 'If you <a href="#" class="open_promo_dialog">upgrade</a> to <span class="gmw-pro-red">PRO</span> you will get instant access to premium, prioritised support via email.</p>';
420
+
421
  echo '<h4>' . __('Activate <span class="gmw-pro-red">PRO</span> features', 'google-maps-widget') . '</h4>';
422
  echo '<p><span class="gmw-pro-red">PRO</span> features give you access to priority support and more than 50 extra options &amp; features including shortcode support, additional map types, more map skins and a host of other additional features.';
423
  echo ' <a class="open_promo_dialog" href="#">Activate PRO features NOW</a>';
424
  echo '</p>';
425
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
426
+ 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>';
427
  echo '</div>';
428
  // end - info tab
429
  echo '</div><p></p>'; // tabs
441
 
442
  $instance['title'] = $new_instance['title'];
443
  $instance['address'] = strip_tags(trim($new_instance['address']));
444
+
445
  $instance['thumb_pin_type'] = $new_instance['thumb_pin_type'];
446
  $instance['thumb_pin_color'] = GMW::sanitize_hex_color($new_instance['thumb_pin_color']);
447
  $instance['thumb_pin_size'] = $new_instance['thumb_pin_size'];
480
 
481
  // output widget
482
  function widget($widget, $instance) {
483
+ $options = GMW::get_options();
484
+
485
  // no user key and installed +3 months ago -> disable map
486
+ if (!GMW::get_api_key('test') && ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 90))) {
487
  echo $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open your map settings to configure the Google Maps API key. The map can\'t work without it.</div>' . $widget['after_widget'];
488
  return;
489
  }
490
+
491
+
492
  $out = $widget_content = $style = '';
493
  $map_params = array();
494
  $instance = $this->upgrade_wiget_instance($instance);
495
  $map_styles = array(
496
  'ultra_light' => 'style=feature:water|element:geometry|color:0xe9e9e9|lightness:17|&style=feature:landscape|element:geometry|color:0xf5f5f5|lightness:20|&style=feature:road.highway|element:geometry.fill|color:0xffffff|lightness:17|&style=feature:road.highway|element:geometry.stroke|color:0xffffff|lightness:29|weight:0.2|&style=feature:road.arterial|element:geometry|color:0xffffff|lightness:18|&style=feature:road.local|element:geometry|color:0xffffff|lightness:16|&style=feature:poi|element:geometry|color:0xf5f5f5|lightness:21|&style=feature:poi.park|element:geometry|color:0xdedede|lightness:21|&style=feature:all|element:labels.text.stroke|visibility:on|color:0xffffff|lightness:16|&style=feature:all|element:labels.text.fill|saturation:36|color:0x333333|lightness:40|&style=feature:all|element:labels.icon|visibility:off|&style=feature:transit|element:geometry|color:0xf2f2f2|lightness:19|&style=feature:administrative|element:geometry.fill|color:0xfefefe|lightness:20|&style=feature:administrative|element:geometry.stroke|color:0xfefefe|lightness:17|weight:1.2|',
497
+ 'gowalla' => 'style=feature:road|element:labels|visibility:simplified|lightness:20|&style=feature:administrative.land_parcel|element:all|visibility:off|&style=feature:landscape.man_made|element:all|visibility:off|&style=feature:transit|element:all|visibility:off|&style=feature:road.local|element:labels|visibility:simplified|&style=feature:road.local|element:geometry|visibility:simplified|&style=feature:road.highway|element:labels|visibility:simplified|&style=feature:poi|element:labels|visibility:off|&style=feature:road.arterial|element:labels|visibility:off|&style=feature:water|element:all|hue:0xa1cdfc|saturation:30|lightness:49|&style=feature:road.highway|element:geometry|hue:0xf49935|&style=feature:road.arterial|element:geometry|hue:0xfad959|',
498
  'mapbox' => 'style=feature:water|element:all|saturation:43|lightness:-11|hue:0x0088ff|&style=feature:road|element:geometry.fill|hue:0xff0000|saturation:-100|lightness:99|&style=feature:road|element:geometry.stroke|color:0x808080|lightness:54|&style=feature:landscape.man_made|element:geometry.fill|color:0xece2d9|&style=feature:poi.park|element:geometry.fill|color:0xccdca1|&style=feature:road|element:labels.text.fill|color:0x767676|&style=feature:road|element:labels.text.stroke|color:0xffffff|&style=feature:poi|element:all|visibility:off|&style=feature:landscape.natural|element:geometry.fill|visibility:on|color:0xb8cb93|&style=feature:poi.park|element:all|visibility:on|&style=feature:poi.sports_complex|element:all|visibility:on|&style=feature:poi.medical|element:all|visibility:on|&style=feature:poi.business|element:all|visibility:simplified|');
499
+
500
  $map_src = '//maps.googleapis.com/maps/api/staticmap';
501
 
502
  // make sure all params are defined
560
  $widget_content .= '<a class="gmw-thumbnail-map" title="' . esc_attr($instance['address']) . '" href="' . $instance['thumb_link'] . '">';
561
  } elseif ($instance['thumb_link_type'] == 'custom_blank') {
562
  $map_alt = esc_attr($instance['address']);
563
+ $widget_content .= '<a class="gmw-thumbnail-map" title="' . esc_attr($instance['address']) . '" target="_blank" href="' . $instance['thumb_link'] . '">';
564
  } elseif ($instance['thumb_link_type'] == 'map_blank') {
565
  $map_alt = __('Click to open the interactive map in a new window', 'google-maps-widget');
566
  $map_url = GMW::build_lightbox_url($instance);
574
  $map_src = apply_filters('gmw_thumb_map_src', $map_src, $instance);
575
  $widget_content .= '<img width="' . $instance['thumb_width'] . '" height="' . $instance['thumb_height'] . '" alt="' . $map_alt . '" title="' . $map_alt . '" src="' . $map_src . '">';
576
 
577
+ if ($instance['thumb_link_type'] == 'lightbox' ||
578
+ $instance['thumb_link_type'] == 'replace' ||
579
  $instance['thumb_link_type'] == 'custom' ||
580
  $instance['thumb_link_type'] == 'custom_blank' ||
581
  $instance['thumb_link_type'] == 'map_blank') {
588
  $tmp = str_ireplace(array('{address}'), array($instance['address']), $instance['thumb_footer']);
589
  $widget_content .= wpautop(do_shortcode($tmp));
590
  }
591
+
592
  if (!empty($instance['thumb_powered_by'])) {
593
  $widget_content .= '<small>We use the fastests <a href="https://wordpress.org/plugins/google-maps-widget/" target="_blank">free maps plugin for WordPress</a></small>';
594
  }
598
 
599
  echo $out;
600
  } // widget
601
+
602
+
603
  // compatibility fixes for widgets prior to v3.0
604
  function upgrade_wiget_instance($instance) {
605
  $instance = wp_parse_args((array) $instance, self::$defaults);
606
+
607
  if (isset($instance['core_ver']) && version_compare($instance['core_ver'], '3.0', '>=')) {
608
+ return $instance;
609
  }
610
+
611
  // pin color is now in hex
612
  if ($instance['thumb_pin_color'][0] != '#') {
613
  $instance['thumb_pin_color'] = GMW::convert_color($instance['thumb_pin_color']);
614
  } elseif (empty($instance['thumb_pin_color'])) {
615
  $instance['thumb_pin_color'] = '#ff0000';
616
  }
617
+
618
  // if we had title before, we need it now too
619
  if (!empty($instance['lightbox_title']) && !in_array('title', $instance['lightbox_feature'])) {
620
  $instance['lightbox_feature'][] = 'title';
626
  } elseif ($instance['lightbox_map_type'] != 'satellite') {
627
  $instance['lightbox_map_type'] = 'roadmap';
628
  }
629
+
630
+ return $instance;
631
  } // upgrade_widget_instance
632
  } // class GoogleMapsWidget
633
  }
google-maps-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Maps Widget
4
  Plugin URI: http://www.gmapswidget.com/
5
  Description: Display a single image super-fast loading Google map in a widget. A larger, full featured map is available in a lightbox. Includes a user-friendly interface and numerous appearance options.
6
  Author: Web Factory Ltd
7
- Version: 3.80
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
@@ -483,6 +483,9 @@ class GMW {
483
  if ($_GET['notice'] == 'api_key') {
484
  GMW::set_options(array('dismiss_notice_api_key' => true));
485
  }
 
 
 
486
 
487
  if (!empty($_GET['redirect'])) {
488
  wp_redirect($_GET['redirect']);
@@ -508,32 +511,40 @@ class GMW {
508
  } // show upgrade notice
509
 
510
  // API key notification is shown only on GMW settings page
511
- // disabled as a test in v3.35+
512
  if (!GMW::get_api_key('test') && GMW::is_plugin_admin_page('settings')) {
513
  add_action('admin_notices', array('GMW', 'notice_api_key'));
 
514
  } // show api key notice
515
 
516
  // rating notification is shown after 7 days if you have active widgets
517
  if (!$notice && empty($options['dismiss_notice_rate']) &&
518
  GMW_tracking::count_active_widgets() > 0 &&
519
- (current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 7)) {
520
  add_action('admin_notices', array('GMW', 'notice_rate_plugin'));
521
  $notice = true;
522
  } // show rate notice
523
 
524
  // tracking notification is shown after 20 days
525
- if (!$notice && !isset($options['allow_tracking']) &&
 
526
  GMW::is_plugin_admin_page('widgets') &&
527
  ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 20))) {
528
  add_action('admin_notices', array('GMW_tracking', 'tracking_notice'));
529
  $notice = true;
530
  } // show tracking notice
 
 
 
 
 
 
 
531
  } // add_notices
532
 
533
 
534
  // display message to get pro features for GMW
535
  static function notice_upgrade() {
536
- $promo_delta = 1 * HOUR_IN_SECONDS - 5;
537
  $options = GMW::get_options();
538
  $activate_url = admin_url('options-general.php?page=gmw_options&gmw_open_promo_dialog');
539
  $dismiss_url = add_query_arg(array('action' => 'gmw_dismiss_notice', 'notice' => 'upgrade', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
@@ -549,8 +560,8 @@ class GMW {
549
  $h = '';
550
  }
551
  $min = $delta / 60 % 60;
552
- echo '<p>We\'ve prepared a special <b>35% welcoming discount</b> available only for another <b class="gmw-countdown" data-endtime="' . ($options['first_install_gmt'] + $promo_delta) . '" style="font-weight: bold;">' . $h . ' ' . $min . 'min</b>.</p>';
553
- echo '<p><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary"><b>Get a lifetime PRO license now for only $19 - LIMITED OFFER!</b></a>';
554
  } else {
555
  echo '<p><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('See what PRO has to offer', 'google-maps-widget') . '</a>';
556
  }
@@ -560,6 +571,20 @@ class GMW {
560
  } // notice_activate_extra_features
561
 
562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  // display message to rate plugin
564
  static function notice_rate_plugin() {
565
  $rate_url = 'https://wordpress.org/support/view/plugin-reviews/google-maps-widget?rate=5#postform';
@@ -567,7 +592,7 @@ class GMW {
567
 
568
  echo '<div id="gmw_rate_notice" class="updated notice"><p>' . __('Hi! We saw you\'ve been using <b>Google Maps Widget</b> for a week and wanted to ask for your help to make the plugin better.<br>We just need a minute of your time to rate the plugin. Thank you!', 'google-maps-widget');
569
 
570
- echo '<br><a target="_blank" href="' . esc_url($rate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('Help us out &amp; rate the plugin', 'google-maps-widget') . '</a>';
571
  echo '&nbsp;&nbsp;<a href="' . esc_url($dismiss_url) . '">' . __('I already rated the plugin', 'google-maps-widget') . '</a>';
572
  echo '</p></div>';
573
  } // notice_rate_plugin
@@ -641,6 +666,8 @@ class GMW {
641
  wp_dequeue_style('facebook-plugin-css');
642
  wp_dequeue_style('facebook-tip-plugin-css');
643
  wp_dequeue_style('facebook-member-plugin-css');
 
 
644
  } // if
645
 
646
  if (GMW::is_plugin_admin_page('plugins')) {
@@ -761,7 +788,7 @@ class GMW {
761
  $options = GMW::get_options();
762
  $promo_delta = 1 * HOUR_IN_SECONDS - 5;
763
  $promo_active = (bool) ((current_time('timestamp') - $options['first_install']) < $promo_delta);
764
- $promo_active2 = (bool) ((current_time('timestamp') - $options['first_install']) > DAY_IN_SECONDS * 60);
765
 
766
  if (GMW::is_plugin_admin_page('widgets') || GMW::is_plugin_admin_page('settings')) {
767
  $current_user = wp_get_current_user();
@@ -780,7 +807,7 @@ class GMW {
780
  $delta = $options['first_install_gmt'] + $promo_delta - time();
781
  $h = $delta / 3600 % 24;
782
  $min = $delta / 60 % 60;
783
- $out .= '<div class="gmw-discount">We\'ve prepared a special <b>35% welcoming discount</b> available only for another <b class="gmw-countdown" data-endtime="' . ($options['first_install_gmt'] + $promo_delta) . '">' . $h . 'h ' . $min . 'min 0sec</b>. Discounts have been applied on the licenses below.</div>';
784
  }
785
  $out .= '</div>'; // header
786
 
@@ -804,7 +831,7 @@ class GMW {
804
  $out .= '<tr>';
805
  $out .= '<td>Lifetime Priority Support</td>';
806
  $out .= '<td><span class="dashicons dashicons-yes"></span> Lifetime Priority Support</td>';
807
- $out .= '<td>1 Year of Priority Support</td>';
808
  $out .= '</tr>';
809
  $out .= '<tr>';
810
  $out .= '<td>Lifetime Updates</td>';
@@ -814,24 +841,24 @@ class GMW {
814
  $out .= '<tr>';
815
  $out .= '<td>';
816
  if ($promo_active) {
817
- $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=pro-agency-welcome&r=welcome-GMW+v' . GMW::$version . '" target="_blank">only <strike>$79</strike> $54</a><span>discount: 31%</span></div>';
818
  } else {
819
  $out .= '<div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=pro-agency&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">BUY $79</a></div>';
820
  }
821
- $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin</span>';
822
  $out .= '</td>';
823
  $out .= '<td>';
824
  if ($promo_active) {
825
- $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=pro-welcome2&r=welcome-GMW+v' . GMW::$version . '" target="_blank">only <strike>$29</strike> $19</a><span>discount: 35%</span></div>';
826
  } elseif ($promo_active2) {
827
- $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=olduser&r=olduser-GMW+v' . GMW::$version . '" target="_blank">only <strike>$29</strike> $19</a><span>discount: 35%</span></div>';
828
  } else {
829
  $out .= '<div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=pro-unlimited2&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">BUY $29</a></div>';
830
  }
831
- $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin</span>';
832
  $out .= '</td>';
833
  $out .= '<td><div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=yearly&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">$15 <small>/year</small></a></div>';
834
- $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin</span>';
835
  $out .= '</td>';
836
  $out .= '</tr>';
837
  $out .= '</table>';
@@ -884,7 +911,7 @@ class GMW {
884
  $out .= '<b>Multiple pins support</b><br>';
885
  $out .= '<ul class="features-list">';
886
  $out .= '<li>Multiple pins support with per-pin options for appearance &amp; click behaviour</li>
887
- <li>12 thumbnail &amp; lightbox map skins + create your own fully custom skin</li>
888
  <li>1500+ map pins</li>
889
  <li>4 extra map image formats for even faster loading</li>
890
  <li>replace thumb with interactive map feature</li>
@@ -1014,7 +1041,7 @@ class GMW {
1014
  if (!GMW::is_activated()) {
1015
  echo '<p>Pins import is one of many <span class="gmw-pro-red">PRO</span> features. <a href="#" class="open_promo_dialog button button-primary">Upgrade now</a> to get access to more than 50 extra options &amp; features.</p>';
1016
  }
1017
-
1018
  echo '<table class="form-table disabled">';
1019
  echo '<tr>
1020
  <th scope="row"><label for="widget_id">' . __('Google Maps Widget', 'google-maps-widget') . '</label></th>
@@ -1037,9 +1064,9 @@ class GMW {
1037
  <th scope="row" colspan="2"><input disabled="disabled" type="submit" name="submit-import-pins" id="submit-import-pins" class="button button-primary button-large" value="Import pins"><br><i style="font-weight: normal;">No data will be written to the widget until you confirm it in step #2.</i></th>';
1038
  echo '</tr>';
1039
  echo '</table>';
1040
-
1041
  echo '</div>'; // import pins
1042
-
1043
  echo '<div id="gmw-settings" style="display: none;">';
1044
  echo '<table class="form-table">';
1045
  echo '<tr>
@@ -1203,7 +1230,7 @@ class GMW {
1203
 
1204
 
1205
  // get plugin info for lightbox
1206
- static function update_details($type, $action, $args) {
1207
  if (!GMW::is_activated()) {
1208
  return false;
1209
  }
4
  Plugin URI: http://www.gmapswidget.com/
5
  Description: Display a single image super-fast loading Google map in a widget. A larger, full featured map is available in a lightbox. Includes a user-friendly interface and numerous appearance options.
6
  Author: Web Factory Ltd
7
+ Version: 3.83
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
483
  if ($_GET['notice'] == 'api_key') {
484
  GMW::set_options(array('dismiss_notice_api_key' => true));
485
  }
486
+ if ($_GET['notice'] == 'olduser') {
487
+ GMW::set_options(array('dismiss_notice_olduser' => true));
488
+ }
489
 
490
  if (!empty($_GET['redirect'])) {
491
  wp_redirect($_GET['redirect']);
511
  } // show upgrade notice
512
 
513
  // API key notification is shown only on GMW settings page
 
514
  if (!GMW::get_api_key('test') && GMW::is_plugin_admin_page('settings')) {
515
  add_action('admin_notices', array('GMW', 'notice_api_key'));
516
+ $notice = true;
517
  } // show api key notice
518
 
519
  // rating notification is shown after 7 days if you have active widgets
520
  if (!$notice && empty($options['dismiss_notice_rate']) &&
521
  GMW_tracking::count_active_widgets() > 0 &&
522
+ (current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 3)) {
523
  add_action('admin_notices', array('GMW', 'notice_rate_plugin'));
524
  $notice = true;
525
  } // show rate notice
526
 
527
  // tracking notification is shown after 20 days
528
+ // disabled - will be completely removed soon
529
+ if (false && !$notice && !isset($options['allow_tracking']) &&
530
  GMW::is_plugin_admin_page('widgets') &&
531
  ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 20))) {
532
  add_action('admin_notices', array('GMW_tracking', 'tracking_notice'));
533
  $notice = true;
534
  } // show tracking notice
535
+
536
+ // upsell to old users
537
+ if (!$notice && empty($options['dismiss_notice_olduser']) &&
538
+ ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 70))) {
539
+ add_action('admin_notices', array('GMW', 'notice_olduser'));
540
+ $notice = true;
541
+ } // upsell to old users
542
  } // add_notices
543
 
544
 
545
  // display message to get pro features for GMW
546
  static function notice_upgrade() {
547
+ $promo_delta = HOUR_IN_SECONDS - 2;
548
  $options = GMW::get_options();
549
  $activate_url = admin_url('options-general.php?page=gmw_options&gmw_open_promo_dialog');
550
  $dismiss_url = add_query_arg(array('action' => 'gmw_dismiss_notice', 'notice' => 'upgrade', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
560
  $h = '';
561
  }
562
  $min = $delta / 60 % 60;
563
+ echo '<p>We\'ve prepared a special <b>20% welcoming discount</b> available only for another <b class="gmw-countdown" data-endtime="' . ($options['first_install_gmt'] + $promo_delta) . '" style="font-weight: bold;">' . $h . ' ' . $min . 'min</b>.</p>';
564
+ echo '<p><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary"><b>Get a lifetime PRO license now for only $23 - LIMITED OFFER!</b></a>';
565
  } else {
566
  echo '<p><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('See what PRO has to offer', 'google-maps-widget') . '</a>';
567
  }
571
  } // notice_activate_extra_features
572
 
573
 
574
+ // display message to get pro features for GMW
575
+ static function notice_olduser() {
576
+ $options = GMW::get_options();
577
+ $activate_url = admin_url('options-general.php?page=gmw_options&gmw_open_promo_dialog');
578
+ $dismiss_url = add_query_arg(array('action' => 'gmw_dismiss_notice', 'notice' => 'olduser', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
579
+
580
+ echo '<div class="updated notice">';
581
+ echo '<p style="font-size: 14px;">We have a <a class="open_promo_dialog" href="' . $activate_url . '">special offer</a> only for users like <b>you</b> who\'ve been using Google Maps Widget for over two months: a <b>one time payment</b>, lifetime license for <b>only $23</b>! No nonsense!<br><a class="open_promo_dialog" href="' . $activate_url . '">Upgrade now</a> to <span class="gmw-pro-red">PRO</span> &amp; get more than 50 extra options &amp; features. License is valid for 3 sites.</p><br>';
582
+
583
+ echo '<a class="open_promo_dialog button button-primary" href="' . $activate_url . '"><b>Grab the limited offer!</b></a>&nbsp;&nbsp;<a href="' . esc_url($dismiss_url) . '" style="margin: 3px 0 0 5px; display: inline-block;">' . __('I\'m not interested (remove notice)', 'google-maps-widget') . '</a>';
584
+ echo '</p></div>';
585
+ } // notice_olduser
586
+
587
+
588
  // display message to rate plugin
589
  static function notice_rate_plugin() {
590
  $rate_url = 'https://wordpress.org/support/view/plugin-reviews/google-maps-widget?rate=5#postform';
592
 
593
  echo '<div id="gmw_rate_notice" class="updated notice"><p>' . __('Hi! We saw you\'ve been using <b>Google Maps Widget</b> for a week and wanted to ask for your help to make the plugin better.<br>We just need a minute of your time to rate the plugin. Thank you!', 'google-maps-widget');
594
 
595
+ echo '<br><a target="_blank" href="' . esc_url($rate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('Help make the plugin better by rating it', 'google-maps-widget') . '</a>';
596
  echo '&nbsp;&nbsp;<a href="' . esc_url($dismiss_url) . '">' . __('I already rated the plugin', 'google-maps-widget') . '</a>';
597
  echo '</p></div>';
598
  } // notice_rate_plugin
666
  wp_dequeue_style('facebook-plugin-css');
667
  wp_dequeue_style('facebook-tip-plugin-css');
668
  wp_dequeue_style('facebook-member-plugin-css');
669
+ wp_dequeue_style('jquery-ui-tooltip-css');
670
+ wp_dequeue_style('social_warfare_admin');
671
  } // if
672
 
673
  if (GMW::is_plugin_admin_page('plugins')) {
788
  $options = GMW::get_options();
789
  $promo_delta = 1 * HOUR_IN_SECONDS - 5;
790
  $promo_active = (bool) ((current_time('timestamp') - $options['first_install']) < $promo_delta);
791
+ $promo_active2 = (bool) ((current_time('timestamp') - $options['first_install']) > DAY_IN_SECONDS * 45);
792
 
793
  if (GMW::is_plugin_admin_page('widgets') || GMW::is_plugin_admin_page('settings')) {
794
  $current_user = wp_get_current_user();
807
  $delta = $options['first_install_gmt'] + $promo_delta - time();
808
  $h = $delta / 3600 % 24;
809
  $min = $delta / 60 % 60;
810
+ $out .= '<div class="gmw-discount">We\'ve prepared a special <b>20% welcoming discount</b> available only for another <b class="gmw-countdown" data-endtime="' . ($options['first_install_gmt'] + $promo_delta) . '">' . $h . 'h ' . $min . 'min 0sec</b>. Discounts have been applied on the licenses below.</div>';
811
  }
812
  $out .= '</div>'; // header
813
 
831
  $out .= '<tr>';
832
  $out .= '<td>Lifetime Priority Support</td>';
833
  $out .= '<td><span class="dashicons dashicons-yes"></span> Lifetime Priority Support</td>';
834
+ $out .= '<td>1 Year of Support</td>';
835
  $out .= '</tr>';
836
  $out .= '<tr>';
837
  $out .= '<td>Lifetime Updates</td>';
841
  $out .= '<tr>';
842
  $out .= '<td>';
843
  if ($promo_active) {
844
+ $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=pro-agency-welcome&r=welcome-GMW+v' . GMW::$version . '" target="_blank">only <strike>$79</strike> $54</a><span>discount: 32%</span></div>';
845
  } else {
846
  $out .= '<div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=pro-agency&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">BUY $79</a></div>';
847
  }
848
+ $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin.<br>Secure payment process.</span>';
849
  $out .= '</td>';
850
  $out .= '<td>';
851
  if ($promo_active) {
852
+ $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=pro-welcome3&r=welcome-GMW+v' . GMW::$version . '" target="_blank">only <strike>$29</strike> $23</a><span>discount: 20%</span></div>';
853
  } elseif ($promo_active2) {
854
+ $out .= '<div class="gmw-promo-button gmw-promo-button-extra"><a href="http://www.gmapswidget.com/buy/?p=olduser2&r=olduser-GMW+v' . GMW::$version . '" target="_blank">only <strike>$29</strike> $23</a><span>discount: 20%</span></div>';
855
  } else {
856
  $out .= '<div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=pro-unlimited2&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">BUY $29</a></div>';
857
  }
858
+ $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin.<br>Secure payment process.</span>';
859
  $out .= '</td>';
860
  $out .= '<td><div class="gmw-promo-button"><a href="http://www.gmapswidget.com/buy/?p=yearly&r=GMW+v' . GMW::$version . '" data-noprevent="1" target="_blank">$15 <small>/year</small></a></div>';
861
+ $out .= '<span class="instant-download">Instant download &amp; activation directly from WordPress admin.<br>Secure payment process.</span>';
862
  $out .= '</td>';
863
  $out .= '</tr>';
864
  $out .= '</table>';
911
  $out .= '<b>Multiple pins support</b><br>';
912
  $out .= '<ul class="features-list">';
913
  $out .= '<li>Multiple pins support with per-pin options for appearance &amp; click behaviour</li>
914
+ <li>14 thumbnail &amp; lightbox map skins + create your own fully custom skin</li>
915
  <li>1500+ map pins</li>
916
  <li>4 extra map image formats for even faster loading</li>
917
  <li>replace thumb with interactive map feature</li>
1041
  if (!GMW::is_activated()) {
1042
  echo '<p>Pins import is one of many <span class="gmw-pro-red">PRO</span> features. <a href="#" class="open_promo_dialog button button-primary">Upgrade now</a> to get access to more than 50 extra options &amp; features.</p>';
1043
  }
1044
+
1045
  echo '<table class="form-table disabled">';
1046
  echo '<tr>
1047
  <th scope="row"><label for="widget_id">' . __('Google Maps Widget', 'google-maps-widget') . '</label></th>
1064
  <th scope="row" colspan="2"><input disabled="disabled" type="submit" name="submit-import-pins" id="submit-import-pins" class="button button-primary button-large" value="Import pins"><br><i style="font-weight: normal;">No data will be written to the widget until you confirm it in step #2.</i></th>';
1065
  echo '</tr>';
1066
  echo '</table>';
1067
+
1068
  echo '</div>'; // import pins
1069
+
1070
  echo '<div id="gmw-settings" style="display: none;">';
1071
  echo '<table class="form-table">';
1072
  echo '<tr>
1230
 
1231
 
1232
  // get plugin info for lightbox
1233
+ static function update_details($false, $action, $args) {
1234
  if (!GMW::is_activated()) {
1235
  return false;
1236
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ License: GPLv2 or later
5
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
6
  Requires at least: 4.0
7
  Tested up to: 4.9
8
- Stable tag: 3.80
9
  Requires PHP: 5.2
10
 
11
  Tired of broken Google Maps taking hours to setup? With Google Maps Widget you'll have a perfect map with a thumbnail & lightbox in minutes!
@@ -28,7 +28,7 @@ Check out some examples on the <a href="http://www.gmapswidget.com/">Google Maps
28
 
29
  * map size - width & height
30
  * map type - road, satellite, terrain & hybrid
31
- * map color scheme - default, refreshed, ultra light, mapbox + 11 extra & any custom map style in PRO
32
  * zoom level
33
  * pin type
34
  * pin color
@@ -149,15 +149,21 @@ Read the <a href="http://wordpress.org/support/plugin/google-maps-widget">suppor
149
 
150
  == Screenshots ==
151
 
152
- 1. Thumbnail map is shown as a widget and since it's just one image it loads super-fast (1 request, about 20KB)
153
- 2. Larger map with all interactive features is available in the lightbox
154
- 3. Widget options - Thumbnail map
155
- 4. Widget options - Interactive map
156
- 5. Widget options - Shortcode
157
- 6. Thumbnail map - light color scheme
 
158
 
159
  == Changelog ==
160
 
 
 
 
 
 
161
  = 3.80 =
162
  * 2018/02/07
163
  * translations are going great thanks to our helpful users!
5
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
6
  Requires at least: 4.0
7
  Tested up to: 4.9
8
+ Stable tag: 3.83
9
  Requires PHP: 5.2
10
 
11
  Tired of broken Google Maps taking hours to setup? With Google Maps Widget you'll have a perfect map with a thumbnail & lightbox in minutes!
28
 
29
  * map size - width & height
30
  * map type - road, satellite, terrain & hybrid
31
+ * map color scheme - default, gowalla, refreshed, ultra light, mapbox + 11 extra & any custom map style in PRO
32
  * zoom level
33
  * pin type
34
  * pin color
149
 
150
  == Screenshots ==
151
 
152
+ 1. Simple & fast - you'll have a great map working in under a minute
153
+ 2. Thumbnail map is shown as a widget and since it's just one image it loads super-fast (1 request, about 20KB)
154
+ 3. Larger map with all interactive features is available in the lightbox
155
+ 4. Widget options - Thumbnail map
156
+ 5. Widget options - Interactive map
157
+ 6. Widget options - Shortcode
158
+ 7. Thumbnail map - light color scheme
159
 
160
  == Changelog ==
161
 
162
+ = 3.83 =
163
+ * 2018/02/26
164
+ * pushing strong on translations!
165
+ * added Gowalla thumbnail color scheme
166
+
167
  = 3.80 =
168
  * 2018/02/07
169
  * translations are going great thanks to our helpful users!