WP Google Map - Version 1.6.3

Version Description

Exception handled for warning message, security enhanced, review giving option added.

Download this release

Release Info

Developer milonfci
Plugin Icon 128x128 WP Google Map
Version 1.6.3
Comparing to
See all releases

Code changes from version 1.6.2 to 1.6.3

assets/js/geo_based_map_create.js CHANGED
@@ -23,14 +23,11 @@ function wpgmapSetAddressByLatLng(lat, lng) {
23
  function generateAlreadyInitiztedMap(map_type, center_lat, center_lng) {
24
  if (map_type === 'ROADMAP') {
25
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
26
- }
27
- else if (map_type === 'SATELLITE') {
28
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
29
- }
30
- else if (map_type === 'HYBRID') {
31
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
32
- }
33
- else if (map_type === 'TERRAIN') {
34
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
35
  }
36
 
@@ -55,14 +52,11 @@ function setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
55
  };
56
  if (map_type === 'ROADMAP') {
57
  gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
58
- }
59
- else if (map_type === 'SATELLITE') {
60
  gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
61
- }
62
- else if (map_type === 'HYBRID') {
63
  gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
64
- }
65
- else if (map_type === 'TERRAIN') {
66
  gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
67
  }
68
  return gmap_settings;
@@ -179,7 +173,9 @@ function openInfoWindow() {
179
  });
180
  infowindow.open(map, marker1);
181
  } else {
182
- infowindow.close();
 
 
183
  }
184
  }
185
 
23
  function generateAlreadyInitiztedMap(map_type, center_lat, center_lng) {
24
  if (map_type === 'ROADMAP') {
25
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
26
+ } else if (map_type === 'SATELLITE') {
 
27
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
28
+ } else if (map_type === 'HYBRID') {
 
29
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
30
+ } else if (map_type === 'TERRAIN') {
 
31
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
32
  }
33
 
52
  };
53
  if (map_type === 'ROADMAP') {
54
  gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
55
+ } else if (map_type === 'SATELLITE') {
 
56
  gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
57
+ } else if (map_type === 'HYBRID') {
 
58
  gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
59
+ } else if (map_type === 'TERRAIN') {
 
60
  gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
61
  }
62
  return gmap_settings;
173
  });
174
  infowindow.open(map, marker1);
175
  } else {
176
+ if (infowindow !== undefined) {
177
+ infowindow.close();
178
+ }
179
  }
180
  }
181
 
assets/js/geo_based_map_edit.js CHANGED
@@ -23,14 +23,11 @@ function wpgmapSetAddressByLatLng(lat, lng, id) {
23
  function generateAlreadyInitiztedMap(map_type, center_lat, center_lng) {
24
  if (map_type === 'ROADMAP') {
25
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
26
- }
27
- else if (map_type === 'SATELLITE') {
28
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
29
- }
30
- else if (map_type === 'HYBRID') {
31
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
32
- }
33
- else if (map_type === 'TERRAIN') {
34
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
35
  }
36
 
@@ -55,14 +52,11 @@ function setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
55
  };
56
  if (map_type === 'ROADMAP') {
57
  gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
58
- }
59
- else if (map_type === 'SATELLITE') {
60
  gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
61
- }
62
- else if (map_type === 'HYBRID') {
63
  gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
64
- }
65
- else if (map_type === 'TERRAIN') {
66
  gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
67
  }
68
  return gmap_settings;
@@ -178,7 +172,9 @@ function openInfoWindow() {
178
  });
179
  infowindow.open(map, marker1);
180
  } else {
181
- infowindow.close();
 
 
182
  }
183
  }
184
 
23
  function generateAlreadyInitiztedMap(map_type, center_lat, center_lng) {
24
  if (map_type === 'ROADMAP') {
25
  map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
26
+ } else if (map_type === 'SATELLITE') {
 
27
  map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
28
+ } else if (map_type === 'HYBRID') {
 
29
  map.setMapTypeId(google.maps.MapTypeId.HYBRID);
30
+ } else if (map_type === 'TERRAIN') {
 
31
  map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
32
  }
33
 
52
  };
