Google Maps Widget – Ultimate Google Maps Plugin - Version 4.23

Version Description

  • 2022/11/26
  • minor security fixes
Download this release

Release Info

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

Code changes from version 4.22 to 4.23

Files changed (3) hide show
  1. gmw-widget.php +71 -70
  2. google-maps-widget.php +323 -21
  3. readme.txt +5 -1
gmw-widget.php CHANGED
@@ -210,8 +210,8 @@ class GoogleMapsWidget extends WP_Widget {
210
  <li>When prompted, overwrite the free version with the PRO one</li>
211
  <li>Create some maps ;)</li>
212
  </ol>';
213
- echo '<style type="text/css"> #widget-' . $this->id . '-savewidget { display: none; } </style>';
214
- echo '<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="hidden" value="' . esc_attr($title) . '">';
215
 
216
  return true;
217
  } // is_activated
@@ -229,18 +229,18 @@ class GoogleMapsWidget extends WP_Widget {
229
 
230
  // widget options markup
231
  // title & address
232
- echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label>';
233
- echo '<input data-tooltip="Widget title styled as defined in the active theme. HTML tags and shortcodes are not supported. Title is optional." class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" placeholder="' . __('Optional Map title', 'google-maps-widget') . '" type="text" value="' . esc_attr($title) . '">';
234
  echo '</p>';
235
- echo '<label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label>';
236
  echo '<div class="input-address-group">';
237
- 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.') . '">';
238
  echo '<a data-target="address" href="#" class="button-secondary gmw-pick-address"><span class="dashicons dashicons-location"></span></a>';
239
  echo '</div>';
240
  // end - title & address
241
 
242
  // tabs
243
- echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul>';
244
  echo '<li><a href="#gmw-thumb">' . __('Thumbnail Map', 'google-maps-widget') . '</a></li>';
245
  echo '<li><a href="#gmw-lightbox">' . __('Interactive Map', 'google-maps-widget') . '</a></li>';
246
  echo '<li><a href="#gmw-pins">' . __('Pins', 'google-maps-widget') . '</a></li>';
@@ -250,154 +250,154 @@ class GoogleMapsWidget extends WP_Widget {
250
 
251
  // thumb tab
252
  echo '<div id="gmw-thumb">';
253
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
254
- echo '<input data-title="Map Width" data-tooltip="Map width in pixels; from 50 to 640. The size limit is imposed by Google. Image may be resized by the theme if the sidebar is narrower." 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="required"> x ';
255
- echo '<input data-title="Map Height" data-tooltip="Map height in pixels; from 50 to 640. The size limit is imposed by Google." 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="required">';
256
  echo ' px</p>';
257
 
258
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
259
- echo '<select data-tooltip="Controls the map layers shown. Roadmap is the most popular, hybrid combines road and satellite while terrain shows physical relief map image, displaying terrain and vegetation.<br>Custom Static Image displays an image of your choosing in order to <b>save money</b> on Google Maps API calls. When clicked it opens the lightbox map." id="' . $this->get_field_id('thumb_type') . '" name="' . $this->get_field_name('thumb_type') . '">';
260
  GMW::create_select_options($thumb_map_types, $thumb_type);
261
  echo '</select></p>';
262
 
263
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_color_scheme') . '">' . __('Color Scheme', 'google-maps-widget') . ':</label>';
264
- echo '<select data-tooltip="Changes the overall appearance of the map. Please note that most visitors are acustomed to the Refreshed color scheme." class="gmw_thumb_color_scheme" id="' . $this->get_field_id('thumb_color_scheme') . '" name="' . $this->get_field_name('thumb_color_scheme') . '">';
265
  GMW::create_select_options($thumb_color_schemes, $thumb_color_scheme);
266
  echo '</select></p>';
267
 
268
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_zoom') . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>';
269
- 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') . '">';
270
  GMW::create_select_options($zoom_levels_thumb, $thumb_zoom);
271
  echo '</select></p>';
272
 
273
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_type') . '">' . __('Pin Type', 'google-maps-widget') . ':</label>';
274
  echo '<select data-tooltip="Predefined pin can be adjusted in terms of color, size and one letter label.
275
- 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') . '">';
276
  GMW::create_select_options($thumb_pin_types, $thumb_pin_type);
277
  echo '</select></p>';
278
 
279
- 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>';
280
- 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') . '">';
281
  GMW::create_select_options($thumb_pin_colors, $thumb_pin_color);
282
  echo '</select>';
283
  echo '</p>';
284
 
285
- echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_size') . '">' . __('Pin Size', 'google-maps-widget') . ':</label>';
286
- echo '<select data-tooltip="All sizes besides the large one are quite small." id="' . $this->get_field_id('thumb_pin_size') . '" name="' . $this->get_field_name('thumb_pin_size') . '">';
287
  GMW::create_select_options($thumb_pin_sizes, $thumb_pin_size);
288
  echo '</select></p>';
289
 
290
- echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_label') . '">' . __('Pin Label', 'google-maps-widget') . ':</label>';
291
- echo '<select data-tooltip="Due to pin\'s size, only single-letter labels are available." id="' . $this->get_field_id('thumb_pin_label') . '" name="' . $this->get_field_name('thumb_pin_label') . '">';
292
  GMW::create_select_options($pin_labels, $thumb_pin_label);
293
  echo '</select></p>';
294
 
295
- 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>';
296
- 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) . '">';
297
  echo '</p>';
298
 
299
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_link_type') . '">' . __('Link To', 'google-maps-widget') . ':</label>';
300
- 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') . '">';
301
  GMW::create_select_options($thumb_link_types, $thumb_link_type);
302
  echo '</select></p>';
303
 
304
- echo '<p class="gmw_thumb_link_section"><label class="gmw-label" for="' . $this->get_field_id('thumb_link') . '">' . __('Custom URL', 'google-maps-widget') . ':</label>';
305
- echo '<input data-tooltip="Make sure the URL starts with http:// if it leads to a different site." placeholder="http://" class="regular-text" id="' . $this->get_field_id('thumb_link') . '" name="' . $this->get_field_name('thumb_link') . '" type="url" value="' . esc_attr($thumb_link) . '">';
306
  echo '</p>';
307
 
308
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_format') . '">' . __('Image Format', 'google-maps-widget') . ':</label>';
309
- echo '<select data-tooltip="Jpg and jpg-baseline typically provide the smallest image size, though they do so through _lossy_ compression which may degrade the image. Gif, png8 and png32 provide lossless compression." id="' . $this->get_field_id('thumb_format') . '" name="' . $this->get_field_name('thumb_format') . '">';
310
  GMW::create_select_options($thumb_formats, $thumb_format);
311
  echo '</select></p>';
312
 
313
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_lang') . '">' . __('Map Language', 'google-maps-widget') . ':</label>';
314
- 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') . '">';
315
  GMW::create_select_options($thumb_langs, $thumb_lang);
316
  echo '</select></p>';
317
 
318
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_hide_title') . '">' . __('Hide Widget Title', 'google-maps-widget') . ':</label>';
319
- echo '<select data-tooltip="You can define a title for easier widgets management in admin but hide it with this option when the widget is displayed on site." id="' . $this->get_field_id('thumb_hide_title') . '" name="' . $this->get_field_name('thumb_hide_title') . '">';
320
  GMW::create_select_options($hide_titles, $thumb_hide_title);
321
  echo '</select></p>';
322
 
323
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_powered_by') . '">' . __('Show Appreciation', 'google-maps-widget') . ':</label>';
324
- 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') . '">';
325
  GMW::create_select_options($thumb_powered_bys, $thumb_powered_by);
326
  echo '</select></p>';
327
 
328
- echo '<p><label for="' . $this->get_field_id('thumb_header') . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>';
329
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the map. HTML tags and shortcodes are fully supported.
330
  If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive header text.
331
- Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('thumb_header') . '" name="' . $this->get_field_name('thumb_header') . '">'. esc_textarea($thumb_header) . '</textarea></p>';
332
- echo '<p><label for="' . $this->get_field_id('thumb_footer') . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>';
333
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the map. HTML tags and shortcodes are fully supported.
334
  If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive footer text.
335
- Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('thumb_footer') . '" name="' . $this->get_field_name('thumb_footer') . '">'. esc_textarea($thumb_footer) . '</textarea></p>';
336
  echo '</div>';
337
  // end - thumbnail tab
338
 
339
  // lightbox tab
340
  echo '<div id="gmw-lightbox">';
341
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_fullscreen') . '">' . __('Lightbox Size', 'google-maps-widget') . ':</label>';
342
- echo '<select data-tooltip="Choose from a custom size or the fullscreen, border-to-border option for the lightbox map." class="gmw_lightbox_fullscreen" id="' . $this->get_field_id('lightbox_fullscreen') . '" name="' . $this->get_field_name('lightbox_fullscreen') . '">';
343
  GMW::create_select_options($lightbox_sizes, $lightbox_fullscreen);
344
  echo '</select>';
345
  echo '<span class="gmw_lightbox_fullscreen_custom_section"><span class="gmw-label label-holder">&nbsp;</span>';
346
- echo '<input data-title="Map Width" data-tooltip="Interactive map width in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text fullscreen_fix" min="50" max="2000" step="1" id="' . $this->get_field_id('lightbox_width') . '" type="number" name="' . $this->get_field_name('lightbox_width') . '" value="' . esc_attr($lightbox_width) . '" required="required"> x ';
347
- echo '<input data-title="Map Height" data-tooltip="Interactive map height in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="number" step="1" min="50" max="2000" value="' . esc_attr($lightbox_height) . '" required="required"> px</span></p>';
348
 
349
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_mode') . '">' . __('Map Mode', 'google-maps-widget') . ':</label>';
350
  echo '<select data-tooltip="Place mode displays a map pin at a defined place or address.
351
  Directions mode displays the path between a start address defined below, and destination defined in the map\'s address.
352
  Search mode displays results for a search across the area around the map\'s address.
353
  View mode returns a map with no markers or directions; it produces a very clean map.
354
- 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') . '">';
355
  GMW::create_select_options($lightbox_modes, $lightbox_mode);
356
  echo '</select></p>';
357
 
358
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_map_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
359
- 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') . '">';
360
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
361
  echo '</select></p>';
362
 
363
- echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_clustering') . '">' . __('Pins Clustering', 'google-maps-widget') . ':</label>';
364
- 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') . '">';
365
  GMW::create_select_options($lightbox_clustering_options, $lightbox_clustering);
366
  echo '</select></p>';
367
 
368
- echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_filtering') . '">' . __('Pins Filtering', 'google-maps-widget') . ':</label>';
369
- 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') . '">';
370
  GMW::create_select_options($lightbox_filtering_options, $lightbox_filtering);
371
  echo '</select></p>';
372
 
373
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_zoom') . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>';
374
- 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." id="' . $this->get_field_id('lightbox_zoom') . '" name="' . $this->get_field_name('lightbox_zoom') . '">';
375
  GMW::create_select_options($zoom_levels_lightbox, $lightbox_zoom);
376
  echo '</select></p>';
377
 
378
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_skin') . '">' . __('Lightbox Skin', 'google-maps-widget') . ':</label>';
379
- echo '<select data-tooltip="Controls the overall appearance of the lightbox, not the map itself. Adjust according to your site\'s design." class="gmw_lightbox_skin" id="' . $this->get_field_id('lightbox_skin') . '" name="' . $this->get_field_name('lightbox_skin') . '">';
380
  GMW::create_select_options($lightbox_skins, $lightbox_skin);
381
  echo '</select></p>';
382
 
383
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_feature') . '">' . __('Lightbox Features', 'google-maps-widget') . ':</label>';
384
  echo '<select data-tooltip="Title is taken from the widget title field. Not all skins have a title, and the ones that do have it in different places, so please test your maps.
385
- Other 3 options control the way users close the lightbox. Enable at least one of them." class="gmw-select2" data-placeholder="' . __('Click to choose features', 'google-maps-widget') . '" multiple="multiple" id="' . $this->get_field_id('lightbox_feature') . '" name="' . $this->get_field_name('lightbox_feature') . '[]">';
386
  GMW::create_select_options($lightbox_features, $lightbox_feature);
387
  echo '</select></p>';
388
 
389
- echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_lang') . '">' . __('Map Language', 'google-maps-widget') . ':</label>';
390
- 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('lightbox_lang') . '" name="' . $this->get_field_name('lightbox_lang') . '">';
391
  GMW::create_select_options($lightbox_langs, $lightbox_lang);
392
  echo '</select></p>';
393
 
394
- echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>';
395
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the interactive map. HTML tags and shortcodes are fully supported.
396
- Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. esc_textarea($lightbox_header) . '</textarea></p>';
397
 
398
- echo '<p><label for="' . $this->get_field_id('lightbox_footer') . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>';
399
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the interactive map. HTML tags and shortcodes are fully supported.
400
- Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('lightbox_footer') . '" name="' . $this->get_field_name('lightbox_footer') . '">'. esc_textarea($lightbox_footer) . '</textarea></p>';
401
 
402
  echo '</div>';
403
  // end - lightbox tab
@@ -437,7 +437,7 @@ class GoogleMapsWidget extends WP_Widget {
437
  echo ' <a class="open_promo_dialog" href="#">Activate PRO features NOW</a>';
438
  echo '</p>';
439
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
440
- 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 Maps Widget for Google Maps for #wordpress. You can grab it too at http://goo.gl/2qcbbf') . '" target="_blank">tweeting about it</a>. Thank you!</p>';
441
  echo '</div>';
442
  // end - info tab
443
  echo '</div><p></p>'; // tabs
@@ -500,9 +500,9 @@ class GoogleMapsWidget extends WP_Widget {
500
  // no user map key -> disable map
501
  if ( !GMW::get_api_key('test') ) {
502
  if ( is_user_logged_in() && current_user_can('administrator') ) {
503
- echo $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open <a href="' . admin_url('options-general.php?page=gmw_options') . '">Maps Widget for Google Maps settings</a> to configure the Google Maps API key. The map can\'t work without it. This is a Google\'s rule that all sites must follow.</div>' . $widget['after_widget'];
504
  } else {
505
- echo $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open Maps Widget for Google Maps settings to configure the Google Maps API key. The map can\'t work without it. This is a Google\'s rule that all sites must follow.</div>' . $widget['after_widget'];
506
  }
507
 
508
  return;
@@ -623,7 +623,7 @@ class GoogleMapsWidget extends WP_Widget {
623
  $out .= apply_filters('gmw_widget_content', $widget_content, $instance);
624
  $out .= $widget['after_widget'];
625
 
626
- echo $out;
627
  } // widget
628
 
629
 
@@ -656,5 +656,6 @@ class GoogleMapsWidget extends WP_Widget {
656
 
657
  return $instance;
658
  } // upgrade_widget_instance
 
659
  } // class GoogleMapsWidget
660
  }
210
  <li>When prompted, overwrite the free version with the PRO one</li>
211
  <li>Create some maps ;)</li>
212
  </ol>';
213
+ echo '<style type="text/css"> #widget-' . esc_attr($this->id) . '-savewidget { display: none; } </style>';
214
+ echo '<input id="' . esc_attr($this->get_field_id('title')) . '" name="' . esc_attr($this->get_field_name('title')) . '" type="hidden" value="' . esc_attr($title) . '">';
215
 
216
  return true;
217
  } // is_activated
