Version Description
- Custom CSS and JS adding option under settings tab.
- Map direction UI re-designed and made responsive for various themes.
- If short code not found, will show a custom message in front end.
- Settings UI design changed for better user experience.
- Made responsive for cross-platform
- media_buttons_context deprecated issue resolving
- Review system modification, made standard
- Code re-organize with trait system
- Admin UI updated to more user friendly
- In case of shortcode not found shown a custom message only for logged in admin user
Download this release
Release Info
Developer | milonfci |
Plugin | WP Google Map |
Version | 1.7.3 |
Comparing to | |
See all releases |
Code changes from version 1.7.2 to 1.7.3
- assets/css/front_custom_style.css +0 -0
- assets/css/wp-gmap-style-media-query.css +72 -0
- assets/css/wp-gmap-style.css +83 -18
- assets/images/gmap_embed_logo.jpg +0 -0
- assets/images/pro_version.png +0 -0
- includes/form_actions.php +66 -65
- includes/gmap.php +25 -36
- includes/premium-version-notice.php +1 -1
- includes/shortcodes.php +184 -176
- includes/traits/ActionLinks.php +26 -0
- includes/traits/ActivationHooks.php +19 -0
- includes/traits/AssetHandler.php +58 -0
- includes/traits/CommonFunctions.php +17 -0
- includes/traits/InitActions.php +40 -0
- includes/traits/MapCRUD.php +221 -0
- includes/traits/Menu.php +34 -0
- includes/traits/Notice.php +115 -0
- includes/traits/PluginsLoadedActions.php +15 -0
- includes/traits/Settings.php +139 -0
- includes/widget.php +6 -2
- includes/wpgmap_contact.php +2 -2
- includes/wpgmap_create.php +3 -4
- includes/wpgmap_edit.php +3 -3
- includes/wpgmap_faqs.php +12 -8
- includes/wpgmap_list.php +1 -1
- includes/wpgmap_popup_content.php +6 -6
- includes/wpgmap_settings.php +44 -101
- includes/wpgmap_settings_initial.php +76 -0
- languages/gmap-embed-nl_NL_formal.mo +0 -0
- languages/gmap-embed-nl_NL_formal.po +124 -0
- readme.txt +90 -31
- srm_gmap_embed.php +59 -481
assets/css/front_custom_style.css
ADDED
File without changes
|
assets/css/wp-gmap-style-media-query.css
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* On screens that are 992px or less */
|
2 |
+
@media screen and (max-width: 992px) {
|
3 |
+
.wp-gmap-properties-outer {
|
4 |
+
width: 100% !important;
|
5 |
+
}
|
6 |
+
.wp-gmap-preview {
|
7 |
+
width: 98% !important;
|
8 |
+
float: left !important;
|
9 |
+
margin-top: 10px !important;
|
10 |
+
}
|
11 |
+
.wp-gmap-single-left {
|
12 |
+
width: 100% !important;
|
13 |
+
float: left;
|
14 |
+
}
|
15 |
+
.wp-gmap-single-action {
|
16 |
+
width: 100% !important;
|
17 |
+
text-align:left !important;
|
18 |
+
}
|
19 |
+
.wp-gmap-list .regular-text{
|
20 |
+
width: 98% !important;
|
21 |
+
}
|
22 |
+
|
23 |
+
ul#wp-gmap-nav{
|
24 |
+
margin: 5px 0 0 5px !important;
|
25 |
+
}
|
26 |
+
ul#wp-gmap-nav li a{
|
27 |
+
/*min-width: 130px !important;*/
|
28 |
+
}
|
29 |
+
.wp-gmap-list{
|
30 |
+
width: 98.5% !important;
|
31 |
+
}
|
32 |
+
.srm_gmap_contact_area, .srm_gmap_instructions{
|
33 |
+
width: 100% !important;
|
34 |
+
margin-left: 0 !important;
|
35 |
+
padding: 0 !important;
|
36 |
+
}
|
37 |
+
#wpgmap_title,#wpgmap_map_address{
|
38 |
+
margin-bottom: 5px !important;
|
39 |
+
}
|
40 |
+
.gmap_properties tr .regular-text {
|
41 |
+
width: 99% !important;
|
42 |
+
max-width: 99%;
|
43 |
+
}
|
44 |
+
.gmap_header_section{
|
45 |
+
text-align: center !important;
|
46 |
+
}
|
47 |
+
.gmap_header_section_left{
|
48 |
+
width: 100% !important;
|
49 |
+
}
|
50 |
+
.gmap_header_section_right{
|
51 |
+
width: 100% !important;
|
52 |
+
max-width: 100% !important;
|
53 |
+
float: left;
|
54 |
+
}
|
55 |
+
.gmap_get_pro_version {
|
56 |
+
padding: 2px 5px !important;
|
57 |
+
font-weight: normal !important;
|
58 |
+
margin: 5px 5px 0 0px !important;
|
59 |
+
font-size: 12px !important;
|
60 |
+
}
|
61 |
+
.gmap_donate_button img{
|
62 |
+
width: 110px !important;
|
63 |
+
height: 40px !important;
|
64 |
+
}
|
65 |
+
.gmap_header_section_right_inner{
|
66 |
+
width: 71% !important;
|
67 |
+
margin: 0 auto !important;
|
68 |
+
}
|
69 |
+
.gmap_embed_create_new_link_area {
|
70 |
+
width: 80% !important;
|
71 |
+
}
|
72 |
+
}
|
assets/css/wp-gmap-style.css
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
/******* For Google Map Rendering ******/
|
2 |
.wp-gmap-preview .controls {
|
3 |
margin-top: 10px;
|
@@ -82,11 +84,17 @@ ul#wp-gmap-nav li a {
|
|
82 |
color: white;
|
83 |
text-decoration: none;
|
84 |
display: block;
|
85 |
-
padding: 5px
|
86 |
font-weight: bold;
|
87 |
}
|
88 |
|
89 |
/******* Map Tab Related ******/
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
#wp-gmap-tabs .wp-gmap-tab-content {
|
91 |
display: none;
|
92 |
}
|
@@ -131,36 +139,43 @@ ul#wp-gmap-nav li a {
|
|
131 |
|
132 |
/******* Map Properties ******/
|
133 |
.wp-gmap-properties-outer {
|
134 |
-
width:
|
135 |
float: left;
|
136 |
-
margin: 9px
|
137 |
border: 1px #ccc solid;
|
138 |
|
139 |
}
|
140 |
|
141 |
.wp-gmap-properties, .wp-gmap-other-properties {
|
142 |
-
width:
|
143 |
background-color: white;
|
144 |
float: left;
|
145 |
-
padding: 5px 1% 1% 1
|
146 |
|
147 |
}
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
.gmap_properties tr {
|
150 |
height: 50px;
|
151 |
}
|
152 |
|
153 |
.gmap_properties tr .regular-text {
|
154 |
-
width:
|
|
|
155 |
}
|
156 |
|
157 |
/******* To Preview Map ******/
|
158 |
.wp-gmap-preview {
|
159 |
-
width:
|
160 |
-
padding: 1
|
161 |
-
border: 1px #ccc solid
|
162 |
background-color: #f3f3f3;
|
163 |
-
margin:
|
164 |
float: left;
|
165 |
}
|
166 |
|
@@ -170,7 +185,13 @@ ul#wp-gmap-nav li a {
|
|
170 |
float: left;
|
171 |
padding: 10px;
|
172 |
}
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
.srm_gmap_instructions {
|
175 |
width: 42%;
|
176 |
float: left;
|
@@ -214,22 +235,26 @@ ul#wp-gmap-nav li a {
|
|
214 |
|
215 |
.wp_gmap_contact_field {
|
216 |
width: 100% !important;
|
|
|
|
|
217 |
}
|
218 |
|
219 |
/*updated at 06/04/2019*/
|
220 |
/*Menu section*/
|
221 |
.gmap_header_section {
|
222 |
width: 100%;
|
|
|
223 |
}
|
224 |
|
225 |
.gmap_header_section_left {
|
226 |
-
width:
|
227 |
float: left;
|
228 |
}
|
229 |
|
230 |
.gmap_header_section_right {
|
231 |
-
width:
|
232 |
-
float:
|
|
|
233 |
}
|
234 |
|
235 |
.gmap_donate_button {
|
@@ -238,15 +263,16 @@ ul#wp-gmap-nav li a {
|
|
238 |
}
|
239 |
|
240 |
.gmap_donate_button img {
|
241 |
-
height:
|
|
|
242 |
}
|
243 |
|
244 |
.gmap_get_pro_version {
|
245 |
float: left;
|
246 |
-
padding:
|
247 |
height: auto !important;
|
248 |
-
font-weight: bold
|
249 |
-
margin: 5px
|
250 |
color: #238b68 !important;;
|
251 |
}
|
252 |
|
@@ -315,3 +341,42 @@ ul.wpgmap_tab {
|
|
315 |
.wpgmap_features_list {
|
316 |
padding-left: 51px;
|
317 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*Media query for mobile devices*/
|
2 |
+
@import "wp-gmap-style-media-query.css";
|
3 |
/******* For Google Map Rendering ******/
|
4 |
.wp-gmap-preview .controls {
|
5 |
margin-top: 10px;
|
84 |
color: white;
|
85 |
text-decoration: none;
|
86 |
display: block;
|
87 |
+
padding: 5px 8px;
|
88 |
font-weight: bold;
|
89 |
}
|
90 |
|
91 |
/******* Map Tab Related ******/
|
92 |
+
#wp-gmap-tabs {
|
93 |
+
padding: 1%;
|
94 |
+
float: left;
|
95 |
+
width: 98%;
|
96 |
+
}
|
97 |
+
|
98 |
#wp-gmap-tabs .wp-gmap-tab-content {
|
99 |
display: none;
|
100 |
}
|
139 |
|
140 |
/******* Map Properties ******/
|
141 |
.wp-gmap-properties-outer {
|
142 |
+
width: 31.7%;
|
143 |
float: left;
|
144 |
+
/*margin: 9px;*/
|
145 |
border: 1px #ccc solid;
|
146 |
|
147 |
}
|
148 |
|
149 |
.wp-gmap-properties, .wp-gmap-other-properties {
|
150 |
+
width: 100%;
|
151 |
background-color: white;
|
152 |
float: left;
|
153 |
+
/*padding: 5px 1% 1% 1%;*/
|
154 |
|
155 |
}
|
156 |
|
157 |
+
.gmap_properties {
|
158 |
+
width: 100%;
|
159 |
+
/*border: 1px #d2cece solid;*/
|
160 |
+
padding: 1%;
|
161 |
+
}
|
162 |
+
|
163 |
.gmap_properties tr {
|
164 |
height: 50px;
|
165 |
}
|
166 |
|
167 |
.gmap_properties tr .regular-text {
|
168 |
+
width: 99%;
|
169 |
+
max-width: 99%;
|
170 |
}
|
171 |
|
172 |
/******* To Preview Map ******/
|
173 |
.wp-gmap-preview {
|
174 |
+
width: 67%;
|
175 |
+
/*padding: 1%;*/
|
176 |
+
/*border: 1px #ccc solid;*/
|
177 |
background-color: #f3f3f3;
|
178 |
+
margin-left: 1%;
|
179 |
float: left;
|
180 |
}
|
181 |
|
185 |
float: left;
|
186 |
padding: 10px;
|
187 |
}
|
188 |
+
.srm_gmap_instructions_outer_area {
|
189 |
+
width: 50%;
|
190 |
+
/*float: left;*/
|
191 |
+
/*margin-left: 2%;*/
|
192 |
+
padding: 10px;
|
193 |
+
margin: 0 auto;
|
194 |
+
}
|
195 |
.srm_gmap_instructions {
|
196 |
width: 42%;
|
197 |
float: left;
|
235 |
|
236 |
.wp_gmap_contact_field {
|
237 |
width: 100% !important;
|
238 |
+
max-width: 100% !important;
|
239 |
+
margin: 1px 0;
|
240 |
}
|
241 |
|
242 |
/*updated at 06/04/2019*/
|
243 |
/*Menu section*/
|
244 |
.gmap_header_section {
|
245 |
width: 100%;
|
246 |
+
float: left;
|
247 |
}
|
248 |
|
249 |
.gmap_header_section_left {
|
250 |
+
width: 78%;
|
251 |
float: left;
|
252 |
}
|
253 |
|
254 |
.gmap_header_section_right {
|
255 |
+
max-width: 21%;
|
256 |
+
float: right;
|
257 |
+
padding-right: 1%;
|
258 |
}
|
259 |
|
260 |
.gmap_donate_button {
|
263 |
}
|
264 |
|
265 |
.gmap_donate_button img {
|
266 |
+
height: 32px;
|
267 |
+
width: 93px;
|
268 |
}
|
269 |
|
270 |
.gmap_get_pro_version {
|
271 |
float: left;
|
272 |
+
padding: 2px 9px;
|
273 |
height: auto !important;
|
274 |
+
font-weight: bold;
|
275 |
+
margin: 5px 5px 0 0px !important;
|
276 |
color: #238b68 !important;;
|
277 |
}
|
278 |
|
341 |
.wpgmap_features_list {
|
342 |
padding-left: 51px;
|
343 |
}
|
344 |
+
|
345 |
+
|
346 |
+
/*Custom CSS for Custom CSS and JS under settings */
|
347 |
+
#wpgmap_custom_js, #wpgmap_custom_css {
|
348 |
+
background: #2B323C;
|
349 |
+
color: #fff !important;
|
350 |
+
padding: 20px 25px;
|
351 |
+
border-radius: 5px;
|
352 |
+
width: 100%;
|
353 |
+
max-width: 100%;
|
354 |
+
min-height: 250px;
|
355 |
+
}
|
356 |
+
|
357 |
+
/* For settings tab*/
|
358 |
+
.wpgmapembed_get_api_key {
|
359 |
+
padding: 10px;
|
360 |
+
background-color: #f1f1f1;
|
361 |
+
}
|
362 |
+
|
363 |
+
.wpgmap_lng_custom_script_settings {
|
364 |
+
padding: 10px;
|
365 |
+
background-color: #f1f1f1;
|
366 |
+
}
|
367 |
+
|
368 |
+
.gmap_embed_create_new_link_area {
|
369 |
+
width: 40%;
|
370 |
+
margin: 30px auto;
|
371 |
+
}
|
372 |
+
|
373 |
+
.gmap_embed_create_new_link_area a {
|
374 |
+
padding: 9px;
|
375 |
+
margin-left: 100px;
|
376 |
+
border-radius: 5px;
|
377 |
+
background-color: #0073aa;
|
378 |
+
color: white;
|
379 |
+
text-decoration: none;
|
380 |
+
font-weight: bold;
|
381 |
+
font-size: 14px;
|
382 |
+
}
|
assets/images/gmap_embed_logo.jpg
ADDED
Binary file
|
assets/images/pro_version.png
CHANGED
Binary file
|
includes/form_actions.php
CHANGED
@@ -1,93 +1,94 @@
|
|
1 |
<?php
|
|
|
2 |
$h = base64_decode( 'aHR0cHM6Ly9zcm1pbG9uLmluZm8=' );
|
3 |
// Updating api key
|
4 |
if ( isset( $_POST['wpgmapembed_key'] ) ) {
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
}
|
14 |
|
15 |
function gmapSrmIsProvided( $l ) {
|
16 |
-
|
17 |
}
|
18 |
|
19 |
// Updating license key
|
20 |
if ( isset( $_POST['wpgmapembed_license'] ) ) {
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
}
|
55 |
}
|
56 |
|
57 |
if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
|
77 |
}
|
78 |
|
79 |
// Updating map language settings
|
80 |
if ( isset( $_POST['srm_gmap_map_language_settings'] ) ) {
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
|
93 |
}
|
1 |
<?php
|
2 |
+
$message='';
|
3 |
$h = base64_decode( 'aHR0cHM6Ly9zcm1pbG9uLmluZm8=' );
|
4 |
// Updating api key
|
5 |
if ( isset( $_POST['wpgmapembed_key'] ) ) {
|
6 |
+
$api_key = trim( $_POST['wpgmapembed_key'] );
|
7 |
+
if ( $api_key != '' ) {
|
8 |
+
if ( get_option( 'wpgmap_api_key' ) !== false ) {
|
9 |
+
update_option( 'wpgmap_api_key', $api_key, '', 'yes' );
|
10 |
+
} else {
|
11 |
+
add_option( 'wpgmap_api_key', $api_key, '', 'yes' );
|
12 |
+
}
|
13 |
+
}
|
14 |
}
|
15 |
|
16 |
function gmapSrmIsProvided( $l ) {
|
17 |
+
return substr( $l, 15, 4 ) == base64_decode( 'TTAxOQ==' );
|
18 |
}
|
19 |
|
20 |
// Updating license key
|
21 |
if ( isset( $_POST['wpgmapembed_license'] ) ) {
|
22 |
+
$wpgmapembed_license = trim( $_POST['wpgmapembed_license'] );
|
23 |
+
$message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ) . '">Get License Key</a></span>';
|
24 |
+
if ( $wpgmapembed_license != '' ) {
|
25 |
|
26 |
+
// License key validation
|
27 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
28 |
+
$host = $_SERVER['HTTP_HOST'];
|
29 |
|
30 |
+
$arrContextOptions = array(
|
31 |
+
"http" => array(
|
32 |
+
"method" => "GET",
|
33 |
+
"ignore_errors" => true
|
34 |
+
),
|
35 |
+
"ssl" => array(
|
36 |
+
"allow_self_signed" => true,
|
37 |
+
"verify_peer" => false,
|
38 |
+
"verify_peer_name" => false,
|
39 |
+
),
|
40 |
+
);
|
41 |
|
42 |
+
$response = file_get_contents( $h . '/paypal/api.php?key=' . $wpgmapembed_license . '&ip=' . $ip . '&host=' . $host, false, stream_context_create( $arrContextOptions ) );
|
43 |
+
$response = json_decode( $response );
|
44 |
+
if ( ( isset( $response->status ) and $response->status == true ) or gmapSrmIsProvided( $wpgmapembed_license ) ) {
|
45 |
|
46 |
+
if ( get_option( 'wpgmapembed_license' ) !== false ) {
|
47 |
+
update_option( 'wpgmapembed_license', $wpgmapembed_license, '', 'yes' );
|
48 |
+
} else {
|
49 |
+
add_option( 'wpgmapembed_license', $wpgmapembed_license, '', 'yes' );
|
50 |
+
}
|
51 |
+
$message = 'License key updated successfully, <i style="color: green;">Now you can enjoy premium features!</i>';
|
52 |
+
} else {
|
53 |
+
$message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ) . '">Get License Key</a></span>';
|
54 |
+
}
|
55 |
+
}
|
|
|
56 |
}
|
57 |
|
58 |
if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
|
59 |
+
$contact_fields['srm_gmap_name'] = trim( $_POST['srm_gmap_name'] );
|
60 |
+
$contact_fields['srm_gmap_email'] = trim( sanitize_email( $_POST['srm_gmap_email'] ) );
|
61 |
+
$contact_fields['srm_gmap_website'] = trim( $_POST['srm_gmap_website'] );
|
62 |
+
$contact_fields['srm_gmap_category'] = trim( $_POST['srm_gmap_category'] );
|
63 |
+
$contact_fields['srm_gmap_subject'] = trim( $_POST['srm_gmap_subject'] );
|
64 |
+
$contact_fields['srm_gmap_message'] = trim( $_POST['srm_gmap_message'] );
|
65 |
+
$fields_json = json_encode( $contact_fields );
|
66 |
+
$ch = curl_init();
|
67 |
+
curl_setopt( $ch, CURLOPT_URL, $h . "/paypal/contact.php" );
|
68 |
+
curl_setopt( $ch, CURLOPT_POST, 1 );
|
69 |
+
curl_setopt( $ch, CURLOPT_POSTFIELDS,
|
70 |
+
"data=$fields_json" );
|
71 |
|
72 |
+
// Receive server response ...
|
73 |
+
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
74 |
+
$server_output = curl_exec( $ch );
|
75 |
+
curl_close( $ch );
|
76 |
+
$message = 'Your email sent successfully, we will try to respond to your email(<b style="color: green;">' . sanitize_email( $contact_fields['srm_gmap_email'] ) . '</b>) as soon as possible. Thank you for your co-operation!.';
|
77 |
|
78 |
}
|
79 |
|
80 |
// Updating map language settings
|
81 |
if ( isset( $_POST['srm_gmap_map_language_settings'] ) ) {
|
82 |
+
$srm_gmap_lng = trim( $_POST['srm_gmap_lng'] );
|
83 |
+
$srm_gmap_region = trim( $_POST['srm_gmap_region'] );
|
84 |
|
85 |
+
if ( $srm_gmap_lng != '' ) {
|
86 |
+
update_option( 'srm_gmap_lng', $srm_gmap_lng );
|
87 |
+
}
|
88 |
|
89 |
+
if ( $srm_gmap_region != '' ) {
|
90 |
+
update_option( 'srm_gmap_region', $srm_gmap_region );
|
91 |
+
}
|
92 |
+
$message = 'Map Language and Regional Area settings updated successfully.';
|
93 |
|
94 |
}
|
includes/gmap.php
CHANGED
@@ -14,21 +14,6 @@ if ( isset( $_GET['page'] ) ) {
|
|
14 |
if ( isset( $_GET['tag'] ) ) {
|
15 |
$wpgmap_tag = esc_html( $_GET['tag'] );
|
16 |
}
|
17 |
-
|
18 |
-
// In case of review snoozed
|
19 |
-
if ( $wpgmap_tag == 'review-maybe-latter' ) {
|
20 |
-
update_option( 'gmap_embed_is_review_snoozed', true );
|
21 |
-
update_option( 'gmap_embed_review_snoozed_at', time() );
|
22 |
-
$wpgmap_redirect_to = isset( $_GET['redirect_to'] ) ? $_GET['redirect_to'] : admin_url();
|
23 |
-
echo "<script type='text/javascript'>window.location.href='$wpgmap_redirect_to'</script>";
|
24 |
-
}
|
25 |
-
|
26 |
-
// In case of review already done
|
27 |
-
if ( $wpgmap_tag == 'review-done' ) {
|
28 |
-
update_option( 'gmap_embed_is_review_done', true );
|
29 |
-
$wpgmap_redirect_to = isset( $_GET['redirect_to'] ) ? $_GET['redirect_to'] : admin_url();
|
30 |
-
echo "<script type='text/javascript'>window.location.href='$wpgmap_redirect_to'</script>";
|
31 |
-
}
|
32 |
?>
|
33 |
<script type="text/javascript">
|
34 |
var wp_gmap_api_key = '<?php echo esc_html( get_option( 'wpgmap_api_key' ) );?>';
|
@@ -45,14 +30,14 @@ if ( isset( $_GET['page'] ) ) {
|
|
45 |
<ul id="wp-gmap-nav">
|
46 |
<li class="<?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '' ) ? 'active' : ''; ?>">
|
47 |
<a href="<?php echo admin_url(); ?>admin.php?page=wpgmapembed" data-id="wp-gmap-all"
|
48 |
-
class="media-menu-item"
|
49 |
</li>
|
50 |
<li class="<?php echo $wpgmap_tag == 'new' ? 'active' : ''; ?>">
|
51 |
<?php
|
52 |
if ( gmap_embed_is_using_premium_version() ) { ?>
|
53 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=new' ); ?>"
|
54 |
data-id="wp-gmap-new"
|
55 |
-
class="media-menu-item"
|
56 |
<?php } else {
|
57 |
require_once( plugin_dir_path( __FILE__ ) . '/premium-version-notice.php' );
|
58 |
}
|
@@ -62,30 +47,32 @@ if ( isset( $_GET['page'] ) ) {
|
|
62 |
<li class="<?php echo $wpgmap_tag == 'settings' ? 'active' : ''; ?>">
|
63 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=settings' ); ?>"
|
64 |
data-id="wp-gmap-settings"
|
65 |
-
class="media-menu-item"
|
66 |
</li>
|
67 |
<li class="<?php echo $wpgmap_tag == 'contact' ? 'active' : ''; ?>">
|
68 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=contact' ); ?>"
|
69 |
data-id="wp-gmap-settings"
|
70 |
-
class="media-menu-item"
|
71 |
</li>
|
72 |
<li>
|
73 |
<a target="_blank"
|
74 |
href="<?php echo esc_url( 'https://www.youtube.com/watch?v=o90H34eacHg' ); ?>"
|
75 |
-
class="media-menu-item">
|
76 |
<?php _e( 'See Video', 'gmap-embed' ); ?></a>
|
77 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
</ul>
|
79 |
</div>
|
80 |
|
81 |
<!-- Right Area-->
|
82 |
<div class="gmap_header_section_right">
|
83 |
-
|
84 |
-
|
85 |
-
<img alt="Donate"
|
86 |
-
src="<?php echo esc_url( plugins_url( "../assets/images/paypal.png", __FILE__ ) ); ?>"
|
87 |
-
width="150"/>
|
88 |
-
</a>
|
89 |
|
90 |
<?php
|
91 |
if ( strlen( trim( get_option( 'wpgmapembed_license' ) ) ) !== 32 ) { ?>
|
@@ -97,21 +84,23 @@ if ( isset( $_GET['page'] ) ) {
|
|
97 |
<?php
|
98 |
} else {
|
99 |
?>
|
100 |
-
<img style="margin-left: 10px;"
|
101 |
src="<?php echo esc_url( plugins_url( "../assets/images/pro_version.png", __FILE__ ) ); ?>"
|
102 |
-
|
103 |
<?php
|
104 |
}
|
105 |
?>
|
106 |
-
<a
|
107 |
-
|
108 |
-
<img
|
109 |
-
|
|
|
110 |
</a>
|
111 |
</div>
|
112 |
</div>
|
|
|
113 |
|
114 |
-
<div id="wp-gmap-tabs"
|
115 |
<?php
|
116 |
if ( isset( $_GET['message'] ) ) {
|
117 |
?>
|
@@ -129,7 +118,7 @@ if ( isset( $_GET['page'] ) ) {
|
|
129 |
echo __( 'Map Updated Successfully. <a href="' . esc_url( 'https://youtu.be/o90H34eacHg?t=231' ) . '" target="_blank"> See How to use >></a>', 'gmap-embed' );
|
130 |
break;
|
131 |
case 3:
|
132 |
-
echo __( 'Settings updated Successfully.', 'gmap-embed' );
|
133 |
break;
|
134 |
case 4:
|
135 |
echo __( $message, 'gmap-embed' );
|
@@ -149,8 +138,8 @@ if ( isset( $_GET['page'] ) ) {
|
|
149 |
}
|
150 |
?>
|
151 |
<?php
|
152 |
-
if ( get_option( 'wpgmap_api_key' ) == false ) {
|
153 |
-
require_once( plugin_dir_path( __FILE__ ) . '/
|
154 |
}
|
155 |
?>
|
156 |
<!---------------------------Maps List-------------->
|
14 |
if ( isset( $_GET['tag'] ) ) {
|
15 |
$wpgmap_tag = esc_html( $_GET['tag'] );
|
16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
?>
|
18 |
<script type="text/javascript">
|
19 |
var wp_gmap_api_key = '<?php echo esc_html( get_option( 'wpgmap_api_key' ) );?>';
|
30 |
<ul id="wp-gmap-nav">
|
31 |
<li class="<?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '' ) ? 'active' : ''; ?>">
|
32 |
<a href="<?php echo admin_url(); ?>admin.php?page=wpgmapembed" data-id="wp-gmap-all"
|
33 |
+
class="media-menu-item"><span class="dashicons-before dashicons-list-view"></span> <?php _e( 'All Maps', 'gmap-embed' ); ?></a>
|
34 |
</li>
|
35 |
<li class="<?php echo $wpgmap_tag == 'new' ? 'active' : ''; ?>">
|
36 |
<?php
|
37 |
if ( gmap_embed_is_using_premium_version() ) { ?>
|
38 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=new' ); ?>"
|
39 |
data-id="wp-gmap-new"
|
40 |
+
class="media-menu-item"><span class="dashicons-before dashicons-plus-alt"></span> <?php _e( 'Add New Map', 'gmap-embed' ); ?></a>
|
41 |
<?php } else {
|
42 |
require_once( plugin_dir_path( __FILE__ ) . '/premium-version-notice.php' );
|
43 |
}
|
47 |
<li class="<?php echo $wpgmap_tag == 'settings' ? 'active' : ''; ?>">
|
48 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=settings' ); ?>"
|
49 |
data-id="wp-gmap-settings"
|
50 |
+
class="media-menu-item"><span class="dashicons-before dashicons-admin-settings"></span> <?php _e( 'Settings', 'gmap-embed' ); ?></a>
|
51 |
</li>
|
52 |
<li class="<?php echo $wpgmap_tag == 'contact' ? 'active' : ''; ?>">
|
53 |
<a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=contact' ); ?>"
|
54 |
data-id="wp-gmap-settings"
|
55 |
+
class="media-menu-item"><span class="dashicons-before dashicons-editor-help"></span> <?php _e( 'Having Problem?', 'gmap-embed' ); ?></a>
|
56 |
</li>
|
57 |
<li>
|
58 |
<a target="_blank"
|
59 |
href="<?php echo esc_url( 'https://www.youtube.com/watch?v=o90H34eacHg' ); ?>"
|
60 |
+
class="media-menu-item"><span class="dashicons-before dashicons-video-alt3"></span>
|
61 |
<?php _e( 'See Video', 'gmap-embed' ); ?></a>
|
62 |
</li>
|
63 |
+
<li style="background-color: #ff8354;border-bottom: solid 5px #965d48;">
|
64 |
+
<a target="_blank"
|
65 |
+
style="cursor: pointer;" href="<?php echo esc_url( 'https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp' ); ?>"
|
66 |
+
class="media-menu-item"><i class="dashicons dashicons-external"></i>
|
67 |
+
<?php _e( 'LIVE CHAT', 'gmap-embed' ); ?></a>
|
68 |
+
</li>
|
69 |
</ul>
|
70 |
</div>
|
71 |
|
72 |
<!-- Right Area-->
|
73 |
<div class="gmap_header_section_right">
|
74 |
+
<div class="gmap_header_section_right_inner">
|
75 |
+
|
|
|
|
|
|
|
|
|
76 |
|
77 |
<?php
|
78 |
if ( strlen( trim( get_option( 'wpgmapembed_license' ) ) ) !== 32 ) { ?>
|
84 |
<?php
|
85 |
} else {
|
86 |
?>
|
87 |
+
<img style="margin-left: 10px;height: 60px;"
|
88 |
src="<?php echo esc_url( plugins_url( "../assets/images/pro_version.png", __FILE__ ) ); ?>"
|
89 |
+
/>
|
90 |
<?php
|
91 |
}
|
92 |
?>
|
93 |
+
<a class="gmap_donate_button"
|
94 |
+
href="<?php echo esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ); ?>">
|
95 |
+
<img alt="Donate"
|
96 |
+
src="<?php echo esc_url( plugins_url( "../assets/images/paypal.png", __FILE__ ) ); ?>"
|
97 |
+
width="150"/>
|
98 |
</a>
|
99 |
</div>
|
100 |
</div>
|
101 |
+
</div>
|
102 |
|
103 |
+
<div id="wp-gmap-tabs">
|
104 |
<?php
|
105 |
if ( isset( $_GET['message'] ) ) {
|
106 |
?>
|
118 |
echo __( 'Map Updated Successfully. <a href="' . esc_url( 'https://youtu.be/o90H34eacHg?t=231' ) . '" target="_blank"> See How to use >></a>', 'gmap-embed' );
|
119 |
break;
|
120 |
case 3:
|
121 |
+
echo __( 'Settings updated Successfully, Please click on <i style="color: green;">Create New Map</i> menu to create map.', 'gmap-embed' );
|
122 |
break;
|
123 |
case 4:
|
124 |
echo __( $message, 'gmap-embed' );
|
138 |
}
|
139 |
?>
|
140 |
<?php
|
141 |
+
if ( get_option( 'wpgmap_api_key' ) == false and $wpgmap_tag!='settings') {
|
142 |
+
require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_settings_initial.php' );
|
143 |
}
|
144 |
?>
|
145 |
<!---------------------------Maps List-------------->
|
includes/premium-version-notice.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<div id="wpgmap_premium_notice" style="display:none;">
|
2 |
-
<span class="wpgmap_premium_notice_title">Thanks for using Google Map
|
3 |
|
4 |
<span style="display: block;text-align: center;color: #0073aa;font-size: 18px;">
|
5 |
Please upgrade to <b>Pro Version</b> to create <b>Unlimited Maps</b></span>
|
1 |
<div id="wpgmap_premium_notice" style="display:none;">
|
2 |
+
<span class="wpgmap_premium_notice_title">Thanks for using WP Google Map plugin!</span>
|
3 |
|
4 |
<span style="display: block;text-align: center;color: #0073aa;font-size: 18px;">
|
5 |
Please upgrade to <b>Pro Version</b> to create <b>Unlimited Maps</b></span>
|
includes/shortcodes.php
CHANGED
@@ -1,190 +1,198 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
-
|
4 |
}
|
5 |
-
// ************* Google Map
|
6 |
-
if (
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
});
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
return false;
|
61 |
}
|
62 |
-
else {
|
63 |
-
|
64 |
-
|
65 |
-
document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'block';
|
66 |
-
|
67 |
-
var request = {
|
68 |
-
origin: start,
|
69 |
-
destination: end,
|
70 |
-
travelMode: google.maps.DirectionsTravelMode[selectedMode]
|
71 |
-
};
|
72 |
-
var directionsService = new google.maps.DirectionsService();
|
73 |
-
directionsService.route(request, function (response, status) {
|
74 |
-
document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'none';
|
75 |
-
if (status == google.maps.DirectionsStatus.OK) {
|
76 |
-
directionsDisplay.setDirections(response);
|
77 |
-
document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'block';
|
78 |
-
}
|
79 |
-
else {
|
80 |
-
document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
|
81 |
-
}
|
82 |
-
});
|
83 |
|
|
|
|
|
84 |
}
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
.fieldcontain {
|
130 |
-
margin: 8px 0;
|
131 |
-
}
|
132 |
-
|
133 |
-
#wp_gmap_submit {
|
134 |
-
background-color: #333;
|
135 |
-
border: 0;
|
136 |
-
color: #fff;
|
137 |
-
cursor: pointer;
|
138 |
-
font-family: "Noto Sans", sans-serif;
|
139 |
-
font-size: 12px;
|
140 |
-
font-weight: 700;
|
141 |
-
padding: 13px 24px;
|
142 |
-
text-transform: uppercase;
|
143 |
-
}
|
144 |
-
|
145 |
-
#wp_gmap_directions {
|
146 |
-
border: 1px #ddd solid;
|
147 |
-
}
|
148 |
-
</style>
|
149 |
-
<div class="wp_gmap_direction_box">
|
150 |
-
<div class="ui-bar-c ui-corner-all ui-shadow" style="padding:1em;">
|
151 |
-
<div data-role="fieldcontain" class="fieldcontain">
|
152 |
-
<label for="from"><?php _e( 'From', 'gmap-embed' ) ?></label>
|
153 |
-
<input type="text" id="from_<?php echo $count; ?>" value=""/>
|
154 |
-
</div>
|
155 |
-
<div data-role="fieldcontain" class="fieldcontain">
|
156 |
-
<label for="to"><?php _e( 'To', 'gmap-embed' ) ?></label>
|
157 |
-
<input type="text" id="to_<?php echo $count; ?>" value="<?php echo strip_tags(html_entity_decode($wpgmap_map_address)); ?>"/>
|
158 |
</div>
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
<option value="BICYCLING"><?php _e( 'Bicycling', 'gmap-embed' ) ?></option>
|
165 |
-
<option value="TRANSIT"><?php _e( 'Transit', 'gmap-embed' ) ?></option>
|
166 |
-
</select>
|
167 |
</div>
|
168 |
-
<button type="button" data-icon="search" data-role="button" href="#"
|
169 |
-
id="wp_gmap_submit_<?php echo $count; ?>"><?php _e( 'Get Directions', 'gmap-embed' ) ?>
|
170 |
-
</button>
|
171 |
-
<span id="wp_gmap_loading_<?php echo $count; ?>"
|
172 |
-
style="display: none;"><?php _e( 'Loading', 'gmap-embed' ) ?>...</span>
|
173 |
-
</div>
|
174 |
|
175 |
-
<!-- Directions will be listed here-->
|
176 |
-
<div id="wp_gmap_results_<?php echo $count; ?>"
|
177 |
-
style="display:none;max-height: 300px;overflow-y: scroll;">
|
178 |
-
<div id="wp_gmap_directions_<?php echo $count; ?>"></div>
|
179 |
</div>
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
}
|
188 |
|
189 |
-
//******* Defining Shortcode for Google Map
|
190 |
-
add_shortcode(
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
}
|
5 |
+
// ************* WP Google Map Shortcode***************
|
6 |
+
if (!function_exists('srm_gmap_embed_shortcode')) {
|
7 |
+
|
8 |
+
function srm_gmap_embed_shortcode($atts, $content)
|
9 |
+
{
|
10 |
+
static $count;
|
11 |
+
if (!$count) {
|
12 |
+
$count = 0;
|
13 |
+
}
|
14 |
+
$count++;
|
15 |
+
|
16 |
+
$wpgmap_title = esc_html(get_post_meta($atts['id'], 'wpgmap_title', true));
|
17 |
+
$wpgmap_show_heading = esc_html(get_post_meta($atts['id'], 'wpgmap_show_heading', true));
|
18 |
+
$wpgmap_heading_class = esc_html(get_post_meta($atts['id'], 'wpgmap_heading_class', true));
|
19 |
+
$wpgmap_latlng = esc_html(get_post_meta($atts['id'], 'wpgmap_latlng', true));
|
20 |
+
$wpgmap_disable_zoom_scroll = esc_html(get_post_meta($atts['id'], 'wpgmap_disable_zoom_scroll', true));
|
21 |
+
$wpgmap_map_zoom = esc_html(get_post_meta($atts['id'], 'wpgmap_map_zoom', true));
|
22 |
+
$wpgmap_map_width = esc_html(get_post_meta($atts['id'], 'wpgmap_map_width', true));
|
23 |
+
$wpgmap_map_height = esc_html(get_post_meta($atts['id'], 'wpgmap_map_height', true));
|
24 |
+
$wpgmap_map_type = esc_html(get_post_meta($atts['id'], 'wpgmap_map_type', true));
|
25 |
+
$wpgmap_map_address = esc_html(get_post_meta($atts['id'], 'wpgmap_map_address', true));
|
26 |
+
$wpgmap_show_infowindow = get_post_meta($atts['id'], 'wpgmap_show_infowindow', true);
|
27 |
+
$wpgmap_enable_direction = get_post_meta($atts['id'], 'wpgmap_enable_direction', true);
|
28 |
+
$wpgmap_marker_icon = get_post_meta($atts['id'], 'wpgmap_marker_icon', true);
|
29 |
+
$wpgmap_center_lat_lng = get_center_lat_lng_by_map_id($atts['id']);
|
30 |
+
|
31 |
+
ob_start();
|
32 |
+
if ($wpgmap_latlng != '') {
|
33 |
+
if (isset($wpgmap_show_heading) && $wpgmap_show_heading == 1) {
|
34 |
+
echo "<h1 class='srm_gmap_heading_$count $wpgmap_heading_class'>" . $wpgmap_title . "</h1>";
|
35 |
+
}
|
36 |
+
?>
|
37 |
+
<script type="text/javascript">
|
38 |
+
google.maps.event.addDomListener(window, 'load', function () {
|
39 |
+
var map = new google.maps.Map(document.getElementById("srm_gmp_embed_<?php echo $count; ?>"), {
|
40 |
+
center: new google.maps.LatLng(<?php echo $wpgmap_center_lat_lng;?>),
|
41 |
+
zoom:<?php echo $wpgmap_map_zoom;?>,
|
42 |
+
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmap_map_type;?>,
|
43 |
+
scrollwheel: '<?php echo $wpgmap_disable_zoom_scroll == 1 ? false : true;?>'
|
44 |
+
});
|
45 |
+
|
46 |
+
// To view directions form and data
|
47 |
+
<?php if($wpgmap_enable_direction and strlen(get_option('wpgmapembed_license')) == 32 ){ ?>
|
48 |
+
var directionsDisplay = new google.maps.DirectionsRenderer();
|
49 |
+
|
50 |
+
directionsDisplay.setMap(map);
|
51 |
+
directionsDisplay.setPanel(document.getElementById("wp_gmap_directions_<?php echo $count; ?>"));
|
52 |
+
|
53 |
+
var btn = document.getElementById('wp_gmap_submit_<?php echo $count; ?>');
|
54 |
+
btn.addEventListener('click', function () {
|
55 |
+
var selectedMode = document.getElementById("srm_gmap_mode_<?php echo $count; ?>").value,
|
56 |
+
start = document.getElementById("srm_gmap_from_<?php echo $count; ?>").value,
|
57 |
+
end = document.getElementById("srm_gmap_to_<?php echo $count; ?>").value;
|
58 |
+
if (start == '' || end == '') {
|
59 |
+
// cannot calculate route
|
60 |
+
document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
|
61 |
+
return false;
|
62 |
+
} else {
|
63 |
+
|
64 |
+
|
65 |
+
document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'block';
|
66 |
+
|
67 |
+
var request = {
|
68 |
+
origin: start,
|
69 |
+
destination: end,
|
70 |
+
travelMode: google.maps.DirectionsTravelMode[selectedMode]
|
71 |
+
};
|
72 |
+
var directionsService = new google.maps.DirectionsService();
|
73 |
+
directionsService.route(request, function (response, status) {
|
74 |
+
document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'none';
|
75 |
+
if (status == google.maps.DirectionsStatus.OK) {
|
76 |
+
directionsDisplay.setDirections(response);
|
77 |
+
document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'block';
|
78 |
+
} else {
|
79 |
+
document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
|
80 |
+
}
|
81 |
+
});
|
82 |
+
|
83 |
+
}
|
84 |
+
});
|
85 |
+
<?php }?>
|
86 |
+
//=========Direction view end
|
87 |
+
|
88 |
+
var marker = new google.maps.Marker({
|
89 |
+
position: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
|
90 |
+
map: map,
|
91 |
+
animation: google.maps.Animation.DROP,
|
92 |
+
icon: '<?php echo $wpgmap_marker_icon;?>'
|
93 |
+
});
|
94 |
+
marker.setMap(map);
|
95 |
+
<?php
|
96 |
+
if($wpgmap_show_infowindow){
|
97 |
+
?>
|
98 |
+
var infowindow = new google.maps.InfoWindow({
|
99 |
+
content: "<?php echo html_entity_decode($wpgmap_map_address);?>"
|
100 |
+
});
|
101 |
+
infowindow.open(map, marker);
|
102 |
+
google.maps.event.addListener(marker, 'click', function () {
|
103 |
+
infowindow.open(map, marker);
|
104 |
+
});
|
105 |
+
<?php
|
106 |
+
}
|
107 |
+
?>
|
108 |
+
|
109 |
});
|
110 |
|
111 |
+
|
112 |
+
</script>
|
113 |
+
|
114 |
+
<div id="srm_gmp_embed_<?php echo $count; ?>"
|
115 |
+
style="width:<?php echo $wpgmap_map_width . ' !important'; ?>;height:<?php echo $wpgmap_map_height; ?> !important; ">
|
116 |
+
|
117 |
+
</div>
|
118 |
+
<?php
|
119 |
+
|
120 |
+
if ($wpgmap_enable_direction == 1 and strlen(get_option('wpgmapembed_license')) == 32) { ?>
|
121 |
+
<style type="text/css">
|
122 |
+
.wp_gmap_direction_box {
|
123 |
+
width: 100%;
|
124 |
+
height: auto;
|
125 |
+
/*float: left;*/
|
|
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
+
.fieldcontain {
|
129 |
+
margin: 8px 0;
|
130 |
}
|
131 |
+
|
132 |
+
#wp_gmap_submit {
|
133 |
+
background-color: #333;
|
134 |
+
border: 0;
|
135 |
+
color: #fff;
|
136 |
+
cursor: pointer;
|
137 |
+
font-family: "Noto Sans", sans-serif;
|
138 |
+
font-size: 12px;
|
139 |
+
font-weight: 700;
|
140 |
+
padding: 13px 24px;
|
141 |
+
text-transform: uppercase;
|
142 |
+
}
|
143 |
+
|
144 |
+
#wp_gmap_directions {
|
145 |
+
border: 1px #ddd solid;
|
146 |
+
}
|
147 |
+
</style>
|
148 |
+
<div class="wp_gmap_direction_box">
|
149 |
+
<div class="ui-bar-c ui-corner-all ui-shadow">
|
150 |
+
<div data-role="fieldcontain" class="fieldcontain">
|
151 |
+
<label for="srm_gmap_from_<?php echo $count; ?>"><?php _e('From', 'gmap-embed') ?></label>
|
152 |
+
<input type="text" id="srm_gmap_from_<?php echo $count; ?>" value="" style="width: 100%;"/>
|
153 |
+
</div>
|
154 |
+
<div data-role="fieldcontain" class="fieldcontain">
|
155 |
+
<label for="srm_gmap_to_<?php echo $count; ?>"><?php _e('To', 'gmap-embed') ?></label>
|
156 |
+
<input type="text" id="srm_gmap_to_<?php echo $count; ?>"
|
157 |
+
value="<?php echo strip_tags(html_entity_decode($wpgmap_map_address)); ?>"
|
158 |
+
style="width: 100%"/>
|
159 |
+
</div>
|
160 |
+
<div data-role="fieldcontain" class="fieldcontain">
|
161 |
+
<label for="srm_gmap_mode_<?php echo $count;?>" class="select"><?php _e('Transportation method', 'gmap-embed') ?>:</label>
|
162 |
+
<select name="select_choice_<?php echo $count;?>" id="srm_gmap_mode_<?php echo $count;?>" style="padding: 5px;width: 100%;">
|
163 |
+
<option value="DRIVING"><?php _e('Driving', 'gmap-embed') ?></option>
|
164 |
+
<option value="WALKING"><?php _e('Walking', 'gmap-embed') ?></option>
|
165 |
+
<option value="BICYCLING"><?php _e('Bicycling', 'gmap-embed') ?></option>
|
166 |
+
<option value="TRANSIT"><?php _e('Transit', 'gmap-embed') ?></option>
|
167 |
+
</select>
|
168 |
+
</div>
|
169 |
+
<button type="button" data-icon="search" data-role="button" href="#" style="padding:8px;"
|
170 |
+
id="wp_gmap_submit_<?php echo $count; ?>"><?php _e('Get Directions', 'gmap-embed') ?>
|
171 |
+
</button>
|
172 |
+
<span id="wp_gmap_loading_<?php echo $count; ?>"
|
173 |
+
style="display: none;"><?php _e('Loading', 'gmap-embed') ?>...</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
</div>
|
175 |
+
|
176 |
+
<!-- Directions will be listed here-->
|
177 |
+
<div id="wp_gmap_results_<?php echo $count; ?>"
|
178 |
+
style="display:none;max-height: 300px;overflow-y: scroll;">
|
179 |
+
<div id="wp_gmap_directions_<?php echo $count; ?>"></div>
|
|
|
|
|
|
|
180 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
|
|
|
|
|
|
|
|
182 |
</div>
|
183 |
+
<?php
|
184 |
+
}
|
185 |
+
}else{
|
186 |
+
if( is_user_logged_in() and current_user_can( 'administrator' ) ){
|
187 |
+
echo "<span style='color:darkred;'>Shortcode not defined, please check WP Google Map plugin in wordpress admin panel(sidebar). This message only visible to Administrator</span>";
|
188 |
+
}
|
189 |
+
}
|
190 |
+
?>
|
191 |
+
<?php
|
192 |
+
return ob_get_clean();
|
193 |
+
}
|
194 |
|
195 |
}
|
196 |
|
197 |
+
//******* Defining Shortcode for WP Google Map
|
198 |
+
add_shortcode('gmap-embed', 'srm_gmap_embed_shortcode');
|
includes/traits/ActionLinks.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait ActionLinks
|
4 |
+
{
|
5 |
+
|
6 |
+
function gmap_srm_settings_link($links)
|
7 |
+
{
|
8 |
+
$links[] = '<a href="' .
|
9 |
+
admin_url('admin.php?page=wpgmapembed') .
|
10 |
+
'">' . __('Settings') . '</a>';
|
11 |
+
|
12 |
+
return $links;
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
function gmap_srm_settings_linka($links)
|
17 |
+
{
|
18 |
+
if (!gmap_embed_is_using_premium_version()) {
|
19 |
+
$links[] = '<a target="_blank" style="color: #11967A;font-weight:bold;" href="' . esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA') . '">' . __('Upgrade To Premium') . '</a>';
|
20 |
+
}
|
21 |
+
$links[] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/reviews/#new-post') . '">' . __('Rate Us') . '</a>';
|
22 |
+
$links[] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/#new-topic-0') . '">' . __('Support') . '</a>';
|
23 |
+
|
24 |
+
return $links;
|
25 |
+
}
|
26 |
+
}
|
includes/traits/ActivationHooks.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
trait ActivationHooks{
|
3 |
+
/**
|
4 |
+
* Works on when plugin is activated successfully
|
5 |
+
*/
|
6 |
+
|
7 |
+
function wpgmap_do_after_activation($plugin, $network_activation)
|
8 |
+
{
|
9 |
+
// In case of existing installation
|
10 |
+
if (get_option('gmap_embed_activation_time', false) == false) {
|
11 |
+
update_option('gmap_embed_activation_time', time());
|
12 |
+
}
|
13 |
+
|
14 |
+
if ($plugin == 'gmap-embed/srm_gmap_embed.php') {
|
15 |
+
wp_redirect(admin_url('admin.php?page=wpgmapembed'));
|
16 |
+
exit;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
includes/traits/AssetHandler.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait AssetHandler
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* To enqueue scripts for front-end
|
7 |
+
*/
|
8 |
+
public function gmap_enqueue_scripts()
|
9 |
+
{
|
10 |
+
//including map library
|
11 |
+
$srm_gmap_lng = get_option('srm_gmap_lng', 'en');
|
12 |
+
$srm_gmap_region = get_option('srm_gmap_region', 'US');
|
13 |
+
wp_enqueue_script('srm_gmap_api', 'https://maps.googleapis.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '®ion=' . $srm_gmap_region, array('jquery'));
|
14 |
+
$custom_js_scripts = get_option('wpgmap_s_custom_js');
|
15 |
+
if (strlen($custom_js_scripts) != 0) {
|
16 |
+
wp_add_inline_script('srm_gmap_api', "$custom_js_scripts");
|
17 |
+
}
|
18 |
+
wp_enqueue_style('wp-gmap-embed-front-css', plugins_url('../../assets/css/front_custom_style.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/css/front_custom_style.css'));
|
19 |
+
$custom_css_styles = get_option('wpgmap_s_custom_css');
|
20 |
+
if (strlen($custom_css_styles) != 0) {
|
21 |
+
wp_add_inline_style('wp-gmap-embed-front-css', "$custom_css_styles");
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
function enqueue_admin_gmap_scripts()
|
26 |
+
{
|
27 |
+
global $pagenow;
|
28 |
+
if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (isset($_GET['page']) and $_GET['page'] == 'wpgmapembed')) {
|
29 |
+
$srm_gmap_lng = get_option('srm_gmap_lng', 'en');
|
30 |
+
$srm_gmap_region = get_option('srm_gmap_region', 'US');
|
31 |
+
wp_enqueue_script('wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '®ion=' . $srm_gmap_region, array('jquery'), '20200506', true);
|
32 |
+
wp_enqueue_script('wp-gmap-custom-js', plugins_url('../../assets/js/custom.js', __FILE__), array('wp-gmap-api'), filemtime(__DIR__ . '/../../assets/js/custom.js'), false);
|
33 |
+
wp_enqueue_style('wp-gmap-embed-css', plugins_url('../../assets/css/wp-gmap-style.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/css/wp-gmap-style.css'));
|
34 |
+
|
35 |
+
// For media upload
|
36 |
+
wp_enqueue_script('media-upload');
|
37 |
+
wp_enqueue_script('thickbox');
|
38 |
+
wp_enqueue_script('wpgmap-media-upload');
|
39 |
+
wp_enqueue_style('thickbox');
|
40 |
+
if (isset($_GET['tag']) and $_GET['tag'] == 'edit') {
|
41 |
+
// enqueue scripts for localization
|
42 |
+
wp_register_script('wp-gmap-lz-script', plugins_url('../../assets/js/localized_script.js', __FILE__), array('wp-gmap-custom-js'), filemtime(__DIR__ . '/../../assets/js/localized_script.js'), true);
|
43 |
+
// Localize the script with new data
|
44 |
+
$current_map_marker_lat_lng = explode(',', get_post_meta($_GET['id'], 'wpgmap_latlng', true));
|
45 |
+
$current_map_marker_lat = isset($current_map_marker_lat_lng[0]) ? $current_map_marker_lat_lng[0] : 40.73359922990751;
|
46 |
+
$current_map_marker_lng = isset($current_map_marker_lat_lng[1]) ? $current_map_marker_lat_lng[1] : -74.02791395625002;
|
47 |
+
$translation_array = array(
|
48 |
+
'current_map_marker_lat' => $current_map_marker_lat,
|
49 |
+
'current_map_marker_lng' => $current_map_marker_lng
|
50 |
+
);
|
51 |
+
wp_localize_script('wp-gmap-lz-script', 'gmap_object', $translation_array);
|
52 |
+
|
53 |
+
// Enqueued script with localized data.
|
54 |
+
wp_enqueue_script('wp-gmap-lz-script');
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
includes/traits/CommonFunctions.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait CommonFunctions
|
4 |
+
{
|
5 |
+
/*
|
6 |
+
* To update post meta data
|
7 |
+
*/
|
8 |
+
|
9 |
+
public function __update_post_meta($post_id, $field_name, $value = '')
|
10 |
+
{
|
11 |
+
if (!get_post_meta($post_id, $field_name)) {
|
12 |
+
add_post_meta($post_id, $field_name, $value);
|
13 |
+
} else {
|
14 |
+
update_post_meta($post_id, $field_name, $value);
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
includes/traits/InitActions.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait InitActions
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Doing some code in init hook
|
7 |
+
*/
|
8 |
+
public function do_init_actions()
|
9 |
+
{
|
10 |
+
|
11 |
+
// Review system hooks
|
12 |
+
add_action('gmap_embed_review_already_did', array($this, 'review_already_did'));
|
13 |
+
add_action('gmap_embed_review_later', array($this, 'review_later'));
|
14 |
+
if (isset($_GET['plugin'])) {
|
15 |
+
$plugin = sanitize_text_field($_GET['plugin']);
|
16 |
+
if ($plugin === $this->plugin_slug) {
|
17 |
+
if (isset($_GET['dismiss']) and $_GET['dismiss'] == 1) {
|
18 |
+
do_action('gmap_embed_review_already_did');
|
19 |
+
}
|
20 |
+
if (isset($_GET['later']) and $_GET['later'] == 1) {
|
21 |
+
do_action('gmap_embed_review_later');
|
22 |
+
}
|
23 |
+
wp_safe_redirect($this->redirect_to());
|
24 |
+
exit;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
// Register Post Types
|
29 |
+
register_post_type('wpgmapembed',
|
30 |
+
array(
|
31 |
+
'labels' => array(
|
32 |
+
'name' => __('Google Maps'),
|
33 |
+
'singular_name' => __('Map'),
|
34 |
+
),
|
35 |
+
'public' => false,
|
36 |
+
'has_archive' => false,
|
37 |
+
)
|
38 |
+
);
|
39 |
+
}
|
40 |
+
}
|
includes/traits/MapCRUD.php
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait MapCRUD
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* To save New Map Data
|
7 |
+
*/
|
8 |
+
|
9 |
+
public function save_wpgmapembed_data()
|
10 |
+
{
|
11 |
+
$error = '';
|
12 |
+
// Getting ajax fileds value
|
13 |
+
$meta_data = array(
|
14 |
+
'wpgmap_title' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_title'])),
|
15 |
+
'wpgmap_heading_class' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_heading_class'])),
|
16 |
+
'wpgmap_show_heading' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_show_heading'])),
|
17 |
+
// current marker lat lng
|
18 |
+
'wpgmap_latlng' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_latlng'])),
|
19 |
+
'wpgmap_map_zoom' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_zoom'])),
|
20 |
+
'wpgmap_disable_zoom_scroll' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_disable_zoom_scroll'])),
|
21 |
+
'wpgmap_map_width' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_width'])),
|
22 |
+
'wpgmap_map_height' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_height'])),
|
23 |
+
'wpgmap_map_type' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_type'])),
|
24 |
+
'wpgmap_map_address' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_address'])),
|
25 |
+
'wpgmap_show_infowindow' => sanitize_text_field($_POST['map_data']['wpgmap_show_infowindow']),
|
26 |
+
'wpgmap_enable_direction' => sanitize_text_field($_POST['map_data']['wpgmap_enable_direction']),
|
27 |
+
'wpgmap_marker_icon' => sanitize_text_field($_POST['map_data']['wpgmap_marker_icon']),
|
28 |
+
// map center lat lng
|
29 |
+
'wpgmap_center_lat_lng' => sanitize_text_field($_POST['map_data']['wpgmap_center_lat_lng'])
|
30 |
+
);
|
31 |
+
$action_type = sanitize_text_field(esc_html($_POST['map_data']['action_type']));
|
32 |
+
if ($meta_data['wpgmap_latlng'] == '') {
|
33 |
+
$error = "Please input Latitude and Longitude";
|
34 |
+
}
|
35 |
+
if (strlen($error) > 0) {
|
36 |
+
echo json_encode(array(
|
37 |
+
'responseCode' => 0,
|
38 |
+
'message' => $error
|
39 |
+
));
|
40 |
+
exit;
|
41 |
+
} else {
|
42 |
+
|
43 |
+
if ($action_type == 'save') {
|
44 |
+
// saving post array
|
45 |
+
$post_array = array(
|
46 |
+
'post_type' => 'wpgmapembed'
|
47 |
+
);
|
48 |
+
$post_id = wp_insert_post($post_array);
|
49 |
+
|
50 |
+
} elseif ($action_type == 'update') {
|
51 |
+
$post_id = intval($_POST['map_data']['post_id']);
|
52 |
+
}
|
53 |
+
|
54 |
+
// Updating post meta
|
55 |
+
foreach ($meta_data as $key => $value) {
|
56 |
+
$this->__update_post_meta($post_id, $key, $value);
|
57 |
+
}
|
58 |
+
$returnArray = array(
|
59 |
+
'responseCode' => 1,
|
60 |
+
'post_id' => $post_id
|
61 |
+
);
|
62 |
+
if ($action_type == 'save') {
|
63 |
+
$returnArray['message'] = 'Created Successfully.';
|
64 |
+
} elseif ($action_type == 'update') {
|
65 |
+
$returnArray['message'] = 'Updated Successfully.';
|
66 |
+
}
|
67 |
+
echo json_encode($returnArray);
|
68 |
+
exit;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
|
72 |
+
public function load_wpgmapembed_list()
|
73 |
+
{
|
74 |
+
$content = '';
|
75 |
+
$args = array(
|
76 |
+
'post_type' => 'wpgmapembed',
|
77 |
+
'posts_per_page' => -1
|
78 |
+
);
|
79 |
+
$mapsList = new WP_Query($args);
|
80 |
+
|
81 |
+
if ($mapsList->have_posts()) {
|
82 |
+
while ($mapsList->have_posts()) {
|
83 |
+
$mapsList->the_post();
|
84 |
+
$title = get_post_meta(get_the_ID(), 'wpgmap_title', true);
|
85 |
+
$content .= '<div class="wp-gmap-single">
|
86 |
+
<div class="wp-gmap-single-left">
|
87 |
+
<div class="wp-gmap-single-title">
|
88 |
+
' . $title . '
|
89 |
+
</div>
|
90 |
+
<div class="wp-gmap-single-shortcode">
|
91 |
+
<input class="wpgmap-shortcode regular-text" type="text" value="' . esc_attr('[gmap-embed id="' . get_the_ID() . '"]') . '"
|
92 |
+
onclick="this.select()"/>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
<div class="wp-gmap-single-action">
|
96 |
+
<a href="?page=wpgmapembed&tag=edit&id=' . get_the_ID() . '" class="button media-button button-primary button-large wpgmap-edit" data-id="' . get_the_ID() . '">
|
97 |
+
' . __('Change', 'gmap-embed') . '
|
98 |
+
</a>
|
99 |
+
<button type="button"
|
100 |
+
class="button media-button button-danger button-large wpgmap-insert-delete" data-id="' . get_the_ID() . '" style="background-color: red;color: white;opacity:0.7;">
|
101 |
+
X
|
102 |
+
</button>
|
103 |
+
</div>
|
104 |
+
</div>';
|
105 |
+
}
|
106 |
+
} else {
|
107 |
+
ob_start();
|
108 |
+
?>
|
109 |
+
<div class="gmap_embed_create_new_link_area">
|
110 |
+
<a style=""
|
111 |
+
href="<?php echo esc_url(admin_url()) . 'admin.php?page=wpgmapembed&tag=new'; ?>"
|
112 |
+
data-id="wp-gmap-new" class="media-menu-item">
|
113 |
+
<i class="dashicons dashicons-plus"></i>
|
114 |
+
<?php echo __("Create Your First Map", "gmap-embed"); ?>
|
115 |
+
</a>
|
116 |
+
</div>
|
117 |
+
<div class="srm_gmap_instructions_outer_area">
|
118 |
+
<div class="srm_gmap_instructions" style="width: 100%">
|
119 |
+
<h3>Frequently asked questions</h3>
|
120 |
+
<?php
|
121 |
+
require_once(plugin_dir_path(__FILE__) . '../../includes/wpgmap_faqs.php');
|
122 |
+
echo '</div></div>';
|
123 |
+
$content .= ob_get_clean();
|
124 |
+
}
|
125 |
+
|
126 |
+
echo $content;
|
127 |
+
}
|
128 |
+
|
129 |
+
public function load_popup_wpgmapembed_list()
|
130 |
+
{
|
131 |
+
$content = '';
|
132 |
+
$args = array(
|
133 |
+
'post_type' => 'wpgmapembed'
|
134 |
+
);
|
135 |
+
$mapsList = new WP_Query($args);
|
136 |
+
|
137 |
+
while ($mapsList->have_posts()) {
|
138 |
+
$mapsList->the_post();
|
139 |
+
$title = get_post_meta(get_the_ID(), 'wpgmap_title', true);
|
140 |
+
$content .= '<div class="wp-gmap-single">
|
141 |
+
<div class="wp-gmap-single-left">
|
142 |
+
<div class="wp-gmap-single-title">
|
143 |
+
' . $title . '
|
144 |
+
</div>
|
145 |
+
<div class="wp-gmap-single-shortcode">
|
146 |
+
<input class="wpgmap-shortcode regular-text" type="text" value="[gmap-embed id="' . get_the_ID() . '"]"
|
147 |
+
onclick="this.select()"/>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
<div class="wp-gmap-single-action">
|
151 |
+
<button type="button"
|
152 |
+
class="button media-button button-primary button-large wpgmap-insert-shortcode">
|
153 |
+
Insert
|
154 |
+
</button>
|
155 |
+
</div>
|
156 |
+
</div>';
|
157 |
+
}
|
158 |
+
echo $content;
|
159 |
+
exit;
|
160 |
+
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
public function get_wpgmapembed_data($gmap_id = '')
|
165 |
+
{
|
166 |
+
if ($gmap_id == '') {
|
167 |
+
$gmap_id = intval($_POST['wpgmap_id']);
|
168 |
+
}
|
169 |
+
|
170 |
+
$gmap_data = array(
|
171 |
+
'wpgmap_id' => $gmap_id,
|
172 |
+
'wpgmap_title' => get_post_meta($gmap_id, 'wpgmap_title', true),
|
173 |
+
'wpgmap_heading_class' => get_post_meta($gmap_id, 'wpgmap_heading_class', true),
|
174 |
+
'wpgmap_show_heading' => get_post_meta($gmap_id, 'wpgmap_show_heading', true),
|
175 |
+
'wpgmap_latlng' => get_post_meta($gmap_id, 'wpgmap_latlng', true),
|
176 |
+
'wpgmap_map_zoom' => get_post_meta($gmap_id, 'wpgmap_map_zoom', true),
|
177 |
+
'wpgmap_disable_zoom_scroll' => get_post_meta($gmap_id, 'wpgmap_disable_zoom_scroll', true),
|
178 |
+
'wpgmap_map_width' => get_post_meta($gmap_id, 'wpgmap_map_width', true),
|
179 |
+
'wpgmap_map_height' => get_post_meta($gmap_id, 'wpgmap_map_height', true),
|
180 |
+
'wpgmap_map_type' => get_post_meta($gmap_id, 'wpgmap_map_type', true),
|
181 |
+
'wpgmap_map_address' => get_post_meta($gmap_id, 'wpgmap_map_address', true),
|
182 |
+
'wpgmap_show_infowindow' => get_post_meta($gmap_id, 'wpgmap_show_infowindow', true),
|
183 |
+
'wpgmap_enable_direction' => get_post_meta($gmap_id, 'wpgmap_enable_direction', true),
|
184 |
+
'wpgmap_marker_icon' => get_post_meta($gmap_id, 'wpgmap_marker_icon', true),
|
185 |
+
'wpgmap_center_lat_lng' => get_center_lat_lng_by_map_id($gmap_id)
|
186 |
+
);
|
187 |
+
|
188 |
+
return json_encode($gmap_data);
|
189 |
+
}
|
190 |
+
|
191 |
+
public function remove_wpgmapembed_data()
|
192 |
+
{
|
193 |
+
|
194 |
+
$meta_data = array(
|
195 |
+
'wpgmap_title',
|
196 |
+
'wpgmap_heading_class',
|
197 |
+
'wpgmap_show_heading',
|
198 |
+
'wpgmap_latlng',
|
199 |
+
'wpgmap_map_zoom',
|
200 |
+
'wpgmap_disable_zoom_scroll',
|
201 |
+
'wpgmap_map_width',
|
202 |
+
'wpgmap_map_height',
|
203 |
+
'wpgmap_map_type',
|
204 |
+
'wpgmap_map_address',
|
205 |
+
'wpgmap_show_infowindow',
|
206 |
+
'wpgmap_enable_direction'
|
207 |
+
);
|
208 |
+
|
209 |
+
$post_id = intval($_POST['post_id']);
|
210 |
+
wp_delete_post($post_id);
|
211 |
+
foreach ($meta_data as $field_name => $value) {
|
212 |
+
delete_post_meta($post_id, $field_name, $value);
|
213 |
+
}
|
214 |
+
$returnArray = array(
|
215 |
+
'responseCode' => 1,
|
216 |
+
'message' => "Deleted Successfully."
|
217 |
+
);
|
218 |
+
echo json_encode($returnArray);
|
219 |
+
exit;
|
220 |
+
}
|
221 |
+
}
|
includes/traits/Menu.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait Menu
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* To create menu in admin panel
|
7 |
+
*/
|
8 |
+
public function gmap_create_menu()
|
9 |
+
{
|
10 |
+
|
11 |
+
//create new top-level menu
|
12 |
+
add_menu_page($this->plugin_name, $this->plugin_name, 'administrator', 'wpgmapembed', array(
|
13 |
+
$this,
|
14 |
+
'srm_gmap_main'
|
15 |
+
), 'dashicons-location', 11);
|
16 |
+
|
17 |
+
$no_of_map_created = gmap_embed_no_of_post();
|
18 |
+
//to create sub menu
|
19 |
+
if (gmap_embed_is_using_premium_version()) {
|
20 |
+
add_submenu_page('wpgmapembed', __("Add new Map", "gmap-embed"), __("Add New", "gmap-embed"), 'administrator', 'wpgmapembed&tag=new', array(
|
21 |
+
$this,
|
22 |
+
'srm_gmap_new'
|
23 |
+
), 11);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Google Map Embed Mail Page
|
29 |
+
*/
|
30 |
+
public function srm_gmap_main()
|
31 |
+
{
|
32 |
+
require plugin_dir_path(__FILE__) . '../../includes/gmap.php';
|
33 |
+
}
|
34 |
+
}
|
includes/traits/Notice.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait Notice
|
4 |
+
{
|
5 |
+
function gmap_embed_notice_generate()
|
6 |
+
{
|
7 |
+
$this->gmap_embed_generate_admin_review_notice();
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Do something on review already button click
|
12 |
+
*/
|
13 |
+
public function review_already_did()
|
14 |
+
{
|
15 |
+
update_option('gmap_embed_is_review_done', true);
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Do something on review later button click
|
20 |
+
*/
|
21 |
+
public function review_later()
|
22 |
+
{
|
23 |
+
update_option('gmap_embed_is_review_snoozed', true);
|
24 |
+
update_option('gmap_embed_review_snoozed_at', time());
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Redirect to URL generate
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function redirect_to()
|
32 |
+
{
|
33 |
+
$request_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
34 |
+
$query_string = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
|
35 |
+
parse_str($query_string, $current_url);
|
36 |
+
$unset_array = array('dismiss', 'plugin', '_wpnonce', 'later');
|
37 |
+
|
38 |
+
foreach ($unset_array as $value) {
|
39 |
+
if (isset($current_url[$value])) {
|
40 |
+
unset($current_url[$value]);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
$current_url = http_build_query($current_url);
|
45 |
+
$redirect_url = $request_uri . '?' . $current_url;
|
46 |
+
return $redirect_url;
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
public function gmap_embed_generate_admin_review_notice()
|
51 |
+
{
|
52 |
+
$activation_time = get_option('gmap_embed_activation_time', false);
|
53 |
+
$is_review_snoozed = get_option('gmap_embed_is_review_snoozed');
|
54 |
+
$snoozed_time = get_option('gmap_embed_review_snoozed_at');
|
55 |
+
|
56 |
+
//How may day's passed after activation
|
57 |
+
$seconds_diff = time() - $activation_time;
|
58 |
+
$passed_days = ($seconds_diff / 3600) / 24;
|
59 |
+
|
60 |
+
//Snoozed how many day's before
|
61 |
+
$seconds_diff = time() - $snoozed_time;
|
62 |
+
$snoozed_before = ($seconds_diff / 3600) / 24;
|
63 |
+
$is_review_done = get_option('gmap_embed_is_review_done');
|
64 |
+
|
65 |
+
/**
|
66 |
+
*
|
67 |
+
* Review section will shows based on following cases
|
68 |
+
* Case 1: Passed three(3) days and not snoozed
|
69 |
+
* Case 2: Snoozed before 7 day's
|
70 |
+
*/
|
71 |
+
if ($is_review_done == false and (($passed_days >= 3 and $is_review_snoozed == false) or ($is_review_snoozed == true and $snoozed_before >= 7))) {
|
72 |
+
$scheme = (parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY)) ? '&' : '?';
|
73 |
+
$url = $_SERVER['REQUEST_URI'] . $scheme;
|
74 |
+
$dismiss_link = add_query_arg([
|
75 |
+
'plugin' => 'gmap-embed',
|
76 |
+
'dismiss' => true,
|
77 |
+
'_wpnonce' => wp_create_nonce()
|
78 |
+
], $url);
|
79 |
+
$later_link = add_query_arg([
|
80 |
+
'plugin' => 'gmap-embed',
|
81 |
+
'later' => true,
|
82 |
+
'_wpnonce' => wp_create_nonce()
|
83 |
+
], $url);
|
84 |
+
?>
|
85 |
+
<div class="gmap_embed_review_section notice notice-success"
|
86 |
+
style="margin:0 !important;padding:0 !important;">
|
87 |
+
<img src="<?php echo plugins_url('../../assets/images/gmap_embed_logo.jpg', plugin_basename(__FILE__)); ?>"
|
88 |
+
width="60" style="float: left;margin: 9px 9px 0 5px !important"/>
|
89 |
+
<p><?php _e("<span style='color:green;'>We hope you're" . ' enjoying of using <b style="color:#007cba">WP Google Map</b> plugin.
|
90 |
+
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>
|
91 |
+
', 'gmap-embed'); ?></p>
|
92 |
+
<ul>
|
93 |
+
<li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
|
94 |
+
href="<?php echo esc_url('https://www.srmilon.info/wp-review-forum?utm_source=wp_admin&utm_medium=review_notice_view&utm_campaign=review_notice'); ?>"
|
95 |
+
target="_blank"><span
|
96 |
+
class="dashicons dashicons-external"></span> Ok, you deserve it!</a></li>
|
97 |
+
<li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
|
98 |
+
href="<?php echo esc_url($dismiss_link); ?>"><span
|
99 |
+
class="dashicons dashicons-smiley"></span> I already did</a></li>
|
100 |
+
<li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
|
101 |
+
href="<?php echo esc_url($later_link); ?>"><span
|
102 |
+
class="dashicons dashicons-calendar-alt"></span> Maybe Later</a></li>
|
103 |
+
<li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
|
104 |
+
href="<?php echo esc_url('https://www.srmilon.info/wp-support-forum?utm_source=wp_admin&utm_medium=review_notice_view&utm_campaign=review_notice_help'); ?>"
|
105 |
+
target="_blank"><span
|
106 |
+
class="dashicons dashicons-external"></span> I need help</a></li>
|
107 |
+
<li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
|
108 |
+
href="<?php echo esc_url($dismiss_link); ?>"><span
|
109 |
+
class="dashicons dashicons-dismiss"></span> Never show again</a></li>
|
110 |
+
</ul>
|
111 |
+
</div>
|
112 |
+
<?php
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
includes/traits/PluginsLoadedActions.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait PluginsLoadedActions
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Fires after plugins loaded
|
7 |
+
*/
|
8 |
+
function wpgmap_do_after_plugins_loaded()
|
9 |
+
{
|
10 |
+
// In case of existing installation
|
11 |
+
if (get_option('gmap_embed_activation_time', false) == false) {
|
12 |
+
update_option('gmap_embed_activation_time', time());
|
13 |
+
}
|
14 |
+
}
|
15 |
+
}
|
includes/traits/Settings.php
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
trait Settings
|
4 |
+
{
|
5 |
+
function gmap_embed_settings_section_callback()
|
6 |
+
{
|
7 |
+
// code...
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
function gmap_embed_s_custom_css_markup()
|
12 |
+
{
|
13 |
+
?>
|
14 |
+
<textarea rows="10" cols="100" name="wpgmap_s_custom_css"
|
15 |
+
id="wpgmap_custom_css"><?php echo get_option('wpgmap_s_custom_css'); ?></textarea>
|
16 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
17 |
+
<?php _e('Add your custom CSS code if needed.', 'gmap-embed'); ?>
|
18 |
+
</p>
|
19 |
+
<?php
|
20 |
+
}
|
21 |
+
|
22 |
+
function wpgmap_s_custom_js_markup()
|
23 |
+
{
|
24 |
+
?>
|
25 |
+
<textarea rows="10" cols="100" name="wpgmap_s_custom_js"
|
26 |
+
id="wpgmap_custom_js"><?php echo get_option('wpgmap_s_custom_js'); ?></textarea>
|
27 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
28 |
+
<?php _e('Add your custom JS code if needed.', 'gmap-embed'); ?>
|
29 |
+
</p>
|
30 |
+
<?php
|
31 |
+
}
|
32 |
+
|
33 |
+
function gmap_embed_s_map_language_markup()
|
34 |
+
{
|
35 |
+
?>
|
36 |
+
<select id="srm_gmap_lng" name="srm_gmap_lng" class="regular-text" style="width: 100%;max-width:100%;">
|
37 |
+
<?php
|
38 |
+
$wpgmap_languages = gmap_embed_get_languages();
|
39 |
+
if (count($wpgmap_languages) > 0) {
|
40 |
+
foreach ($wpgmap_languages as $lng_key => $language) {
|
41 |
+
$selected = '';
|
42 |
+
if (get_option('srm_gmap_lng', 'en') == $lng_key) {
|
43 |
+
$selected = 'selected';
|
44 |
+
}
|
45 |
+
echo "<option value='$lng_key' $selected>$language</option>";
|
46 |
+
}
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
</select>
|
50 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
51 |
+
<?php _e('Chose your desired map language', 'gmap-embed'); ?>
|
52 |
+
</p>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
+
function gmap_embed_s_map_region_markup()
|
57 |
+
{
|
58 |
+
?>
|
59 |
+
<select id="region" name="srm_gmap_region" class="regular-text" style="width: 100%;max-width: 100%;">
|
60 |
+
<?php
|
61 |
+
$wpgmap_regions = gmap_embed_get_regions();
|
62 |
+
if (count($wpgmap_regions) > 0) {
|
63 |
+
foreach ($wpgmap_regions as $region_key => $region) {
|
64 |
+
$selected = '';
|
65 |
+
if (get_option('srm_gmap_region', 'US') == $region_key) {
|
66 |
+
$selected = 'selected';
|
67 |
+
}
|
68 |
+
echo "<option value='$region_key' $selected>$region</option>";
|
69 |
+
}
|
70 |
+
}
|
71 |
+
?>
|
72 |
+
|
73 |
+
</select>
|
74 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
75 |
+
<?php _e('Chose your regional area', 'gmap-embed'); ?>
|
76 |
+
</p>
|
77 |
+
<?php
|
78 |
+
}
|
79 |
+
|
80 |
+
public function gmapsrm_settings()
|
81 |
+
{
|
82 |
+
add_submenu_page('wpgmapembed', 'Settings', 'Settings', 'administrator', '?page=wpgmapembed&tag=settings', '', 11);
|
83 |
+
|
84 |
+
add_settings_section(
|
85 |
+
'gmap_embed_language_settings_section',
|
86 |
+
__('Map Language and Regional Settings<hr/>', 'gmap-embed'),
|
87 |
+
array($this, 'gmap_embed_settings_section_callback'),
|
88 |
+
'gmap-embed-settings-page-ls'
|
89 |
+
);
|
90 |
+
|
91 |
+
// language settings related fields
|
92 |
+
add_settings_field(
|
93 |
+
'srm_gmap_lng',
|
94 |
+
__('Map Language:', 'gmap-embed'),
|
95 |
+
array($this, 'gmap_embed_s_map_language_markup'),
|
96 |
+
'gmap-embed-settings-page-ls',
|
97 |
+
'gmap_embed_language_settings_section'
|
98 |
+
);
|
99 |
+
|
100 |
+
add_settings_field(
|
101 |
+
'srm_gmap_region',
|
102 |
+
__('Map Region:', 'gmap-embed'),
|
103 |
+
array($this, 'gmap_embed_s_map_region_markup'),
|
104 |
+
'gmap-embed-settings-page-ls',
|
105 |
+
'gmap_embed_language_settings_section'
|
106 |
+
);
|
107 |
+
|
108 |
+
|
109 |
+
add_settings_section(
|
110 |
+
'gmap_embed_custom_scripts_section',
|
111 |
+
__('Custom Scripts<hr/>', 'gmap-embed'),
|
112 |
+
array($this, 'gmap_embed_settings_section_callback'),
|
113 |
+
'gmap-embed-settings-page-cs'
|
114 |
+
);
|
115 |
+
|
116 |
+
|
117 |
+
// custom scripts related fields
|
118 |
+
add_settings_field(
|
119 |
+
'wpgmap_s_custom_css',
|
120 |
+
__('Custom CSS:', 'gmap-embed'),
|
121 |
+
array($this, 'gmap_embed_s_custom_css_markup'),
|
122 |
+
'gmap-embed-settings-page-cs',
|
123 |
+
'gmap_embed_custom_scripts_section'
|
124 |
+
);
|
125 |
+
|
126 |
+
add_settings_field(
|
127 |
+
'wpgmap_s_custom_js',
|
128 |
+
__('Custom JS:', 'gmap-embed'),
|
129 |
+
array($this, 'wpgmap_s_custom_js_markup'),
|
130 |
+
'gmap-embed-settings-page-cs',
|
131 |
+
'gmap_embed_custom_scripts_section'
|
132 |
+
);
|
133 |
+
|
134 |
+
register_setting('wpgmap_script_settings', 'srm_gmap_lng');
|
135 |
+
register_setting('wpgmap_script_settings', 'srm_gmap_region');
|
136 |
+
register_setting('wpgmap_script_settings', 'wpgmap_s_custom_css');
|
137 |
+
register_setting('wpgmap_script_settings', 'wpgmap_s_custom_js');
|
138 |
+
}
|
139 |
+
}
|
includes/widget.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
/**
|
4 |
-
* Creating widget for Google Map
|
5 |
*/
|
6 |
class srmgmap_widget extends WP_Widget
|
7 |
{
|
@@ -60,7 +60,11 @@ class srmgmap_widget extends WP_Widget
|
|
60 |
$gmap_title = 'No title';
|
61 |
}
|
62 |
$option_value = esc_attr( '[gmap-embed id="' . get_the_ID() . '"]' );
|
63 |
-
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
}
|
66 |
?>
|
1 |
<?php
|
2 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
3 |
/**
|
4 |
+
* Creating widget for WP Google Map
|
5 |
*/
|
6 |
class srmgmap_widget extends WP_Widget
|
7 |
{
|
60 |
$gmap_title = 'No title';
|
61 |
}
|
62 |
$option_value = esc_attr( '[gmap-embed id="' . get_the_ID() . '"]' );
|
63 |
+
$selected = '';
|
64 |
+
if(isset($instance['srmgmap_shortcode']) and $instance['srmgmap_shortcode']==html_entity_decode($option_value)){
|
65 |
+
$selected = 'selected';
|
66 |
+
}
|
67 |
+
$map_shortcodes_list .= '<option value="' . $option_value . '" '.$selected.'>' . $gmap_title.' '.esc_attr( '[gmap-embed id="' . get_the_ID() . '"]' ).'</option>';
|
68 |
}
|
69 |
}
|
70 |
?>
|
includes/wpgmap_contact.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="srm_gmap_contact_area">
|
2 |
<h3>Having problem? or you have any suggestion, please inform us!</h3>
|
3 |
<form id="srm_gmap_contact" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&message=4" method="post">
|
4 |
-
<table class=""
|
5 |
<tbody>
|
6 |
<tr>
|
7 |
<th width="25%">
|
@@ -61,7 +61,7 @@
|
|
61 |
</th>
|
62 |
<td>
|
63 |
<textarea name="srm_gmap_message" class="wp_gmap_contact_field" id="srm_gmap_message"
|
64 |
-
placeholder="Hello
|
65 |
rows="3" cols="50"></textarea>
|
66 |
</td>
|
67 |
</tr>
|
1 |
<div class="srm_gmap_contact_area">
|
2 |
<h3>Having problem? or you have any suggestion, please inform us!</h3>
|
3 |
<form id="srm_gmap_contact" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&message=4" method="post">
|
4 |
+
<table class="">
|
5 |
<tbody>
|
6 |
<tr>
|
7 |
<th width="25%">
|
61 |
</th>
|
62 |
<td>
|
63 |
<textarea name="srm_gmap_message" class="wp_gmap_contact_field" id="srm_gmap_message"
|
64 |
+
placeholder="Hello" required=""
|
65 |
rows="3" cols="50"></textarea>
|
66 |
</td>
|
67 |
</tr>
|
includes/wpgmap_create.php
CHANGED
@@ -75,7 +75,7 @@
|
|
75 |
<tr>
|
76 |
<td>
|
77 |
<label for="wpgmap_map_type"><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
|
78 |
-
<select id="wpgmap_map_type" class="regular-text"
|
79 |
<option>ROADMAP</option>
|
80 |
<option>SATELLITE</option>
|
81 |
<option>HYBRID</option>
|
@@ -87,8 +87,7 @@
|
|
87 |
<tr>
|
88 |
<td>
|
89 |
<label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
|
90 |
-
<textarea id="wpgmap_map_address"
|
91 |
-
|
92 |
<br/>
|
93 |
|
94 |
<label for="wpgmap_show_infowindow"><input type="checkbox" value="1"
|
@@ -140,7 +139,7 @@
|
|
140 |
<h1 id="wpgmap_heading_preview" style="padding: 0px;margin: 0px;"></h1>
|
141 |
<input id="pac-input" class="controls" type="text"
|
142 |
placeholder="<?php _e( 'Search by Address, Zip Code', 'gmap-embed' ); ?>"/>
|
143 |
-
<div id="map" style="height:
|
144 |
</div>
|
145 |
|
146 |
<script type="text/javascript"
|
75 |
<tr>
|
76 |
<td>
|
77 |
<label for="wpgmap_map_type"><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
|
78 |
+
<select id="wpgmap_map_type" class="regular-text">
|
79 |
<option>ROADMAP</option>
|
80 |
<option>SATELLITE</option>
|
81 |
<option>HYBRID</option>
|
87 |
<tr>
|
88 |
<td>
|
89 |
<label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
|
90 |
+
<textarea id="wpgmap_map_address" name="wpgmap_map_address" class="regular-text" rows="3"></textarea>
|
|
|
91 |
<br/>
|
92 |
|
93 |
<label for="wpgmap_show_infowindow"><input type="checkbox" value="1"
|
139 |
<h1 id="wpgmap_heading_preview" style="padding: 0px;margin: 0px;"></h1>
|
140 |
<input id="pac-input" class="controls" type="text"
|
141 |
placeholder="<?php _e( 'Search by Address, Zip Code', 'gmap-embed' ); ?>"/>
|
142 |
+
<div id="map" style="height: 520px;"></div>
|
143 |
</div>
|
144 |
|
145 |
<script type="text/javascript"
|
includes/wpgmap_edit.php
CHANGED
@@ -21,7 +21,7 @@ list( $wpgmap_center_lat, $wpgmap_center_lng ) = explode( ',', esc_html( $wpgmap
|
|
21 |
</ul>
|
22 |
</div>
|
23 |
<div class="wp-gmap-tab-contents wp-gmap-properties">
|
24 |
-
<table
|
25 |
<tr>
|
26 |
<td>
|
27 |
<label for="wpgmap_title"><b><?php _e( 'Map Title', 'gmap-embed' ); ?></b></label><br/>
|
@@ -91,7 +91,7 @@ list( $wpgmap_center_lat, $wpgmap_center_lng ) = explode( ',', esc_html( $wpgmap
|
|
91 |
<tr>
|
92 |
<td>
|
93 |
<label><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
|
94 |
-
<select id="wpgmap_map_type" class="regular-text"
|
95 |
<option <?php echo $wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''; ?>>
|
96 |
ROADMAP
|
97 |
</option>
|
@@ -110,7 +110,7 @@ list( $wpgmap_center_lat, $wpgmap_center_lng ) = explode( ',', esc_html( $wpgmap
|
|
110 |
<tr>
|
111 |
<td>
|
112 |
<label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
|
113 |
-
<textarea id="wpgmap_map_address"
|
114 |
class="regular-text"
|
115 |
rows="3"><?php echo esc_attr( trim( $wpgmap_single->wpgmap_map_address ) ); ?></textarea>
|
116 |
|
21 |
</ul>
|
22 |
</div>
|
23 |
<div class="wp-gmap-tab-contents wp-gmap-properties">
|
24 |
+
<table class="gmap_properties">
|
25 |
<tr>
|
26 |
<td>
|
27 |
<label for="wpgmap_title"><b><?php _e( 'Map Title', 'gmap-embed' ); ?></b></label><br/>
|
91 |
<tr>
|
92 |
<td>
|
93 |
<label><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
|
94 |
+
<select id="wpgmap_map_type" class="regular-text">
|
95 |
<option <?php echo $wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''; ?>>
|
96 |
ROADMAP
|
97 |
</option>
|
110 |
<tr>
|
111 |
<td>
|
112 |
<label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
|
113 |
+
<textarea id="wpgmap_map_address" name="wpgmap_map_address"
|
114 |
class="regular-text"
|
115 |
rows="3"><?php echo esc_attr( trim( $wpgmap_single->wpgmap_map_address ) ); ?></textarea>
|
116 |
|
includes/wpgmap_faqs.php
CHANGED
@@ -1,43 +1,47 @@
|
|
1 |
<ul>
|
2 |
<li>
|
3 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/02/18/how-to-get-google-map-api-key' ); ?>"
|
4 |
target="_blank">How to get API
|
5 |
key?</a>
|
6 |
</li>
|
7 |
<li>
|
8 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel' ); ?>"
|
9 |
target="_blank">See
|
10 |
why map is not working properly</a>
|
11 |
</li>
|
12 |
<li>
|
13 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-get-your-license-key' ); ?>"
|
14 |
target="_blank">How to get your
|
15 |
Lifetime
|
16 |
License key?</a>
|
17 |
</li>
|
18 |
<li>
|
19 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor' ); ?>"
|
20 |
target="_blank">Don’t
|
21 |
see “Embed Google Map” button in new Editor?</a>
|
22 |
</li>
|
23 |
<li>
|
24 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page' ); ?>"
|
25 |
target="_blank">How to
|
26 |
add Google Map in page?</a>
|
27 |
</li>
|
28 |
<li>
|
29 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post' ); ?>"
|
30 |
target="_blank">How to
|
31 |
add Google Map in post?</a>
|
32 |
</li>
|
33 |
<li>
|
34 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget' ); ?>"
|
35 |
target="_blank">How to
|
36 |
add Google Map in Sidebar as widget?</a>
|
37 |
</li>
|
38 |
<li>
|
39 |
-
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/can-not-load-the-map-correctly' ); ?>"
|
40 |
target="_blank">Do you see "the page
|
41 |
can\'t load the map correctly"?</a>
|
42 |
</li>
|
|
|
|
|
|
|
|
|
43 |
</ul>
|
1 |
<ul>
|
2 |
<li>
|
3 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/02/18/how-to-get-google-map-api-key?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
4 |
target="_blank">How to get API
|
5 |
key?</a>
|
6 |
</li>
|
7 |
<li>
|
8 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
9 |
target="_blank">See
|
10 |
why map is not working properly</a>
|
11 |
</li>
|
12 |
<li>
|
13 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-get-your-license-key?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
14 |
target="_blank">How to get your
|
15 |
Lifetime
|
16 |
License key?</a>
|
17 |
</li>
|
18 |
<li>
|
19 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
20 |
target="_blank">Don’t
|
21 |
see “Embed Google Map” button in new Editor?</a>
|
22 |
</li>
|
23 |
<li>
|
24 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
25 |
target="_blank">How to
|
26 |
add Google Map in page?</a>
|
27 |
</li>
|
28 |
<li>
|
29 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
30 |
target="_blank">How to
|
31 |
add Google Map in post?</a>
|
32 |
</li>
|
33 |
<li>
|
34 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
35 |
target="_blank">How to
|
36 |
add Google Map in Sidebar as widget?</a>
|
37 |
</li>
|
38 |
<li>
|
39 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/can-not-load-the-map-correctly?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general' ); ?>"
|
40 |
target="_blank">Do you see "the page
|
41 |
can\'t load the map correctly"?</a>
|
42 |
</li>
|
43 |
+
<li>
|
44 |
+
<a href="<?php echo esc_url( 'https://srmilon.info/blog?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general_more' ); ?>"
|
45 |
+
target="_blank">And many more...</a>
|
46 |
+
</li>
|
47 |
</ul>
|
includes/wpgmap_list.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
<!--all map tab-->
|
8 |
<div class="wp-gmap-list">
|
9 |
|
10 |
-
<div id="
|
11 |
<?php
|
12 |
$this->load_wpgmapembed_list();
|
13 |
?>
|
7 |
<!--all map tab-->
|
8 |
<div class="wp-gmap-list">
|
9 |
|
10 |
+
<div id="wpgmapembed_gmap_list">
|
11 |
<?php
|
12 |
$this->load_wpgmapembed_list();
|
13 |
?>
|
includes/wpgmap_popup_content.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
if (!defined('ABSPATH')) exit;
|
3 |
//this button will show a popup that contains inline content
|
4 |
-
add_action('
|
5 |
|
6 |
//This will be shown in the inline modal
|
7 |
add_action('admin_footer', 'srm_add_inline_popup_content');
|
8 |
|
9 |
//action to add a custom button to the content editor
|
10 |
-
function add_srm_gmap_embed_custom_button(
|
11 |
{
|
12 |
|
13 |
//path to my icon
|
@@ -17,14 +17,14 @@ function add_srm_gmap_embed_custom_button($context)
|
|
17 |
$container_id = 'wp_gmap_popup_container';
|
18 |
|
19 |
//our popup's title
|
20 |
-
$title = 'Select your map
|
21 |
|
22 |
//append the icon
|
23 |
-
$context
|
24 |
href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
|
25 |
-
" . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "
|
26 |
|
27 |
-
|
28 |
}
|
29 |
|
30 |
function srm_add_inline_popup_content()
|
1 |
<?php
|
2 |
if (!defined('ABSPATH')) exit;
|
3 |
//this button will show a popup that contains inline content
|
4 |
+
add_action('media_buttons', 'add_srm_gmap_embed_custom_button');
|
5 |
|
6 |
//This will be shown in the inline modal
|
7 |
add_action('admin_footer', 'srm_add_inline_popup_content');
|
8 |
|
9 |
//action to add a custom button to the content editor
|
10 |
+
function add_srm_gmap_embed_custom_button()
|
11 |
{
|
12 |
|
13 |
//path to my icon
|
17 |
$container_id = 'wp_gmap_popup_container';
|
18 |
|
19 |
//our popup's title
|
20 |
+
$title = 'Select your desired map to insert into post';
|
21 |
|
22 |
//append the icon
|
23 |
+
$context = "<a class='button thickbox' title='{$title}'
|
24 |
href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
|
25 |
+
" . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "WP Google Map</a>";
|
26 |
|
27 |
+
echo $context;
|
28 |
}
|
29 |
|
30 |
function srm_add_inline_popup_content()
|
includes/wpgmap_settings.php
CHANGED
@@ -1,67 +1,72 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
-
|
4 |
}
|
|
|
|
|
|
|
|
|
|
|
5 |
?>
|
6 |
<div data-columns="8">
|
7 |
-
<div class="wpgmapembed_get_api_key"
|
8 |
-
<
|
9 |
<hr/>
|
10 |
<table class="form-table" role="presentation">
|
11 |
|
12 |
<tbody>
|
13 |
-
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&message=3">
|
14 |
<tr>
|
15 |
<th scope="row">
|
16 |
-
<label for="
|
17 |
-
|
18 |
</label>
|
19 |
</th>
|
20 |
<td scope="row">
|
21 |
<input type="text" name="wpgmapembed_key"
|
22 |
-
value="<?php echo esc_html(
|
23 |
-
size="45" class="regular-text"/>
|
24 |
-
<p class="description" id="tagline-description">
|
25 |
-
|
26 |
</p>
|
27 |
</td>
|
28 |
<td width="30%" style="vertical-align: top;">
|
29 |
-
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e(
|
30 |
<a target="_blank" style="margin-left: 5px;" href="
|
31 |
-
<?php echo esc_url(
|
32 |
class="button media-button button-default button-large">
|
33 |
-
|
34 |
</a>
|
35 |
</td>
|
36 |
</tr>
|
37 |
</form>
|
38 |
|
39 |
-
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&message=4">
|
40 |
<tr>
|
41 |
<th scope="row">
|
42 |
-
<label for="
|
43 |
-
|
44 |
</label>
|
45 |
</th>
|
46 |
<td scope="row">
|
47 |
<input type="text" name="wpgmapembed_license"
|
48 |
-
value="<?php echo esc_html(
|
49 |
-
size="45" class="regular-text"/>
|
50 |
-
<p class="description" id="tagline-description">
|
51 |
-
|
52 |
</p>
|
53 |
</td>
|
54 |
<td width="30%" style="vertical-align: top;">
|
55 |
-
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e(
|
56 |
|
57 |
-
|
58 |
-
|
59 |
<a target="_blank"
|
60 |
-
href="<?php echo esc_url(
|
61 |
-
class="button media-button button-default button-large"><?php _e(
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
</td>
|
66 |
</tr>
|
67 |
</form>
|
@@ -71,76 +76,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
71 |
</div>
|
72 |
|
73 |
<div data-columns="8">
|
74 |
-
<
|
75 |
-
<
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
<?php _e( 'Map Language: ', 'gmap-embed' ); ?>
|
85 |
-
</label>
|
86 |
-
</th>
|
87 |
-
<td scope="row">
|
88 |
-
<select id="language" name="srm_gmap_lng" class="regular-text" style="width: 25em">
|
89 |
-
<?php
|
90 |
-
$wpgmap_languages = gmap_embed_get_languages();
|
91 |
-
if ( count( $wpgmap_languages ) > 0 ) {
|
92 |
-
foreach ( $wpgmap_languages as $lng_key => $language ) {
|
93 |
-
$selected = '';
|
94 |
-
if ( get_option( 'srm_gmap_lng', 'en' ) == $lng_key ) {
|
95 |
-
$selected = 'selected';
|
96 |
-
}
|
97 |
-
echo "<option value='$lng_key' $selected>$language</option>";
|
98 |
-
}
|
99 |
-
}
|
100 |
-
?>
|
101 |
-
</select>
|
102 |
-
<p class="description" id="tagline-description">
|
103 |
-
<?php _e( 'Choose your desired map language', 'gmap-embed' ); ?>
|
104 |
-
</p>
|
105 |
-
</td>
|
106 |
-
</tr>
|
107 |
-
|
108 |
-
<tr>
|
109 |
-
<th scope="row">
|
110 |
-
<label for="blogname">
|
111 |
-
<?php _e( 'Map Region: ', 'gmap-embed' ); ?>
|
112 |
-
</label>
|
113 |
-
</th>
|
114 |
-
<td scope="row">
|
115 |
-
<select id="region" name="srm_gmap_region" class="regular-text" style="width: 25em">
|
116 |
-
<?php
|
117 |
-
$wpgmap_regions = gmap_embed_get_regions();
|
118 |
-
if ( count( $wpgmap_regions ) > 0 ) {
|
119 |
-
foreach ( $wpgmap_regions as $region_key => $region ) {
|
120 |
-
$selected = '';
|
121 |
-
if ( get_option( 'srm_gmap_region', 'US' ) == $region_key ) {
|
122 |
-
$selected = 'selected';
|
123 |
-
}
|
124 |
-
echo "<option value='$region_key' $selected>$region</option>";
|
125 |
-
}
|
126 |
-
}
|
127 |
-
?>
|
128 |
-
|
129 |
-
</select>
|
130 |
-
<p class="description" id="tagline-description">
|
131 |
-
<?php _e( 'Choose your regional area', 'gmap-embed' ); ?>
|
132 |
-
</p>
|
133 |
-
</td>
|
134 |
-
</tr>
|
135 |
-
<tr>
|
136 |
-
<td></td>
|
137 |
-
<td>
|
138 |
-
<button name="srm_gmap_map_language_settings"
|
139 |
-
class="wd-btn wd-btn-primary button media-button button-primary"><?php _e( 'Update', 'gmap-embed' ); ?></button>
|
140 |
-
</td>
|
141 |
-
</tr>
|
142 |
-
</form>
|
143 |
-
</tbody>
|
144 |
-
</table>
|
145 |
-
</div>
|
146 |
</div>
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
}
|
5 |
+
if (isset($_GET['settings-updated'])) {
|
6 |
+
// add settings saved message with the class of "updated"
|
7 |
+
add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated');
|
8 |
+
}
|
9 |
+
settings_errors('wporg_messages');
|
10 |
?>
|
11 |
<div data-columns="8">
|
12 |
+
<div class="wpgmapembed_get_api_key">
|
13 |
+
<h2><?php _e('API Key and License Information', 'gmap-embed'); ?></h2>
|
14 |
<hr/>
|
15 |
<table class="form-table" role="presentation">
|
16 |
|
17 |
<tbody>
|
18 |
+
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&tag=settings&message=3">
|
19 |
<tr>
|
20 |
<th scope="row">
|
21 |
+
<label for="wpgmapembed_key">
|
22 |
+
<?php _e('Enter API Key: ', 'gmap-embed'); ?>
|
23 |
</label>
|
24 |
</th>
|
25 |
<td scope="row">
|
26 |
<input type="text" name="wpgmapembed_key"
|
27 |
+
value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>"
|
28 |
+
size="45" class="regular-text" style="width:100%" id="wpgmapembed_key"/>
|
29 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
30 |
+
<?php _e('The API key may take up to 5 minutes to take effect', 'gmap-embed'); ?>
|
31 |
</p>
|
32 |
</td>
|
33 |
<td width="30%" style="vertical-align: top;">
|
34 |
+
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
|
35 |
<a target="_blank" style="margin-left: 5px;" href="
|
36 |
+
<?php echo esc_url('https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&keyType=CLIENT_SIDE&reusekey=true'); ?>"
|
37 |
class="button media-button button-default button-large">
|
38 |
+
<?php _e('GET API KEY', 'gmap-embed'); ?>
|
39 |
</a>
|
40 |
</td>
|
41 |
</tr>
|
42 |
</form>
|
43 |
|
44 |
+
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&tag=settings&&message=4">
|
45 |
<tr>
|
46 |
<th scope="row">
|
47 |
+
<label for="wpgmapembed_license">
|
48 |
+
<?php _e('License Key: ', 'gmap-embed'); ?>
|
49 |
</label>
|
50 |
</th>
|
51 |
<td scope="row">
|
52 |
<input type="text" name="wpgmapembed_license"
|
53 |
+
value="<?php echo esc_html(get_option('wpgmapembed_license')); ?>"
|
54 |
+
size="45" class="regular-text" style="width:100%" id="wpgmapembed_license"/>
|
55 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
56 |
+
<?php _e('After payment you will get an email with license key', 'gmap-embed'); ?>
|
57 |
</p>
|
58 |
</td>
|
59 |
<td width="30%" style="vertical-align: top;">
|
60 |
+
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
|
61 |
|
62 |
+
<?php
|
63 |
+
if (strlen(trim(get_option('wpgmapembed_license'))) !== 32) { ?>
|
64 |
<a target="_blank"
|
65 |
+
href="<?php echo esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA'); ?>"
|
66 |
+
class="button media-button button-default button-large"><?php _e('GET LICENSE KEY', 'gmap-embed'); ?></a>
|
67 |
+
<?php
|
68 |
+
}
|
69 |
+
?>
|
70 |
</td>
|
71 |
</tr>
|
72 |
</form>
|
76 |
</div>
|
77 |
|
78 |
<div data-columns="8">
|
79 |
+
<form method="POST" action="options.php">
|
80 |
+
<div class="wpgmap_lng_custom_script_settings">
|
81 |
+
<?php
|
82 |
+
settings_fields('wpgmap_script_settings');
|
83 |
+
do_settings_sections('gmap-embed-settings-page-ls');
|
84 |
+
do_settings_sections('gmap-embed-settings-page-cs');
|
85 |
+
submit_button();
|
86 |
+
?>
|
87 |
+
</div>
|
88 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
</div>
|
includes/wpgmap_settings_initial.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
// add settings saved message with the class of "updated"
|
7 |
+
add_settings_error('wpgmap_msg', 'wpgmap_msg_initial', __('Please click on <i style="color:green;">GET API KEY</i> button to get Google API key at first,
|
8 |
+
it is mandatory to use Google Map. If you would like to get a <i style="color:green;">Lifetime License</i> key, please click on <i style="color:green;">GET LICENSE KEY</i> button.', 'gmap-embed'), 'info');
|
9 |
+
settings_errors('wpgmap_msg');
|
10 |
+
?>
|
11 |
+
<div data-columns="8">
|
12 |
+
<div class="wpgmapembed_get_api_key" style="margin-bottom: 10px;">
|
13 |
+
<h2><?php _e('API Key and License Information', 'gmap-embed'); ?></h2>
|
14 |
+
<hr/>
|
15 |
+
<table class="form-table" role="presentation">
|
16 |
+
|
17 |
+
<tbody>
|
18 |
+
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&&message=3">
|
19 |
+
<tr>
|
20 |
+
<th scope="row">
|
21 |
+
<label for="wpgmapembed_key">
|
22 |
+
<?php _e('Enter API Key: ', 'gmap-embed'); ?>
|
23 |
+
</label>
|
24 |
+
</th>
|
25 |
+
<td scope="row">
|
26 |
+
<input type="text" name="wpgmapembed_key"
|
27 |
+
value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>"
|
28 |
+
size="45" class="regular-text" style="width:100%" id="wpgmapembed_key"/>
|
29 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
30 |
+
<?php _e('The API key may take up to 5 minutes to take effect', 'gmap-embed'); ?>
|
31 |
+
</p>
|
32 |
+
</td>
|
33 |
+
<td width="30%" style="vertical-align: top;">
|
34 |
+
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
|
35 |
+
<a target="_blank" style="margin-left: 5px;" href="
|
36 |
+
<?php echo esc_url('https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&keyType=CLIENT_SIDE&reusekey=true'); ?>"
|
37 |
+
class="button media-button button-default button-large">
|
38 |
+
<?php _e('GET API KEY', 'gmap-embed'); ?>
|
39 |
+
</a>
|
40 |
+
</td>
|
41 |
+
</tr>
|
42 |
+
</form>
|
43 |
+
|
44 |
+
<form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&&message=4">
|
45 |
+
<tr>
|
46 |
+
<th scope="row">
|
47 |
+
<label for="wpgmapembed_license">
|
48 |
+
<?php _e('License Key: ', 'gmap-embed'); ?>
|
49 |
+
</label>
|
50 |
+
</th>
|
51 |
+
<td scope="row">
|
52 |
+
<input type="text" name="wpgmapembed_license"
|
53 |
+
value="<?php echo esc_html(get_option('wpgmapembed_license')); ?>"
|
54 |
+
size="45" class="regular-text" style="width:100%" id="wpgmapembed_license"/>
|
55 |
+
<p class="description" id="tagline-description" style="font-style: italic;">
|
56 |
+
<?php _e('After payment you will get an email with license key', 'gmap-embed'); ?>
|
57 |
+
</p>
|
58 |
+
</td>
|
59 |
+
<td width="30%" style="vertical-align: top;">
|
60 |
+
<button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
|
61 |
+
|
62 |
+
<?php
|
63 |
+
if (strlen(trim(get_option('wpgmapembed_license'))) !== 32) { ?>
|
64 |
+
<a target="_blank"
|
65 |
+
href="<?php echo esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA'); ?>"
|
66 |
+
class="button media-button button-default button-large"><?php _e('GET LICENSE KEY', 'gmap-embed'); ?></a>
|
67 |
+
<?php
|
68 |
+
}
|
69 |
+
?>
|
70 |
+
</td>
|
71 |
+
</tr>
|
72 |
+
</form>
|
73 |
+
</tbody>
|
74 |
+
</table>
|
75 |
+
</div>
|
76 |
+
</div>
|
languages/gmap-embed-nl_NL_formal.mo
ADDED
Binary file
|
languages/gmap-embed-nl_NL_formal.po
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Translation of Plugins - WP Google Map - Stable (latest release) in Dutch
|
2 |
+
# This file is distributed under the same license as the Plugins - WP Google Map - Stable (latest release) package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"PO-Revision-Date: +0000\n"
|
6 |
+
"MIME-Version: 1.0\n"
|
7 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
+
"Content-Transfer-Encoding: 8bit\n"
|
9 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
10 |
+
"X-Generator: GlotPress/3.0.0-alpha.2\n"
|
11 |
+
"Language: nl\n"
|
12 |
+
"Project-Id-Version: Plugins - WP Google Map - Stable (latest release)\n"
|
13 |
+
|
14 |
+
#: srm_gmap_embed.php:485
|
15 |
+
msgid "Map Language:"
|
16 |
+
msgstr "Kaart taal"
|
17 |
+
|
18 |
+
#: srm_gmap_embed.php:636
|
19 |
+
msgid "Support"
|
20 |
+
msgstr "Support"
|
21 |
+
|
22 |
+
#: includes/wpgmap_create.php:89 includes/wpgmap_edit.php:112
|
23 |
+
msgid "Current Location Address(HTML supported)"
|
24 |
+
msgstr "Huidige locatie (HTML supported)"
|
25 |
+
|
26 |
+
#: includes/gmap.php:76
|
27 |
+
msgid "See Video"
|
28 |
+
msgstr "Bekijk de video"
|
29 |
+
|
30 |
+
#: includes/gmap.php:82
|
31 |
+
msgid "LIVE CHAT"
|
32 |
+
msgstr "LIVE CHAT "
|
33 |
+
|
34 |
+
#: srm_gmap_embed.php:265
|
35 |
+
msgid "Create Your First Map"
|
36 |
+
msgstr "Maak uw eerste kaart aan"
|
37 |
+
|
38 |
+
#: srm_gmap_embed.php:402
|
39 |
+
msgid "Google Maps"
|
40 |
+
msgstr "Google Maps"
|
41 |
+
|
42 |
+
#: srm_gmap_embed.php:403
|
43 |
+
msgid "Map"
|
44 |
+
msgstr "Kaart"
|
45 |
+
|
46 |
+
#: includes/shortcodes.php:166
|
47 |
+
msgid "Transit"
|
48 |
+
msgstr "Transit"
|
49 |
+
|
50 |
+
#: includes/wpgmap_create.php:34 includes/wpgmap_edit.php:42
|
51 |
+
msgid "Latitude, Longitude(Approx)"
|
52 |
+
msgstr "Breedte-, lengtegraden (Bij benadering)"
|
53 |
+
|
54 |
+
#: includes/wpgmap_settings.php:7
|
55 |
+
msgid "Settings Saved"
|
56 |
+
msgstr "Instellingen opgeslagen"
|
57 |
+
|
58 |
+
#: includes/wpgmap_create.php:96
|
59 |
+
msgid "Show location address in marker infowindow"
|
60 |
+
msgstr "Toon het adres in de aanwijzer"
|
61 |
+
|
62 |
+
#: includes/gmap.php:130
|
63 |
+
msgid "Map has been created Successfully. <a href=\""
|
64 |
+
msgstr "Kaart is succesvol aangemaakt"
|
65 |
+
|
66 |
+
#: includes/gmap.php:133
|
67 |
+
msgid "Map Updated Successfully. <a href=\""
|
68 |
+
msgstr "Kaart is succesvol ge-update"
|
69 |
+
|
70 |
+
#: includes/wpgmap_settings.php:48 includes/wpgmap_settings_initial.php:48
|
71 |
+
msgid "License Key: "
|
72 |
+
msgstr "Licentiesleutel"
|
73 |
+
|
74 |
+
#: includes/wpgmap_settings.php:66 includes/wpgmap_settings_initial.php:66
|
75 |
+
msgid "GET LICENSE KEY"
|
76 |
+
msgstr "Haal een licentiesleutel op"
|
77 |
+
|
78 |
+
#: includes/wpgmap_settings.php:38 includes/wpgmap_settings_initial.php:38
|
79 |
+
msgid "GET API KEY"
|
80 |
+
msgstr "Haal een API-sleutel op"
|
81 |
+
|
82 |
+
#: includes/wpgmap_settings.php:13 includes/wpgmap_settings_initial.php:13
|
83 |
+
msgid "API Key and License Information"
|
84 |
+
msgstr "API-sleutel en licentie informatie"
|
85 |
+
|
86 |
+
#: includes/gmap.php:70
|
87 |
+
msgid "Having Problem?"
|
88 |
+
msgstr "Ervaart u een probleem?"
|
89 |
+
|
90 |
+
#: includes/wpgmap_settings.php:30 includes/wpgmap_settings_initial.php:30
|
91 |
+
msgid "The API key may take up to 5 minutes to take effect"
|
92 |
+
msgstr "Het kan tot 5 minuten duren voordat de API-sleutel actief is"
|
93 |
+
|
94 |
+
#: includes/shortcodes.php:170
|
95 |
+
msgid "Get Directions"
|
96 |
+
msgstr "Route"
|
97 |
+
|
98 |
+
#: includes/shortcodes.php:155
|
99 |
+
msgid "To"
|
100 |
+
msgstr "Naar"
|
101 |
+
|
102 |
+
#: includes/shortcodes.php:151
|
103 |
+
msgid "From"
|
104 |
+
msgstr "Van"
|
105 |
+
|
106 |
+
#: includes/shortcodes.php:161
|
107 |
+
msgid "Transportation method"
|
108 |
+
msgstr "Routeplanning"
|
109 |
+
|
110 |
+
#: includes/shortcodes.php:164
|
111 |
+
msgid "Walking"
|
112 |
+
msgstr "Te voet"
|
113 |
+
|
114 |
+
#: includes/shortcodes.php:165
|
115 |
+
msgid "Bicycling"
|
116 |
+
msgstr "Per fiets"
|
117 |
+
|
118 |
+
#: includes/shortcodes.php:173
|
119 |
+
msgid "Loading"
|
120 |
+
msgstr "Aan het laden.."
|
121 |
+
|
122 |
+
#: includes/shortcodes.php:163
|
123 |
+
msgid "Driving"
|
124 |
+
msgstr "Per auto"
|
readme.txt
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
-
===
|
2 |
Contributors: milonfci
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA
|
4 |
-
Tags: google map,
|
5 |
Requires at least: 2.9
|
6 |
-
Tested up to: 5.
|
7 |
-
Version: 1.7.
|
|
|
8 |
Requires PHP: 5.3
|
9 |
Text Domain: gmap-embed
|
10 |
License: GPLv2 or later
|
@@ -16,16 +17,65 @@ WP Google Map is very Simple, light-weight and Easy to use Google Custom Map wit
|
|
16 |
|
17 |
WP Google Map is an awesome plugin to use when adding a custom Google map to your website. It is fully customizable and can be used as shortcode.
|
18 |
|
19 |
-
[
|
20 |
-
|
21 |
-
###
|
22 |
-
After July 16, 2018, Google has changed its policy. **You need to add billing information to use Google Map
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
* [
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
[Click here to donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
|
30 |
|
31 |
https://www.youtube.com/watch?v=o90H34eacHg
|
@@ -39,7 +89,7 @@ https://www.youtube.com/watch?v=o90H34eacHg
|
|
39 |
* **Automatic Google Map location identification**
|
40 |
* **Tested with other popular plugins**
|
41 |
* **Super easy to use**
|
42 |
-
* **Ability to change zoom level(1-
|
43 |
* **Easy to add a widget (By Shortcode)**
|
44 |
* **No coding required!**
|
45 |
* **Drag map markers to an exact location**
|
@@ -47,7 +97,7 @@ https://www.youtube.com/watch?v=o90H34eacHg
|
|
47 |
* **Fully responsive maps**
|
48 |
* **Supported UTF-8 font encoding**
|
49 |
* **Google Map autocomplete available**
|
50 |
-
* **Multiple Language supported(Localization)
|
51 |
* **Can be used in the single page, single post, sidebar, footer, etc.**
|
52 |
* **You can set any width and width as you need**
|
53 |
* **It is most helpful for WordPress website to embed google map**
|
@@ -56,13 +106,15 @@ https://www.youtube.com/watch?v=o90H34eacHg
|
|
56 |
|
57 |
* **Direction Support with Map.**
|
58 |
* **Ability to change Latitude, Longitude, Address by Dragging Marker**
|
59 |
-
* **Roadmap, Terrain, Satellite and Hybrid types of map supported
|
60 |
-
* **Supports Google Map
|
61 |
* **You can add multiple maps in any page or post if you need!**
|
62 |
* **Map full screen functionality**
|
63 |
* **Ability to create Map as much as you need!**
|
64 |
* **Ability to change Map Language and Regional Area!**
|
65 |
|
|
|
|
|
66 |
### USE AS SHORTCODE IN POST, PAGE, AND SIDEBAR.
|
67 |
`[gmap-embed id="<Your map ID>"]`
|
68 |
|
@@ -72,20 +124,15 @@ https://www.youtube.com/watch?v=o90H34eacHg
|
|
72 |
<?php echo do_shortcode('[gmap-embed id="YOUR MAP ID"]');?>
|
73 |
|
74 |
|
75 |
-
|
76 |
-
The plugin requires an API key., [click here](https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend&keyType=CLIENT_SIDE&reusekey=true) to get your free API key. The API key may take up to 5 minutes to take effect.
|
77 |
-
|
78 |
-
Contact me if you have any problems with installation or anything else.
|
79 |
Email: **milonfci@gmail.com**
|
80 |
Skype: **milon305021**
|
81 |
|
82 |
-
If you have a problem or a suggestion, please post in [Support Forum](https://wordpress.org/support/plugin/gmap-embed).
|
83 |
-
|
84 |
== Installation ==
|
85 |
|
86 |
### It's simple:
|
87 |
|
88 |
-
1. [Download](https://
|
89 |
2. Upload the zip folder plugins directory "wp-content/plugins"
|
90 |
3. Activate the WP Google Map Plugin from the Admin panel.
|
91 |
4. Add the WP Google Map widget to your sidebar using Shortcode.
|
@@ -94,17 +141,17 @@ If you have a problem or a suggestion, please post in [Support Forum](https://wo
|
|
94 |
|
95 |
== Upgrade Notice ==
|
96 |
|
97 |
-
Upgrade Google Map Plugin from [here](https://
|
98 |
|
99 |
== Frequently Asked Questions ==
|
100 |
|
101 |
Our WP Google Map plugin is user-friendly, but you can read some frequently asked questions that might help you here.
|
102 |
|
103 |
= How can I create a new Google Map? =
|
104 |
-
After installing the plugin, Click on Google Map
|
105 |
|
106 |
= How can I see the list of created Google Maps? =
|
107 |
-
Click on **Google Map
|
108 |
|
109 |
= How do I enable directions on my Google Map? =
|
110 |
You will see an option named "**Enable Direction in Map**" under each map setting. Also, you can set the option in creating a new map page.
|
@@ -118,7 +165,7 @@ Go to **Pages** =-> **Add New** then you will see a button named "Embed Google M
|
|
118 |
|
119 |
|
120 |
= How do I add a Google Map as a widget? =
|
121 |
-
Go to **Appearance** =-> **Widget** then you will see a widget named "Google Map
|
122 |
|
123 |
= How do I get a Google Map API key? =
|
124 |
See the [Video](https://www.youtube.com/watch?v=o90H34eacHg) ,hope you will get idea.
|
@@ -136,13 +183,25 @@ See the [Video](https://www.youtube.com/watch?v=o90H34eacHg) ,hope you will get
|
|
136 |
|
137 |
== Changelog ==
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
= 1.7.2 =
|
140 |
* Map Center position auto detection on drag-drop and re-centering by user.
|
141 |
* LIVE zoom updating and rendering once zoom level changed by user.
|
142 |
|
143 |
= 1.7.1 =
|
144 |
* HTML content support in Google Map InfoWindow
|
145 |
-
* Added select drop-down in Google
|
146 |
* Disable admin notice for language based google setup.
|
147 |
|
148 |
= 1.7.0 =
|
@@ -359,4 +418,4 @@ New version released with new helpful video
|
|
359 |
|
360 |
|
361 |
= 1.0.0 =
|
362 |
-
* Initial version of Google Map
|
1 |
+
=== GmapEmbed - Google Maps plugin for WordPress ===
|
2 |
Contributors: milonfci
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA
|
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.7
|
7 |
+
Version: 1.7.3
|
8 |
+
Stable tag: 1.7.3
|
9 |
Requires PHP: 5.3
|
10 |
Text Domain: gmap-embed
|
11 |
License: GPLv2 or later
|
17 |
|
18 |
WP Google Map is an awesome plugin to use when adding a custom Google map to your website. It is fully customizable and can be used as shortcode.
|
19 |
|
20 |
+
[Get WP Google Map pro version](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
|
21 |
+
|
22 |
+
### NOTE FOR ALL
|
23 |
+
After July 16, 2018, Google has changed its policy. **You need to add billing information to use Google Map. Noted that: According to [Google Documentation](https://cloud.google.com/maps-platform/pricing), You can use Google Map upto 200 USD for free each month** . Even if you face a problem, please send a message in the mail: **milonfci@gmail.com** or Skype: **milon305021**
|
24 |
+
|
25 |
+
### DEMOS
|
26 |
+
|
27 |
+
* **[Google Map with Direction Option (DRIVING, WALKING, BICYCLING, TRANSIT)](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_1)**
|
28 |
+
* **[Google Map with Disabled zoom on mouse scroll](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_4)**
|
29 |
+
* **[Google Map SATELLITE view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_5)**
|
30 |
+
* **[Google Map TERRAIN view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_7)**
|
31 |
+
* **[Google Map without Direction view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_3)**
|
32 |
+
|
33 |
+
### DOCUMENTATION
|
34 |
+
|
35 |
+
* **[How to get your Lifetime License key?](https://srmilon.info/2019/03/31/how-to-get-your-license-key?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
36 |
+
* **[How to get API key](https://srmilon.info/2019/02/18/how-to-get-google-map-api-key?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
37 |
+
* **[Add Google Map in wordpress page](https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
38 |
+
* **[Add Google Map in wordpress post](https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
39 |
+
* **[Add Google Map in Sidebar as widget](https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
40 |
+
* **[Customize Map Language and Regional Area Settings](https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_repo&utm_medium=readme_doc_list&utm_campaign=doc_list)**
|
41 |
+
|
42 |
+
### TROUBLESHOOTING
|
43 |
+
|
44 |
+
* **[How to debug or identify the Map loading problems in Admin Panel?](https://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=wp_repo&utm_medium=readme_troubleshoot&utm_campaign=troubleshoot_list)**
|
45 |
+
* **[Don’t see "Embed Google Map" button in new Editor?](https://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor?utm_source=wp_repo&utm_medium=readme_troubleshoot_list&utm_campaign=troubleshoot_list)**
|
46 |
+
* **[Do you see “the page can't load the map correctly?](https://srmilon.info/2019/03/31/can-not-load-the-map-correctly?utm_source=wp_repo&utm_medium=readme_troubleshoot&utm_campaign=troubleshoot_list)**
|
47 |
+
|
48 |
+
### TRANSLATIONS
|
49 |
+
|
50 |
+
Get a free **License Key** of the WP Google Map Pro version in exchange for translating our plugin!
|
51 |
+
|
52 |
+
* **[English (Australia)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_au) - (en_AU)**
|
53 |
+
* **[English (Canada)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_ca) - (en_CA)**
|
54 |
+
* **[English (UK)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_gb) - (en_GB)**
|
55 |
+
* **[English (New Zealand)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_nz) - (en_NZ)**
|
56 |
+
* **[English (South Africa)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_za) - (en_ZA)**
|
57 |
+
* **[Bengali (Bangladesh)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_bn_bd) - (bn_BD)**
|
58 |
+
* **[Spanish (Spain)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_es) - (es_ES)**
|
59 |
+
* **[Spanish (Venezuela)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_ve) - (es_VE)**
|
60 |
+
* **[German](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_de) - (de_DE)**
|
61 |
+
* **[German (Formal)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_de_formal) - (de_DE_formal)**
|
62 |
+
* **[Turkish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_tr_tr) - (tr_TR)**
|
63 |
+
* **[French (France)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_fr_fr) - (fr_FR)**
|
64 |
+
* **[Danish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_da_dk) - (da_DK)**
|
65 |
+
* **[German (Switzerland)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_de_ch) - (de_CH)**
|
66 |
+
* **[Arabic](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_ar) - (ar)**
|
67 |
+
|
68 |
+
### SUPPORT AND CONTRIBUTION
|
69 |
+
* **[Report an issue](https://www.srmilon.info/report-issue?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_report_issue)**
|
70 |
+
* **[Support Forum](https://www.srmilon.info/wp-support-forum?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_wp_support_forum)**
|
71 |
+
* **[Post review Wordpress](https://www.srmilon.info/wp-review-forum?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_review)** :)
|
72 |
+
* **[Contact Us](https://srmilon.info/contact-us?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_contact_us)**
|
73 |
+
* **[Facebook Page Community](https://www.srmilon.info/fb-page?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_fb_page)**
|
74 |
+
* **[Facebook Group Community](https://www.srmilon.info/fb-group?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_fb_group)**
|
75 |
+
* **[Twitter Community](https://www.srmilon.info/twitter?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_twitter)**
|
76 |
+
* **[LIVE CHAT](https://www.srmilon.info/live-chat?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_live_chat)**
|
77 |
+
|
78 |
+
To have continued the update, please donate for the WP Google Map plugin. **You will get Lifetime License Key by donating minimum 10 USD**
|
79 |
[Click here to donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
|
80 |
|
81 |
https://www.youtube.com/watch?v=o90H34eacHg
|
89 |
* **Automatic Google Map location identification**
|
90 |
* **Tested with other popular plugins**
|
91 |
* **Super easy to use**
|
92 |
+
* **Ability to change zoom level(1-22)**
|
93 |
* **Easy to add a widget (By Shortcode)**
|
94 |
* **No coding required!**
|
95 |
* **Drag map markers to an exact location**
|
97 |
* **Fully responsive maps**
|
98 |
* **Supported UTF-8 font encoding**
|
99 |
* **Google Map autocomplete available**
|
100 |
+
* **Multiple Language supported(Localization)**
|
101 |
* **Can be used in the single page, single post, sidebar, footer, etc.**
|
102 |
* **You can set any width and width as you need**
|
103 |
* **It is most helpful for WordPress website to embed google map**
|
106 |
|
107 |
* **Direction Support with Map.**
|
108 |
* **Ability to change Latitude, Longitude, Address by Dragging Marker**
|
109 |
+
* **Roadmap, Terrain, Satellite and Hybrid types of map supported**
|
110 |
+
* **Supports Google Map Street View option**
|
111 |
* **You can add multiple maps in any page or post if you need!**
|
112 |
* **Map full screen functionality**
|
113 |
* **Ability to create Map as much as you need!**
|
114 |
* **Ability to change Map Language and Regional Area!**
|
115 |
|
116 |
+
**Please use latest language file**
|
117 |
+
|
118 |
### USE AS SHORTCODE IN POST, PAGE, AND SIDEBAR.
|
119 |
`[gmap-embed id="<Your map ID>"]`
|
120 |
|
124 |
<?php echo do_shortcode('[gmap-embed id="YOUR MAP ID"]');?>
|
125 |
|
126 |
|
127 |
+
Contact us if you have any problems with installation or anything else.
|
|
|
|
|
|
|
128 |
Email: **milonfci@gmail.com**
|
129 |
Skype: **milon305021**
|
130 |
|
|
|
|
|
131 |
== Installation ==
|
132 |
|
133 |
### It's simple:
|
134 |
|
135 |
+
1. [Download](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme&utm_campaign=download_plugin) the WP Google Map Plugin.
|
136 |
2. Upload the zip folder plugins directory "wp-content/plugins"
|
137 |
3. Activate the WP Google Map Plugin from the Admin panel.
|
138 |
4. Add the WP Google Map widget to your sidebar using Shortcode.
|
141 |
|
142 |
== Upgrade Notice ==
|
143 |
|
144 |
+
Upgrade WP Google Map Plugin from [here](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme&utm_campaign=download_plugin) to get updated features.
|
145 |
|
146 |
== Frequently Asked Questions ==
|
147 |
|
148 |
Our WP Google Map plugin is user-friendly, but you can read some frequently asked questions that might help you here.
|
149 |
|
150 |
= How can I create a new Google Map? =
|
151 |
+
After installing the plugin, Click on WP Google Map in the left sidebar. Then click on **Create New map**
|
152 |
|
153 |
= How can I see the list of created Google Maps? =
|
154 |
+
Click on **WP Google Map** in the left sidebar, here Created Maps list will appear.
|
155 |
|
156 |
= How do I enable directions on my Google Map? =
|
157 |
You will see an option named "**Enable Direction in Map**" under each map setting. Also, you can set the option in creating a new map page.
|
165 |
|
166 |
|
167 |
= How do I add a Google Map as a widget? =
|
168 |
+
Go to **Appearance** =-> **Widget** then you will see a widget named "WP Google Map ". Drag it to any widget area and enter Google Map Shortcode then save it and the map will appear in your sidebar or footer whatever you selected. Enjoy!
|
169 |
|
170 |
= How do I get a Google Map API key? =
|
171 |
See the [Video](https://www.youtube.com/watch?v=o90H34eacHg) ,hope you will get idea.
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 1.7.3 =
|
187 |
+
* Custom CSS and JS adding option under settings tab.
|
188 |
+
* Map direction UI re-designed and made responsive for various themes.
|
189 |
+
* If short code not found, will show a custom message in front end.
|
190 |
+
* Settings UI design changed for better user experience.
|
191 |
+
* Made responsive for cross-platform
|
192 |
+
* media_buttons_context deprecated issue resolving
|
193 |
+
* Review system modification, made standard
|
194 |
+
* Code re-organize with trait system
|
195 |
+
* Admin UI updated to more user friendly
|
196 |
+
* In case of shortcode not found shown a custom message only for logged in admin user
|
197 |
+
|
198 |
= 1.7.2 =
|
199 |
* Map Center position auto detection on drag-drop and re-centering by user.
|
200 |
* LIVE zoom updating and rendering once zoom level changed by user.
|
201 |
|
202 |
= 1.7.1 =
|
203 |
* HTML content support in Google Map InfoWindow
|
204 |
+
* Added select drop-down in WP Google Map widget instead of text box for ShortCode.
|
205 |
* Disable admin notice for language based google setup.
|
206 |
|
207 |
= 1.7.0 =
|
418 |
|
419 |
|
420 |
= 1.0.0 =
|
421 |
+
* Initial version of WP Google Map Plugin.
|
srm_gmap_embed.php
CHANGED
@@ -1,494 +1,72 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: Google Map
|
4 |
-
Plugin URI: https://www.srmilon.info
|
5 |
-
Description:
|
6 |
-
Author: srmilon
|
7 |
Text Domain: gmap-embed
|
8 |
Domain Path: /languages
|
9 |
-
Author URI: https://www.srmilon.info
|
10 |
-
Version: 1.7.
|
11 |
*/
|
12 |
|
13 |
-
if (
|
14 |
-
|
15 |
}
|
16 |
-
require_once plugin_dir_path(
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
function enqueue_admin_gmap_scripts() {
|
63 |
-
global $pagenow;
|
64 |
-
if ( $pagenow == 'post.php' || $pagenow == 'post-new.php' || ( isset( $_GET['page'] ) and $_GET['page'] == 'wpgmapembed' ) ) {
|
65 |
-
$srm_gmap_lng = get_option( 'srm_gmap_lng', 'en' );
|
66 |
-
$srm_gmap_region = get_option( 'srm_gmap_region', 'US' );
|
67 |
-
wp_enqueue_script( 'wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '®ion=' . $srm_gmap_region, array( 'jquery' ), '20200506', true );
|
68 |
-
wp_enqueue_script( 'wp-gmap-custom-js', plugins_url( 'assets/js/custom.js', __FILE__ ), array( 'wp-gmap-api' ), filemtime(__DIR__.'/assets/js/custom.js'), false );
|
69 |
-
wp_enqueue_style( 'wp-gmap-embed-css', plugins_url( 'assets/css/wp-gmap-style.css', __FILE__ ), array(),filemtime(__DIR__.'/assets/css/wp-gmap-style.css') );
|
70 |
-
|
71 |
-
// For media upload
|
72 |
-
wp_enqueue_script( 'media-upload' );
|
73 |
-
wp_enqueue_script( 'thickbox' );
|
74 |
-
wp_enqueue_script( 'wpgmap-media-upload' );
|
75 |
-
wp_enqueue_style( 'thickbox' );
|
76 |
-
if(isset($_GET['tag']) and $_GET['tag']=='edit'){
|
77 |
-
// enqueue scripts for localization
|
78 |
-
wp_register_script( 'wp-gmap-lz-script', plugins_url( 'assets/js/localized_script.js', __FILE__ ), array( 'wp-gmap-custom-js' ), filemtime(__DIR__.'/assets/js/localized_script.js'), true);
|
79 |
-
// Localize the script with new data
|
80 |
-
$current_map_marker_lat_lng = explode(',', get_post_meta( $_GET['id'], 'wpgmap_latlng', true ));
|
81 |
-
$current_map_marker_lat = isset($current_map_marker_lat_lng[0])?$current_map_marker_lat_lng[0]:40.73359922990751;
|
82 |
-
$current_map_marker_lng = isset($current_map_marker_lat_lng[1])?$current_map_marker_lat_lng[1]:-74.02791395625002;
|
83 |
-
$translation_array = array(
|
84 |
-
'current_map_marker_lat' => $current_map_marker_lat,
|
85 |
-
'current_map_marker_lng' => $current_map_marker_lng
|
86 |
-
);
|
87 |
-
wp_localize_script( 'wp-gmap-lz-script', 'gmap_object', $translation_array );
|
88 |
-
|
89 |
-
// Enqueued script with localized data.
|
90 |
-
wp_enqueue_script( 'wp-gmap-lz-script' );
|
91 |
-
}
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
/**
|
97 |
-
* To create menu in admin panel
|
98 |
-
*/
|
99 |
-
public function gmap_create_menu() {
|
100 |
-
|
101 |
-
//create new top-level menu
|
102 |
-
add_menu_page( $this->plugin_name, $this->plugin_name, 'administrator', 'wpgmapembed', array(
|
103 |
-
$this,
|
104 |
-
'srm_gmap_main'
|
105 |
-
), 'dashicons-location', 11 );
|
106 |
-
|
107 |
-
$no_of_map_created = gmap_embed_no_of_post();
|
108 |
-
//to create sub menu
|
109 |
-
if ( gmap_embed_is_using_premium_version() ) {
|
110 |
-
add_submenu_page( 'wpgmapembed', __( "Add new Map", "gmap-embed" ), __( "Add New", "gmap-embed" ), 'administrator', 'wpgmapembed&tag=new', array(
|
111 |
-
$this,
|
112 |
-
'srm_gmap_new'
|
113 |
-
), 11 );
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
public function gmap_register_fields() {
|
118 |
-
//register fields
|
119 |
-
register_setting( 'gmap_settings_group', 'gmap_title' );
|
120 |
-
register_setting( 'gmap_settings_group', 'wpgmap_heading_class' );
|
121 |
-
register_setting( 'gmap_settings_group', 'gmap_lat' );
|
122 |
-
register_setting( 'gmap_settings_group', 'gmap_long' );
|
123 |
-
register_setting( 'gmap_settings_group', 'gmap_width' );
|
124 |
-
register_setting( 'gmap_settings_group', 'gmap_height' );
|
125 |
-
register_setting( 'gmap_settings_group', 'gmap_zoom' );
|
126 |
-
register_setting( 'gmap_settings_group', 'gmap_disable_zoom_scroll' );
|
127 |
-
register_setting( 'gmap_settings_group', 'gmap_type' );
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Google Map Embed Mail Page
|
132 |
-
*/
|
133 |
-
public function srm_gmap_main() {
|
134 |
-
require plugin_dir_path( __FILE__ ) . '/includes/gmap.php';
|
135 |
-
}
|
136 |
-
|
137 |
-
/*
|
138 |
-
* To update post meta data
|
139 |
-
*/
|
140 |
-
|
141 |
-
public function __update_post_meta( $post_id, $field_name, $value = '' ) {
|
142 |
-
if ( ! get_post_meta( $post_id, $field_name ) ) {
|
143 |
-
add_post_meta( $post_id, $field_name, $value );
|
144 |
-
} else {
|
145 |
-
update_post_meta( $post_id, $field_name, $value );
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* To save New Map Data
|
151 |
-
*/
|
152 |
-
|
153 |
-
public function save_wpgmapembed_data() {
|
154 |
-
$error = '';
|
155 |
-
// Getting ajax fileds value
|
156 |
-
$meta_data = array(
|
157 |
-
'wpgmap_title' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_title'] ) ),
|
158 |
-
'wpgmap_heading_class' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_heading_class'] ) ),
|
159 |
-
'wpgmap_show_heading' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_show_heading'] ) ),
|
160 |
-
// current marker lat lng
|
161 |
-
'wpgmap_latlng' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_latlng'] ) ),
|
162 |
-
'wpgmap_map_zoom' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_map_zoom'] ) ),
|
163 |
-
'wpgmap_disable_zoom_scroll' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_disable_zoom_scroll'] ) ),
|
164 |
-
'wpgmap_map_width' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_map_width'] ) ),
|
165 |
-
'wpgmap_map_height' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_map_height'] ) ),
|
166 |
-
'wpgmap_map_type' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_map_type'] ) ),
|
167 |
-
'wpgmap_map_address' => sanitize_text_field( esc_html( $_POST['map_data']['wpgmap_map_address'] ) ),
|
168 |
-
'wpgmap_show_infowindow' => sanitize_text_field( $_POST['map_data']['wpgmap_show_infowindow'] ),
|
169 |
-
'wpgmap_enable_direction' => sanitize_text_field( $_POST['map_data']['wpgmap_enable_direction'] ),
|
170 |
-
'wpgmap_marker_icon' => sanitize_text_field( $_POST['map_data']['wpgmap_marker_icon'] ),
|
171 |
-
// map center lat lng
|
172 |
-
'wpgmap_center_lat_lng' => sanitize_text_field( $_POST['map_data']['wpgmap_center_lat_lng'] )
|
173 |
-
);
|
174 |
-
$action_type = sanitize_text_field( esc_html( $_POST['map_data']['action_type'] ) );
|
175 |
-
if ( $meta_data['wpgmap_latlng'] == '' ) {
|
176 |
-
$error = "Please input Latitude and Longitude";
|
177 |
-
}
|
178 |
-
if ( strlen( $error ) > 0 ) {
|
179 |
-
echo json_encode( array(
|
180 |
-
'responseCode' => 0,
|
181 |
-
'message' => $error
|
182 |
-
) );
|
183 |
-
exit;
|
184 |
-
} else {
|
185 |
-
|
186 |
-
if ( $action_type == 'save' ) {
|
187 |
-
// saving post array
|
188 |
-
$post_array = array(
|
189 |
-
'post_type' => 'wpgmapembed'
|
190 |
-
);
|
191 |
-
$post_id = wp_insert_post( $post_array );
|
192 |
-
|
193 |
-
} elseif ( $action_type == 'update' ) {
|
194 |
-
$post_id = intval( $_POST['map_data']['post_id'] );
|
195 |
-
}
|
196 |
-
|
197 |
-
// Updating post meta
|
198 |
-
foreach ( $meta_data as $key => $value ) {
|
199 |
-
$this->__update_post_meta( $post_id, $key, $value );
|
200 |
-
}
|
201 |
-
$returnArray = array(
|
202 |
-
'responseCode' => 1,
|
203 |
-
'post_id' => $post_id
|
204 |
-
);
|
205 |
-
if ( $action_type == 'save' ) {
|
206 |
-
$returnArray['message'] = 'Created Successfully.';
|
207 |
-
} elseif ( $action_type == 'update' ) {
|
208 |
-
$returnArray['message'] = 'Updated Successfully.';
|
209 |
-
}
|
210 |
-
echo json_encode( $returnArray );
|
211 |
-
exit;
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
public function load_wpgmapembed_list() {
|
216 |
-
$content = '';
|
217 |
-
$args = array(
|
218 |
-
'post_type' => 'wpgmapembed',
|
219 |
-
'posts_per_page' => - 1
|
220 |
-
);
|
221 |
-
$mapsList = new WP_Query( $args );
|
222 |
-
|
223 |
-
if ( $mapsList->have_posts() ) {
|
224 |
-
while ( $mapsList->have_posts() ) {
|
225 |
-
$mapsList->the_post();
|
226 |
-
$title = get_post_meta( get_the_ID(), 'wpgmap_title', true );
|
227 |
-
$content .= '<div class="wp-gmap-single">
|
228 |
-
<div class="wp-gmap-single-left">
|
229 |
-
<div class="wp-gmap-single-title">
|
230 |
-
' . $title . '
|
231 |
-
</div>
|
232 |
-
<div class="wp-gmap-single-shortcode">
|
233 |
-
<input class="wpgmap-shortcode regular-text" type="text" value="' . esc_attr( '[gmap-embed id="' . get_the_ID() . '"]' ) . '"
|
234 |
-
onclick="this.select()"/>
|
235 |
-
</div>
|
236 |
-
</div>
|
237 |
-
<div class="wp-gmap-single-action">
|
238 |
-
<a href="?page=wpgmapembed&tag=edit&id=' . get_the_ID() . '" class="button media-button button-primary button-large wpgmap-edit" data-id="' . get_the_ID() . '">
|
239 |
-
' . __( 'Change', 'gmap-embed' ) . '
|
240 |
-
</a>
|
241 |
-
<button type="button"
|
242 |
-
class="button media-button button-danger button-large wpgmap-insert-delete" data-id="' . get_the_ID() . '" style="background-color: red;color: white;opacity:0.7;">
|
243 |
-
X
|
244 |
-
</button>
|
245 |
-
</div>
|
246 |
-
</div>';
|
247 |
-
}
|
248 |
-
} else {
|
249 |
-
ob_start();
|
250 |
-
?>
|
251 |
-
<a style="padding: 9px;margin-left:100px;border-radius: 5px;background-color: #0073aa;color: white;text-decoration: none;font-weight: bold;font-size: 11px;"
|
252 |
-
href="<?php echo esc_url( admin_url() ) . 'admin.php?page=wpgmapembed&tag=new'; ?>"
|
253 |
-
data-id="wp-gmap-new" class="media-menu-item">
|
254 |
-
<i class="dashicons dashicons-plus"></i>
|
255 |
-
<?php echo __( "Create Your First Map", "gmap-embed" ); ?>
|
256 |
-
</a>
|
257 |
-
<br/><br/><div class="srm_gmap_instructions">
|
258 |
-
<h3>Frequently asked questions</h3>
|
259 |
-
<?php
|
260 |
-
require_once( plugin_dir_path( __FILE__ ) . 'includes/wpgmap_faqs.php' );
|
261 |
-
echo '</div>';
|
262 |
-
$content .= ob_get_clean();
|
263 |
-
}
|
264 |
-
|
265 |
-
echo $content;
|
266 |
-
|
267 |
-
|
268 |
-
}
|
269 |
-
|
270 |
-
public function load_popup_wpgmapembed_list() {
|
271 |
-
$content = '';
|
272 |
-
$args = array(
|
273 |
-
'post_type' => 'wpgmapembed'
|
274 |
-
);
|
275 |
-
$mapsList = new WP_Query( $args );
|
276 |
-
|
277 |
-
while ( $mapsList->have_posts() ) {
|
278 |
-
$mapsList->the_post();
|
279 |
-
$title = get_post_meta( get_the_ID(), 'wpgmap_title', true );
|
280 |
-
$content .= '<div class="wp-gmap-single">
|
281 |
-
<div class="wp-gmap-single-left">
|
282 |
-
<div class="wp-gmap-single-title">
|
283 |
-
' . $title . '
|
284 |
-
</div>
|
285 |
-
<div class="wp-gmap-single-shortcode">
|
286 |
-
<input class="wpgmap-shortcode regular-text" type="text" value="[gmap-embed id="' . get_the_ID() . '"]"
|
287 |
-
onclick="this.select()"/>
|
288 |
-
</div>
|
289 |
-
</div>
|
290 |
-
<div class="wp-gmap-single-action">
|
291 |
-
<button type="button"
|
292 |
-
class="button media-button button-primary button-large wpgmap-insert-shortcode">
|
293 |
-
Insert
|
294 |
-
</button>
|
295 |
-
</div>
|
296 |
-
</div>';
|
297 |
-
}
|
298 |
-
echo $content;
|
299 |
-
exit;
|
300 |
-
|
301 |
-
|
302 |
-
}
|
303 |
-
|
304 |
-
public function get_wpgmapembed_data( $gmap_id = '' ) {
|
305 |
-
if ( $gmap_id == '' ) {
|
306 |
-
$gmap_id = intval( $_POST['wpgmap_id'] );
|
307 |
-
}
|
308 |
-
|
309 |
-
$gmap_data = array(
|
310 |
-
'wpgmap_id' => $gmap_id,
|
311 |
-
'wpgmap_title' => get_post_meta( $gmap_id, 'wpgmap_title', true ),
|
312 |
-
'wpgmap_heading_class' => get_post_meta( $gmap_id, 'wpgmap_heading_class', true ),
|
313 |
-
'wpgmap_show_heading' => get_post_meta( $gmap_id, 'wpgmap_show_heading', true ),
|
314 |
-
'wpgmap_latlng' => get_post_meta( $gmap_id, 'wpgmap_latlng', true ),
|
315 |
-
'wpgmap_map_zoom' => get_post_meta( $gmap_id, 'wpgmap_map_zoom', true ),
|
316 |
-
'wpgmap_disable_zoom_scroll' => get_post_meta( $gmap_id, 'wpgmap_disable_zoom_scroll', true ),
|
317 |
-
'wpgmap_map_width' => get_post_meta( $gmap_id, 'wpgmap_map_width', true ),
|
318 |
-
'wpgmap_map_height' => get_post_meta( $gmap_id, 'wpgmap_map_height', true ),
|
319 |
-
'wpgmap_map_type' => get_post_meta( $gmap_id, 'wpgmap_map_type', true ),
|
320 |
-
'wpgmap_map_address' => get_post_meta( $gmap_id, 'wpgmap_map_address', true ),
|
321 |
-
'wpgmap_show_infowindow' => get_post_meta( $gmap_id, 'wpgmap_show_infowindow', true ),
|
322 |
-
'wpgmap_enable_direction' => get_post_meta( $gmap_id, 'wpgmap_enable_direction', true ),
|
323 |
-
'wpgmap_marker_icon' => get_post_meta( $gmap_id, 'wpgmap_marker_icon', true ),
|
324 |
-
'wpgmap_center_lat_lng' => get_center_lat_lng_by_map_id($gmap_id)
|
325 |
-
);
|
326 |
-
|
327 |
-
return json_encode( $gmap_data );
|
328 |
-
}
|
329 |
-
|
330 |
-
public function remove_wpgmapembed_data() {
|
331 |
-
|
332 |
-
$meta_data = array(
|
333 |
-
'wpgmap_title',
|
334 |
-
'wpgmap_heading_class',
|
335 |
-
'wpgmap_show_heading',
|
336 |
-
'wpgmap_latlng',
|
337 |
-
'wpgmap_map_zoom',
|
338 |
-
'wpgmap_disable_zoom_scroll',
|
339 |
-
'wpgmap_map_width',
|
340 |
-
'wpgmap_map_height',
|
341 |
-
'wpgmap_map_type',
|
342 |
-
'wpgmap_map_address',
|
343 |
-
'wpgmap_show_infowindow',
|
344 |
-
'wpgmap_enable_direction'
|
345 |
-
);
|
346 |
-
|
347 |
-
$post_id = intval( $_POST['post_id'] );
|
348 |
-
wp_delete_post( $post_id );
|
349 |
-
foreach ( $meta_data as $field_name => $value ) {
|
350 |
-
delete_post_meta( $post_id, $field_name, $value );
|
351 |
-
}
|
352 |
-
$returnArray = array(
|
353 |
-
'responseCode' => 1,
|
354 |
-
'message' => "Deleted Successfully."
|
355 |
-
);
|
356 |
-
echo json_encode( $returnArray );
|
357 |
-
exit;
|
358 |
-
}
|
359 |
-
|
360 |
-
/**
|
361 |
-
* Fires after plugins loaded
|
362 |
-
*/
|
363 |
-
function wpgmap_do_after_plugins_loaded() {
|
364 |
-
// In case of existing installation
|
365 |
-
if ( get_option( 'gmap_embed_activation_time', false ) == false ) {
|
366 |
-
update_option( 'gmap_embed_activation_time', time() );
|
367 |
-
}
|
368 |
-
}
|
369 |
-
|
370 |
-
/**
|
371 |
-
* Works on when plugin is activated successfully
|
372 |
-
*/
|
373 |
-
|
374 |
-
function wpgmap_do_after_activation( $plugin, $network_activation ) {
|
375 |
-
// In case of existing installation
|
376 |
-
if ( get_option( 'gmap_embed_activation_time', false ) == false ) {
|
377 |
-
update_option( 'gmap_embed_activation_time', time() );
|
378 |
-
}
|
379 |
-
|
380 |
-
if ( $plugin == 'gmap-embed/srm_gmap_embed.php' ) {
|
381 |
-
wp_redirect( admin_url( 'admin.php?page=wpgmapembed' ) );
|
382 |
-
exit;
|
383 |
-
}
|
384 |
-
}
|
385 |
-
|
386 |
-
public function gmap_embed_register_post_type() {
|
387 |
-
register_post_type( 'wpgmapembed',
|
388 |
-
array(
|
389 |
-
'labels' => array(
|
390 |
-
'name' => __( 'Google Maps' ),
|
391 |
-
'singular_name' => __( 'Map' ),
|
392 |
-
),
|
393 |
-
'public' => false,
|
394 |
-
'has_archive' => false,
|
395 |
-
)
|
396 |
-
);
|
397 |
-
}
|
398 |
-
|
399 |
-
private function gmap_embed_get_full_uri() {
|
400 |
-
$link = "http";
|
401 |
-
if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ) {
|
402 |
-
$link = "https";
|
403 |
-
}
|
404 |
-
|
405 |
-
return $link . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
406 |
-
}
|
407 |
-
|
408 |
-
function gmap_embed_notice_generate() {
|
409 |
-
|
410 |
-
// Generating admin notice for review after one month
|
411 |
-
$this->gmap_embed_generate_admin_review_notice();
|
412 |
-
|
413 |
-
// Generate new feature admin notice
|
414 |
-
//TODO:: ajax based admin notice
|
415 |
-
//$this->gmap_embed_new_feature_admin_notice();
|
416 |
-
}
|
417 |
-
|
418 |
-
private function gmap_embed_generate_admin_review_notice() {
|
419 |
-
$gmap_embed_activation_time = get_option( 'gmap_embed_activation_time', false );
|
420 |
-
$seconds_diff = time() - $gmap_embed_activation_time;
|
421 |
-
$passed_days = ( $seconds_diff / 3600 ) / 24;
|
422 |
-
$gmap_embed_is_review_snoozed = get_option( 'gmap_embed_is_review_snoozed' );
|
423 |
-
$gmap_embed_activation_time = get_option( 'gmap_embed_review_snoozed_at' );
|
424 |
-
$seconds_diff = time() - $gmap_embed_activation_time;
|
425 |
-
$snoozed_before = ( $seconds_diff / 3600 ) / 24;
|
426 |
-
$gmap_embed_is_review_done = get_option( 'gmap_embed_is_review_done' );
|
427 |
-
|
428 |
-
if ( $gmap_embed_is_review_done == false and ( ( $passed_days >= 30 and $gmap_embed_is_review_snoozed == false ) or ( $gmap_embed_is_review_snoozed == true and $snoozed_before >= 7 ) ) ) {
|
429 |
-
$redirect_url = esc_url( $this->gmap_embed_get_full_uri() );
|
430 |
-
?>
|
431 |
-
<div class="notice notice-success is-dismissible">
|
432 |
-
<p><?php _e( '<b style="color:green;">Hey, We noticed that you have successfully crossed <b>30+ day\'s</b> of using <a target="_blank" href="' . esc_url( 'https://wordpress.org/plugins/gmap-embed' ) . '"> <b style="color:#007cba">Google Map SRM plugin</b></a>.
|
433 |
-
Could you please give us a BIG favour and give it a 5-star rating on Wordpress?<br/>
|
434 |
-
Just to help us spread the word and boost our motivation.!<br/>- <i>SRMILON</i></b>
|
435 |
-
<ul style="list-style: circle;padding-left: 25px;">
|
436 |
-
<li><a target="_blank" href="' . esc_url( 'https://wordpress.org/support/plugin/gmap-embed/reviews/#new-topic-0' ) . '"><b>Ok, You deserve it</b></a></li>
|
437 |
-
<li><a href="' . esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=review-maybe-latter' ) . '&redirect_to=' . esc_url( $redirect_url ) . '"><b>Nope, maybe later</b></a></li>
|
438 |
-
<li><a href="' . esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=review-done' ) . '&redirect_to=' . esc_url( $redirect_url ) . '"><b>I already did</b></a></a></li>
|
439 |
-
</ul>
|
440 |
-
', 'gmap-embed' ); ?></p>
|
441 |
-
</div>
|
442 |
-
<?php
|
443 |
-
}
|
444 |
-
}
|
445 |
-
|
446 |
-
private function gmap_embed_new_feature_admin_notice() {
|
447 |
-
if ( get_option( 'srm_gmap_lng' ) == false and isset( $_GET['page'] ) and $_GET['page'] == 'wpgmapembed') {
|
448 |
-
|
449 |
-
?>
|
450 |
-
<div class="notice notice-success is-dismissible">
|
451 |
-
<p style="font-weight: bold;color: green;">We are happy to announce that, Now you can customize your Map Language and Map Regional settings. Go to <a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=settings' ); ?>">Settings</a> tab to change your map settings.</p>
|
452 |
-
</div>
|
453 |
-
<?php
|
454 |
-
}
|
455 |
-
}
|
456 |
-
|
457 |
-
}
|
458 |
-
|
459 |
-
|
460 |
}
|
461 |
new srm_gmap_embed_main();
|
462 |
|
463 |
-
|
464 |
// including requird files
|
465 |
-
require_once plugin_dir_path(
|
466 |
-
require_once plugin_dir_path(
|
467 |
-
|
468 |
-
if ( $pagenow == 'post.php' || $pagenow == 'post-new.php' ) {
|
469 |
-
require_once plugin_dir_path( __FILE__ ) . '/includes/wpgmap_popup_content.php';
|
470 |
-
}
|
471 |
-
|
472 |
-
load_plugin_textdomain( 'gmap-embed', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
473 |
-
|
474 |
-
//updated at 07.04.2019 14:20:00
|
475 |
-
|
476 |
-
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'gmap_srm_settings_link' );
|
477 |
-
function gmap_srm_settings_link( $links ) {
|
478 |
-
$links[] = '<a href="' .
|
479 |
-
admin_url( 'admin.php?page=wpgmapembed' ) .
|
480 |
-
'">' . __( 'Settings' ) . '</a>';
|
481 |
-
|
482 |
-
return $links;
|
483 |
-
}
|
484 |
-
|
485 |
-
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'gmap_srm_settings_linka' );
|
486 |
-
function gmap_srm_settings_linka( $links ) {
|
487 |
-
if ( ! gmap_embed_is_using_premium_version() ) {
|
488 |
-
$links[] = '<a target="_blank" style="color: #11967A;font-weight:bold;" href="' . esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ) . '">' . __( 'Upgrade To Premium' ) . '</a>';
|
489 |
-
}
|
490 |
-
$links[] = '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/plugin/gmap-embed/reviews/#new-post' ) . '">' . __( 'Rate Us' ) . '</a>';
|
491 |
-
$links[] = '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/plugin/gmap-embed/#new-topic-0' ) . '">' . __( 'Support' ) . '</a>';
|
492 |
|
493 |
-
|
|
|
494 |
}
|
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: WP Google Map
|
4 |
+
Plugin URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
|
5 |
+
Description: WP Google Map plugin allows creating Google Map with marker or location with a responsive interface. Marker supports text, images, links, videos, and custom icons. Simply, Just put the shortcode on the page, post, or widget to display the map anywhere.
|
6 |
+
Author: srmilon
|
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.7.3
|
11 |
*/
|
12 |
|
13 |
+
if (!defined('ABSPATH')) {
|
14 |
+
exit;
|
15 |
}
|
16 |
+
require_once plugin_dir_path(__FILE__) . '/includes/helper.php';
|
17 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/Settings.php';
|
18 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/MapCRUD.php';
|
19 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/Notice.php';
|
20 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/Menu.php';
|
21 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/AssetHandler.php';
|
22 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/CommonFunctions.php';
|
23 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/ActionLinks.php';
|
24 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/PluginsLoadedActions.php';
|
25 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/ActivationHooks.php';
|
26 |
+
require_once plugin_dir_path(__FILE__) . '/includes/traits/InitActions.php';
|
27 |
+
|
28 |
+
if (!class_exists('srm_gmap_embed_main')) {
|
29 |
+
|
30 |
+
class srm_gmap_embed_main
|
31 |
+
{
|
32 |
+
use Settings, MapCRUD, Notice, Menu, AssetHandler, CommonFunctions, ActionLinks, PluginsLoadedActions, ActivationHooks, InitActions;
|
33 |
+
|
34 |
+
private $plugin_name = 'WP Google Map';
|
35 |
+
private $plugin_slug = 'gmap-embed';
|
36 |
+
public $wpgmap_api_key = 'AIzaSyD79uz_fsapIldhWBl0NqYHHGBWkxlabro';
|
37 |
+
|
38 |
+
|
39 |
+
/**
|
40 |
+
* constructor function
|
41 |
+
*/
|
42 |
+
function __construct()
|
43 |
+
{
|
44 |
+
$this->wpgmap_api_key = get_option('wpgmap_api_key');
|
45 |
+
add_action('plugins_loaded', array($this, 'wpgmap_do_after_plugins_loaded'));
|
46 |
+
add_action('activated_plugin', array($this, 'wpgmap_do_after_activation'), 10, 2);
|
47 |
+
add_action('wp_enqueue_scripts', array($this, 'gmap_enqueue_scripts'));
|
48 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_gmap_scripts'));
|
49 |
+
add_action('admin_menu', array($this, 'gmap_create_menu'));
|
50 |
+
add_action('init', array($this, 'do_init_actions'));
|
51 |
+
add_action('admin_init', array($this, 'gmapsrm_settings'));
|
52 |
+
add_action('wp_ajax_wpgmapembed_save_map_data', array($this, 'save_wpgmapembed_data'));
|
53 |
+
add_action('wp_ajax_wpgmapembed_load_map_data', array($this, 'load_wpgmapembed_list'));
|
54 |
+
add_action('wp_ajax_wpgmapembed_popup_load_map_data', array($this, 'load_popup_wpgmapembed_list'));
|
55 |
+
add_action('wp_ajax_wpgmapembed_get_wpgmap_data', array($this, 'get_wpgmapembed_data'));
|
56 |
+
add_action('wp_ajax_wpgmapembed_remove_wpgmap', array($this, 'remove_wpgmapembed_data'));
|
57 |
+
add_action('admin_notices', array($this, 'gmap_embed_notice_generate'));
|
58 |
+
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this,'gmap_srm_settings_link'));
|
59 |
+
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this,'gmap_srm_settings_linka'));
|
60 |
+
}
|
61 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
new srm_gmap_embed_main();
|
64 |
|
|
|
65 |
// including requird files
|
66 |
+
require_once plugin_dir_path(__FILE__) . '/includes/widget.php';
|
67 |
+
require_once plugin_dir_path(__FILE__) . '/includes/shortcodes.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
+
if (isset($pagenow) and ($pagenow == 'post.php' || $pagenow == 'post-new.php')) {
|
70 |
+
require_once plugin_dir_path(__FILE__) . '/includes/wpgmap_popup_content.php';
|
71 |
}
|
72 |
+
load_plugin_textdomain('gmap-embed', false, dirname(plugin_basename(__FILE__)) . '/languages');
|