53
  if (map_type === 'ROADMAP') {
54
  gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
55
+ } else if (map_type === 'SATELLITE') {
 
56
  gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
57
+ } else if (map_type === 'HYBRID') {
 
58
  gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
59
+ } else if (map_type === 'TERRAIN') {
 
60
  gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
61
  }
62
  return gmap_settings;
172
  });
173
  infowindow.open(map, marker1);
174
  } else {
175
+ if (infowindow !== undefined) {
176
+ infowindow.close();
177
+ }
178
  }
179
  }
180
 
includes/form_actions.php CHANGED
@@ -56,7 +56,7 @@ if ( isset( $_POST['wpgmapembed_license'] ) ) {
56
 
57
  if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
58
  $contact_fields['srm_gmap_name'] = trim( $_POST['srm_gmap_name'] );
59
- $contact_fields['srm_gmap_email'] = trim( $_POST['srm_gmap_email'] );
60
  $contact_fields['srm_gmap_website'] = trim( $_POST['srm_gmap_website'] );
61
  $contact_fields['srm_gmap_category'] = trim( $_POST['srm_gmap_category'] );
62
  $contact_fields['srm_gmap_subject'] = trim( $_POST['srm_gmap_subject'] );
@@ -73,6 +73,6 @@ if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
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;">' . $contact_fields['srm_gmap_email'] . '</b>) as soon as possible. Thank you for your co-operation!.';
77
 
78
  }
56
 
57
  if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
58
  $contact_fields['srm_gmap_name'] = trim( $_POST['srm_gmap_name'] );
59
+ $contact_fields['srm_gmap_email'] = trim( sanitize_email($_POST['srm_gmap_email']) );
60
  $contact_fields['srm_gmap_website'] = trim( $_POST['srm_gmap_website'] );
61
  $contact_fields['srm_gmap_category'] = trim( $_POST['srm_gmap_category'] );
62
  $contact_fields['srm_gmap_subject'] = trim( $_POST['srm_gmap_subject'] );
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
  }
