WP Google Maps - Version 6.4.02

Version Description

  • 2017-01-20 - Low priority =
  • Removed an echo that was incorrectly placed
Download this release

Release Info

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

Code changes from version 6.4.00 to 6.4.02

Files changed (3) hide show
  1. js/wpgmaps_plugin_row.js +31 -0
  2. readme.txt +6 -0
  3. wpGoogleMaps.php +92 -13
js/wpgmaps_plugin_row.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+
3
+ jQuery("body").on("click", "#wpgmza_signup_newsletter_btn", function() {
4
+
5
+ var a_email = jQuery("#wpgmza_signup_newsletter").val();
6
+ jQuery("#wpgmza_signup_newsletter").hide('slow');
7
+ jQuery("#wpgmza_signup_newsletter_btn").hide('slow');
8
+ jQuery("#wpgmza_subscribe_div").html("Thank you!");
9
+ var data = {
10
+ action: 'wpgmza_subscribe',
11
+ prod: 'wpgmza',
12
+ a_email: a_email
13
+
14
+ };
15
+ jQuery.post('//ccplugins.co/newsletter-subscription/index.php', data, function(response) {
16
+ returned_data = JSON.parse(response);
17
+
18
+ });
19
+
20
+ var data = {
21
+ action: 'wpgmza_subscribe',
22
+ security: wpgmza_sub_nonce
23
+
24
+ };
25
+ jQuery.post(ajaxurl, data, function(response) {
26
+
27
+ });
28
+
29
+
30
+ });
31
+ });
readme.txt CHANGED
@@ -214,6 +214,12 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
214
 
215
  == Changelog ==
216
 
 
 
 
 
 
 
217
  = 6.4.00 - 2017-01-11 - Medium priority =
218
  * Added an option to set default store locator address
219
  * Full screen map functionality added
214
 
215
  == Changelog ==
216
 
217
+ = 6.4.02 - 2017-01-20 - Low priority =
218
+ * Removed an echo that was incorrectly placed
219
+
220
+ = 6.4.01 - 2017-01-20 - Low priority =
221
+ * Added the ability for users to subscribe to our mailing list
222
+
223
  = 6.4.00 - 2017-01-11 - Medium priority =
224
  * Added an option to set default store locator address
225
  * Full screen map functionality added
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
- Version: 6.4.00
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
@@ -11,6 +11,12 @@ Domain Path: /languages
11
  */
12
 
13
  /*
 
 
 
 
 
 
14
  * 6.4.00 - 2017-01-11 - Low priority
15
  * Documented all PHP functions
16
  * Added an option to set default store locator address
@@ -305,8 +311,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
305
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
306
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
307
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
308
- $wpgmza_version = "6.4.00";
309
- $wpgmza_p_version = "6.09";
310
  $wpgmza_t = "basic";
311
  define("WPGMAPS", $wpgmza_version);
312
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -317,24 +323,25 @@ include ("base/classes/widget_module.class.php");
317
  include ("base/includes/deprecated.php");
318
 
319
 
320
- if (function_exists('wpgmaps_head_pro')) {
321
- add_action('admin_head', 'wpgmaps_head_pro');
322
  } else {
323
- if (function_exists('wpgmaps_pro_activate') && floatval($wpgmza_version) < 5.24) {
324
- add_action('admin_head', 'wpgmaps_head_old');
325
  } else {
326
- add_action('admin_head', 'wpgmaps_head');
327
  }
328
 
329
  }
330
- add_action('admin_head','wpgmaps_feedback_head');
331
 
332
- add_action('admin_footer', 'wpgmaps_reload_map_on_post');
 
333
  register_activation_hook( __FILE__, 'wpgmaps_activate' );
334
  register_deactivation_hook( __FILE__, 'wpgmaps_deactivate' );
335
- add_action('init', 'wpgmaps_init');
336
- add_action('admin_menu', 'wpgmaps_admin_menu');
337
- add_filter('widget_text', 'do_shortcode');
338
 
339
 
340
  $debug_start = (float) array_sum(explode(' ',microtime()));
@@ -612,6 +619,78 @@ function wpgmaps_handle_directory() {
612
 
613
  }
614
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  /**
616
  * Check if the XML folder exists, if not, display a warning notification
617
  * @return void
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
+ Version: 6.4.02
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
11
  */
12
 
