Version Description
- Code Optimization
- Security enhancement
Download this release
Release Info
Developer | milonfci |
Plugin | WP Google Map |
Version | 1.8.5 |
Comparing to | |
See all releases |
Code changes from version 1.8.4 to 1.8.5
- admin/includes/wgm_messages_viewer.php +1 -1
- admin/includes/wpgmap_edit.php +11 -12
- admin/includes/wpgmap_settings.php +4 -4
- admin/includes/wpgmap_setup_wizard.php +1 -1
- admin/includes/wpgmap_support.php +0 -1
- includes/Classes/srmgmap_widget.php +12 -12
- includes/Traits/AssetHandler.php +5 -5
- includes/Traits/MapCRUD.php +1 -1
- includes/Traits/MarkerCRUD.php +27 -28
- includes/Traits/MediaButtons.php +1 -1
- includes/Traits/Notice.php +1 -1
- includes/Traits/Settings.php +18 -18
- readme.txt +6 -2
- srm_gmap_embed.php +2 -2
admin/includes/wgm_messages_viewer.php
CHANGED
@@ -15,7 +15,7 @@ if (isset($_GET['message'])) {
|
|
15 |
echo __('API key updated Successfully, Please click on <a href="'.admin_url('admin.php?page=wpgmapembed-new').'"><i style="color: green;">Add New</i></a> menu to add new map.', 'gmap-embed');
|
16 |
break;
|
17 |
case 4:
|
18 |
-
echo __($message, 'gmap-embed');
|
19 |
break;
|
20 |
case -1:
|
21 |
echo __('Map Deleted Successfully.', 'gmap-embed');
|
15 |
echo __('API key updated Successfully, Please click on <a href="'.admin_url('admin.php?page=wpgmapembed-new').'"><i style="color: green;">Add New</i></a> menu to add new map.', 'gmap-embed');
|
16 |
break;
|
17 |
case 4:
|
18 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities(__($message, 'gmap-embed')))));
|
19 |
break;
|
20 |
case -1:
|
21 |
echo __('Map Deleted Successfully.', 'gmap-embed');
|
admin/includes/wpgmap_edit.php
CHANGED
@@ -9,7 +9,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
9 |
<div class="wrap">
|
10 |
<h1 class="wp-heading-inline"><?php _e('Edit Map', 'gmap-embed'); ?></h1>
|
11 |
<?php if (_wgm_can_add_new_map()) { ?>
|
12 |
-
<a href="<?php echo admin_url('admin.php?page=wpgmapembed-new'); ?>" class="page-title-action">Add New</a>
|
13 |
<?php
|
14 |
} else {
|
15 |
echo '<a href="#" class="page-title-action wgm_enable_premium" style="opacity: .3" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Create Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=add_new_map'))) . '">Add New</a><sup class="wgm-pro-label">Pro</sup>';
|
@@ -21,7 +21,6 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
21 |
}
|
22 |
echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
|
23 |
echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Documentation', 'gmap-embed') . '</a>';
|
24 |
-
// echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=header_menu') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
|
25 |
?>
|
26 |
<span style="float: right;margin: 0px 8px 0 0;">Shortcode <input type="text"
|
27 |
value="<?php echo esc_attr('[gmap-embed id="' . sanitize_text_field(esc_html($_GET['id'])) . '"]'); ?>"
|
@@ -54,7 +53,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
54 |
<br/>
|
55 |
|
56 |
<input type="checkbox" value="1" name="wpgmap_show_heading"
|
57 |
-
id="wpgmap_show_heading" <?php echo ($wpgmap_single->wpgmap_show_heading == 1) ? 'checked' : ''; ?>>
|
58 |
<label for="wpgmap_show_heading"><?php _e('Show as map title', 'gmap-embed'); ?></label>
|
59 |
</td>
|
60 |
</tr>
|
@@ -104,16 +103,16 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
104 |
<td>
|
105 |
<label><b><?php _e('Map Type', 'gmap-embed'); ?></b></label><br/>
|
106 |
<select id="wpgmap_map_type" class="regular-text">
|
107 |
-
<option <?php echo $wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''; ?>>
|
108 |
ROADMAP
|
109 |
</option>
|
110 |
-
<option <?php echo $wpgmap_single->wpgmap_map_type == 'SATELLITE' ? 'selected' : ''; ?>>
|
111 |
SATELLITE
|
112 |
</option>
|
113 |
-
<option <?php echo $wpgmap_single->wpgmap_map_type == 'HYBRID' ? 'selected' : ''; ?>>
|
114 |
HYBRID
|
115 |
</option>
|
116 |
-
<option <?php echo $wpgmap_single->wpgmap_map_type == 'TERRAIN' ? 'selected' : ''; ?>>
|
117 |
TERRAIN
|
118 |
</option>
|
119 |
</select>
|
@@ -132,7 +131,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
132 |
<td>
|
133 |
<label for="wpgmap_heading_class"><b><?php _e('Heading Custom Class', 'gmap-embed'); ?></b></label><br/>
|
134 |
<input id="wpgmap_heading_class" name="wpgmap_heading_class"
|
135 |
-
value="<?php echo $wpgmap_single->wpgmap_heading_class; ?>" type="text"
|
136 |
class="regular-text">
|
137 |
</td>
|
138 |
</tr>
|
@@ -142,7 +141,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
142 |
type="checkbox"
|
143 |
value="1" <?php echo !_wgm_is_premium() ? 'disabled="disabled" ' : '' ?>
|
144 |
name="wpgmap_enable_direction"
|
145 |
-
id="wpgmap_enable_direction" <?php echo ($wpgmap_single->wpgmap_enable_direction == 1) ? 'checked' : ''; ?>>
|
146 |
<?php _e('Enable Direction option in Map', 'gmap-embed'); ?>
|
147 |
<?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">Pro</sup>' : ''; ?>
|
148 |
</label>
|
@@ -153,7 +152,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
153 |
<td>
|
154 |
<small style="font-size: 9px;font-style: italic">Disable zoom on mouse scroll settings
|
155 |
has been moved under <a
|
156 |
-
href="<?php echo admin_url('admin.php?page=wpgmapembed-settings#_wgm_disable_zoom_control'); ?>">settings</a>
|
157 |
menu.</small>
|
158 |
</td>
|
159 |
</tr>
|
@@ -163,7 +162,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
163 |
|
164 |
<div class="wp-gmap-preview">
|
165 |
<h1 id="wpgmap_heading_preview"
|
166 |
-
style="padding: 0px;margin: 0px;"><?php echo $wpgmap_single->wpgmap_title; ?></h1>
|
167 |
<input id="wgm_pac_input" class="wgm_controls" type="text"
|
168 |
placeholder="<?php _e('Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed'); ?>"/>
|
169 |
<div id="wgm_map" style="height: 520px;"></div>
|
@@ -179,7 +178,7 @@ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_sin
|
|
179 |
(function ($) {
|
180 |
$(function () {
|
181 |
google.maps.event.addDomListener(window, 'load',
|
182 |
-
wgm_initAutocomplete('wgm_map', 'wgm_pac_input',<?php echo $wpgmap_center_lat;?>,<?php echo $wpgmap_center_lng;?>, '<?php echo $wpgmap_single->wpgmap_map_type; ?>',<?php echo $wpgmap_single->wpgmap_map_zoom;?>, 'edit')
|
183 |
);
|
184 |
if (jQuery('#wpgmap_show_infowindow').is(':checked') === true) {
|
185 |
wgm_openInfoWindow();
|
9 |
<div class="wrap">
|
10 |
<h1 class="wp-heading-inline"><?php _e('Edit Map', 'gmap-embed'); ?></h1>
|
11 |
<?php if (_wgm_can_add_new_map()) { ?>
|
12 |
+
<a href="<?php echo esc_url(admin_url('admin.php?page=wpgmapembed-new')); ?>" class="page-title-action">Add New</a>
|
13 |
<?php
|
14 |
} else {
|
15 |
echo '<a href="#" class="page-title-action wgm_enable_premium" style="opacity: .3" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Create Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=add_new_map'))) . '">Add New</a><sup class="wgm-pro-label">Pro</sup>';
|
21 |
}
|
22 |
echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
|
23 |
echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Documentation', 'gmap-embed') . '</a>';
|
|
|
24 |
?>
|
25 |
<span style="float: right;margin: 0px 8px 0 0;">Shortcode <input type="text"
|
26 |
value="<?php echo esc_attr('[gmap-embed id="' . sanitize_text_field(esc_html($_GET['id'])) . '"]'); ?>"
|
53 |
<br/>
|
54 |
|
55 |
<input type="checkbox" value="1" name="wpgmap_show_heading"
|
56 |
+
id="wpgmap_show_heading" <?php echo esc_attr(($wpgmap_single->wpgmap_show_heading == 1) ? 'checked' : ''); ?>>
|
57 |
<label for="wpgmap_show_heading"><?php _e('Show as map title', 'gmap-embed'); ?></label>
|
58 |
</td>
|
59 |
</tr>
|
103 |
<td>
|
104 |
<label><b><?php _e('Map Type', 'gmap-embed'); ?></b></label><br/>
|
105 |
<select id="wpgmap_map_type" class="regular-text">
|
106 |
+
<option <?php echo esc_attr($wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''); ?>>
|
107 |
ROADMAP
|
108 |
</option>
|
109 |
+
<option <?php echo esc_attr($wpgmap_single->wpgmap_map_type == 'SATELLITE' ? 'selected' : ''); ?>>
|
110 |
SATELLITE
|
111 |
</option>
|
112 |
+
<option <?php echo esc_attr($wpgmap_single->wpgmap_map_type == 'HYBRID' ? 'selected' : ''); ?>>
|
113 |
HYBRID
|
114 |
</option>
|
115 |
+
<option <?php echo esc_attr($wpgmap_single->wpgmap_map_type == 'TERRAIN' ? 'selected' : ''); ?>>
|
116 |
TERRAIN
|
117 |
</option>
|
118 |
</select>
|
131 |
<td>
|
132 |
<label for="wpgmap_heading_class"><b><?php _e('Heading Custom Class', 'gmap-embed'); ?></b></label><br/>
|
133 |
<input id="wpgmap_heading_class" name="wpgmap_heading_class"
|
134 |
+
value="<?php echo esc_attr($wpgmap_single->wpgmap_heading_class); ?>" type="text"
|
135 |
class="regular-text">
|
136 |
</td>
|
137 |
</tr>
|
141 |
type="checkbox"
|
142 |
value="1" <?php echo !_wgm_is_premium() ? 'disabled="disabled" ' : '' ?>
|
143 |
name="wpgmap_enable_direction"
|
144 |
+
id="wpgmap_enable_direction" <?php echo esc_attr(($wpgmap_single->wpgmap_enable_direction == 1) ? 'checked' : ''); ?>>
|
145 |
<?php _e('Enable Direction option in Map', 'gmap-embed'); ?>
|
146 |
<?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">Pro</sup>' : ''; ?>
|
147 |
</label>
|
152 |
<td>
|
153 |
<small style="font-size: 9px;font-style: italic">Disable zoom on mouse scroll settings
|
154 |
has been moved under <a
|
155 |
+
href="<?php echo esc_url(admin_url('admin.php?page=wpgmapembed-settings#_wgm_disable_zoom_control')); ?>">settings</a>
|
156 |
menu.</small>
|
157 |
</td>
|
158 |
</tr>
|
162 |
|
163 |
<div class="wp-gmap-preview">
|
164 |
<h1 id="wpgmap_heading_preview"
|
165 |
+
style="padding: 0px;margin: 0px;"><?php echo esc_html($wpgmap_single->wpgmap_title); ?></h1>
|
166 |
<input id="wgm_pac_input" class="wgm_controls" type="text"
|
167 |
placeholder="<?php _e('Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed'); ?>"/>
|
168 |
<div id="wgm_map" style="height: 520px;"></div>
|
178 |
(function ($) {
|
179 |
$(function () {
|
180 |
google.maps.event.addDomListener(window, 'load',
|
181 |
+
wgm_initAutocomplete('wgm_map', 'wgm_pac_input',<?php echo esc_html($wpgmap_center_lat);?>,<?php echo esc_html($wpgmap_center_lng);?>, '<?php echo esc_html($wpgmap_single->wpgmap_map_type); ?>',<?php echo esc_html($wpgmap_single->wpgmap_map_zoom);?>, 'edit')
|
182 |
);
|
183 |
if (jQuery('#wpgmap_show_infowindow').is(':checked') === true) {
|
184 |
wgm_openInfoWindow();
|
admin/includes/wpgmap_settings.php
CHANGED
@@ -6,10 +6,10 @@ if (isset($_GET['settings-updated'])) {
|
|
6 |
}
|
7 |
settings_errors('wporg_messages');
|
8 |
|
9 |
-
$h =
|
10 |
// Updating api key
|
11 |
if (isset($_POST['wpgmapembed_key'])) {
|
12 |
-
$api_key = trim($_POST['wpgmapembed_key']);
|
13 |
if ($api_key != '') {
|
14 |
if (get_option('wpgmap_api_key') !== false) {
|
15 |
update_option('wpgmap_api_key', $api_key, '', 'yes');
|
@@ -21,12 +21,12 @@ if (isset($_POST['wpgmapembed_key'])) {
|
|
21 |
|
22 |
function gmapSrmIsProvided($l)
|
23 |
{
|
24 |
-
return substr($l, 15, 4) ==
|
25 |
}
|
26 |
|
27 |
// Updating license key
|
28 |
if (isset($_POST['wpgmapembed_license'])) {
|
29 |
-
$wpgmapembed_license = trim(esc_html($_POST['wpgmapembed_license']));
|
30 |
$message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=settings_get_license') . '">Get License Key</a></span>';
|
31 |
if ($wpgmapembed_license != '') {
|
32 |
|
6 |
}
|
7 |
settings_errors('wporg_messages');
|
8 |
|
9 |
+
$h = 'https://srmilon.info';
|
10 |
// Updating api key
|
11 |
if (isset($_POST['wpgmapembed_key'])) {
|
12 |
+
$api_key = trim(sanitize_text_field(esc_html($_POST['wpgmapembed_key'])));
|
13 |
if ($api_key != '') {
|
14 |
if (get_option('wpgmap_api_key') !== false) {
|
15 |
update_option('wpgmap_api_key', $api_key, '', 'yes');
|
21 |
|
22 |
function gmapSrmIsProvided($l)
|
23 |
{
|
24 |
+
return substr($l, 15, 4) == 'M019';
|
25 |
}
|
26 |
|
27 |
// Updating license key
|
28 |
if (isset($_POST['wpgmapembed_license'])) {
|
29 |
+
$wpgmapembed_license = trim(esc_html(sanitize_text_field($_POST['wpgmapembed_license'])));
|
30 |
$message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=settings_get_license') . '">Get License Key</a></span>';
|
31 |
if ($wpgmapembed_license != '') {
|
32 |
|
admin/includes/wpgmap_setup_wizard.php
CHANGED
@@ -100,7 +100,7 @@
|
|
100 |
if (get_option('srm_gmap_region', 'US') == $region_key) {
|
101 |
$selected = 'selected';
|
102 |
}
|
103 |
-
echo "<option value='$region_key' $selected
|
104 |
}
|
105 |
}
|
106 |
?>
|
100 |
if (get_option('srm_gmap_region', 'US') == $region_key) {
|
101 |
$selected = 'selected';
|
102 |
}
|
103 |
+
echo "<option value='$region_key' $selected>".esc_html($region)."</option>";
|
104 |
}
|
105 |
}
|
106 |
?>
|
admin/includes/wpgmap_support.php
CHANGED
@@ -9,7 +9,6 @@
|
|
9 |
|
10 |
echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
|
11 |
echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Documentation', 'gmap-embed') . '</a>';
|
12 |
-
// echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_support&utm_medium=admin_link&utm_campaign=header_menu') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
|
13 |
?>
|
14 |
<hr class="wp-header-end">
|
15 |
|
9 |
|
10 |
echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
|
11 |
echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Documentation', 'gmap-embed') . '</a>';
|
|
|
12 |
?>
|
13 |
<hr class="wp-header-end">
|
14 |
|
includes/Classes/srmgmap_widget.php
CHANGED
@@ -38,12 +38,12 @@ class srmgmap_widget extends WP_Widget
|
|
38 |
|
39 |
extract($args);
|
40 |
extract($instance);
|
41 |
-
echo $before_widget;
|
42 |
if (!empty($title)) {
|
43 |
-
echo $before_title . $title . $after_title;
|
44 |
}
|
45 |
echo do_shortcode($instance['srmgmap_shortcode']);
|
46 |
-
echo $after_widget;
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -52,7 +52,7 @@ class srmgmap_widget extends WP_Widget
|
|
52 |
*/
|
53 |
public function form($instance)
|
54 |
{
|
55 |
-
$title = !empty($instance['title']) ? $instance['title'] :
|
56 |
$map_shortcodes_list = '';
|
57 |
$args = array(
|
58 |
'post_type' => 'wpgmapembed',
|
@@ -78,21 +78,21 @@ class srmgmap_widget extends WP_Widget
|
|
78 |
}
|
79 |
?>
|
80 |
<p>
|
81 |
-
<label for="<?php echo $this->get_field_id('title'); ?>">Title: </label>
|
82 |
</p>
|
83 |
<p>
|
84 |
-
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
85 |
-
name="<?php echo $this->get_field_name('title'); ?>" type="text"
|
86 |
value="<?php echo esc_attr($title); ?>"/>
|
87 |
</p>
|
88 |
<p>
|
89 |
-
<label for="<?php echo $this->get_field_id('srmgmap_shortcode'); ?>"> Select Google Map
|
90 |
Shortcode:</label><br/>
|
91 |
</p>
|
92 |
<p>
|
93 |
-
<select id="<?php echo $this->get_field_id('srmgmap_shortcode'); ?>"
|
94 |
-
name="<?php echo $this->get_field_name('srmgmap_shortcode'); ?>" class="widefat">
|
95 |
-
<?php echo $map_shortcodes_list; ?>
|
96 |
</select>
|
97 |
</p>
|
98 |
|
@@ -102,7 +102,7 @@ class srmgmap_widget extends WP_Widget
|
|
102 |
public function update($new_instance, $old_instance)
|
103 |
{
|
104 |
$instance = array();
|
105 |
-
$instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title'])
|
106 |
$instance['srmgmap_shortcode'] = (!empty($new_instance['srmgmap_shortcode'])) ? $new_instance['srmgmap_shortcode'] : '';
|
107 |
return $instance;
|
108 |
}
|
38 |
|
39 |
extract($args);
|
40 |
extract($instance);
|
41 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($before_widget))));
|
42 |
if (!empty($title)) {
|
43 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($before_title . $title . $after_title))));
|
44 |
}
|
45 |
echo do_shortcode($instance['srmgmap_shortcode']);
|
46 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($after_widget))));
|
47 |
}
|
48 |
|
49 |
/**
|
52 |
*/
|
53 |
public function form($instance)
|
54 |
{
|
55 |
+
$title = !empty($instance['title']) ? wp_unslash(html_entity_decode(sanitize_text_field(htmlentities(__($instance['title']))))) : wp_unslash(html_entity_decode(sanitize_text_field(htmlentities(__('', 'text_domain')))));
|
56 |
$map_shortcodes_list = '';
|
57 |
$args = array(
|
58 |
'post_type' => 'wpgmapembed',
|
78 |
}
|
79 |
?>
|
80 |
<p>
|
81 |
+
<label for="<?php echo esc_attr($this->get_field_id('title')); ?>">Title: </label>
|
82 |
</p>
|
83 |
<p>
|
84 |
+
<input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>"
|
85 |
+
name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text"
|
86 |
value="<?php echo esc_attr($title); ?>"/>
|
87 |
</p>
|
88 |
<p>
|
89 |
+
<label for="<?php echo esc_attr($this->get_field_id('srmgmap_shortcode')); ?>"> Select Google Map
|
90 |
Shortcode:</label><br/>
|
91 |
</p>
|
92 |
<p>
|
93 |
+
<select id="<?php echo esc_attr($this->get_field_id('srmgmap_shortcode')); ?>"
|
94 |
+
name="<?php echo esc_attr($this->get_field_name('srmgmap_shortcode')); ?>" class="widefat">
|
95 |
+
<?php echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($map_shortcodes_list)))); ?>
|
96 |
</select>
|
97 |
</p>
|
98 |
|
102 |
public function update($new_instance, $old_instance)
|
103 |
{
|
104 |
$instance = array();
|
105 |
+
$instance['title'] = (!empty($new_instance['title'])) ? esc_html(strip_tags($new_instance['title'])): '';
|
106 |
$instance['srmgmap_shortcode'] = (!empty($new_instance['srmgmap_shortcode'])) ? $new_instance['srmgmap_shortcode'] : '';
|
107 |
return $instance;
|
108 |
}
|
includes/Traits/AssetHandler.php
CHANGED
@@ -144,15 +144,15 @@ trait AssetHandler
|
|
144 |
*/
|
145 |
function enqueue_admin_gmap_scripts()
|
146 |
{
|
147 |
-
$page = isset($_GET['page']) ? $_GET['page'] : '';
|
148 |
global $pagenow;
|
149 |
-
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (
|
150 |
|
151 |
// Registering common scripts (Included: Google API)
|
152 |
$this->registerCommonScripts();
|
153 |
|
154 |
// Including Google Map API for only New Map and Edit Map page
|
155 |
-
if (
|
156 |
wp_enqueue_script('wp-gmap-api');
|
157 |
}
|
158 |
|
@@ -175,7 +175,7 @@ trait AssetHandler
|
|
175 |
|
176 |
|
177 |
/** Edit and Add Map page */
|
178 |
-
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (
|
179 |
wp_enqueue_script('wgm-map-curd-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_map_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_map_crud.js'), true);
|
180 |
wp_enqueue_script('wp-gmap-markers-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_marker_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_marker_crud.js'), true);
|
181 |
# Datatable
|
@@ -184,7 +184,7 @@ trait AssetHandler
|
|
184 |
}
|
185 |
|
186 |
/** Setup Wizard */
|
187 |
-
if (
|
188 |
wp_enqueue_style('wp-gmap-setup-wizard-css', WGM_PLUGIN_URL . 'admin/assets/css/setup_wizard.css', array(), filemtime(WGM_PLUGIN_PATH . '/admin/assets/css/setup_wizard.css'));
|
189 |
wp_enqueue_script('wp-gmap-setup-wizard-js', WGM_PLUGIN_URL . 'admin/assets/js/setup_wizard.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/setup_wizard.js'), true);
|
190 |
}
|
144 |
*/
|
145 |
function enqueue_admin_gmap_scripts()
|
146 |
{
|
147 |
+
$page = isset($_GET['page']) ? sanitize_text_field(esc_html($_GET['page'])) : '';
|
148 |
global $pagenow;
|
149 |
+
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || ($page == 'wpgmapembed' or $page == 'wpgmapembed-settings' or $page == 'wpgmapembed-new' or $page == 'wgm_setup_wizard' or $page == 'wpgmapembed-support')) {
|
150 |
|
151 |
// Registering common scripts (Included: Google API)
|
152 |
$this->registerCommonScripts();
|
153 |
|
154 |
// Including Google Map API for only New Map and Edit Map page
|
155 |
+
if (in_array(get_option('_wgm_load_map_api_condition', 'always'), ['where-required', 'always', 'only-backend-end']) && ($page == 'wpgmapembed' or $page == 'wpgmapembed-new')) {
|
156 |
wp_enqueue_script('wp-gmap-api');
|
157 |
}
|
158 |
|
175 |
|
176 |
|
177 |
/** Edit and Add Map page */
|
178 |
+
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || ($page == 'wpgmapembed' or $page == 'wpgmapembed-new')) {
|
179 |
wp_enqueue_script('wgm-map-curd-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_map_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_map_crud.js'), true);
|
180 |
wp_enqueue_script('wp-gmap-markers-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_marker_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_marker_crud.js'), true);
|
181 |
# Datatable
|
184 |
}
|
185 |
|
186 |
/** Setup Wizard */
|
187 |
+
if ($page == 'wgm_setup_wizard') {
|
188 |
wp_enqueue_style('wp-gmap-setup-wizard-css', WGM_PLUGIN_URL . 'admin/assets/css/setup_wizard.css', array(), filemtime(WGM_PLUGIN_PATH . '/admin/assets/css/setup_wizard.css'));
|
189 |
wp_enqueue_script('wp-gmap-setup-wizard-js', WGM_PLUGIN_URL . 'admin/assets/js/setup_wizard.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/setup_wizard.js'), true);
|
190 |
}
|
includes/Traits/MapCRUD.php
CHANGED
@@ -189,7 +189,7 @@ trait MapCRUD
|
|
189 |
</div>
|
190 |
</div>';
|
191 |
}
|
192 |
-
echo $content;
|
193 |
wp_die();
|
194 |
}
|
195 |
|
189 |
</div>
|
190 |
</div>';
|
191 |
}
|
192 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($content))));
|
193 |
wp_die();
|
194 |
}
|
195 |
|
includes/Traits/MarkerCRUD.php
CHANGED
@@ -52,21 +52,21 @@ trait MarkerCRUD
|
|
52 |
}
|
53 |
|
54 |
global $wpdb;
|
55 |
-
|
56 |
-
$map_id = sanitize_text_field(esc_html($
|
57 |
$error = '';
|
58 |
// Getting ajax fields value
|
59 |
$map_marker_data = array(
|
60 |
'map_id' => $map_id,
|
61 |
-
'marker_name' => strlen(sanitize_text_field(esc_html($
|
62 |
-
'marker_desc' => sanitize_text_field(htmlentities($
|
63 |
-
'icon' => sanitize_text_field(esc_html($
|
64 |
-
'address' => sanitize_text_field(esc_html($
|
65 |
-
'lat_lng' => sanitize_text_field(esc_html($
|
66 |
-
'have_marker_link' => sanitize_text_field(esc_html($
|
67 |
-
'marker_link' => sanitize_text_field(esc_html($
|
68 |
-
'marker_link_new_tab' => sanitize_text_field(esc_html($
|
69 |
-
'show_desc_by_default' => sanitize_text_field(esc_html($
|
70 |
);
|
71 |
if ($map_marker_data['lat_lng'] == '') {
|
72 |
$error = __("Please input Latitude and Longitude", 'gmap-embed');
|
@@ -141,21 +141,20 @@ trait MarkerCRUD
|
|
141 |
|
142 |
global $wpdb;
|
143 |
$error = '';
|
144 |
-
$
|
145 |
-
$
|
146 |
-
$map_id = sanitize_text_field(esc_html($marker_data['wpgmap_map_id']));
|
147 |
// Getting ajax fields value
|
148 |
$map_marker_data = array(
|
149 |
'map_id' => $map_id,
|
150 |
-
'marker_name' => strlen(sanitize_text_field(esc_html($
|
151 |
-
'marker_desc' => sanitize_text_field(htmlentities($
|
152 |
-
'icon' => sanitize_text_field(esc_html($
|
153 |
-
'address' => sanitize_text_field(esc_html($
|
154 |
-
'lat_lng' => sanitize_text_field(esc_html($
|
155 |
-
'have_marker_link' => sanitize_text_field(esc_html($
|
156 |
-
'marker_link' => sanitize_text_field(esc_html($
|
157 |
-
'marker_link_new_tab' => sanitize_text_field(esc_html($
|
158 |
-
'show_desc_by_default' => sanitize_text_field(esc_html($
|
159 |
);
|
160 |
if ($map_marker_data['lat_lng'] == '') {
|
161 |
$error = __("Please input Latitude and Longitude", 'gmap-embed');
|
@@ -288,8 +287,8 @@ trait MarkerCRUD
|
|
288 |
public function get_no_of_markers_by_map_id($map_id = 0)
|
289 |
{
|
290 |
global $wpdb;
|
291 |
-
$map_id = sanitize_text_field(esc_html($map_id));
|
292 |
-
return $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'"
|
293 |
}
|
294 |
|
295 |
/**
|
@@ -309,7 +308,7 @@ trait MarkerCRUD
|
|
309 |
}
|
310 |
|
311 |
global $wpdb;
|
312 |
-
$map_id = sanitize_text_field(esc_html($_POST['data']['map_id']));
|
313 |
$filtered_map_markers = [];
|
314 |
$map_markers = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'", $map_id));
|
315 |
if (count($map_markers) > 0) {
|
@@ -338,7 +337,7 @@ trait MarkerCRUD
|
|
338 |
}
|
339 |
|
340 |
global $wpdb;
|
341 |
-
$map_id = sanitize_text_field(esc_html($_POST['data']['map_id']));
|
342 |
$filtered_map_markers = [];
|
343 |
$map_markers = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'", $map_id));
|
344 |
if (count($map_markers) > 0) {
|
@@ -445,7 +444,7 @@ trait MarkerCRUD
|
|
445 |
die ('Busted!');
|
446 |
}
|
447 |
global $wpdb;
|
448 |
-
$marker_id = sanitize_text_field(esc_html(
|
449 |
$result = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE id='%d'", $marker_id), OBJECT);
|
450 |
$result->marker_desc = wp_unslash(html_entity_decode($result->marker_desc));
|
451 |
echo json_encode($result);
|
52 |
}
|
53 |
|
54 |
global $wpdb;
|
55 |
+
|
56 |
+
$map_id = intval(sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_map_id'])));
|
57 |
$error = '';
|
58 |
// Getting ajax fields value
|
59 |
$map_marker_data = array(
|
60 |
'map_id' => $map_id,
|
61 |
+
'marker_name' => strlen(sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_name']))) == 0 ? null : sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_name'])),
|
62 |
+
'marker_desc' => sanitize_text_field(htmlentities($_POST['map_markers_data']['wpgmap_marker_desc'])),
|
63 |
+
'icon' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_icon'])),
|
64 |
+
'address' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_address'])),
|
65 |
+
'lat_lng' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_lat_lng'])),
|
66 |
+
'have_marker_link' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_have_marker_link'])),
|
67 |
+
'marker_link' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_link'])),
|
68 |
+
'marker_link_new_tab' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_link_new_tab'])),
|
69 |
+
'show_desc_by_default' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_infowindow_show'])),
|
70 |
);
|
71 |
if ($map_marker_data['lat_lng'] == '') {
|
72 |
$error = __("Please input Latitude and Longitude", 'gmap-embed');
|
141 |
|
142 |
global $wpdb;
|
143 |
$error = '';
|
144 |
+
$marker_id = intval(sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_id'])));
|
145 |
+
$map_id = intval(sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_map_id'])));
|
|
|
146 |
// Getting ajax fields value
|
147 |
$map_marker_data = array(
|
148 |
'map_id' => $map_id,
|
149 |
+
'marker_name' => strlen(sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_name']))) == 0 ? null : sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_name'])),
|
150 |
+
'marker_desc' => sanitize_text_field(htmlentities($_POST['map_markers_data']['wpgmap_marker_desc'])),
|
151 |
+
'icon' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_icon'])),
|
152 |
+
'address' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_address'])),
|
153 |
+
'lat_lng' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_lat_lng'])),
|
154 |
+
'have_marker_link' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_have_marker_link'])),
|
155 |
+
'marker_link' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_link'])),
|
156 |
+
'marker_link_new_tab' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_link_new_tab'])),
|
157 |
+
'show_desc_by_default' => sanitize_text_field(esc_html($_POST['map_markers_data']['wpgmap_marker_infowindow_show'])),
|
158 |
);
|
159 |
if ($map_marker_data['lat_lng'] == '') {
|
160 |
$error = __("Please input Latitude and Longitude", 'gmap-embed');
|
287 |
public function get_no_of_markers_by_map_id($map_id = 0)
|
288 |
{
|
289 |
global $wpdb;
|
290 |
+
$map_id = intval(sanitize_text_field(esc_html($map_id)));
|
291 |
+
return $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'", $map_id));
|
292 |
}
|
293 |
|
294 |
/**
|
308 |
}
|
309 |
|
310 |
global $wpdb;
|
311 |
+
$map_id = intval(sanitize_text_field(esc_html($_POST['data']['map_id'])));
|
312 |
$filtered_map_markers = [];
|
313 |
$map_markers = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'", $map_id));
|
314 |
if (count($map_markers) > 0) {
|
337 |
}
|
338 |
|
339 |
global $wpdb;
|
340 |
+
$map_id = intval(sanitize_text_field(esc_html($_POST['data']['map_id'])));
|
341 |
$filtered_map_markers = [];
|
342 |
$map_markers = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='%d'", $map_id));
|
343 |
if (count($map_markers) > 0) {
|
444 |
die ('Busted!');
|
445 |
}
|
446 |
global $wpdb;
|
447 |
+
$marker_id = intval(sanitize_text_field(esc_html($_POST['data']['marker_id'])));
|
448 |
$result = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE id='%d'", $marker_id), OBJECT);
|
449 |
$result->marker_desc = wp_unslash(html_entity_decode($result->marker_desc));
|
450 |
echo json_encode($result);
|
includes/Traits/MediaButtons.php
CHANGED
@@ -25,7 +25,7 @@ trait MediaButtons
|
|
25 |
href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
|
26 |
" . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "WP Google Map</a>";
|
27 |
|
28 |
-
echo $context;
|
29 |
}
|
30 |
|
31 |
public function wp_google_map_media_button_content()
|
25 |
href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
|
26 |
" . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "WP Google Map</a>";
|
27 |
|
28 |
+
echo wp_unslash(html_entity_decode(sanitize_text_field(htmlentities($context))));
|
29 |
}
|
30 |
|
31 |
public function wp_google_map_media_button_content()
|
includes/Traits/Notice.php
CHANGED
@@ -118,7 +118,7 @@ trait Notice
|
|
118 |
], $url);
|
119 |
?>
|
120 |
<div class="gmap_embed_review_section notice notice-success">
|
121 |
-
<img src="<?php echo WGM_PLUGIN_URL . 'admin/assets/images/gmap_embed_logo.jpg'; ?>"
|
122 |
width="60" style="float: left;margin: 9px 9px 0 5px !important"/>
|
123 |
<p><?php _e("<span style='color:green;'>We hope you're" . ' enjoying of using <b style="color:#007cba">WP Google Map</b> plugin.
|
124 |
Could you please give us a BIG favour and give it a 5-star rating on Wordpress to help us spread the word and boost our motivation!</span>
|
118 |
], $url);
|
119 |
?>
|
120 |
<div class="gmap_embed_review_section notice notice-success">
|
121 |
+
<img src="<?php echo esc_url(WGM_PLUGIN_URL . 'admin/assets/images/gmap_embed_logo.jpg'); ?>"
|
122 |
width="60" style="float: left;margin: 9px 9px 0 5px !important"/>
|
123 |
<p><?php _e("<span style='color:green;'>We hope you're" . ' enjoying of using <b style="color:#007cba">WP Google Map</b> plugin.
|
124 |
Could you please give us a BIG favour and give it a 5-star rating on Wordpress to help us spread the word and boost our motivation!</span>
|
includes/Traits/Settings.php
CHANGED
@@ -26,7 +26,7 @@ trait Settings
|
|
26 |
{
|
27 |
?>
|
28 |
<textarea rows="10" cols="100" name="wpgmap_s_custom_css"
|
29 |
-
id="wpgmap_custom_css"><?php echo get_option('wpgmap_s_custom_css'); ?></textarea>
|
30 |
<p class="description" id="tagline-description" style="font-style: italic;">
|
31 |
<?php _e('Add your custom CSS code if needed.', 'gmap-embed'); ?>
|
32 |
</p>
|
@@ -40,7 +40,7 @@ trait Settings
|
|
40 |
{
|
41 |
?>
|
42 |
<textarea rows="10" cols="100" name="wpgmap_s_custom_js"
|
43 |
-
id="wpgmap_custom_js"><?php echo get_option('wpgmap_s_custom_js'); ?></textarea>
|
44 |
<p class="description" id="tagline-description" style="font-style: italic;">
|
45 |
<?php _e('Add your custom JS code if needed.', 'gmap-embed'); ?>
|
46 |
</p>
|
@@ -55,19 +55,19 @@ trait Settings
|
|
55 |
{
|
56 |
?>
|
57 |
<select name="_wgm_load_map_api_condition" id="_wgm_load_map_api_condition">
|
58 |
-
<option value="where-required" <?php echo get_option('_wgm_load_map_api_condition') == 'where-required' ? 'selected' : '' ?>>
|
59 |
Where required
|
60 |
</option>
|
61 |
-
<option value="always" <?php echo get_option('_wgm_load_map_api_condition') == 'always' ? 'selected' : '' ?>>
|
62 |
Always
|
63 |
</option>
|
64 |
-
<option value="only-front-end" <?php echo get_option('_wgm_load_map_api_condition') == 'only-front-end' ? 'selected' : '' ?>>
|
65 |
Only Front End
|
66 |
</option>
|
67 |
-
<option value="only-back-end" <?php echo get_option('_wgm_load_map_api_condition') == 'only-back-end' ? 'selected' : '' ?>>
|
68 |
Only Back End
|
69 |
</option>
|
70 |
-
<option value="never" <?php echo get_option('_wgm_load_map_api_condition') == 'never' ? 'selected' : '' ?>>
|
71 |
Never
|
72 |
</option>
|
73 |
</select>
|
@@ -83,7 +83,7 @@ trait Settings
|
|
83 |
?>
|
84 |
<input type="checkbox" name="_wgm_prevent_other_plugin_theme_api_load"
|
85 |
id="_wgm_prevent_other_plugin_theme_api_load"
|
86 |
-
value="Y" <?php echo get_option('_wgm_prevent_other_plugin_theme_api_load') == 'Y' ? 'checked="checked"' : ''; ?>> Check this option if your want to prevent other plugin or theme loading map api, in case of you are getting api key error, included multiple api key error.
|
87 |
<br/>
|
88 |
<?php
|
89 |
}
|
@@ -96,29 +96,29 @@ trait Settings
|
|
96 |
{
|
97 |
?>
|
98 |
<input type="checkbox" name="_wgm_disable_full_screen_control" id="_wgm_disable_full_screen_control"
|
99 |
-
value="Y" <?php echo get_option('_wgm_disable_full_screen_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Full Screen Control
|
100 |
<br/>
|
101 |
<input type="checkbox" name="_wgm_disable_street_view" id="_wgm_disable_street_view"
|
102 |
-
value="Y" <?php echo get_option('_wgm_disable_street_view') == 'Y' ? 'checked="checked"' : ''; ?>> Disable StreetView
|
103 |
<br/>
|
104 |
<input type="checkbox" name="_wgm_disable_zoom_control" id="_wgm_disable_zoom_control"
|
105 |
-
value="Y" <?php echo get_option('_wgm_disable_zoom_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Zoom Controls
|
106 |
<br/>
|
107 |
<input type="checkbox" name="_wgm_disable_pan_control" id="_wgm_disable_pan_control"
|
108 |
-
value="Y" <?php echo get_option('_wgm_disable_pan_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Pan Controls
|
109 |
<br/>
|
110 |
<input type="checkbox" name="_wgm_disable_map_type_control" id="_wgm_disable_map_type_control"
|
111 |
-
value="Y" <?php echo get_option('_wgm_disable_map_type_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Map Type Controls
|
112 |
<br/>
|
113 |
<input type="checkbox" name="_wgm_disable_mouse_wheel_zoom" id="_wgm_disable_mouse_wheel_zoom"
|
114 |
-
value="Y" <?php echo get_option('_wgm_disable_mouse_wheel_zoom') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Wheel Zoom
|
115 |
<br/>
|
116 |
<input type="checkbox" name="_wgm_disable_mouse_dragging" id="_wgm_disable_mouse_dragging"
|
117 |
-
value="Y" <?php echo get_option('_wgm_disable_mouse_dragging') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Dragging
|
118 |
<br/>
|
119 |
<input type="checkbox" name="_wgm_disable_mouse_double_click_zooming"
|
120 |
id="_wgm_disable_mouse_double_click_zooming"
|
121 |
-
value="Y" <?php echo get_option('_wgm_disable_mouse_double_click_zooming') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Double Click Zooming
|
122 |
<br/>
|
123 |
<?php
|
124 |
}
|
@@ -138,7 +138,7 @@ trait Settings
|
|
138 |
if (get_option('srm_gmap_lng', 'en') == $lng_key) {
|
139 |
$selected = 'selected';
|
140 |
}
|
141 |
-
echo "<option value='$lng_key' $selected
|
142 |
}
|
143 |
}
|
144 |
?>
|
@@ -164,7 +164,7 @@ trait Settings
|
|
164 |
if (get_option('srm_gmap_region', 'US') == $region_key) {
|
165 |
$selected = 'selected';
|
166 |
}
|
167 |
-
echo "<option value='$region_key' $selected
|
168 |
}
|
169 |
}
|
170 |
?>
|
26 |
{
|
27 |
?>
|
28 |
<textarea rows="10" cols="100" name="wpgmap_s_custom_css"
|
29 |
+
id="wpgmap_custom_css"><?php echo esc_html(get_option('wpgmap_s_custom_css')); ?></textarea>
|
30 |
<p class="description" id="tagline-description" style="font-style: italic;">
|
31 |
<?php _e('Add your custom CSS code if needed.', 'gmap-embed'); ?>
|
32 |
</p>
|
40 |
{
|
41 |
?>
|
42 |
<textarea rows="10" cols="100" name="wpgmap_s_custom_js"
|
43 |
+
id="wpgmap_custom_js"><?php echo esc_html(get_option('wpgmap_s_custom_js')); ?></textarea>
|
44 |
<p class="description" id="tagline-description" style="font-style: italic;">
|
45 |
<?php _e('Add your custom JS code if needed.', 'gmap-embed'); ?>
|
46 |
</p>
|
55 |
{
|
56 |
?>
|
57 |
<select name="_wgm_load_map_api_condition" id="_wgm_load_map_api_condition">
|
58 |
+
<option value="where-required" <?php echo esc_attr(get_option('_wgm_load_map_api_condition') == 'where-required' ? 'selected' : ''); ?>>
|
59 |
Where required
|
60 |
</option>
|
61 |
+
<option value="always" <?php echo esc_attr(get_option('_wgm_load_map_api_condition') == 'always' ? 'selected' : ''); ?>>
|
62 |
Always
|
63 |
</option>
|
64 |
+
<option value="only-front-end" <?php echo esc_attr(get_option('_wgm_load_map_api_condition') == 'only-front-end' ? 'selected' : ''); ?>>
|
65 |
Only Front End
|
66 |
</option>
|
67 |
+
<option value="only-back-end" <?php echo esc_attr(get_option('_wgm_load_map_api_condition') == 'only-back-end' ? 'selected' : ''); ?>>
|
68 |
Only Back End
|
69 |
</option>
|
70 |
+
<option value="never" <?php echo esc_attr(get_option('_wgm_load_map_api_condition') == 'never' ? 'selected' : ''); ?>>
|
71 |
Never
|
72 |
</option>
|
73 |
</select>
|
83 |
?>
|
84 |
<input type="checkbox" name="_wgm_prevent_other_plugin_theme_api_load"
|
85 |
id="_wgm_prevent_other_plugin_theme_api_load"
|
86 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_prevent_other_plugin_theme_api_load') == 'Y' ? 'checked="checked"' : ''); ?>> Check this option if your want to prevent other plugin or theme loading map api, in case of you are getting api key error, included multiple api key error.
|
87 |
<br/>
|
88 |
<?php
|
89 |
}
|
96 |
{
|
97 |
?>
|
98 |
<input type="checkbox" name="_wgm_disable_full_screen_control" id="_wgm_disable_full_screen_control"
|
99 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_full_screen_control') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Full Screen Control
|
100 |
<br/>
|
101 |
<input type="checkbox" name="_wgm_disable_street_view" id="_wgm_disable_street_view"
|
102 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_street_view') == 'Y' ? 'checked="checked"' : ''); ?>> Disable StreetView
|
103 |
<br/>
|
104 |
<input type="checkbox" name="_wgm_disable_zoom_control" id="_wgm_disable_zoom_control"
|
105 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_zoom_control') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Zoom Controls
|
106 |
<br/>
|
107 |
<input type="checkbox" name="_wgm_disable_pan_control" id="_wgm_disable_pan_control"
|
108 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_pan_control') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Pan Controls
|
109 |
<br/>
|
110 |
<input type="checkbox" name="_wgm_disable_map_type_control" id="_wgm_disable_map_type_control"
|
111 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_map_type_control') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Map Type Controls
|
112 |
<br/>
|
113 |
<input type="checkbox" name="_wgm_disable_mouse_wheel_zoom" id="_wgm_disable_mouse_wheel_zoom"
|
114 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_mouse_wheel_zoom') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Mouse Wheel Zoom
|
115 |
<br/>
|
116 |
<input type="checkbox" name="_wgm_disable_mouse_dragging" id="_wgm_disable_mouse_dragging"
|
117 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_mouse_dragging') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Mouse Dragging
|
118 |
<br/>
|
119 |
<input type="checkbox" name="_wgm_disable_mouse_double_click_zooming"
|
120 |
id="_wgm_disable_mouse_double_click_zooming"
|
121 |
+
value="Y" <?php echo esc_attr(get_option('_wgm_disable_mouse_double_click_zooming') == 'Y' ? 'checked="checked"' : ''); ?>> Disable Mouse Double Click Zooming
|
122 |
<br/>
|
123 |
<?php
|
124 |
}
|
138 |
if (get_option('srm_gmap_lng', 'en') == $lng_key) {
|
139 |
$selected = 'selected';
|
140 |
}
|
141 |
+
echo "<option value='" . esc_attr($lng_key) . "' $selected>" . esc_html($language) . "</option>";
|
142 |
}
|
143 |
}
|
144 |
?>
|
164 |
if (get_option('srm_gmap_region', 'US') == $region_key) {
|
165 |
$selected = 'selected';
|
166 |
}
|
167 |
+
echo "<option value='" . esc_attr($region_key) . "' $selected>" . esc_html($region) . "</option>";
|
168 |
}
|
169 |
}
|
170 |
?>
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: google map, map, maps, google maps, map markers, google map plugin, google map embed, google maps plugin, wp google map, map plugin, map embed, best google maps, store locator, map direction, map widget, street view
|
5 |
Requires at least: 2.9
|
6 |
Tested up to: 5.9
|
7 |
-
Version: 1.8.
|
8 |
-
Stable tag: 1.8.
|
9 |
Requires PHP: 5.3
|
10 |
Text Domain: gmap-embed
|
11 |
License: GPLv2 or later
|
@@ -199,6 +199,10 @@ Learn more about how [Appsero collects and uses this data](https://appsero.com/p
|
|
199 |
|
200 |
== Changelog ==
|
201 |
|
|
|
|
|
|
|
|
|
202 |
= 1.8.4 =
|
203 |
* CSRF issue fixing
|
204 |
* Tabs UI update
|
4 |
Tags: google map, map, maps, google maps, map markers, google map plugin, google map embed, google maps plugin, wp google map, map plugin, map embed, best google maps, store locator, map direction, map widget, street view
|
5 |
Requires at least: 2.9
|
6 |
Tested up to: 5.9
|
7 |
+
Version: 1.8.5
|
8 |
+
Stable tag: 1.8.5
|
9 |
Requires PHP: 5.3
|
10 |
Text Domain: gmap-embed
|
11 |
License: GPLv2 or later
|
199 |
|
200 |
== Changelog ==
|
201 |
|
202 |
+
= 1.8.5 =
|
203 |
+
* Code Optimization
|
204 |
+
* Security enhancement
|
205 |
+
|
206 |
= 1.8.4 =
|
207 |
* CSRF issue fixing
|
208 |
* Tabs UI update
|
srm_gmap_embed.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
Text Domain: gmap-embed
|
8 |
Domain Path: /languages
|
9 |
Author URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
10 |
-
Version: 1.8.
|
11 |
*/
|
12 |
|
13 |
use WGMSRM\Classes\Database;
|
@@ -16,7 +16,7 @@ if (!defined('ABSPATH')) {
|
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
-
define('WGM_PLUGIN_VERSION', '1.8.
|
20 |
define('WGM_PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__)));
|
21 |
define('WGM_PLUGIN_URL', trailingslashit(plugins_url('/', __FILE__)));
|
22 |
|
7 |
Text Domain: gmap-embed
|
8 |
Domain Path: /languages
|
9 |
Author URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
|
10 |
+
Version: 1.8.5
|
11 |
*/
|
12 |
|
13 |
use WGMSRM\Classes\Database;
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
+
define('WGM_PLUGIN_VERSION', '1.8.5');
|
20 |
define('WGM_PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__)));
|
21 |
define('WGM_PLUGIN_URL', trailingslashit(plugins_url('/', __FILE__)));
|
22 |
|