WP Google Maps - Version 6.3.13

Version Description

  • 2016-07-07 - Medium priority =
  • Revised Maps API Dequeue Script Added
  • Remove Style dequeue script as this was causing UI conflicts
  • Added option to disable Maps API from being loaded on front end
Download this release

Release Info

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

Code changes from version 6.3.12 to 6.3.13

Files changed (2) hide show
  1. readme.txt +6 -1
  2. wpGoogleMaps.php +50 -28
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
=== WP Google Maps ===
2
- Contributors: WPGMaps, NickDuncan, CodeCabin_, Jarryd Long
3
Donate link: http://www.wpgmaps.com
4
Tags: google maps, maps, map, map markers, google, google map, google maps plugin, wp maps, wp google maps, wp google map, easy map, store locator, map plugin, directions, map directions, google map plugin, routes, polygons, polylines, streetview, location, marker, latitude, longitude, map widget, map themes
5
Requires at least: 3.5
@@ -207,6 +207,11 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
207
208
== Changelog ==
209
210
= 6.3.12 - 2016-06-27 - Medium priority =
211
* Modified the API key notification to make it simpler and more intuitive
212
1
=== WP Google Maps ===
2
+ Contributors: WPGMaps, NickDuncan, CodeCabin_, Jarryd Long, DylanAuty
3
Donate link: http://www.wpgmaps.com
4
Tags: google maps, maps, map, map markers, google, google map, google maps plugin, wp maps, wp google maps, wp google map, easy map, store locator, map plugin, directions, map directions, google map plugin, routes, polygons, polylines, streetview, location, marker, latitude, longitude, map widget, map themes
5
Requires at least: 3.5
207
208
== Changelog ==
209
210
+ = 6.3.13 - 2016-07-07 - Medium priority =
211
+ * Revised Maps API Dequeue Script Added
212
+ * Remove Style dequeue script as this was causing UI conflicts
213
+ * Added option to disable Maps API from being loaded on front end
214
+
215
= 6.3.12 - 2016-06-27 - Medium priority =
216
* Modified the API key notification to make it simpler and more intuitive
217
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
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.3.12
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
Text Domain: wp-google-maps
@@ -11,6 +11,11 @@ Domain Path: /languages
11
*/
12
13
/*
14
* 6.3.12 - 2016-06-27 - Medium priority
15
* Modified the API key notification to make it simpler and more intuitive
16
*
@@ -241,8 +246,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
241
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
242
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
243
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
244
- $wpgmza_version = "6.3.12";
245
- $wpgmza_p_version = "6.3.12";
246
$wpgmza_t = "basic";
247
define("WPGMAPS", $wpgmza_version);
248
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -1671,7 +1676,8 @@ function wpgmaps_user_javascript_basic() {
1671
}
1672
?>
1673
1674
- <?php if( get_option( 'wpgmza_google_maps_api_key' ) ){ ?>
1675
<script type="text/javascript">
1676
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1677
var wpgmza_api_key = '<?php echo get_option( 'wpgmza_google_maps_api_key' ); ?>';
@@ -1682,7 +1688,8 @@ function wpgmaps_user_javascript_basic() {
1682
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1683
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>&libraries=places' type='text/javascript'%3E%3C/script%3E"));
1684
</script>
1685
- <?php } ?>
1686
<script type="text/javascript" >
1687
var marker_pull = '<?php echo $marker_pull; ?>';
1688
<?php if (isset($markers) && strlen($markers) > 0 && $markers != "[]"){ ?>var db_marker_array = JSON.stringify(<?php echo $markers; ?>);<?php } else { echo "var db_marker_array = '';"; } ?>
@@ -2285,8 +2292,7 @@ function wpgmaps_user_javascript_basic() {
2285
2286
// user autofill
2287
if (elementExists !== null) {
2288
- <?php if (!$restrict_search) { ?>
2289
- console.log('not restricting');
2290
/* initialize the autocomplete form */
2291
autocomplete = new google.maps.places.Autocomplete(
2292
/** @type {HTMLInputElement} */(document.getElementById('addressInput')),
@@ -2297,8 +2303,7 @@ function wpgmaps_user_javascript_basic() {
2297
fillInAddress();
2298
});
2299
<?php } else { ?>
2300
- /* initialize the autocomplete form */
2301
- console.log('restricting');
2302
autocomplete = new google.maps.places.Autocomplete(
2303
/** @type {HTMLInputElement} */(document.getElementById('addressInput')),
2304
{ types: ['geocode'], componentRestrictions: {country: '<?php echo $restrict_search; ?>'} });
@@ -3438,6 +3443,8 @@ function wpgmaps_head() {
3438
if (isset($_POST['wpgmza_settings_map_pan'])) { $wpgmza_data['wpgmza_settings_map_pan'] = sanitize_text_field($_POST['wpgmza_settings_map_pan']); }
3439
if (isset($_POST['wpgmza_settings_map_type'])) { $wpgmza_data['wpgmza_settings_map_type'] = sanitize_text_field($_POST['wpgmza_settings_map_type']); }
3440
if (isset($_POST['wpgmza_settings_force_jquery'])) { $wpgmza_data['wpgmza_settings_force_jquery'] = sanitize_text_field($_POST['wpgmza_settings_force_jquery']); }
3441
if (isset($_POST['wpgmza_settings_map_scroll'])) { $wpgmza_data['wpgmza_settings_map_scroll'] = sanitize_text_field($_POST['wpgmza_settings_map_scroll']); }
3442
if (isset($_POST['wpgmza_settings_map_draggable'])) { $wpgmza_data['wpgmza_settings_map_draggable'] = sanitize_text_field($_POST['wpgmza_settings_map_draggable']); }
3443
if (isset($_POST['wpgmza_settings_map_clickzoom'])) { $wpgmza_data['wpgmza_settings_map_clickzoom'] = sanitize_text_field($_POST['wpgmza_settings_map_clickzoom']); }
@@ -4029,6 +4036,9 @@ function wpgmaps_settings_page_basic() {
4029
if (isset($wpgmza_settings['wpgmza_settings_map_pan'])) { $wpgmza_settings_map_pan = $wpgmza_settings['wpgmza_settings_map_pan']; }
4030
if (isset($wpgmza_settings['wpgmza_settings_map_type'])) { $wpgmza_settings_map_type = $wpgmza_settings['wpgmza_settings_map_type']; }
4031
if (isset($wpgmza_settings['wpgmza_settings_force_jquery'])) { $wpgmza_force_jquery = $wpgmza_settings['wpgmza_settings_force_jquery']; }
4032
if (isset($wpgmza_settings['wpgmza_settings_map_scroll'])) { $wpgmza_settings_map_scroll = $wpgmza_settings['wpgmza_settings_map_scroll']; }
4033
if (isset($wpgmza_settings['wpgmza_settings_map_draggable'])) { $wpgmza_settings_map_draggable = $wpgmza_settings['wpgmza_settings_map_draggable']; }
4034
if (isset($wpgmza_settings['wpgmza_settings_map_clickzoom'])) { $wpgmza_settings_map_clickzoom = $wpgmza_settings['wpgmza_settings_map_clickzoom']; }
@@ -4089,6 +4099,10 @@ function wpgmaps_settings_page_basic() {
4089
if (isset($wpgmza_settings_map_type)) { if ($wpgmza_settings_map_type == "yes") { $wpgmza_type_checked = "checked='checked'"; } else { $wpgmza_type_checked = ""; } } else { $wpgmza_type_checked = ""; }
4090
if (isset($wpgmza_force_jquery)) { if ($wpgmza_force_jquery == "yes") { $wpgmza_force_jquery_checked = "checked='checked'"; } else { $wpgmza_force_jquery_checked = ""; } } else { $wpgmza_force_jquery_checked = ""; }
4091
4092
if (isset($wpgmza_settings['wpgmza_settings_enable_usage_tracking'])) {
4093
if ($wpgmza_settings['wpgmza_settings_enable_usage_tracking'] == "yes") {
4094
$wpgmza_settings_enable_usage_tracking = "checked='checked'";
@@ -4174,6 +4188,14 @@ function wpgmaps_settings_page_basic() {
4174
$ret .= " <div class='switch'><input name='wpgmza_settings_force_jquery' type='checkbox' class='cmn-toggle cmn-toggle-yes-no' id='wpgmza_settings_force_jquery' value='yes' $wpgmza_force_jquery_checked /> <label for='wpgmza_settings_force_jquery' data-on='".__("Yes", "wp-google-maps")."' data-off='".__("No", "wp-google-maps")."'></label></div> ".__("Over-ride current jQuery with version 1.11.3 (Tick this box if you are receiving jQuery related errors after updating to WordPress 4.5)", 'wp-google-maps')."<br />";
4175
$ret .= " </td>";
4176
$ret .= " </tr>";
4177
$ret .= " <tr>";
4178
$ret .= " <td width='200' valign='top'>".__("Use Google Maps API","wp-google-maps").":</td>";
4179
$ret .= " <td>";
@@ -6547,27 +6569,27 @@ add_action('init', 'wpgmza_deregister_scripts',999);
6547
add_action('wp_footer', 'wpgmza_deregister_scripts',999);
6548
add_action('wp_print_scripts', 'wpgmza_deregister_scripts',999);
6549
function wpgmza_deregister_scripts() {
6550
- global $short_code_active;
6551
- if ($short_code_active) {
6552
- $map_handle = '';
6553
- global $wp_scripts;
6554
- if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
6555
- foreach ( $wp_scripts->registered as $script) {
6556
- if (strpos($script->src, 'maps.google.com/maps/api/js') !== false) {
6557
- if (!isset($script->handle) || $script->handle == '') {
6558
$script->handle = 'remove-this-map-call';
6559
- }
6560
- unset($script->src);
6561
- $map_handle = $script->handle;
6562
- if ($map_handle != '') {
6563
$wp_scripts->remove( $map_handle );
6564
$map_handle = '';
6565
break;
6566
- }
6567
- }
6568
- }
6569
- }
6570
- }
6571
}
6572
6573
add_action('wp_ajax_track_usage', 'wpgmaps_usage_tracking_callback');
@@ -6726,8 +6748,8 @@ function wpgmza_deregister_styles() {
6726
if (isset($wp_styles->registered) && is_array($wp_styles->registered)) {
6727
foreach ( $wp_styles->registered as $script) {
6728
if (strpos($script->src, 'jquery-ui.theme.css') !== false || strpos($script->src, 'jquery-ui.css') !== false) {
6729
- $script->handle = "";
6730
- $script->src = "";
6731
}
6732
}
6733
}
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.3.13
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
Text Domain: wp-google-maps
11
*/
12
13
/*
14
+ * 6.3.13 - 2016-07-05 - Medium priority
15
+ * Revised Maps API Dequeue Script Added
16
+ * Remove Style dequeue script as this was causing UI conflicts
17
+ * Added option to disable Maps API from being loaded on front end
18
+ *
19
* 6.3.12 - 2016-06-27 - Medium priority
20
* Modified the API key notification to make it simpler and more intuitive
21
*
246
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
247
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
248
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
249
+ $wpgmza_version = "6.3.13";
250
+ $wpgmza_p_version = "6.02";
251
$wpgmza_t = "basic";
252
define("WPGMAPS", $wpgmza_version);
253
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
1676
}
1677
?>
1678
1679
+ <?php if(isset($wpgmza_settings['wpgmza_settings_remove_api']) && $wpgmza_settings['wpgmza_settings_remove_api'] == "yes"){ } else {
1680
+ if( get_option( 'wpgmza_google_maps_api_key' ) ){ ?>
1681
<script type="text/javascript">
1682
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1683
var wpgmza_api_key = '<?php echo get_option( 'wpgmza_google_maps_api_key' ); ?>';
1688
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1689
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?<?php echo $api_version_string; ?>&libraries=places' type='text/javascript'%3E%3C/script%3E"));
1690
</script>
1691
+ <?php }
1692
+ } ?>
1693
<script type="text/javascript" >
1694
var marker_pull = '<?php echo $marker_pull; ?>';
1695
<?php if (isset($markers) && strlen($markers) > 0 && $markers != "[]"){ ?>var db_marker_array = JSON.stringify(<?php echo $markers; ?>);<?php } else { echo "var db_marker_array = '';"; } ?>
2292
2293
// user autofill
2294
if (elementExists !== null) {
2295
+ <?php if (!$restrict_search) { ?>
2296
/* initialize the autocomplete form */
2297
autocomplete = new google.maps.places.Autocomplete(
2298
/** @type {HTMLInputElement} */(document.getElementById('addressInput')),
2303
fillInAddress();
2304
});
2305
<?php } else { ?>
2306
+ /* initialize the autocomplete form */
2307
autocomplete = new google.maps.places.Autocomplete(
2308
/** @type {HTMLInputElement} */(document.getElementById('addressInput')),
2309
{ types: ['geocode'], componentRestrictions: {country: '<?php echo $restrict_search; ?>'} });
3443
if (isset($_POST['wpgmza_settings_map_pan'])) { $wpgmza_data['wpgmza_settings_map_pan'] = sanitize_text_field($_POST['wpgmza_settings_map_pan']); }
3444
if (isset($_POST['wpgmza_settings_map_type'])) { $wpgmza_data['wpgmza_settings_map_type'] = sanitize_text_field($_POST['wpgmza_settings_map_type']); }
3445
if (isset($_POST['wpgmza_settings_force_jquery'])) { $wpgmza_data['wpgmza_settings_force_jquery'] = sanitize_text_field($_POST['wpgmza_settings_force_jquery']); }
3446
+ if (isset($_POST['wpgmza_settings_remove_api'])) { $wpgmza_data['wpgmza_settings_remove_api'] = sanitize_text_field($_POST['wpgmza_settings_remove_api']); }
3447
+
3448
if (isset($_POST['wpgmza_settings_map_scroll'])) { $wpgmza_data['wpgmza_settings_map_scroll'] = sanitize_text_field($_POST['wpgmza_settings_map_scroll']); }
3449
if (isset($_POST['wpgmza_settings_map_draggable'])) { $wpgmza_data['wpgmza_settings_map_draggable'] = sanitize_text_field($_POST['wpgmza_settings_map_draggable']); }
3450
if (isset($_POST['wpgmza_settings_map_clickzoom'])) { $wpgmza_data['wpgmza_settings_map_clickzoom'] = sanitize_text_field($_POST['wpgmza_settings_map_clickzoom']); }
4036
if (isset($wpgmza_settings['wpgmza_settings_map_pan'])) { $wpgmza_settings_map_pan = $wpgmza_settings['wpgmza_settings_map_pan']; }
4037
if (isset($wpgmza_settings['wpgmza_settings_map_type'])) { $wpgmza_settings_map_type = $wpgmza_settings['wpgmza_settings_map_type']; }
4038
if (isset($wpgmza_settings['wpgmza_settings_force_jquery'])) { $wpgmza_force_jquery = $wpgmza_settings['wpgmza_settings_force_jquery']; }
4039
+
4040
+ if (isset($wpgmza_settings['wpgmza_settings_remove_api'])) { $wpgmza_remove_api = $wpgmza_settings['wpgmza_settings_remove_api']; }
4041
+
4042
if (isset($wpgmza_settings['wpgmza_settings_map_scroll'])) { $wpgmza_settings_map_scroll = $wpgmza_settings['wpgmza_settings_map_scroll']; }
4043
if (isset($wpgmza_settings['wpgmza_settings_map_draggable'])) { $wpgmza_settings_map_draggable = $wpgmza_settings['wpgmza_settings_map_draggable']; }
4044
if (isset($wpgmza_settings['wpgmza_settings_map_clickzoom'])) { $wpgmza_settings_map_clickzoom = $wpgmza_settings['wpgmza_settings_map_clickzoom']; }
4099
if (isset($wpgmza_settings_map_type)) { if ($wpgmza_settings_map_type == "yes") { $wpgmza_type_checked = "checked='checked'"; } else { $wpgmza_type_checked = ""; } } else { $wpgmza_type_checked = ""; }
4100
if (isset($wpgmza_force_jquery)) { if ($wpgmza_force_jquery == "yes") { $wpgmza_force_jquery_checked = "checked='checked'"; } else { $wpgmza_force_jquery_checked = ""; } } else { $wpgmza_force_jquery_checked = ""; }
4101
4102
+ if (isset($wpgmza_remove_api)) { if ($wpgmza_remove_api == "yes") { $wpgmza_remove_api_checked = "checked='checked'"; } else { $wpgmza_remove_api_checked = ""; } } else { $wpgmza_remove_api_checked = ""; }
4103
+
4104
+
4105
+
4106
if (isset($wpgmza_settings['wpgmza_settings_enable_usage_tracking'])) {
4107
if ($wpgmza_settings['wpgmza_settings_enable_usage_tracking'] == "yes") {
4108
$wpgmza_settings_enable_usage_tracking = "checked='checked'";
4188
$ret .= " <div class='switch'><input name='wpgmza_settings_force_jquery' type='checkbox' class='cmn-toggle cmn-toggle-yes-no' id='wpgmza_settings_force_jquery' value='yes' $wpgmza_force_jquery_checked /> <label for='wpgmza_settings_force_jquery' data-on='".__("Yes", "wp-google-maps")."' data-off='".__("No", "wp-google-maps")."'></label></div> ".__("Over-ride current jQuery with version 1.11.3 (Tick this box if you are receiving jQuery related errors after updating to WordPress 4.5)", 'wp-google-maps')."<br />";
4189
$ret .= " </td>";
4190
$ret .= " </tr>";
4191
+
4192
+ $ret .= " <tr>";
4193
+ $ret .= " <td width='200' valign='top'></td>";
4194
+ $ret .= " <td>";
4195
+ $ret .= " <div class='switch'><input name='wpgmza_settings_remove_api' type='checkbox' class='cmn-toggle cmn-toggle-yes-no' id='wpgmza_settings_remove_api' value='yes' $wpgmza_remove_api_checked /> <label for='wpgmza_settings_remove_api' data-on='".__("Yes", "wp-google-maps")."' data-off='".__("No", "wp-google-maps")."'></label></div> ".__("Do not load the Google Maps API (Only check this if your theme loads the Google Maps API by default)", 'wp-google-maps')."<br />";
4196
+ $ret .= " </td>";
4197
+ $ret .= " </tr>";
4198
+
4199
$ret .= " <tr>";
4200
$ret .= " <td width='200' valign='top'>".__("Use Google Maps API","wp-google-maps").":</td>";
4201
$ret .= " <td>";
6569
add_action('wp_footer', 'wpgmza_deregister_scripts',999);
6570
add_action('wp_print_scripts', 'wpgmza_deregister_scripts',999);
6571
function wpgmza_deregister_scripts() {
6572
+ global $short_code_active;
6573
+ if ($short_code_active) {
6574
+ $map_handle = '';
6575
+ global $wp_scripts;
6576
+ if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
6577
+ foreach ( $wp_scripts->registered as $script) {
6578
+ if (strpos($script->src, 'maps.google.com/maps/api/js') !== false || strpos($script->src, 'maps.googleapis.com/maps/api') !== false || strpos($script->src, 'maps.googleapis') !== false || strpos($script->src, 'maps.google') !== false) {
6579
+ if (!isset($script->handle) || $script->handle == '') {
6580
$script->handle = 'remove-this-map-call';
6581
+ }
6582
+ unset($script->src);
6583
+ $map_handle = $script->handle;
6584
+ if ($map_handle != '') {
6585
$wp_scripts->remove( $map_handle );
6586
$map_handle = '';
6587
break;
6588
+ }
6589
+ }
6590
+ }
6591
+ }
6592
+ }
6593
}
6594
6595
add_action('wp_ajax_track_usage', 'wpgmaps_usage_tracking_callback');
6748
if (isset($wp_styles->registered) && is_array($wp_styles->registered)) {
6749
foreach ( $wp_styles->registered as $script) {
6750
if (strpos($script->src, 'jquery-ui.theme.css') !== false || strpos($script->src, 'jquery-ui.css') !== false) {
6751
+ // $script->handle = "";
6752
+ // $script->src = "";
6753
}
6754
}
6755
}