229
 
230
  // widget options markup
231
  // title & address
232
+ echo '<p><label for="' . esc_attr($this->get_field_id('title')) . '">' . __('Title', 'google-maps-widget') . ':</label>';
233
+ echo '<input data-tooltip="Widget title styled as defined in the active theme. HTML tags and shortcodes are not supported. Title is optional." class="widefat" id="' . esc_attr($this->get_field_id('title')) . '" name="' . esc_attr($this->get_field_name('title')) . '" placeholder="' . __('Optional Map title', 'google-maps-widget') . '" type="text" value="' . esc_attr($title) . '">';
234
  echo '</p>';
235
+ echo '<label for="' . esc_attr($this->get_field_id('address')) . '">' . __('Address', 'google-maps-widget') . ':</label>';
236
  echo '<div class="input-address-group">';
237
+ echo '<input name="' . esc_attr($this->get_field_name('address')) . '" type="text" value="' . esc_attr($address) . '" required="required" class="widefat" id="' . esc_attr($this->get_field_id('address')) . '" placeholder="' . __('Address / location to show', 'google-maps-widget') . '" data-tooltip="' . esc_html('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.') . '">';
238
  echo '<a data-target="address" href="#" class="button-secondary gmw-pick-address"><span class="dashicons dashicons-location"></span></a>';
