WP Google Maps - Version 6.2.0

Version Description

  • Liberty Update - 2015-06-24 - Medium Priority =
  • Security enhancements (map editor, marker location, map settings)
  • Weather has been removed (deprecated by Google Maps)
  • Major bug fix (Google Map places bug) - caused the map markers not to show if the map store locator was not enabled
  • Fixed a bug that caused the jQuery error message to display br
Download this release

Release Info

Developer WPGMaps
Plugin Icon 128x128 WP Google Maps
Version 6.2.0
Comparing to
See all releases

Code changes from version 6.1.10 to 6.2.0

readme.txt CHANGED
@@ -38,8 +38,6 @@ The [WP Google Maps Pro Version](http://www.wpgmaps.com/purchase-professional-ve
38
  * Right click to add a marker to your Google map
39
  * No advertising or links
40
  * Google Maps Autocomplete
41
- * Google Maps Weather Layer
42
- * Google Maps Cloud Layer
43
  * Google Maps Transport Layer
44
  * Google Maps Weather Layer
45
  * Set the max zoom level for your map
@@ -176,9 +174,13 @@ Try [Nifty Maps](http://www.niftymaps.co) - Comprehensive Map Builder for all we
176
  4. WP Google Maps Pro version: Add custom markers to your Google map
177
  5. WP Google Maps Lite version: General settings page
178
  6. WP Google Maps Pro version: General settings page
179
- 7. WP Google Maps Pro version: Export/Import your map markers
180
  8. WP Google Maps Pro version: Advanced Google map options.
181
- 9. WP Google Maps Pro version: Responsive carousel map marker listing
 
 
 
 
182
 
183
  == Upgrade Notice ==
184
 
@@ -193,6 +195,12 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
196
  = 6.1.10 - 2015-06-10 - High priority =
197
  * XSS security patch
198
  * Security enhancements
38
  * Right click to add a marker to your Google map
39
  * No advertising or links
40
  * Google Maps Autocomplete
 
 
41
  * Google Maps Transport Layer
42
  * Google Maps Weather Layer
43
  * Set the max zoom level for your map
174
  4. WP Google Maps Pro version: Add custom markers to your Google map
175
  5. WP Google Maps Lite version: General settings page
176
  6. WP Google Maps Pro version: General settings page
177
+ 7. WP Google Maps Pro version: InfoWindow settings page
178
  8. WP Google Maps Pro version: Advanced Google map options.
179
+ 9. WP Google Maps Pro version: Map marker listing options
180
+ 10. WP Google Maps Pro version: Export/Import your map markers
181
+ 11. WP Google Maps Pro version: Responsive carousel map marker listing
182
+ 12. WP Google Maps Lite version: Store Locator Settings
183
+ 13. WP Google Maps Lite version: Store Locator Map
184
 
185
  == Upgrade Notice ==
186
 
195
 
196
  == Changelog ==
197
 
198
+ = 6.2.0 - Liberty Update - 2015-06-24 - Medium Priority =
199
+ * Security enhancements (map editor, marker location, map settings)
200
+ * Weather has been removed (deprecated by Google Maps)
201
+ * Major bug fix (Google Map places bug) - caused the map markers not to show if the map store locator was not enabled
202
+ * Fixed a bug that caused the jQuery error message to display br
203
+
204
  = 6.1.10 - 2015-06-10 - High priority =
205
  * XSS security patch
206
  * Security enhancements
screenshot-1.jpg CHANGED
Binary file
screenshot-10.jpg ADDED
Binary file
screenshot-11.jpg ADDED
Binary file
screenshot-12.jpg ADDED
Binary file
screenshot-13.jpg ADDED
Binary file
screenshot-4.jpg CHANGED
Binary file
screenshot-5.jpg CHANGED
Binary file
screenshot-6.jpg CHANGED
Binary file
screenshot-7.jpg CHANGED
Binary file
screenshot-8.jpg CHANGED
Binary file
screenshot-9.jpg CHANGED
Binary file
wpGoogleMaps.php CHANGED
@@ -3,12 +3,18 @@
3
  Plugin Name: WP Google Maps
4
  Plugin URI: http://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
- Version: 6.1.10
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  */
10
 
11
- /*
 
 
 
 
 
 
12
  * 6.1.10 - 2015-06-10 - High priority
13
  * XSS security patch
14
  * Security enhancements
@@ -163,8 +169,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
163
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
164
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
165
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
166
- $wpgmza_version = "6.1.10";
167
- $wpgmza_p_version = "6.1.10";
168
  $wpgmza_t = "basic";
169
  define("WPGMAPS", $wpgmza_version);
170
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -521,7 +527,7 @@ function wpgmaps_reload_map_on_post() {
521
  }
522
  function wpgmaps_get_marker_url($mapid = false) {
523
  if (!$mapid) {
524
- $mapid = $_POST['map_id'];
525
  }
526
  if (!$mapid) {
527
  $mapid = sanitize_text_field($_GET['map_id']);
@@ -670,9 +676,13 @@ function wpgmaps_admin_javascript_basic() {
670
  $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
671
 
672
  $map_other_settings = maybe_unserialize($res->other_settings);
 
 
 
673
  if (isset($map_other_settings['weather_layer'])) { $weather_layer = $map_other_settings['weather_layer']; } else { $weather_layer = 0; }
674
  if (isset($map_other_settings['weather_layer_temp_type'])) { $weather_layer_temp_type = $map_other_settings['weather_layer_temp_type']; } else { $weather_layer_temp_type = 0; }
675
  if (isset($map_other_settings['cloud_layer'])) { $cloud_layer = $map_other_settings['cloud_layer']; } else { $cloud_layer = 0; }
 
676
  if (isset($map_other_settings['transport_layer'])) { $transport_layer = $map_other_settings['transport_layer']; } else { $transport_layer = 0; }
677
 
678
 
@@ -730,23 +740,13 @@ function wpgmaps_admin_javascript_basic() {
730
 
731
  ?>
732
 
733
- <?php
734
-
735
- if ($cloud_layer == 1 || $weather_layer == 1) { ?>
736
-
737
- <script type="text/javascript">
738
- var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
739
- document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=weather,places' type='text/javascript'%3E%3C/script%3E"));
740
- </script>
741
-
742
- <?php } else { ?>
743
 
744
  <script type="text/javascript">
745
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
746
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=places' type='text/javascript'%3E%3C/script%3E"));
747
  </script>
748
 
749
- <?php } ?>
750
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
751
 
752
  <link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
@@ -779,16 +779,17 @@ function wpgmaps_admin_javascript_basic() {
779
 
780
  jQuery(document).ready(function(){
781
 
782
- /* initialize the autocomplete form */
783
- autocomplete = new google.maps.places.Autocomplete(
784
- /** @type {HTMLInputElement} */(document.getElementById('wpgmza_add_address')),
785
- { types: ['geocode'] });
786
- // When the user selects an address from the dropdown,
787
- // populate the address fields in the form.
788
- google.maps.event.addListener(autocomplete, 'place_changed', function() {
789
- fillInAddress();
790
- });
791
-
 
792
  wpgmzaTable = jQuery('#wpgmza_table').dataTable({
793
  "bProcessing": true,
794
  "aaSorting": [[ 0, "desc" ]]
@@ -1296,24 +1297,7 @@ function wpgmaps_admin_javascript_basic() {
1296
  var trafficLayer = new google.maps.TrafficLayer();
1297
  trafficLayer.setMap(MYMAP.map);
1298
  <?php } ?>
1299
- <?php if ($weather_layer == 1) { ?>
1300
- <?php if($weather_layer_temp_type == 2) { ?>
1301
- var weatherLayer = new google.maps.weather.WeatherLayer({
1302
- temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT
1303
- });
1304
- weatherLayer.setMap(MYMAP.map);
1305
- <?php } else { ?>
1306
- var weatherLayer = new google.maps.weather.WeatherLayer({
1307
- temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS
1308
- });
1309
- weatherLayer.setMap(MYMAP.map);
1310
-
1311
- <?php } ?>
1312
- <?php } ?>
1313
- <?php if ($cloud_layer == 1) { ?>
1314
- var cloudLayer = new google.maps.weather.CloudLayer();
1315
- cloudLayer.setMap(MYMAP.map);
1316
- <?php } ?>
1317
  <?php if ($transport_layer == 1) { ?>
1318
  var transitLayer = new google.maps.TransitLayer();
1319
  transitLayer.setMap(MYMAP.map);
@@ -1515,11 +1499,15 @@ function wpgmaps_user_javascript_basic() {
1515
  }
1516
 
1517
  $map_other_settings = maybe_unserialize($res->other_settings);
 
 
 
1518
  if (isset($map_other_settings['weather_layer'])) { $weather_layer = $map_other_settings['weather_layer']; } else { $weather_layer = false; }
1519
  if (isset($map_other_settings['weather_layer_temp_type'])) { $weather_layer_temp_type = $map_other_settings['weather_layer_temp_type']; } else { $weather_layer_temp_type = false; }
1520
  if (isset($map_other_settings['cloud_layer'])) { $cloud_layer = $map_other_settings['cloud_layer']; } else { $cloud_layer = false; }
 
 
1521
  if (isset($map_other_settings['transport_layer'])) { $transport_layer = $map_other_settings['transport_layer']; } else { $transport_layer = false; }
1522
-
1523
  if (isset($map_other_settings['store_locator_bounce'])) { $store_locator_bounce = $map_other_settings['store_locator_bounce']; } else { $store_locator_bounce = 1; }
1524
 
1525
  $wpgmza_lat = $res->map_start_lat;
@@ -1560,24 +1548,10 @@ function wpgmaps_user_javascript_basic() {
1560
  ?>
1561
 
1562
 
1563
- <?php
1564
-
1565
- if ($cloud_layer == 1 || $weather_layer == 1) { ?>
1566
-
1567
- <script type="text/javascript">
1568
- var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1569
- document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=weather,places' type='text/javascript'%3E%3C/script%3E"));
1570
- </script>
1571
-
1572
- <?php } else { ?>
1573
-
1574
  <script type="text/javascript">
1575
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1576
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=places' type='text/javascript'%3E%3C/script%3E"));
1577
  </script>
1578
-
1579
- <?php } ?>
1580
-
1581
 
1582
  <script type="text/javascript" >
1583
  var marker_pull = '<?php echo $marker_pull; ?>';
@@ -1594,7 +1568,9 @@ function wpgmaps_user_javascript_basic() {
1594
 
1595
  jQuery(document).ready(function(){
1596
  if (/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)) {
1597
- document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
 
 
1598
  } else {
1599
 
1600
  jQuery("#wpgmza_map").css({
@@ -1752,24 +1728,6 @@ function wpgmaps_user_javascript_basic() {
1752
  var trafficLayer = new google.maps.TrafficLayer();
1753
  trafficLayer.setMap(this.map);
1754
  <?php } ?>
1755
- <?php if (isset($weather_layer) && $weather_layer == 1) { ?>
1756
- <?php if($weather_layer_temp_type == 2) { ?>
1757
- var weatherLayer = new google.maps.weather.WeatherLayer({
1758
- temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT
1759
- });
1760
- weatherLayer.setMap(MYMAP.map);
1761
- <?php } else { ?>
1762
- var weatherLayer = new google.maps.weather.WeatherLayer({
1763
- temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS
1764
- });
1765
- weatherLayer.setMap(MYMAP.map);
1766
-
1767
- <?php } ?>
1768
- <?php } ?>
1769
- <?php if (isset($cloud_layer) && $cloud_layer == 1) { ?>
1770
- var cloudLayer = new google.maps.weather.CloudLayer();
1771
- cloudLayer.setMap(MYMAP.map);
1772
- <?php } ?>
1773
  <?php if (isset($transport_layer) && $transport_layer == 1) { ?>
1774
  var transitLayer = new google.maps.TransitLayer();
1775
  transitLayer.setMap(MYMAP.map);
@@ -2093,18 +2051,18 @@ function wpgmaps_user_javascript_basic() {
2093
  // Get the place details from the autocomplete object.
2094
  var place = autocomplete.getPlace();
2095
  }
2096
-
2097
-
2098
-
2099
- /* initialize the autocomplete form */
2100
- autocomplete = new google.maps.places.Autocomplete(
2101
  /** @type {HTMLInputElement} */(document.getElementById('addressInput')),
2102
  { types: ['geocode'] });
2103
- // When the user selects an address from the dropdown,
2104
- // populate the address fields in the form.
2105
- google.maps.event.addListener(autocomplete, 'place_changed', function() {
2106
  fillInAddress();
2107
- });
 
2108
 
2109
 
2110
  function searchLocations(map_id) {
@@ -2198,7 +2156,7 @@ function wpgmaps_update_xml_file($mapid = false) {
2198
 
2199
 
2200
  if (!$mapid) {
2201
- $mapid = $_POST['map_id'];
2202
  }
2203
  if (!$mapid) {
2204
  $mapid = sanitize_text_field($_GET['map_id']);
@@ -2606,8 +2564,8 @@ function wpgmaps_action_callback_basic() {
2606
  if ($check == 1) {
2607
 
2608
  if ($_POST['action'] == "add_marker") {
2609
- $rows_affected = $wpdb->insert( $table_name, array( 'map_id' => $_POST['map_id'], 'address' => sanitize_text_field($_POST['address']), 'lat' => $_POST['lat'], 'lng' => $_POST['lng'], 'infoopen' => $_POST['infoopen'], 'description' => '', 'title' => '', 'anim' => $_POST['anim'], 'link' => '', 'icon' => '', 'pic' => '', 'infoopen' => $_POST['infoopen'], 'retina' => '0' ) );
2610
- $wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
2611
  if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
2612
  $return_a = array(
2613
  "marker_id" => $wpdb->insert_id,
@@ -2617,9 +2575,9 @@ function wpgmaps_action_callback_basic() {
2617
  echo json_encode($return_a);
2618
  }
2619
  if ($_POST['action'] == "edit_marker") {
2620
- $cur_id = $_POST['edit_id'];
2621
- $rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET address = %s, lat = %f, lng = %f, anim = %d, infoopen = %d WHERE id = %d", sanitize_text_field($_POST['address']), $_POST['lat'], $_POST['lng'], $_POST['anim'], $_POST['infoopen'], $cur_id) );
2622
- $wpgmza_check = wpgmaps_update_xml_file($_POST['map_id']);
2623
  if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
2624
  $return_a = array(
2625
  "marker_id" => $cur_id,
@@ -2630,7 +2588,7 @@ function wpgmaps_action_callback_basic() {
2630
 
2631
  }
2632
  if ($_POST['action'] == "delete_marker") {
2633
- $marker_id = $_POST['marker_id'];
2634
  $wpdb->query(
2635
  "
2636
  DELETE FROM $wpgmza_tblname
@@ -2896,6 +2854,7 @@ function wpgmaps_head() {
2896
  $traffic_enabled = intval($_POST['wpgmza_traffic']);
2897
 
2898
  $map_max_zoom = intval($_POST['wpgmza_max_zoom']);
 
2899
 
2900
  $gps = explode(",",$map_start_location);
2901
  $map_start_lat = $gps[0];
@@ -2910,11 +2869,12 @@ function wpgmaps_head() {
2910
 
2911
 
2912
  $other_settings['map_max_zoom'] = sanitize_text_field($map_max_zoom);
2913
-
2914
-
2915
  $other_settings['weather_layer'] = intval($_POST['wpgmza_weather']);
2916
  $other_settings['weather_layer_temp_type'] = intval($_POST['wpgmza_weather_temp_type']);
2917
  $other_settings['cloud_layer'] = intval($_POST['wpgmza_cloud']);
 
2918
  $other_settings['transport_layer'] = intval($_POST['wpgmza_transport']);
2919
 
2920
  $other_settings_data = maybe_serialize($other_settings);
@@ -4242,16 +4202,17 @@ function wpgmza_basic_menu() {
4242
  if (isset($other_settings_data['store_locator_query_string'])) { $wpgmza_store_locator_query_string = stripslashes($other_settings_data['store_locator_query_string']); } else { $wpgmza_store_locator_query_string = __("ZIP / Address:","wp-google-maps"); }
4243
  if (isset($other_settings_data['wpgmza_store_locator_restrict'])) { $wpgmza_store_locator_restrict = $other_settings_data['wpgmza_store_locator_restrict']; } else { $wpgmza_store_locator_restrict = ""; }
4244
 
 
4245
  if (isset($other_settings_data['weather_layer'])) { $wpgmza_weather_option = $other_settings_data['weather_layer']; } else { $wpgmza_weather_option = 2; }
4246
  if (isset($other_settings_data['weather_layer_temp_type'])) { $wpgmza_weather_option_temp_type = $other_settings_data['weather_layer_temp_type']; } else { $wpgmza_weather_option_temp_type = 1; }
4247
  if (isset($other_settings_data['cloud_layer'])) { $wpgmza_cloud_option = $other_settings_data['cloud_layer']; } else { $wpgmza_cloud_option = 2; }
 
4248
  if (isset($other_settings_data['transport_layer'])) { $wpgmza_transport_option = $other_settings_data['transport_layer']; } else { $wpgmza_transport_option = 2; }
4249
 
4250
- if (isset($other_settings_data['map_max_zoom'])) { $wpgmza_max_zoom[intval($other_settings_data['map_max_zoom'])] = "SELECTED"; } else { $wpgmza_max_zoom[3] = "SELECTED"; }
4251
 
4252
 
4253
  if (isset($res->map_start_zoom)) { $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED"; } else { $wpgmza_zoom[8] = "SELECTED"; }
4254
- if (isset($res->map_max_zoom)) { $wpgmza_max_zoom[intval($res->map_max_zoom)] = "SELECTED"; } else { $wpgmza_max_zoom[3] = "SELECTED"; }
4255
  if (isset($res->type)) { $wpgmza_map_type[intval($res->type)] = "SELECTED"; } else { $wpgmza_map_type[1] = "SELECTED"; }
4256
  if (isset($res->alignment)) { $wpgmza_map_align[intval($res->alignment)] = "SELECTED"; } else { $wpgmza_map_align[1] = "SELECTED"; }
4257
  if (isset($res->bicycle)) { $wpgmza_bicycle[intval($res->bicycle)] = "SELECTED"; } else { $wpgmza_bicycle[2] = "SELECTED"; }
@@ -4304,20 +4265,19 @@ function wpgmza_basic_menu() {
4304
  $wpgmza_store_locator_bounce_checked[1] = 'selected';
4305
  }
4306
 
4307
-
4308
  $wpgmza_weather_layer_checked[0] = '';
4309
  $wpgmza_weather_layer_checked[1] = '';
4310
-
4311
  $wpgmza_weather_layer_temp_type_checked[0] = '';
4312
  $wpgmza_weather_layer_temp_type_checked[1] = '';
4313
-
4314
-
4315
  $wpgmza_cloud_layer_checked[0] = '';
4316
  $wpgmza_cloud_layer_checked[1] = '';
 
4317
  $wpgmza_transport_layer_checked[0] = '';
4318
  $wpgmza_transport_layer_checked[1] = '';
4319
 
4320
-
 
4321
  if ($wpgmza_weather_option == 1) {
4322
  $wpgmza_weather_layer_checked[0] = 'selected';
4323
  } else {
@@ -4333,6 +4293,7 @@ function wpgmza_basic_menu() {
4333
  } else {
4334
  $wpgmza_cloud_layer_checked[1] = 'selected';
4335
  }
 
4336
  if ($wpgmza_transport_option == 1) {
4337
  $wpgmza_transport_layer_checked[0] = 'selected';
4338
  } else {
@@ -4584,27 +4545,7 @@ function wpgmza_basic_menu() {
4584
  <option value=\"2\" ".$wpgmza_traffic[2].">".__("No","wp-google-maps")."</option>
4585
  </select></td>
4586
  </tr>
4587
- <tr>
4588
- <td width='320'>".__("Enable Weather Layer?","wp-google-maps").":</td>
4589
- <td>
4590
- <select id='wpgmza_weather' name='wpgmza_weather' class='postform'>
4591
- <option value=\"1\" ".$wpgmza_weather_layer_checked[0].">".__("Yes","wp-google-maps")."</option>
4592
- <option value=\"2\" ".$wpgmza_weather_layer_checked[1].">".__("No","wp-google-maps")."</option>
4593
- </select>
4594
- <select id='wpgmza_weather_temp_type' name='wpgmza_weather_temp_type' class='postform'>
4595
- <option value=\"1\" ".$wpgmza_weather_layer_temp_type_checked[0].">".__("Show in Degrees Celsius","wp-google-maps")."</option>
4596
- <option value=\"2\" ".$wpgmza_weather_layer_temp_type_checked[1].">".__("Show in Degrees Fahrenheit","wp-google-maps")."</option>
4597
- </select>
4598
- </td>
4599
- </tr>
4600
- <tr>
4601
- <td width='320'>".__("Enable Cloud Layer?","wp-google-maps").":</td>
4602
- <td><select id='wpgmza_cloud' name='wpgmza_cloud' class='postform'>
4603
- <option value=\"1\" ".$wpgmza_cloud_layer_checked[0].">".__("Yes","wp-google-maps")."</option>
4604
- <option value=\"2\" ".$wpgmza_cloud_layer_checked[1].">".__("No","wp-google-maps")."</option>
4605
- </select>
4606
- </td>
4607
- </tr>
4608
  <tr>
4609
  <td width='320'>".__("Enable Public Transport Layer?","wp-google-maps").":</td>
4610
  <td><select id='wpgmza_transport' name='wpgmza_transport' class='postform'>
3
  Plugin Name: WP Google Maps
4
  Plugin URI: http://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
+ Version: 6.2.0
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  */
10
 
11
+ /* 6.2.0 - Liberty Update - 2015-06-24 - Medium Priority
12
+ * Security enhancements (map editor, marker location, map settings)
13
+ * Weather has been removed (deprecated by Google Maps)
14
+ * Major bug fix (Google Map places bug) - caused the map markers not to show if the map store locator was not enabled
15
+ * Fixed a bug that caused the jQuery error message to display briefly before the map loaded
16
+ * Fixed a bug that caused the max map zoom to default back to 3
17
+ *
18
  * 6.1.10 - 2015-06-10 - High priority
19
  * XSS security patch
20
  * Security enhancements
169
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
170
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
171
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
172
+ $wpgmza_version = "6.2.0";
173
+ $wpgmza_p_version = "6.2.0";
174
  $wpgmza_t = "basic";
175
  define("WPGMAPS", $wpgmza_version);
176
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
527
  }
528
  function wpgmaps_get_marker_url($mapid = false) {
529
  if (!$mapid) {
530
+ $mapid = sanitize_text_field($_POST['map_id']);
531
  }
532
  if (!$mapid) {
533
  $mapid = sanitize_text_field($_GET['map_id']);
676
  $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
677
 
678
  $map_other_settings = maybe_unserialize($res->other_settings);
679
+ /*
680
+ * deprecated in 6.2.0
681
+ *
682
  if (isset($map_other_settings['weather_layer'])) { $weather_layer = $map_other_settings['weather_layer']; } else { $weather_layer = 0; }
683
  if (isset($map_other_settings['weather_layer_temp_type'])) { $weather_layer_temp_type = $map_other_settings['weather_layer_temp_type']; } else { $weather_layer_temp_type = 0; }
684
  if (isset($map_other_settings['cloud_layer'])) { $cloud_layer = $map_other_settings['cloud_layer']; } else { $cloud_layer = 0; }
685
+ */
686
  if (isset($map_other_settings['transport_layer'])) { $transport_layer = $map_other_settings['transport_layer']; } else { $transport_layer = 0; }
687
 
688
 
740
 
741
  ?>
742
 
 
 
 
 
 
 
 
 
 
 
743
 
744
  <script type="text/javascript">
745
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
746
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=places' type='text/javascript'%3E%3C/script%3E"));
747
  </script>
748
 
749
+
750
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
751
 
752
  <link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
779
 
780
  jQuery(document).ready(function(){
781
 
782
+ if (typeof document.getElementById('wpgmza_add_address') !== "undefined") {
783
+ /* initialize the autocomplete form */
784
+ autocomplete = new google.maps.places.Autocomplete(
785
+ /** @type {HTMLInputElement} */(document.getElementById('wpgmza_add_address')),
786
+ { types: ['geocode'] });
787
+ // When the user selects an address from the dropdown,
788
+ // populate the address fields in the form.
789
+ google.maps.event.addListener(autocomplete, 'place_changed', function() {
790
+ fillInAddress();
791
+ });
792
+ }
793
  wpgmzaTable = jQuery('#wpgmza_table').dataTable({
794
  "bProcessing": true,
795
  "aaSorting": [[ 0, "desc" ]]
1297
  var trafficLayer = new google.maps.TrafficLayer();
1298
  trafficLayer.setMap(MYMAP.map);
1299
  <?php } ?>
1300
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1301
  <?php if ($transport_layer == 1) { ?>
1302
  var transitLayer = new google.maps.TransitLayer();
1303
  transitLayer.setMap(MYMAP.map);
1499
  }
1500
 
1501
  $map_other_settings = maybe_unserialize($res->other_settings);
1502
+ /*
1503
+ * deprecated in 6.2.0
1504
+
1505
  if (isset($map_other_settings['weather_layer'])) { $weather_layer = $map_other_settings['weather_layer']; } else { $weather_layer = false; }
1506
  if (isset($map_other_settings['weather_layer_temp_type'])) { $weather_layer_temp_type = $map_other_settings['weather_layer_temp_type']; } else { $weather_layer_temp_type = false; }
1507
  if (isset($map_other_settings['cloud_layer'])) { $cloud_layer = $map_other_settings['cloud_layer']; } else { $cloud_layer = false; }
1508
+ */
1509
+
1510
  if (isset($map_other_settings['transport_layer'])) { $transport_layer = $map_other_settings['transport_layer']; } else { $transport_layer = false; }
 
1511
  if (isset($map_other_settings['store_locator_bounce'])) { $store_locator_bounce = $map_other_settings['store_locator_bounce']; } else { $store_locator_bounce = 1; }
1512
 
1513
  $wpgmza_lat = $res->map_start_lat;
1548
  ?>
1549
 
1550
 
 
 
 
 
 
 
 
 
 
 
 
1551
  <script type="text/javascript">
1552
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1553
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>sensor=false&libraries=places' type='text/javascript'%3E%3C/script%3E"));
1554
  </script>
 
 
 
1555
 
1556
  <script type="text/javascript" >
1557
  var marker_pull = '<?php echo $marker_pull; ?>';
1568
 
1569
  jQuery(document).ready(function(){
1570
  if (/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)) {
1571
+ setTimeout(function(){
1572
+ document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
1573
+ }, 3000);
1574
  } else {
1575
 
1576
  jQuery("#wpgmza_map").css({
1728
  var trafficLayer = new google.maps.TrafficLayer();
1729
  trafficLayer.setMap(this.map);
1730
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1731
  <?php if (isset($transport_layer) && $transport_layer == 1) { ?>
1732
  var transitLayer = new google.maps.TransitLayer();
1733
  transitLayer.setMap(MYMAP.map);
2051
  // Get the place details from the autocomplete object.
2052
  var place = autocomplete.getPlace();
2053
  }
2054
+ var elementExists = document.getElementById("addressInput");
2055
+ if (elementExists !== null) {
2056
+ /* initialize the autocomplete form */
2057
+ autocomplete = new google.maps.places.Autocomplete(
 
2058
  /** @type {HTMLInputElement} */(document.getElementById('addressInput')),
2059
  { types: ['geocode'] });
2060
+ // When the user selects an address from the dropdown,
2061
+ // populate the address fields in the form.
2062
+ google.maps.event.addListener(autocomplete, 'place_changed', function() {
2063
  fillInAddress();
2064
+ });
2065
+ }
2066
 
2067
 
2068
  function searchLocations(map_id) {
2156
 
2157
 
2158
  if (!$mapid) {
2159
+ $mapid = sanitize_text_field($_POST['map_id']);
2160
  }
2161
  if (!$mapid) {
2162
  $mapid = sanitize_text_field($_GET['map_id']);
2564
  if ($check == 1) {
2565
 
2566
  if ($_POST['action'] == "add_marker") {
2567
+ $rows_affected = $wpdb->insert( $table_name, array( 'map_id' => sanitize_text_field($_POST['map_id']), 'address' => sanitize_text_field($_POST['address']), 'lat' => sanitize_text_field($_POST['lat']), 'lng' => sanitize_text_field($_POST['lng']), 'infoopen' => $_POST['infoopen'], 'description' => '', 'title' => '', 'anim' => sanitize_text_field($_POST['anim']), 'link' => '', 'icon' => '', 'pic' => '', 'infoopen' => sanitize_text_field($_POST['infoopen']), 'retina' => '0' ) );
2568
+ $wpgmza_check = wpgmaps_update_xml_file(sanitize_text_field($_POST['map_id']));
2569
  if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
2570
  $return_a = array(
2571
  "marker_id" => $wpdb->insert_id,
2575
  echo json_encode($return_a);
2576
  }
2577
  if ($_POST['action'] == "edit_marker") {
2578
+ $cur_id = sanitize_text_field($_POST['edit_id']);
2579
+ $rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET address = %s, lat = %f, lng = %f, anim = %d, infoopen = %d WHERE id = %d", sanitize_text_field($_POST['address']), sanitize_text_field($_POST['lat']), sanitize_text_field($_POST['lng']), sanitize_text_field($_POST['anim']), sanitize_text_field($_POST['infoopen']), $cur_id) );
2580
+ $wpgmza_check = wpgmaps_update_xml_file(sanitize_text_field($_POST['map_id']));
2581
  if ( is_wp_error($wpgmza_check) ) wpgmza_return_error($wpgmza_check);
2582
  $return_a = array(
2583
  "marker_id" => $cur_id,
2588
 
2589
  }
2590
  if ($_POST['action'] == "delete_marker") {
2591
+ $marker_id = sanitize_text_field($_POST['marker_id']);
2592
  $wpdb->query(
2593
  "
2594
  DELETE FROM $wpgmza_tblname
2854
  $traffic_enabled = intval($_POST['wpgmza_traffic']);
2855
 
2856
  $map_max_zoom = intval($_POST['wpgmza_max_zoom']);
2857
+
2858
 
2859
  $gps = explode(",",$map_start_location);
2860
  $map_start_lat = $gps[0];
2869
 
2870
 
2871
  $other_settings['map_max_zoom'] = sanitize_text_field($map_max_zoom);
2872
+ /* deprecated in 6.2.0
2873
+
2874
  $other_settings['weather_layer'] = intval($_POST['wpgmza_weather']);
2875
  $other_settings['weather_layer_temp_type'] = intval($_POST['wpgmza_weather_temp_type']);
2876
  $other_settings['cloud_layer'] = intval($_POST['wpgmza_cloud']);
2877
+ */
2878
  $other_settings['transport_layer'] = intval($_POST['wpgmza_transport']);
2879
 
2880
  $other_settings_data = maybe_serialize($other_settings);
4202
  if (isset($other_settings_data['store_locator_query_string'])) { $wpgmza_store_locator_query_string = stripslashes($other_settings_data['store_locator_query_string']); } else { $wpgmza_store_locator_query_string = __("ZIP / Address:","wp-google-maps"); }
4203
  if (isset($other_settings_data['wpgmza_store_locator_restrict'])) { $wpgmza_store_locator_restrict = $other_settings_data['wpgmza_store_locator_restrict']; } else { $wpgmza_store_locator_restrict = ""; }
4204
 
4205
+ /* deprecated in 6.2.0
4206
  if (isset($other_settings_data['weather_layer'])) { $wpgmza_weather_option = $other_settings_data['weather_layer']; } else { $wpgmza_weather_option = 2; }
4207
  if (isset($other_settings_data['weather_layer_temp_type'])) { $wpgmza_weather_option_temp_type = $other_settings_data['weather_layer_temp_type']; } else { $wpgmza_weather_option_temp_type = 1; }
4208
  if (isset($other_settings_data['cloud_layer'])) { $wpgmza_cloud_option = $other_settings_data['cloud_layer']; } else { $wpgmza_cloud_option = 2; }
4209
+ */
4210
  if (isset($other_settings_data['transport_layer'])) { $wpgmza_transport_option = $other_settings_data['transport_layer']; } else { $wpgmza_transport_option = 2; }
4211
 
4212
+ if (isset($other_settings_data['map_max_zoom'])) { $wpgmza_max_zoom[intval($other_settings_data['map_max_zoom'])] = "SELECTED"; } else { $wpgmza_max_zoom[1] = "SELECTED"; }
4213
 
4214
 
4215
  if (isset($res->map_start_zoom)) { $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED"; } else { $wpgmza_zoom[8] = "SELECTED"; }
 
4216
  if (isset($res->type)) { $wpgmza_map_type[intval($res->type)] = "SELECTED"; } else { $wpgmza_map_type[1] = "SELECTED"; }
4217
  if (isset($res->alignment)) { $wpgmza_map_align[intval($res->alignment)] = "SELECTED"; } else { $wpgmza_map_align[1] = "SELECTED"; }
4218
  if (isset($res->bicycle)) { $wpgmza_bicycle[intval($res->bicycle)] = "SELECTED"; } else { $wpgmza_bicycle[2] = "SELECTED"; }
4265
  $wpgmza_store_locator_bounce_checked[1] = 'selected';
4266
  }
4267
 
4268
+ /*
4269
  $wpgmza_weather_layer_checked[0] = '';
4270
  $wpgmza_weather_layer_checked[1] = '';
 
4271
  $wpgmza_weather_layer_temp_type_checked[0] = '';
4272
  $wpgmza_weather_layer_temp_type_checked[1] = '';
 
 
4273
  $wpgmza_cloud_layer_checked[0] = '';
4274
  $wpgmza_cloud_layer_checked[1] = '';
4275
+ */
4276
  $wpgmza_transport_layer_checked[0] = '';
4277
  $wpgmza_transport_layer_checked[1] = '';
4278
 
4279
+
4280
+ /*
4281
  if ($wpgmza_weather_option == 1) {
4282
  $wpgmza_weather_layer_checked[0] = 'selected';
4283
  } else {
4293
  } else {
4294
  $wpgmza_cloud_layer_checked[1] = 'selected';
4295
  }
4296
+ */
4297
  if ($wpgmza_transport_option == 1) {
4298
  $wpgmza_transport_layer_checked[0] = 'selected';
4299
  } else {
4545
  <option value=\"2\" ".$wpgmza_traffic[2].">".__("No","wp-google-maps")."</option>
4546
  </select></td>
4547
  </tr>
4548
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4549
  <tr>
4550
  <td width='320'>".__("Enable Public Transport Layer?","wp-google-maps").":</td>
4551
  <td><select id='wpgmza_transport' name='wpgmza_transport' class='postform'>