includes/gmap.php CHANGED
@@ -14,6 +14,21 @@ if ( isset( $_GET['page'] ) ) {
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' ) );?>';
@@ -152,7 +167,7 @@ if ( isset( $_GET['page'] ) ) {
152
  <!---------------------------Create New Map-------------->
153
 
154
  <div
155
- class="wp-gmap-tab-content <?php echo ( $_GET['page'] == 'wpgmapembed' && $_GET['tag'] == 'new' ) ? 'active' : ''; ?>"
156
  id="wp-gmap-new">
157
  <?php
158
  if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'new' ) {
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' ) );?>';
167
  <!---------------------------Create New Map-------------->
168
 
169
  <div
170
+ class="wp-gmap-tab-content <?php echo ( $_GET['page'] == 'wpgmapembed' && $wpgmap_tag == 'new' ) ? 'active' : ''; ?>"
171
  id="wp-gmap-new">
172
  <?php
173
  if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'new' ) {
includes/premium-version-notice.php CHANGED
@@ -37,7 +37,7 @@
37
  full-screen functionality
38
  </li>
39
  <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Ability
40
- to create Map and Marker as much as you need!
41
  </li>
42
  <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Google
43
  Map Auto-Complete available
37
  full-screen functionality
38
  </li>
39
  <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Ability
40
+ to create Map as much as you need!
41
  </li>
42
  <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Google
43
  Map Auto-Complete available
includes/wpgmap_contact.php CHANGED
@@ -17,7 +17,7 @@
17
  </th>
18
  <td>
19
  <input type="email" class="wp_gmap_contact_field" name="srm_gmap_email"
20
- value="<?php echo get_bloginfo( 'admin_email' ); ?>"
21
  id="srm_gmap_email" required=""
22
  placeholder="example@mail.com">
23
  <span style="color:red">Please provide a valid email for further communication</span>
@@ -82,46 +82,14 @@
82
 
83
  <div class="srm_gmap_instructions">
84
  <h3>Frequently asked questions</h3>
85
- <ul>
86
- <li>
87
- <a href="http://srmilon.info/2019/02/18/how-to-get-google-map-api-key" target="_blank">How to get API
88
- key?</a>
89
- </li>
90
- <li>
91
- <a href="http://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel"
92
- target="_blank">See
93
- why map is not working properly</a>
94
- </li>
95
- <li>
96
- <a href="http://srmilon.info/2019/03/31/how-to-get-your-license-key" target="_blank">How to get your
97
- Lifetime
98
- License key?</a>
99
- </li>
100
- <li>
101
- <a href="http://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor" target="_blank">Don’t
102
- see “Embed Google Map” button in new Editor?</a>
103
- </li>
104
- <li>
105
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page" target="_blank">How to
106
- add Google Map in page?</a>
107
- </li>
108
- <li>
109
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post" target="_blank">How to
110
- add Google Map in post?</a>
111
- </li>
112
- <li>
113
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget" target="_blank">How to
114
- add Google Map in Sidebar as widget?</a>
115
- </li>
116
- <li>
117
- <a href="http://srmilon.info/2019/03/31/can-not-load-the-map-correctly" target="_blank">Do you see "the page
118
- can\'t load the map correctly"?</a>
119
- </li>
120
- </ul>
121
  </div>
122
 
123
  <div class="srm_gmap_video_area">
124
- <iframe width="100%" height="520" src="https://www.youtube.com/embed/Nh2z_oRK-RM" frameborder="0"
 
125
  allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
126
 
127
  </div>
17
  </th>
18
  <td>
19
  <input type="email" class="wp_gmap_contact_field" name="srm_gmap_email"
20
+ value="<?php echo sanitize_email( get_bloginfo( 'admin_email' ) ); ?>"
21
  id="srm_gmap_email" required=""
22
  placeholder="example@mail.com">
23
  <span style="color:red">Please provide a valid email for further communication</span>
82
 
83
  <div class="srm_gmap_instructions">
84
  <h3>Frequently asked questions</h3>
85
+ <?php
86
+ require_once( plugin_dir_path( __FILE__ ) . 'wpgmap_faqs.php' );
87
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  </div>
89
 
90
  <div class="srm_gmap_video_area">
91
+ <iframe width="100%" height="520" src="<?php echo esc_url( 'https://www.youtube.com/embed/Nh2z_oRK-RM' ); ?>"
92
+ frameborder="0"
93
  allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
94
 
95
  </div>
includes/wpgmap_faqs.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul>
2
+ <li>
3
+ <a href="<?php echo esc_url( 'http://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( 'http://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( 'http://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( 'http://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( 'http://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( 'http://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( 'http://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( 'http://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>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: google map, gmap, google map embed, wp map, wp map embed, map embed, best google maps, best maps, bing maps, cross-browser, custom google map, custom google maps, map direction, easy map, geo, geocoder, maps, google earth, google map plugin, google map shortcode, google map widget, google maps v3, google maps, gprs, gps, gpx, kml, latitude, Longitude, location, location by address, map, map directions, map markers, map plugin, map shortcode, map styles, maps google, post map, map point, polygons, roads, routes, store locator, street view, wp google map, contact page map, google map wordpress, google maps wordpress, google maps for wordpress, simple google map, simple google map plugin, wp google maps,maps
5
  Requires at least: 2.9
6
  Tested up to: 5.4
7
- Version: 1.6.2
8
  Requires PHP: 5.3
9
  Text Domain: gmap-embed
10
  License: GPLv2 or later
@@ -60,7 +60,7 @@ https://www.youtube.com/watch?v=Nh2z_oRK-RM
60
  * **Supports Google Map Streetview option**
61
  * **You can add multiple maps in any page or post if you need!**
62
  * **Map full screen functionality**
63
- * **Ability to create Map and Marker as much as you need!**
64
 
65
  ### USE AS SHORTCODE IN POST, PAGE, AND SIDEBAR.
66
  `[gmap-embed id="<Your map ID>"]`
@@ -135,6 +135,9 @@ See the [Video](https://www.youtube.com/watch?v=Nh2z_oRK-RM) ,hope you will get
135
 
136
  == Changelog ==
137
 
 
 
 
138
  = 1.6.2 =
139
  Security feature updated and feedback resolving.
140
 
4
  Tags: google map, gmap, google map embed, wp map, wp map embed, map embed, best google maps, best maps, bing maps, cross-browser, custom google map, custom google maps, map direction, easy map, geo, geocoder, maps, google earth, google map plugin, google map shortcode, google map widget, google maps v3, google maps, gprs, gps, gpx, kml, latitude, Longitude, location, location by address, map, map directions, map markers, map plugin, map shortcode, map styles, maps google, post map, map point, polygons, roads, routes, store locator, street view, wp google map, contact page map, google map wordpress, google maps wordpress, google maps for wordpress, simple google map, simple google map plugin, wp google maps,maps
5
  Requires at least: 2.9
6
  Tested up to: 5.4
7
+ Version: 1.6.3
8
  Requires PHP: 5.3
9
  Text Domain: gmap-embed
10
  License: GPLv2 or later
60
  * **Supports Google Map Streetview option**
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
 
65
  ### USE AS SHORTCODE IN POST, PAGE, AND SIDEBAR.
66
  `[gmap-embed id="<Your map ID>"]`
135
 
136
  == Changelog ==
137
 
138
+ = 1.6.3 =
139
+ Exception handled for warning message, security enhanced, review giving option added.
140
+
141
  = 1.6.2 =
142
  Security feature updated and feedback resolving.
143
 
srm_gmap_embed.php CHANGED
@@ -7,7 +7,7 @@
7
  Text Domain: gmap-embed
8
  Domain Path: /languages
9
  Author URI: http://www.srmilon.info
10
- Version: 1.6.2
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
@@ -28,6 +28,7 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
28
  */
29
  function __construct() {
30
  $this->wpgmap_api_key = get_option( 'wpgmap_api_key' );
 
31
  add_action( 'activated_plugin', array( $this, 'wpgmap_do_after_activation' ), 10, 2 );
32
  add_action( 'wp_enqueue_scripts', array( $this, 'gmap_enqueue_scripts' ) );
33
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_gmap_scripts' ) );
@@ -39,6 +40,8 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
39
  add_action( 'wp_ajax_wpgmapembed_popup_load_map_data', array( $this, 'load_popup_wpgmapembed_list' ) );
40
  add_action( 'wp_ajax_wpgmapembed_get_wpgmap_data', array( $this, 'get_wpgmapembed_data' ) );
41
  add_action( 'wp_ajax_wpgmapembed_remove_wpgmap', array( $this, 'remove_wpgmapembed_data' ) );
 
 
42
  }
43
 
44
  /**
@@ -56,7 +59,7 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
56
 
57
  function enqueue_admin_gmap_scripts() {
58
  global $pagenow;
59
- if ( $pagenow == 'post.php' || $pagenow == 'post-new.php' || @$_GET['page'] == 'wpgmapembed' ) {
60
  wp_enqueue_script( 'wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places', array( 'jquery' ), '20161019', true );
61
  wp_enqueue_script( 'wp-gmap-custom-js', plugins_url( 'assets/js/custom.js', __FILE__ ), array( 'wp-gmap-api' ), '20161019', false );
62
  wp_enqueue_style( 'wp-gmap-embed-css', plugins_url( 'assets/css/wp-gmap-style.css', __FILE__ ), rand( 999, 9999 ) );
@@ -225,40 +228,11 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
225
  data-id="wp-gmap-new" class="media-menu-item">' . __( "Create New Map", "gmap-embed" ) . '</a>';
226
  $content .= '<br/><br/><div class="srm_gmap_instructions">
227
  <h3>Frequently asked questions</h3>
228
- <ul>
229
- <li>
230
- <a href="http://srmilon.info/2019/02/18/how-to-get-google-map-api-key" target="_blank">How to get API
231
- key?</a>
232
- </li>
233
- <li>
234
- <a href="http://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel" target="_blank">See why map is not working properly</a>
235
- </li>
236
- <li>
237
- <a href="http://srmilon.info/2019/03/31/how-to-get-your-license-key" target="_blank">How to get your Lifetime
238
- License key?</a>
239
- </li>
240
- <li>
241
- <a href="http://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor" target="_blank">Don’t see "Embed Google Map" button in new Editor?
242
- </a>
243
- </li>
244
- <li>
245
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page" target="_blank">How to
246
- add Google Map in page?</a>
247
- </li>
248
- <li>
249
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post" target="_blank">How to
250
- add Google Map in post?</a>
251
- </li>
252
- <li>
253
- <a href="http://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget" target="_blank">How to
254
- add Google Map in Sidebar as widget?</a>
255
- </li>
256
- <li>
257
- <a href="http://srmilon.info/2019/03/31/can-not-load-the-map-correctly" target="_blank">Do you see "the page
258
- can\'t load the map correctly"?</a>
259
- </li>
260
- </ul>
261
- </div>';
262
  }
263
 
264
  echo $content;
@@ -354,12 +328,26 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
354
  exit;
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
357
  /**
358
  * Works on when plugin is activated successfully
359
  */
360
 
361
  function wpgmap_do_after_activation( $plugin, $network_activation ) {
362
- // do stuff
 
 
 
 
363
  if ( $plugin == 'gmap-embed/srm_gmap_embed.php' ) {
364
  wp_redirect( admin_url( 'admin.php?page=wpgmapembed' ) );
365
  exit;
@@ -379,6 +367,57 @@ if ( ! class_exists( 'srm_gmap_embed_main' ) ) {
379
  );
380
  }
381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
 
383
  }
384
 
@@ -411,8 +450,10 @@ function gmap_srm_settings_link( $links ) {
411
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'gmap_srm_settings_linka' );
412
  function gmap_srm_settings_linka( $links ) {
413
  if ( ! gmap_embed_is_using_premium_version() ) {
414
- $links[] = '<a target="_blank" style="color: #11967A;font-weight:bold;" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA">' . __( 'Upgrade To Premium' ) . '</a>';
415
  }
 
 
416
 
417
  return $links;
418
  }
7
  Text Domain: gmap-embed
8
  Domain Path: /languages
9
  Author URI: http://www.srmilon.info
10
+ Version: 1.6.3
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
28
  */
29
  function __construct() {
30
  $this->wpgmap_api_key = get_option( 'wpgmap_api_key' );
31
+ add_action( 'plugins_loaded', array( $this, 'wpgmap_do_after_plugins_loaded' ) );
32
  add_action( 'activated_plugin', array( $this, 'wpgmap_do_after_activation' ), 10, 2 );
33
  add_action( 'wp_enqueue_scripts', array( $this, 'gmap_enqueue_scripts' ) );
34
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_gmap_scripts' ) );
40
  add_action( 'wp_ajax_wpgmapembed_popup_load_map_data', array( $this, 'load_popup_wpgmapembed_list' ) );
41
  add_action( 'wp_ajax_wpgmapembed_get_wpgmap_data', array( $this, 'get_wpgmapembed_data' ) );
42
  add_action( 'wp_ajax_wpgmapembed_remove_wpgmap', array( $this, 'remove_wpgmapembed_data' ) );
43
+ add_action( 'admin_notices', array( $this, 'gmap_embed_notice_for_review' ) );
44
+
45
  }
46
 
47
  /**
59
 
60
  function enqueue_admin_gmap_scripts() {
61
  global $pagenow;
62
+ if ( $pagenow == 'post.php' || $pagenow == 'post-new.php' || ( isset( $_GET['page'] ) and $_GET['page'] == 'wpgmapembed' ) ) {
63
  wp_enqueue_script( 'wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places', array( 'jquery' ), '20161019', true );
64
  wp_enqueue_script( 'wp-gmap-custom-js', plugins_url( 'assets/js/custom.js', __FILE__ ), array( 'wp-gmap-api' ), '20161019', false );
65
  wp_enqueue_style( 'wp-gmap-embed-css', plugins_url( 'assets/css/wp-gmap-style.css', __FILE__ ), rand( 999, 9999 ) );
228
  data-id="wp-gmap-new" class="media-menu-item">' . __( "Create New Map", "gmap-embed" ) . '</a>';
229
  $content .= '<br/><br/><div class="srm_gmap_instructions">
230
  <h3>Frequently asked questions</h3>
231
+ ';
232
+ ob_start();
233
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wpgmap_faqs.php' );
234
+ $content .= ob_get_clean();
235
+ $content .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
 
238
  echo $content;
328
  exit;
329
  }
330
 
331
+ /**
332
+ * Fires after plugins loaded
333
+ */
334
+ function wpgmap_do_after_plugins_loaded() {
335
+ // In case of existing installation
336
+ if ( get_option( 'gmap_embed_activation_time', false ) == false ) {
337
+ update_option( 'gmap_embed_activation_time', time() );
338
+ }
339
+ }
340
+
341
  /**
342
  * Works on when plugin is activated successfully
343
  */
344
 
345
  function wpgmap_do_after_activation( $plugin, $network_activation ) {
346
+ // In case of existing installation
347
+ if ( get_option( 'gmap_embed_activation_time', false ) == false ) {
348
+ update_option( 'gmap_embed_activation_time', time() );
349
+ }
350
+
351
  if ( $plugin == 'gmap-embed/srm_gmap_embed.php' ) {
352
  wp_redirect( admin_url( 'admin.php?page=wpgmapembed' ) );
353
  exit;
367
  );
368
  }
369
 
370
+ private function gmap_embed_get_full_uri() {
371
+ $link = "http";
372
+ if ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ) {
373
+ $link = "https";
374
+ }
375
+
376
+ return $link . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
377
+ }
378
+
379
+ function gmap_embed_notice_for_review() {
380
+
381
+ // // testing cases
382
+ // update_option( 'gmap_embed_activation_time', time() - 30 * 24 * 3600 );
383
+ // update_option( 'gmap_embed_is_review_snoozed', false );
384
+ //// update_option( 'gmap_embed_review_snoozed_at', time()-90*24*3600 );
385
+ // update_option( 'gmap_embed_is_review_done', false );
386
+
387
+ // In case of existing installation
388
+ // if ( get_option( 'gmap_embed_activation_time', false ) == false ) {
389
+ // update_option( 'gmap_embed_activation_time', time() );
390
+ // }
391
+
392
+
393
+ $gmap_embed_activation_time = get_option( 'gmap_embed_activation_time', false );
394
+ $seconds_diff = time() - $gmap_embed_activation_time;
395
+ $passed_days = ( $seconds_diff / 3600 ) / 24;
396
+ $gmap_embed_is_review_snoozed = get_option( 'gmap_embed_is_review_snoozed' );
397
+ $gmap_embed_activation_time = get_option( 'gmap_embed_review_snoozed_at' );
398
+ $seconds_diff = time() - $gmap_embed_activation_time;
399
+ $snoozed_before = ( $seconds_diff / 3600 ) / 24;
400
+ $gmap_embed_is_review_done = get_option( 'gmap_embed_is_review_done' );
401
+
402
+
403
+ 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 ) ) ) {
404
+ $redirect_url = esc_url( $this->gmap_embed_get_full_uri() );
405
+ ?>
406
+ <div class="notice notice-success is-dismissible">
407
+ <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="https://wordpress.org/plugins/gmap-embed"> <b style="color:#007cba">Google Map SRM plugin</b></a>.
408
+ Could you please give us a BIG favour and give it a 5-star rating on Wordpress?<br/>
409
+ Just to help us spread the word and boost our motivation.!<br/>- <i>SRMILON</i></b>
410
+ <ul style="list-style: circle;padding-left: 25px;">
411
+ <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>
412
+ <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>
413
+ <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>
414
+ </ul>
415
+ ', 'gmap-embed' ); ?></p>
416
+ </div>
417
+ <?php
418
+ }
419
+ }
420
+
421
 
422
  }
423
 
450
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'gmap_srm_settings_linka' );
451
  function gmap_srm_settings_linka( $links ) {
452
  if ( ! gmap_embed_is_using_premium_version() ) {
453
+ $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>';
454
  }
455
+ $links[] = '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/plugin/gmap-embed/reviews/#new-post' ) . '">' . __( 'Rate Us' ) . '</a>';
456
+ $links[] = '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/plugin/gmap-embed/#new-topic-0' ) . '">' . __( 'Support' ) . '</a>';
457
 
458
  return $links;
459
  }