239
  echo '</div>';
240
  // end - title & address
241
 
242
  // tabs
243
+ echo '<div class="gmw-tabs" id="tab-' . esc_attr($this->id) . '"><ul>';
244
  echo '<li><a href="#gmw-thumb">' . __('Thumbnail Map', 'google-maps-widget') . '</a></li>';
245
  echo '<li><a href="#gmw-lightbox">' . __('Interactive Map', 'google-maps-widget') . '</a></li>';
246
  echo '<li><a href="#gmw-pins">' . __('Pins', 'google-maps-widget') . '</a></li>';
250
 
251
  // thumb tab
252
  echo '<div id="gmw-thumb">';
253
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_width')) . '">' . __('Map Size', 'google-maps-widget') . ':</label>';
254
+ echo '<input data-title="Map Width" data-tooltip="Map width in pixels; from 50 to 640. The size limit is imposed by Google. Image may be resized by the theme if the sidebar is narrower." min="50" max="640" step="1" class="small-text" id="' . esc_attr($this->get_field_id('thumb_width')) . '" name="' . esc_attr($this->get_field_name('thumb_width')) . '" type="number" value="' . esc_attr($thumb_width) . '" required="required"> x ';
255
+ echo '<input data-title="Map Height" data-tooltip="Map height in pixels; from 50 to 640. The size limit is imposed by Google." min="50" max="640" step="1" class="small-text" id="' . esc_attr($this->get_field_id('thumb_height')) . '" name="' . esc_attr($this->get_field_name('thumb_height')) . '" type="number" value="' . esc_attr($thumb_height) . '" required="required">';
256
  echo ' px</p>';
257
 
258
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_type')) . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
259
+ echo '<select data-tooltip="Controls the map layers shown. Roadmap is the most popular, hybrid combines road and satellite while terrain shows physical relief map image, displaying terrain and vegetation.<br>Custom Static Image displays an image of your choosing in order to <b>save money</b> on Google Maps API calls. When clicked it opens the lightbox map." id="' . esc_attr($this->get_field_id('thumb_type')) . '" name="' . esc_attr($this->get_field_name('thumb_type')) . '">';
260
  GMW::create_select_options($thumb_map_types, $thumb_type);
261
  echo '</select></p>';
262
 
263
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_color_scheme')) . '">' . __('Color Scheme', 'google-maps-widget') . ':</label>';
264
+ echo '<select data-tooltip="Changes the overall appearance of the map. Please note that most visitors are acustomed to the Refreshed color scheme." class="gmw_thumb_color_scheme" id="' . esc_attr($this->get_field_id('thumb_color_scheme')) . '" name="' . esc_attr($this->get_field_name('thumb_color_scheme')) . '">';
265
  GMW::create_select_options($thumb_color_schemes, $thumb_color_scheme);
266
  echo '</select></p>';
267
 
268
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_zoom')) . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>';
269
+ 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="' . esc_attr($this->get_field_id('thumb_zoom')) . '" name="' . esc_attr($this->get_field_name('thumb_zoom')) . '">';
270
  GMW::create_select_options($zoom_levels_thumb, $thumb_zoom);
271
  echo '</select></p>';
272
 
273
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_pin_type')) . '">' . __('Pin Type', 'google-maps-widget') . ':</label>';
274
  echo '<select data-tooltip="Predefined pin can be adjusted in terms of color, size and one letter label.
275
+ Custom pin can be any custom image stored on a publically available server (HTTPS is not supported)." class="gmw_thumb_pin_type" id="' . esc_attr($this->get_field_id('thumb_pin_type')) . '" name="' . esc_attr($this->get_field_name('thumb_pin_type')) . '">';
276
  GMW::create_select_options($thumb_pin_types, $thumb_pin_type);
277
  echo '</select></p>';
278
 
279
+ echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_pin_color')) . '">' . __('Pin Color', 'google-maps-widget') . ':</label>';
280
+ 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="' . esc_attr($this->get_field_id('thumb_pin_color')) . '" name="' . esc_attr($this->get_field_name('thumb_pin_color')) . '">';
281
  GMW::create_select_options($thumb_pin_colors, $thumb_pin_color);
282
  echo '</select>';
283
  echo '</p>';
284
 
285
+ echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_pin_size')) . '">' . __('Pin Size', 'google-maps-widget') . ':</label>';
286
+ echo '<select data-tooltip="All sizes besides the large one are quite small." id="' . esc_attr($this->get_field_id('thumb_pin_size')) . '" name="' . esc_attr($this->get_field_name('thumb_pin_size')) . '">';
287
  GMW::create_select_options($thumb_pin_sizes, $thumb_pin_size);
288
  echo '</select></p>';
289
 
290
+ echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_pin_label')) . '">' . __('Pin Label', 'google-maps-widget') . ':</label>';
291
+ echo '<select data-tooltip="Due to pin\'s size, only single-letter labels are available." id="' . esc_attr($this->get_field_id('thumb_pin_label')) . '" name="' . esc_attr($this->get_field_name('thumb_pin_label')) . '">';
292
  GMW::create_select_options($pin_labels, $thumb_pin_label);
293
  echo '</select></p>';
294
 
295
+ echo '<p class="gmw_thumb_pin_type_custom"><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_pin_img')) . '">' . __('Pin Image URL', 'google-maps-widget') . ':</label>';
296
+ 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="' . esc_attr($this->get_field_id('thumb_pin_img')) . '" name="' . esc_attr($this->get_field_name('thumb_pin_img')) . '" value="' . esc_attr($thumb_pin_img) . '">';
297
  echo '</p>';
298
 
299
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_link_type')) . '">' . __('Link To', 'google-maps-widget') . ':</label>';
300
+ 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="' . esc_attr($this->get_field_id('thumb_link_type')) . '" name="' . esc_attr($this->get_field_name('thumb_link_type')) . '">';
301
  GMW::create_select_options($thumb_link_types, $thumb_link_type);
302
  echo '</select></p>';
303
 
304
+ echo '<p class="gmw_thumb_link_section"><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_link')) . '">' . __('Custom URL', 'google-maps-widget') . ':</label>';
305
+ echo '<input data-tooltip="Make sure the URL starts with http:// if it leads to a different site." placeholder="http://" class="regular-text" id="' . esc_attr($this->get_field_id('thumb_link')) . '" name="' . esc_attr($this->get_field_name('thumb_link')) . '" type="url" value="' . esc_attr($thumb_link) . '">';
306
  echo '</p>';
307
 
308
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_format')) . '">' . __('Image Format', 'google-maps-widget') . ':</label>';
309
+ echo '<select data-tooltip="Jpg and jpg-baseline typically provide the smallest image size, though they do so through _lossy_ compression which may degrade the image. Gif, png8 and png32 provide lossless compression." id="' . esc_attr($this->get_field_id('thumb_format')) . '" name="' . esc_attr($this->get_field_name('thumb_format')) . '">';
310
  GMW::create_select_options($thumb_formats, $thumb_format);
311
  echo '</select></p>';
312
 
313
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_lang')) . '">' . __('Map Language', 'google-maps-widget') . ':</label>';
314
+ 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="' . esc_attr($this->get_field_id('thumb_lang')) . '" name="' . esc_attr($this->get_field_name('thumb_lang')) . '">';
315
  GMW::create_select_options($thumb_langs, $thumb_lang);
316
  echo '</select></p>';
317
 
318
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_hide_title')) . '">' . __('Hide Widget Title', 'google-maps-widget') . ':</label>';
319
+ echo '<select data-tooltip="You can define a title for easier widgets management in admin but hide it with this option when the widget is displayed on site." id="' . esc_attr($this->get_field_id('thumb_hide_title')) . '" name="' . esc_attr($this->get_field_name('thumb_hide_title')) . '">';
320
  GMW::create_select_options($hide_titles, $thumb_hide_title);