13
  /*
14
+ * 6.4.02 - 2017-01-20 - Low priority
15
+ * Removed an echo that was incorrectly placed
16
+ *
17
+ * 6.4.01 - 2017-01-20 - Low priority
18
+ * Added the ability for users to subscribe to our mailing list
19
+ *
20
  * 6.4.00 - 2017-01-11 - Low priority
21
  * Documented all PHP functions
22
  * Added an option to set default store locator address
311
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
312
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
313
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
314
+ $wpgmza_version = "6.4.02";
315
+ $wpgmza_p_version = "6.11";
316
  $wpgmza_t = "basic";
317
  define("WPGMAPS", $wpgmza_version);
318
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
323
  include ("base/includes/deprecated.php");
324
 
325
 
326
+ if (function_exists('wpgmaps_head_pro' )) {
327
+ add_action( 'admin_head', 'wpgmaps_head_pro' );
328
  } else {
329
+ if (function_exists( 'wpgmaps_pro_activate' ) && floatval($wpgmza_version) < 5.24) {
330
+ add_action( 'admin_head', 'wpgmaps_head_old' );
331
  } else {
332
+ add_action( 'admin_head', 'wpgmaps_head' );
333
  }
334
 
335
  }
336
+ add_action( 'admin_head','wpgmaps_feedback_head' );
337
 
338
+
339
+ add_action( 'admin_footer', 'wpgmaps_reload_map_on_post' );
340
  register_activation_hook( __FILE__, 'wpgmaps_activate' );
341
  register_deactivation_hook( __FILE__, 'wpgmaps_deactivate' );
342
+ add_action( 'init', 'wpgmaps_init' );
343
+ add_action( 'admin_menu', 'wpgmaps_admin_menu' );
344
+ add_filter( 'widget_text', 'do_shortcode' );
345
 
346
 
347
  $debug_start = (float) array_sum(explode(' ',microtime()));
619
 
620
  }
621
 
622
+
623
+ /**
624
+ * Plugin action links filter
625
+ *
626
+ * @param array $links
627
+ * @return array
628
+ */
629
+ add_filter( 'network_admin_plugin_action_links_wp-google-maps/wpGoogleMaps.php', 'wpgmza_plugin_action_links' );
630
+ add_filter( 'plugin_action_links_wp-google-maps/wpGoogleMaps.php', 'wpgmza_plugin_action_links' );
631
+ function wpgmza_plugin_action_links( $links ) {
632
+ array_unshift( $links,
633
+ '<a class="edit" href="' . admin_url('admin.php?page=wp-google-maps-menu') . '">' . __( 'Map Editor', 'wp-google-maps' ) . '</a>' );
634
+ array_unshift( $links,
635
+ '<a class="edit" href="' . admin_url('admin.php?page=wp-google-maps-menu-settings') . '">' . __( 'Settings', 'wp-google-maps' ) . '</a>' );
636
+ array_unshift( $links,
637
+ '<a class="" target="_BLANK" href="https://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=plugin_link_upgrade">' . __( 'Get Pro Version', 'wp-google-maps' ) . '</a>' );
638
+
639
+
640
+ return $links;
641
+ }
642
+
643
+ add_action( 'wp_ajax_wpgmza_subscribe','wpgmza_ajax_subscribe');
644
+
645
+ function wpgmza_ajax_subscribe() {
646
+ $check = check_ajax_referer( 'wpgmza_subscribe', 'security' );
647
+ if ( $check == 1 ) {
648
+ if ( $_POST['action'] == 'wpgmza_subscribe' ) {
649
+ $uid = get_current_user_id();
650
+ update_user_meta( $uid, 'wpgmza_subscribed', true);
651
+
652
+ }
653
+ }
654
+ }
655
+
656
+ add_action ( 'admin_head', 'wpgmza_plugin_row_js' );
657
+ function wpgmza_plugin_row_js(){
658
+ $current_page = get_current_screen();
659
+
660
+ if ( $current_page->base == 'plugins' ) {
661
+ wp_register_script( 'wpgmza_plugin_row_js', WPGMAPS_DIR.'js/wpgmaps_plugin_row.js', array( 'jquery-ui-core' ) );
662
+ wp_enqueue_script( 'wpgmza_plugin_row_js' );
663
+ wp_localize_script( 'wpgmza_plugin_row_js', 'wpgmza_sub_nonce', wp_create_nonce("wpgmza_subscribe") );
664
+ }
665
+ }
666
+
667
+
668
+ /**
669
+ * Adds the email subscription field below the plugin row on the plugins page
670
+ *
671
+ */
672
+ add_filter( 'plugin_row_meta', 'wpgmza_plugin_row', 4, 10 );
673
+ function wpgmza_plugin_row( $plugin_meta, $plugin_file, $plugin_data, $status ) {
674
+
675
+ if ( $plugin_file == "wp-google-maps/wpGoogleMaps.php") {
676
+ $check = get_user_meta(get_current_user_id(),"wpgmza_subscribed");
677
+
678
+ if (!$check) {
679
+ $ret = '<div style="margin-top:10px; color:#333; display:block; white-space:normal;">';
680
+ $ret .= '<form>';
681
+ $ret .= '<p><label for="wpgmza_signup_newsletter" style="font-style:italic; margin-bottom:5px;">' . __( 'Sign up to our newsletter and get information on the latest updates, beta versions and specials.', 'wp-google-maps' ) . '</label></p>';
682
+ $ret .= '<span id="wpgmza_subscribe_div">';
683
+ $ret .= '<input type="text" name="wpgmza_signup_newsletter" id="wpgmza_signup_newsletter" value="'.get_option( 'admin_email' ).'"></option>';
684
+ $ret .= '<input type="button" class="button button-primary" id="wpgmza_signup_newsletter_btn" name="wpgmza_signup_newsletter_btn" value="' . __( 'Sign up', 'wp-google-maps' ) . '" />';
685
+ $ret .= '<span>';
686
+ $ret .= '</form>';
687
+ $ret .= '</div>';
688
+ array_push( $plugin_meta, $ret );
689
+ }
690
+ }
691
+ return $plugin_meta;
692
+ }
693
+
694
  /**
695
  * Check if the XML folder exists, if not, display a warning notification
696
  * @return void