WP Google Maps - Version 6.4.01

Version Description

  • 2017-01-20 - Low priority =
  • Added the ability for users to subscribe to our mailing list
Download this release

Release Info

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

Code changes from version 6.4.00 to 6.4.01

Files changed (3) hide show
  1. js/wpgmaps_plugin_row.js +31 -0
  2. readme.txt +3 -0
  3. wpGoogleMaps.php +90 -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,9 @@ 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.01 - 2017-01-20 - Low priority =
218
+ * Added the ability for users to subscribe to our mailing list
219
+
220
= 6.4.00 - 2017-01-11 - Medium priority =
221
* Added an option to set default store locator address
222
* 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,9 @@ 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 +308,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 +320,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 +616,79 @@ 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.01
7
Author: WP Google Maps
8
Author URI: https://www.wpgmaps.com
9
Text Domain: wp-google-maps
11
*/
12
13
/*
14
+ * 6.4.01 - 2017-01-20 - Low priority
15
+ * Added the ability for users to subscribe to our mailing list
16
+ *
17
* 6.4.00 - 2017-01-11 - Low priority
18
* Documented all PHP functions
19
* Added an option to set default store locator address
308
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
309
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
310
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
311
+ $wpgmza_version = "6.4.01";
312
+ $wpgmza_p_version = "6.11";
313
$wpgmza_t = "basic";
314
define("WPGMAPS", $wpgmza_version);
315
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
320
include ("base/includes/deprecated.php");
321
322
323
+ if (function_exists('wpgmaps_head_pro' )) {
324
+ add_action( 'admin_head', 'wpgmaps_head_pro' );
325
} else {
326
+ if (function_exists( 'wpgmaps_pro_activate' ) && floatval($wpgmza_version) < 5.24) {
327
+ add_action( 'admin_head', 'wpgmaps_head_old' );
328
} else {
329
+ add_action( 'admin_head', 'wpgmaps_head' );
330
}
331
332
}
333
+ add_action( 'admin_head','wpgmaps_feedback_head' );
334
+
335
336
+ add_action( 'admin_footer', 'wpgmaps_reload_map_on_post' );
337
register_activation_hook( __FILE__, 'wpgmaps_activate' );
338
register_deactivation_hook( __FILE__, 'wpgmaps_deactivate' );
339
+ add_action( 'init', 'wpgmaps_init' );
340
+ add_action( 'admin_menu', 'wpgmaps_admin_menu' );
341
+ add_filter( 'widget_text', 'do_shortcode' );
342
343
344
$debug_start = (float) array_sum(explode(' ',microtime()));
616
617
}
618
619
+
620
+ /**
621
+ * Plugin action links filter
622
+ *
623
+ * @param array $links
624
+ * @return array
625
+ */
626
+ add_filter( 'network_admin_plugin_action_links_wp-google-maps/wpGoogleMaps.php', 'wpgmza_plugin_action_links' );
627
+ add_filter( 'plugin_action_links_wp-google-maps/wpGoogleMaps.php', 'wpgmza_plugin_action_links' );
628
+ function wpgmza_plugin_action_links( $links ) {
629
+ echo "eh";
630
+ array_unshift( $links,
631
+ '<a class="edit" href="' . admin_url('admin.php?page=wp-google-maps-menu') . '">' . __( 'Map Editor', 'wp-google-maps' ) . '</a>' );
632
+ array_unshift( $links,
633
+ '<a class="edit" href="' . admin_url('admin.php?page=wp-google-maps-menu-settings') . '">' . __( 'Settings', 'wp-google-maps' ) . '</a>' );
634
+ array_unshift( $links,
635
+ '<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>' );
636
+
637
+
638
+ return $links;
639
+ }
640
+
641
+ add_action( 'wp_ajax_wpgmza_subscribe','wpgmza_ajax_subscribe');
642
+
643
+ function wpgmza_ajax_subscribe() {
644
+ $check = check_ajax_referer( 'wpgmza_subscribe', 'security' );
645
+ if ( $check == 1 ) {
646
+ if ( $_POST['action'] == 'wpgmza_subscribe' ) {
647
+ $uid = get_current_user_id();
648
+ update_user_meta( $uid, 'wpgmza_subscribed', true);
649
+
650
+ }
651
+ }
652
+ }
653
+
654
+ add_action ( 'admin_head', 'wpgmza_plugin_row_js' );
655
+ function wpgmza_plugin_row_js(){
656
+ $current_page = get_current_screen();
657
+
658
+ if ( $current_page->base == 'plugins' ) {
659
+ wp_register_script( 'wpgmza_plugin_row_js', WPGMAPS_DIR.'js/wpgmaps_plugin_row.js', array( 'jquery-ui-core' ) );
660
+ wp_enqueue_script( 'wpgmza_plugin_row_js' );
661
+ wp_localize_script( 'wpgmza_plugin_row_js', 'wpgmza_sub_nonce', wp_create_nonce("wpgmza_subscribe") );
662
+ }
663
+ }
664
+
665
+
666
+ /**
667
+ * Adds the email subscription field below the plugin row on the plugins page
668
+ *
669
+ */
670
+ add_filter( 'plugin_row_meta', 'wpgmza_plugin_row', 4, 10 );
671
+ function wpgmza_plugin_row( $plugin_meta, $plugin_file, $plugin_data, $status ) {
672
+
673
+ if ( $plugin_file == "wp-google-maps/wpGoogleMaps.php") {
674
+ $check = get_user_meta(get_current_user_id(),"wpgmza_subscribed");
675
+
676
+ if (!$check) {
677
+ $ret = '<div style="margin-top:10px; color:#333; display:block; white-space:normal;">';
678
+ $ret .= '<form>';
679
+ $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>';
680
+ $ret .= '<span id="wpgmza_subscribe_div">';
681
+ $ret .= '<input type="text" name="wpgmza_signup_newsletter" id="wpgmza_signup_newsletter" value="'.get_option( 'admin_email' ).'"></option>';
682
+ $ret .= '<input type="button" class="button button-primary" id="wpgmza_signup_newsletter_btn" name="wpgmza_signup_newsletter_btn" value="' . __( 'Sign up', 'wp-google-maps' ) . '" />';
683
+ $ret .= '<span>';
684
+ $ret .= '</form>';
685
+ $ret .= '</div>';
686
+ array_push( $plugin_meta, $ret );
687
+ }
688
+ }
689
+ return $plugin_meta;
690
+ }
691
+
692
/**
693
* Check if the XML folder exists, if not, display a warning notification
694
* @return void