321
  echo '</select></p>';
322
 
323
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('thumb_powered_by')) . '">' . __('Show Appreciation', 'google-maps-widget') . ':</label>';
324
+ echo '<select data-tooltip="Please help others learn about GMW by placing a tiny link below the map. Thank you very much!" id="' . esc_attr($this->get_field_id('thumb_powered_by')) . '" name="' . esc_attr($this->get_field_name('thumb_powered_by')) . '">';
325
  GMW::create_select_options($thumb_powered_bys, $thumb_powered_by);
326
  echo '</select></p>';
327
 
328
+ echo '<p><label for="' . esc_attr($this->get_field_id('thumb_header')) . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>';
329
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the map. HTML tags and shortcodes are fully supported.
330
  If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive header text.
331
+ Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . esc_attr($this->get_field_id('thumb_header')) . '" name="' . esc_attr($this->get_field_name('thumb_header')) . '">'. esc_textarea($thumb_header) . '</textarea></p>';
332
+ echo '<p><label for="' . esc_attr($this->get_field_id('thumb_footer')) . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>';
333
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the map. HTML tags and shortcodes are fully supported.
334
  If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive footer text.
335
+ Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . esc_attr($this->get_field_id('thumb_footer')) . '" name="' . esc_attr($this->get_field_name('thumb_footer')) . '">'. esc_textarea($thumb_footer) . '</textarea></p>';
336
  echo '</div>';
337
  // end - thumbnail tab
338
 
339
  // lightbox tab
340
  echo '<div id="gmw-lightbox">';
341
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_fullscreen')) . '">' . __('Lightbox Size', 'google-maps-widget') . ':</label>';
342
+ echo '<select data-tooltip="Choose from a custom size or the fullscreen, border-to-border option for the lightbox map." class="gmw_lightbox_fullscreen" id="' . esc_attr($this->get_field_id('lightbox_fullscreen')) . '" name="' . esc_attr($this->get_field_name('lightbox_fullscreen')) . '">';
343
  GMW::create_select_options($lightbox_sizes, $lightbox_fullscreen);
344
  echo '</select>';
345
  echo '<span class="gmw_lightbox_fullscreen_custom_section"><span class="gmw-label label-holder">&nbsp;</span>';
346
+ echo '<input data-title="Map Width" data-tooltip="Interactive map width in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text fullscreen_fix" min="50" max="2000" step="1" id="' . esc_attr($this->get_field_id('lightbox_width')) . '" type="number" name="' . esc_attr($this->get_field_name('lightbox_width')) . '" value="' . esc_attr($lightbox_width) . '" required="required"> x ';
347
+ echo '<input data-title="Map Height" data-tooltip="Interactive map height in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text" id="' . esc_attr($this->get_field_id('lightbox_height')) . '" name="' . esc_attr($this->get_field_name('lightbox_height')) . '" type="number" step="1" min="50" max="2000" value="' . esc_attr($lightbox_height) . '" required="required"> px</span></p>';
348
 
349
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_mode')) . '">' . __('Map Mode', 'google-maps-widget') . ':</label>';
350
  echo '<select data-tooltip="Place mode displays a map pin at a defined place or address.
351
  Directions mode displays the path between a start address defined below, and destination defined in the map\'s address.
352
  Search mode displays results for a search across the area around the map\'s address.
353
  View mode returns a map with no markers or directions; it produces a very clean map.
354
+ Street View provides panoramic views on the designated location. Please note that it\'s not available on all locations." class="gmw_lightbox_mode" id="' . esc_attr($this->get_field_id('lightbox_mode')) . '" name="' . esc_attr($this->get_field_name('lightbox_mode')) . '">';
355
  GMW::create_select_options($lightbox_modes, $lightbox_mode);
356
  echo '</select></p>';
357
 
358
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_map_type')) . '">' . __('Map Type', 'google-maps-widget') . ':</label>';
359
+ echo '<select data-tooltip="Controls the map layers shown." id="' . esc_attr($this->get_field_id('lightbox_map_type')) . '" name="' . esc_attr($this->get_field_name('lightbox_map_type')) . '">';
360
  GMW::create_select_options($lightbox_map_types, $lightbox_map_type);
361
  echo '</select></p>';
362
 
363
+ echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_clustering')) . '">' . __('Pins Clustering', 'google-maps-widget') . ':</label>';
364
+ 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="' . esc_attr($this->get_field_id('lightbox_clustering')) . '" name="' . esc_attr($this->get_field_name('lightbox_clustering')) . '">';
365
  GMW::create_select_options($lightbox_clustering_options, $lightbox_clustering);
366
  echo '</select></p>';
367
 
368
+ echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_filtering')) . '">' . __('Pins Filtering', 'google-maps-widget') . ':</label>';
369
+ 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="' . esc_attr($this->get_field_id('lightbox_filtering')) . '" name="' . esc_attr($this->get_field_name('lightbox_filtering')) . '">';
370
  GMW::create_select_options($lightbox_filtering_options, $lightbox_filtering);
371
  echo '</select></p>';
372
 
373
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_zoom')) . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>';
374
+ 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." id="' . esc_attr($this->get_field_id('lightbox_zoom')) . '" name="' . esc_attr($this->get_field_name('lightbox_zoom')) . '">';
375
  GMW::create_select_options($zoom_levels_lightbox, $lightbox_zoom);
376
  echo '</select></p>';
377
 
378
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_skin')) . '">' . __('Lightbox Skin', 'google-maps-widget') . ':</label>';
379
+ echo '<select data-tooltip="Controls the overall appearance of the lightbox, not the map itself. Adjust according to your site\'s design." class="gmw_lightbox_skin" id="' . esc_attr($this->get_field_id('lightbox_skin')) . '" name="' . esc_attr($this->get_field_name('lightbox_skin')) . '">';
380
  GMW::create_select_options($lightbox_skins, $lightbox_skin);
381
  echo '</select></p>';
382
 
383
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_feature')) . '">' . __('Lightbox Features', 'google-maps-widget') . ':</label>';
384
  echo '<select data-tooltip="Title is taken from the widget title field. Not all skins have a title, and the ones that do have it in different places, so please test your maps.
385
+ Other 3 options control the way users close the lightbox. Enable at least one of them." class="gmw-select2" data-placeholder="' . __('Click to choose features', 'google-maps-widget') . '" multiple="multiple" id="' . esc_attr($this->get_field_id('lightbox_feature')) . '" name="' . esc_attr($this->get_field_name('lightbox_feature')) . '[]">';
386
  GMW::create_select_options($lightbox_features, $lightbox_feature);
387
  echo '</select></p>';
388
 
389
+ echo '<p><label class="gmw-label" for="' . esc_attr($this->get_field_id('lightbox_lang')) . '">' . __('Map Language', 'google-maps-widget') . ':</label>';
390
+ 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="' . esc_attr($this->get_field_id('lightbox_lang')) . '" name="' . esc_attr($this->get_field_name('lightbox_lang')) . '">';
391
  GMW::create_select_options($lightbox_langs, $lightbox_lang);
392
  echo '</select></p>';
393
 
394
+ echo '<p><label for="' . esc_attr($this->get_field_id('lightbox_header')) . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>';
395
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the interactive map. HTML tags and shortcodes are fully supported.
396
+ Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . esc_attr($this->get_field_id('lightbox_header')) . '" name="' . esc_attr($this->get_field_name('lightbox_header')) . '">'. esc_textarea($lightbox_header) . '</textarea></p>';
397
 
398
+ echo '<p><label for="' . esc_attr($this->get_field_id('lightbox_footer')) . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>';
399
  echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the interactive map. HTML tags and shortcodes are fully supported.
400
+ Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . esc_attr($this->get_field_id('lightbox_footer')) . '" name="' . esc_attr($this->get_field_name('lightbox_footer')) . '">'. esc_textarea($lightbox_footer) . '</textarea></p>';
401
 
402
  echo '</div>';
403
  // end - lightbox tab
437
  echo ' <a class="open_promo_dialog" href="#">Activate PRO features NOW</a>';
438
  echo '</p>';
439
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
440
+ 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=' . esc_attr(urlencode('I\'m using the #free Maps Widget for Google Maps for #wordpress. You can grab it too at http://goo.gl/2qcbbf')) . '" target="_blank">tweeting about it</a>. Thank you!</p>';
441
  echo '</div>';
442
  // end - info tab
443
  echo '</div><p></p>'; // tabs
500
  // no user map key -> disable map
501
  if ( !GMW::get_api_key('test') ) {
502
  if ( is_user_logged_in() && current_user_can('administrator') ) {
503
+ GMW::wp_kses_wf( $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open <a href="' . admin_url('options-general.php?page=gmw_options') . '">Maps Widget for Google Maps settings</a> to configure the Google Maps API key. The map can\'t work without it. This is a Google\'s rule that all sites must follow.</div>' . $widget['after_widget']);
504
  } else {
505
+ GMW::wp_kses_wf( $widget['before_widget'] . '<div style="border: 1px solid black; padding: 20px;">Open Maps Widget for Google Maps settings to configure the Google Maps API key. The map can\'t work without it. This is a Google\'s rule that all sites must follow.</div>' . $widget['after_widget']);
506
  }
507
 
508
  return;
623
  $out .= apply_filters('gmw_widget_content', $widget_content, $instance);
624
  $out .= $widget['after_widget'];
625
 
626
+ GMW::wp_kses_wf($out);
627
  } // widget
628
 
629
 
656
 
657
  return $instance;
658
  } // upgrade_widget_instance
659
+
660
  } // class GoogleMapsWidget
661
  }
google-maps-widget.php CHANGED
@@ -4,13 +4,13 @@ Plugin Name: Maps Widget for Google Maps
4
  Plugin URI: https://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: WebFactory Ltd
7
- Version: 4.22
8
  Author URI: https://www.gmapswidget.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
11
  Requires at least: 4.0
12
  Requires PHP: 5.2
13
- Tested up to: 6.0
14
 
15
  Copyright 2012 - 2022 WebFactory Ltd (email : gmw@webfactoryltd.com)
16
 
@@ -439,7 +439,7 @@ class GMW {
439
  $out .= "</div>\n";
440
  } // foreach $widgets
441
 
442
- echo $out;
443
  } // dialogs_markup
444
 
445
 
@@ -550,7 +550,7 @@ class GMW {
550
  $h = '';
551
  }
552
  $min = $delta / 60 % 60;
553
- 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>';
554
  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 $39 - LIMITED OFFER!</b></a>';
555
  } else {
556
  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>';
@@ -568,9 +568,9 @@ class GMW {
568
  $dismiss_url = add_query_arg(array('action' => 'gmw_dismiss_notice', 'notice' => 'olduser', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
569
 
570
  echo '<div class="updated notice">';
571
- 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 Maps Widget for Google Maps for a while: a <b>one time payment</b>, lifetime license for <b>only $39</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.</p><br>';
572
 
573
- 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>';
574
  echo '</p></div>';
575
  } // notice_olduser
576
 
@@ -961,7 +961,7 @@ class GMW {
961
  $out .= '</div>'; // dialog
962
  } // address picker and pins dialog if activated
963
 
964
- echo $out;
965
  } // admin_dialogs_markup
966
 
967
 
@@ -974,7 +974,7 @@ class GMW {
974
  $options = GMW::get_options();
975
 
976
  echo '<div class="wrap gmw-options">';
977
- echo '<h1><img alt="' . __('Maps Widget for Google Maps', 'google-maps-widget') . '" title="' . __('Maps Widget for Google Maps', 'google-maps-widget') . '" height="55" src="' . GMW_PLUGIN_URL . 'images/gmw-logo.png"> Maps Widget for Google Maps</h1>';
978
 
979
  echo '<form method="post" action="options.php">';
980
  settings_fields(GMW::$options);
@@ -994,13 +994,13 @@ class GMW {
994
  echo '<table class="form-table disabled">';
995
  echo '<tr>
996
  <th scope="row"><label for="widget_id">' . __('Maps Widget for Google Maps', 'google-maps-widget') . '</label></th>
997
- <td><select disabled="disabled" name="' . GMW::$options . '[widget_id]" id="widget_id">';
998
  echo '<option value="">- select the widget to import pins to -</option>';
999
  echo '</select><br><span class="description">Choose a widget you want to import pins to. Any existing pins will be overwritten with the new pins. Other widget options will not be altered in any way.</span></td></tr>';
1000
 
1001
  echo '<tr>
1002
  <th scope="row"><label for="pins_txt">' . __('Pins, copy/paste', 'google-maps-widget') . '</label></th>';
1003
- echo '<td><textarea disabled="disabled" style="width: 500px;" rows="3" name="' . GMW::$options . '[pins_txt]" id="pins_txt">';
1004
  echo '</textarea><br><span class="description">Data has to be formatted in a CSV fashion. One pin per line, individual fields double quoted and separated by a comma. All fields have to be included.<br>
1005
  Please refer to the <a href="https://www.gmapswidget.com/documentation/importing-pins/" target="_blank">detailed documentation article</a> or grab the <a href="https://www.gmapswidget.com/wp-content/uploads/2018/02/sample-pins-import.csv" target="_blank">sample import file and modify it.</span></td></tr>';
1006
 
@@ -1020,13 +1020,13 @@ class GMW {
1020
  echo '<table class="form-table">';
1021
  echo '<tr>
1022
  <th scope="row"><label for="api_key">' . __('Google Maps API Key', 'google-maps-widget') . '</label></th>
1023
- <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.\')">
1024
  <p class="description">New Google Maps usage policy dictates that everyone using the maps should register for a free API key.<br>
1025
  Detailed instruction on how to generate a key in under a minute are available in the <a href="http://www.gmapswidget.com/documentation/generate-google-maps-api-key/" target="_blank">documentation</a>.<br>If you already have a key make sure the following APIs are enabled: Google Maps JavaScript API, Google Static Maps API, Google Maps Embed API &amp; Google Maps Geocoding API.</p></td>
1026
 
1027
  </tr>';
1028
  echo '</table>';
1029
- echo get_submit_button(__('Save Settings', 'google-maps-widget'));
1030
 
1031
  if (!GMW::is_activated()) {
1032
  echo '<p>Not sure if you should upgrade to <span class="gmw-pro-red">PRO</span>? It offers more than 50 extra features like shortcodes, Google Analytics tracking, multiple pins support &amp; much more; <a href="#" class="open_promo_dialog button" data-target-screen="gmw_dialog_pro_features">compare features now</a>.</p>';
@@ -1036,36 +1036,36 @@ class GMW {
1036
  echo '<table class="form-table disabled">';
1037
  echo '<tr>
1038
  <th scope="row"><label for="sc_map">' . __('Map Shortcode', 'google-maps-widget') . '</label></th>
1039
- <td><input class="regular-text" name="' . GMW::$options . '[sc_map]" type="text" id="sc_map" value="' . esc_attr($options['sc_map']) . '" disabled="disabled" placeholder="Map shortcode" required="required" oninvalid="this.setCustomValidity(\'Please enter the shortcode you want to use for Maps Widget for Google Maps maps.\')" oninput="setCustomValidity(\'\')">
1040
  <p class="description">If the default shortcode "gmw" is taken by another plugin change it to something else, eg: "gmaps".</p></td>
1041
  </tr>';
1042
  echo '<tr>
1043
  <th scope="row"><label for="track_ga">' . __('Track with Google Analytics', 'google-maps-widget') . '</label></th>
1044
- <td><input name="' . GMW::$options . '[track_ga]" disabled="disabled" type="checkbox" id="track_ga" value="1"' . checked('1', $options['track_ga'], false) . '>
1045
  <span class="description">Each time the interactive map is opened either in lightbox or as a thumbnail replacement a Google Analytics Event will be tracked.<br>You need to have GA already configured on the site. It is fully compatible with all GA plugins and all GA tracking code versions. Default: unchecked.</span></td></tr>';
1046
  echo '<tr>
1047
  <th scope="row"><label for="include_jquery">' . __('Include jQuery', 'google-maps-widget') . '</label></th>
1048
- <td><input name="' . GMW::$options . '[include_jquery]" disabled="disabled" type="checkbox" id="include_jquery" value="1"' . checked('1', $options['include_jquery'], false) . '>
1049
  <span class="description">If you\'re experiencing problems with double jQuery include disable this option. Default: checked.</span></td></tr>';
1050
  echo '<tr>
1051
  <th scope="row"><label for="include_gmaps_api">' . __('Include Google Maps API JS', 'google-maps-widget') . '</label></th>
1052
- <td><input disabled="disabled" name="' . GMW::$options . '[include_gmaps_api]" type="checkbox" id="include_gmaps_api" value="1"' . checked('1', $options['include_gmaps_api'], false) . '>
1053
  <span class="description">If your theme or other plugins already include Google Maps API JS disable this option. Default: checked.</span></td></tr>';
1054
  echo '<tr>
1055
  <th scope="row"><label for="include_lightbox_css">' . __('Include Colorbox &amp; Thumbnail CSS', 'google-maps-widget') . '</label></th>
1056
- <td><input name="' . GMW::$options . '[include_lightbox_css]" disabled="disabled" type="checkbox" id="include_lightbox_css" value="1"' . checked('1', $options['include_lightbox_css'], false) . '>
1057
  <span class="description">If your theme or other plugins already include Colorbox CSS disable this option.<br>Please note that widget (thumbnail map) related CSS will also be removed which will cause minor differences in the way it\'s displayed. Default: checked.</span></td></tr>';
1058
  echo '<tr>
1059
  <th scope="row"><label for="include_lightbox_js">' . __('Include Colorbox JS', 'google-maps-widget') . '</label></th>
1060
- <td><input name="' . GMW::$options . '[include_lightbox_js]" disabled="disabled" type="checkbox" id="include_lightbox_js" value="1"' . checked('1', $options['include_lightbox_js'], false) . '>
1061
  <span class="description">If your theme or other plugins already include Colorbox JS file disable this option. Default: checked.</span></td></tr>';
1062
  echo '<tr>
1063
  <th scope="row"><label for="disable_tooltips">' . __('Disable Admin Tooltips', 'google-maps-widget') . '</label></th>
1064
- <td><input name="' . GMW::$options . '[disable_tooltips]" type="checkbox" disabled="disabled" id="disable_tooltips" value="1"' . checked('1', $options['disable_tooltips'], false) . '>
1065
  <span class="description">All settings in widget edit GUI have tooltips. This setting completely disables them. Default: unchecked.</span></td></tr>';
1066
  echo '<tr>
1067
  <th scope="row"><label for="disable_sidebar">' . __('Disable Hidden Sidebar', 'google-maps-widget') . '</label></th>
1068
- <td><input name="' . GMW::$options . '[disable_sidebar]" disabled="disabled" type="checkbox" id="disable_sidebar" value="1"' . checked('1', $options['disable_sidebar'], false) . '>
1069
  <span class="description">Hidden sidebar helps you to build maps that are displayed with shortcodes. If it bothers you in the admin, disable it. Default: unchecked.</span></td></tr>';
1070
  echo '</table>';
1071
 
@@ -1159,12 +1159,314 @@ class GMW {
1159
  } // foreach
1160
 
1161
  if ($output) {
1162
- echo $out;
1163
  } else {
1164
  return $out;
1165
  }
1166
  } // create_select_options
1167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1168
 
1169
  // sanitizes color code string, leaves # intact
1170
  static function sanitize_hex_color( $color ) {
4
  Plugin URI: https://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: WebFactory Ltd
7
+ Version: 4.23
8
  Author URI: https://www.gmapswidget.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
11
  Requires at least: 4.0
12
  Requires PHP: 5.2
13
+ Tested up to: 6.1
14
 
15
  Copyright 2012 - 2022 WebFactory Ltd (email : gmw@webfactoryltd.com)
16
 
439
  $out .= "</div>\n";
440
  } // foreach $widgets
441
 
442
+ self::wp_kses_wf($out);
443
  } // dialogs_markup
444
 
445
 
550
  $h = '';
551
  }
552
  $min = $delta / 60 % 60;
553
+ echo '<p>We\'ve prepared a special <b>20% welcoming discount</b> available only for another <b class="gmw-countdown" data-endtime="' . esc_attr(($options['first_install_gmt'] + $promo_delta)) . '" style="font-weight: bold;">' . esc_attr($h) . ' ' . esc_attr($min) . 'min</b>.</p>';
554
  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 $39 - LIMITED OFFER!</b></a>';
555
  } else {
556
  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>';
568
  $dismiss_url = add_query_arg(array('action' => 'gmw_dismiss_notice', 'notice' => 'olduser', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
569
 
570
  echo '<div class="updated notice">';
571
+ echo '<p style="font-size: 14px;">We have a <a class="open_promo_dialog" href="' . esc_url($activate_url) . '">special offer</a> only for users like <b>you</b> who\'ve been using Maps Widget for Google Maps for a while: a <b>one time payment</b>, lifetime license for <b>only $39</b>! No nonsense!<br><a class="open_promo_dialog" href="' . esc_url($activate_url) . '">Upgrade now</a> to <span class="gmw-pro-red">PRO</span> &amp; get more than 50 extra options &amp; features.</p><br>';
572
 
573
+ echo '<a class="open_promo_dialog button button-primary" href="' . esc_url($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>';
574
  echo '</p></div>';
575
  } // notice_olduser
576
 
961
  $out .= '</div>'; // dialog
962
  } // address picker and pins dialog if activated
963
 
964
+ self::wp_kses_wf($out);
965
  } // admin_dialogs_markup
966
 
967
 
974
  $options = GMW::get_options();
975
 
976
  echo '<div class="wrap gmw-options">';
977
+ echo '<h1><img alt="' . __('Maps Widget for Google Maps', 'google-maps-widget') . '" title="' . __('Maps Widget for Google Maps', 'google-maps-widget') . '" height="55" src="' . esc_url(GMW_PLUGIN_URL) . 'images/gmw-logo.png"> Maps Widget for Google Maps</h1>';
978
 
979
  echo '<form method="post" action="options.php">';
980
  settings_fields(GMW::$options);
994
  echo '<table class="form-table disabled">';
995
  echo '<tr>
996
  <th scope="row"><label for="widget_id">' . __('Maps Widget for Google Maps', 'google-maps-widget') . '</label></th>
997
+ <td><select disabled="disabled" name="' . esc_attr(GMW::$options) . '[widget_id]" id="widget_id">';
998
  echo '<option value="">- select the widget to import pins to -</option>';
999
  echo '</select><br><span class="description">Choose a widget you want to import pins to. Any existing pins will be overwritten with the new pins. Other widget options will not be altered in any way.</span></td></tr>';
1000
 
1001
  echo '<tr>
1002
  <th scope="row"><label for="pins_txt">' . __('Pins, copy/paste', 'google-maps-widget') . '</label></th>';
1003
+ echo '<td><textarea disabled="disabled" style="width: 500px;" rows="3" name="' . esc_attr(GMW::$options) . '[pins_txt]" id="pins_txt">';
1004
  echo '</textarea><br><span class="description">Data has to be formatted in a CSV fashion. One pin per line, individual fields double quoted and separated by a comma. All fields have to be included.<br>
1005
  Please refer to the <a href="https://www.gmapswidget.com/documentation/importing-pins/" target="_blank">detailed documentation article</a> or grab the <a href="https://www.gmapswidget.com/wp-content/uploads/2018/02/sample-pins-import.csv" target="_blank">sample import file and modify it.</span></td></tr>';
1006
 
1020
  echo '<table class="form-table">';
1021
  echo '<tr>
1022
  <th scope="row"><label for="api_key">' . __('Google Maps API Key', 'google-maps-widget') . '</label></th>
1023
+ <td><input name="' . esc_attr(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.\')">
1024
  <p class="description">New Google Maps usage policy dictates that everyone using the maps should register for a free API key.<br>
1025
  Detailed instruction on how to generate a key in under a minute are available in the <a href="http://www.gmapswidget.com/documentation/generate-google-maps-api-key/" target="_blank">documentation</a>.<br>If you already have a key make sure the following APIs are enabled: Google Maps JavaScript API, Google Static Maps API, Google Maps Embed API &amp; Google Maps Geocoding API.</p></td>
1026
 
1027
  </tr>';
1028
  echo '</table>';
1029
+ self::wp_kses_wf(get_submit_button(__('Save Settings', 'google-maps-widget')));
1030
 
1031
  if (!GMW::is_activated()) {
1032
  echo '<p>Not sure if you should upgrade to <span class="gmw-pro-red">PRO</span>? It offers more than 50 extra features like shortcodes, Google Analytics tracking, multiple pins support &amp; much more; <a href="#" class="open_promo_dialog button" data-target-screen="gmw_dialog_pro_features">compare features now</a>.</p>';
1036
  echo '<table class="form-table disabled">';
1037
  echo '<tr>
1038
  <th scope="row"><label for="sc_map">' . __('Map Shortcode', 'google-maps-widget') . '</label></th>
1039
+ <td><input class="regular-text" name="' . esc_attr(GMW::$options) . '[sc_map]" type="text" id="sc_map" value="' . esc_attr($options['sc_map']) . '" disabled="disabled" placeholder="Map shortcode" required="required" oninvalid="this.setCustomValidity(\'Please enter the shortcode you want to use for Maps Widget for Google Maps maps.\')" oninput="setCustomValidity(\'\')">
1040
  <p class="description">If the default shortcode "gmw" is taken by another plugin change it to something else, eg: "gmaps".</p></td>
1041
  </tr>';
1042
  echo '<tr>
1043
  <th scope="row"><label for="track_ga">' . __('Track with Google Analytics', 'google-maps-widget') . '</label></th>
1044
+ <td><input name="' . esc_attr(GMW::$options) . '[track_ga]" disabled="disabled" type="checkbox" id="track_ga" value="1"' . checked('1', $options['track_ga'], false) . '>
1045
  <span class="description">Each time the interactive map is opened either in lightbox or as a thumbnail replacement a Google Analytics Event will be tracked.<br>You need to have GA already configured on the site. It is fully compatible with all GA plugins and all GA tracking code versions. Default: unchecked.</span></td></tr>';
1046
  echo '<tr>
1047
  <th scope="row"><label for="include_jquery">' . __('Include jQuery', 'google-maps-widget') . '</label></th>
1048
+ <td><input name="' . esc_attr(GMW::$options) . '[include_jquery]" disabled="disabled" type="checkbox" id="include_jquery" value="1"' . checked('1', $options['include_jquery'], false) . '>
1049
  <span class="description">If you\'re experiencing problems with double jQuery include disable this option. Default: checked.</span></td></tr>';
1050
  echo '<tr>
1051
  <th scope="row"><label for="include_gmaps_api">' . __('Include Google Maps API JS', 'google-maps-widget') . '</label></th>
1052
+ <td><input disabled="disabled" name="' . esc_attr(GMW::$options) . '[include_gmaps_api]" type="checkbox" id="include_gmaps_api" value="1"' . checked('1', $options['include_gmaps_api'], false) . '>
1053
  <span class="description">If your theme or other plugins already include Google Maps API JS disable this option. Default: checked.</span></td></tr>';
1054
  echo '<tr>
1055
  <th scope="row"><label for="include_lightbox_css">' . __('Include Colorbox &amp; Thumbnail CSS', 'google-maps-widget') . '</label></th>
1056
+ <td><input name="' . esc_attr(GMW::$options) . '[include_lightbox_css]" disabled="disabled" type="checkbox" id="include_lightbox_css" value="1"' . checked('1', $options['include_lightbox_css'], false) . '>
1057
  <span class="description">If your theme or other plugins already include Colorbox CSS disable this option.<br>Please note that widget (thumbnail map) related CSS will also be removed which will cause minor differences in the way it\'s displayed. Default: checked.</span></td></tr>';
1058
  echo '<tr>
1059
  <th scope="row"><label for="include_lightbox_js">' . __('Include Colorbox JS', 'google-maps-widget') . '</label></th>
1060
+ <td><input name="' . esc_attr(GMW::$options) . '[include_lightbox_js]" disabled="disabled" type="checkbox" id="include_lightbox_js" value="1"' . checked('1', $options['include_lightbox_js'], false) . '>
1061
  <span class="description">If your theme or other plugins already include Colorbox JS file disable this option. Default: checked.</span></td></tr>';
1062
  echo '<tr>
1063
  <th scope="row"><label for="disable_tooltips">' . __('Disable Admin Tooltips', 'google-maps-widget') . '</label></th>
1064
+ <td><input name="' . esc_attr(GMW::$options) . '[disable_tooltips]" type="checkbox" disabled="disabled" id="disable_tooltips" value="1"' . checked('1', $options['disable_tooltips'], false) . '>
1065
  <span class="description">All settings in widget edit GUI have tooltips. This setting completely disables them. Default: unchecked.</span></td></tr>';
1066
  echo '<tr>
1067
  <th scope="row"><label for="disable_sidebar">' . __('Disable Hidden Sidebar', 'google-maps-widget') . '</label></th>
1068
+ <td><input name="' . esc_attr(GMW::$options) . '[disable_sidebar]" disabled="disabled" type="checkbox" id="disable_sidebar" value="1"' . checked('1', $options['disable_sidebar'], false) . '>
1069
  <span class="description">Hidden sidebar helps you to build maps that are displayed with shortcodes. If it bothers you in the admin, disable it. Default: unchecked.</span></td></tr>';
1070
  echo '</table>';
1071
 
1159
  } // foreach
1160
 
1161
  if ($output) {
1162
+ self::wp_kses_wf($out);
1163
  } else {
1164
  return $out;
1165
  }
1166
  } // create_select_options
1167
 
1168
+ static function wp_kses_wf($html)
1169
+ {
1170
+ add_filter('safe_style_css', function ($styles) {
1171
+ $styles_wf = array(
1172
+ 'text-align',
1173
+ 'margin',
1174
+ 'color',
1175
+ 'float',
1176
+ 'border',
1177
+ 'background',
1178
+ 'background-color',
1179
+ 'border-bottom',
1180
+ 'border-bottom-color',
1181
+ 'border-bottom-style',
1182
+ 'border-bottom-width',
1183
+ 'border-collapse',
1184
+ 'border-color',
1185
+ 'border-left',
1186
+ 'border-left-color',
1187
+ 'border-left-style',
1188
+ 'border-left-width',
1189
+ 'border-right',
1190
+ 'border-right-color',
1191
+ 'border-right-style',
1192
+ 'border-right-width',
1193
+ 'border-spacing',
1194
+ 'border-style',
1195
+ 'border-top',
1196
+ 'border-top-color',
1197
+ 'border-top-style',
1198
+ 'border-top-width',
1199
+ 'border-width',
1200
+ 'caption-side',
1201
+ 'clear',
1202
+ 'cursor',
1203
+ 'direction',
1204
+ 'font',
1205
+ 'font-family',
1206
+ 'font-size',
1207
+ 'font-style',
1208
+ 'font-variant',
1209
+ 'font-weight',
1210
+ 'height',
1211
+ 'letter-spacing',
1212
+ 'line-height',
1213
+ 'margin-bottom',
1214
+ 'margin-left',
1215
+ 'margin-right',
1216
+ 'margin-top',
1217
+ 'overflow',
1218
+ 'padding',
1219
+ 'padding-bottom',
1220
+ 'padding-left',
1221
+ 'padding-right',
1222
+ 'padding-top',
1223
+ 'text-decoration',
1224
+ 'text-indent',
1225
+ 'vertical-align',
1226
+ 'width',
1227
+ 'display',
1228
+ );
1229
+
1230
+ foreach ($styles_wf as $style_wf) {
1231
+ $styles[] = $style_wf;
1232
+ }
1233
+ return $styles;
1234
+ });
1235
+
1236
+ $allowed_tags = wp_kses_allowed_html('post');
1237
+ $allowed_tags['input'] = array(
1238
+ 'type' => true,
1239
+ 'style' => true,
1240
+ 'class' => true,
1241
+ 'id' => true,
1242
+ 'checked' => true,
1243
+ 'disabled' => true,
1244
+ 'name' => true,
1245
+ 'size' => true,
1246
+ 'placeholder' => true,
1247
+ 'value' => true,
1248
+ 'data-*' => true,
1249
+ 'size' => true,
1250
+ 'disabled' => true
1251
+ );
1252
+
1253
+ $allowed_tags['textarea'] = array(
1254
+ 'type' => true,
1255
+ 'style' => true,
1256
+ 'class' => true,
1257
+ 'id' => true,
1258
+ 'checked' => true,
1259
+ 'disabled' => true,
1260
+ 'name' => true,
1261
+ 'size' => true,
1262
+ 'placeholder' => true,
1263
+ 'value' => true,
1264
+ 'data-*' => true,
1265
+ 'cols' => true,
1266
+ 'rows' => true,
1267
+ 'disabled' => true,
1268
+ 'autocomplete' => true
1269
+ );
1270
+
1271
+ $allowed_tags['select'] = array(
1272
+ 'type' => true,
1273
+ 'style' => true,
1274
+ 'class' => true,
1275
+ 'id' => true,
1276
+ 'checked' => true,
1277
+ 'disabled' => true,
1278
+ 'name' => true,
1279
+ 'size' => true,
1280
+ 'placeholder' => true,
1281
+ 'value' => true,
1282
+ 'data-*' => true,
1283
+ 'multiple' => true,
1284
+ 'disabled' => true
1285
+ );
1286
+
1287
+ $allowed_tags['option'] = array(
1288
+ 'type' => true,
1289
+ 'style' => true,
1290
+ 'class' => true,
1291
+ 'id' => true,
1292
+ 'checked' => true,
1293
+ 'disabled' => true,
1294
+ 'name' => true,
1295
+ 'size' => true,
1296
+ 'placeholder' => true,
1297
+ 'value' => true,
1298
+ 'selected' => true,
1299
+ 'data-*' => true
1300
+ );
1301
+ $allowed_tags['optgroup'] = array(
1302
+ 'type' => true,
1303
+ 'style' => true,
1304
+ 'class' => true,
1305
+ 'id' => true,
1306
+ 'checked' => true,
1307
+ 'disabled' => true,
1308
+ 'name' => true,
1309
+ 'size' => true,
1310
+ 'placeholder' => true,
1311
+ 'value' => true,
1312
+ 'selected' => true,
1313
+ 'data-*' => true,
1314
+ 'label' => true
1315
+ );
1316
+
1317
+ $allowed_tags['a'] = array(
1318
+ 'href' => true,
1319
+ 'data-*' => true,
1320
+ 'class' => true,
1321
+ 'style' => true,
1322
+ 'id' => true,
1323
+ 'target' => true,
1324
+ 'data-*' => true,
1325
+ 'role' => true,
1326
+ 'aria-controls' => true,
1327
+ 'aria-selected' => true,
1328
+ 'disabled' => true
1329
+ );
1330
+
1331
+ $allowed_tags['div'] = array(
1332
+ 'style' => true,
1333
+ 'class' => true,
1334
+ 'id' => true,
1335
+ 'data-*' => true,
1336
+ 'role' => true,
1337
+ 'aria-labelledby' => true,
1338
+ 'value' => true,
1339
+ 'aria-modal' => true,
1340
+ 'tabindex' => true
1341
+ );
1342
+
1343
+ $allowed_tags['li'] = array(
1344
+ 'style' => true,
1345
+ 'class' => true,
1346
+ 'id' => true,
1347
+ 'data-*' => true,
1348
+ 'role' => true,
1349
+ 'aria-labelledby' => true,
1350
+ 'value' => true,
1351
+ 'aria-modal' => true,
1352
+ 'tabindex' => true
1353
+ );
1354
+
1355
+ $allowed_tags['span'] = array(
1356
+ 'style' => true,
1357
+ 'class' => true,
1358
+ 'id' => true,
1359
+ 'data-*' => true,
1360
+ 'aria-hidden' => true
1361
+ );
1362
+
1363
+ $allowed_tags['style'] = array(
1364
+ 'class' => true,
1365
+ 'id' => true,
1366
+ 'type' => true
1367
+ );
1368
+
1369
+ $allowed_tags['fieldset'] = array(
1370
+ 'class' => true,
1371
+ 'id' => true,
1372
+ 'type' => true
1373
+ );
1374
+
1375
+ $allowed_tags['link'] = array(
1376
+ 'class' => true,
1377
+ 'id' => true,
1378
+ 'type' => true,
1379
+ 'rel' => true,
1380
+ 'href' => true,
1381
+ 'media' => true
1382
+ );
1383
+
1384
+ $allowed_tags['form'] = array(
1385
+ 'style' => true,
1386
+ 'class' => true,
1387
+ 'id' => true,
1388
+ 'method' => true,
1389
+ 'action' => true,
1390
+ 'data-*' => true
1391
+ );
1392
+
1393
+ $allowed_tags['script'] = array(
1394
+ 'class' => true,
1395
+ 'id' => true,
1396
+ 'type' => true,
1397
+ 'src' => true
1398
+ );
1399
+
1400
+ echo wp_kses($html, $allowed_tags);
1401
+
1402
+ add_filter('safe_style_css', function ($styles) {
1403
+ $styles_wf = array(
1404
+ 'text-align',
1405
+ 'margin',
1406
+ 'color',
1407
+ 'float',
1408
+ 'border',
1409
+ 'background',
1410
+ 'background-color',
1411
+ 'border-bottom',
1412
+ 'border-bottom-color',
1413
+ 'border-bottom-style',
1414
+ 'border-bottom-width',
1415
+ 'border-collapse',
1416
+ 'border-color',
1417
+ 'border-left',
1418
+ 'border-left-color',
1419
+ 'border-left-style',
1420
+ 'border-left-width',
1421
+ 'border-right',
1422
+ 'border-right-color',
1423
+ 'border-right-style',
1424
+ 'border-right-width',
1425
+ 'border-spacing',
1426
+ 'border-style',
1427
+ 'border-top',
1428
+ 'border-top-color',
1429
+ 'border-top-style',
1430
+ 'border-top-width',
1431
+ 'border-width',
1432
+ 'caption-side',
1433
+ 'clear',
1434
+ 'cursor',
1435
+ 'direction',
1436
+ 'font',
1437
+ 'font-family',
1438
+ 'font-size',
1439
+ 'font-style',
1440
+ 'font-variant',
1441
+ 'font-weight',
1442
+ 'height',
1443
+ 'letter-spacing',
1444
+ 'line-height',
1445
+ 'margin-bottom',
1446
+ 'margin-left',
1447
+ 'margin-right',
1448
+ 'margin-top',
1449
+ 'overflow',
1450
+ 'padding',
1451
+ 'padding-bottom',
1452
+ 'padding-left',
1453
+ 'padding-right',
1454
+ 'padding-top',
1455
+ 'text-decoration',
1456
+ 'text-indent',
1457
+ 'vertical-align',
1458
+ 'width'
1459
+ );
1460
+
1461
+ foreach ($styles_wf as $style_wf) {
1462
+ if (($key = array_search($style_wf, $styles)) !== false) {
1463
+ unset($styles[$key]);
1464
+ }
1465
+ }
1466
+ return $styles;
1467
+ });
1468
+ }
1469
+
1470
 
1471
  // sanitizes color code string, leaves # intact
1472
  static function sanitize_hex_color( $color ) {
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: 6.1
8
- Stable tag: 4.22
9
  Requires PHP: 5.2
10
 
11
  Are your Google Maps slow? Try Map Widget for Google Maps. You'll have a fast Google Maps widget with a thumbnail & lightbox map in minutes!
@@ -181,6 +181,10 @@ Try <a href="http://www.niftymaps.co">Nifty Maps</a> - a comprehensive Map Build
181
 
182
  == Changelog ==
183
 
 
 
 
 
184
  = 4.22 =
185
  * 2021/07/18
186
  * added notice for WP 5.8
5
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
6
  Requires at least: 4.0
7
  Tested up to: 6.1
8
+ Stable tag: 4.23
9
  Requires PHP: 5.2
10
 
11
  Are your Google Maps slow? Try Map Widget for Google Maps. You'll have a fast Google Maps widget with a thumbnail & lightbox map in minutes!
181
 
182
  == Changelog ==
183
 
184
+ = 4.23 =
185
+ * 2022/11/26
186
+ * minor security fixes
187
+
188
  = 4.22 =
189
  * 2021/07/18
190
  * added notice for WP 5.8