WD Google Maps – Google Maps builder Plugin - Version 1.0.46

Version Description

  • Added: Notice to install Backup WD plugin
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Maps – Google Maps builder Plugin
Version 1.0.46
Comparing to
See all releases

Code changes from version 1.0.45 to 1.0.46

.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ .idea/*
css/wd_bp_install.css ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @media only screen and (max-width: 500px) {
2
+ body #wd_backup_logo {
3
+ max-width: 100%;
4
+ }
5
+ body #wd_bp_notice_cont p {
6
+ padding-right: 25px !important;
7
+ }
8
+ }
9
+
10
+ #wd_bp_logo_notice {
11
+ width: 40px;
12
+ float: left;
13
+ margin-right: 10px;
14
+ }
15
+
16
+ #wd_bp_notice_cont {
17
+ position: relative;
18
+ }
19
+
20
+ .wds_backup_install p {
21
+ padding-top: 0px;
22
+ margin-top: 0px;
23
+ }
24
+
25
+ #wd_bp_notice_cont a {
26
+ margin: 0 5px;
27
+ }
28
+
29
+ #wd_bp_notice_cont .dashicons-dismiss:before {
30
+ content: "\f153";
31
+ background: 0 0;
32
+ color: #72777c;
33
+ display: block;
34
+ font: 400 16px/20px dashicons;
35
+ speak: none;
36
+ height: 20px;
37
+ text-align: center;
38
+ width: 20px;
39
+ -webkit-font-smoothing: antialiased;
40
+ -moz-osx-font-smoothing: grayscale;
41
+ }
42
+
43
+ .wd_bp_notice_dissmiss {
44
+ margin-top: 5px;
45
+ }
46
+
gmwd_admin_class.php CHANGED
@@ -11,18 +11,19 @@ class GMWDAdmin{
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
- private static $version = '1.0.45';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct() {
 
19
 
20
  // Includes
21
- add_action('init', array($this, 'gmwd_includes'));
22
 
23
 
24
  // Add menu
25
- add_action('admin_menu', array($this,'gmwd_options_panel'),9);
26
  //add_action('admin_init', array($this,'setup_redirect'));
27
 
28
  //Screen options
@@ -32,11 +33,11 @@ class GMWDAdmin{
32
  add_filter('set-screen-option', array($this, 'gmwd_set_option_mapstyles'), 10, 3);
33
 
34
  // Add admin styles and scripts
35
- add_action('admin_enqueue_scripts', array($this, 'gmwd_styles'));
36
- add_action('admin_enqueue_scripts', array($this, 'gmwd_scripts'));
37
 
38
  // Add shortcode
39
- add_action('admin_head', array($this,'gmwd_admin_ajax'));
40
  add_action('wp_ajax_gmwd_shortcode', array('GMWDAdmin', 'gmwd_ajax'));
41
 
42
  add_filter('mce_buttons', array($this, 'gmwd_add_button'), 0);
@@ -53,8 +54,7 @@ class GMWDAdmin{
53
 
54
 
55
  add_action('wp_ajax_map_data', array('GMWDAdmin', 'gmwd_ajax'));
56
-
57
- }
58
  ////////////////////////////////////////////////////////////////////////////////////////
59
  // Public Methods //
60
  ////////////////////////////////////////////////////////////////////////////////////////
@@ -84,6 +84,9 @@ class GMWDAdmin{
84
 
85
  require_once GMWD_DIR . "/update/gmwd_update.php";
86
  gmwd_update();
 
 
 
87
  }
88
 
89
 
@@ -191,7 +194,8 @@ class GMWDAdmin{
191
  }
192
  if($page == "uninstall_gmwd") {
193
  wp_enqueue_style('gmwd_deactivate-css', GMWD_URL . '/wd/assets/css/deactivate_popup.css', array(), self::$version);
194
- }
 
195
 
196
  }
197
 
@@ -250,7 +254,8 @@ class GMWDAdmin{
250
  "email" => $admin_data->data->user_email,
251
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
252
  ));
253
- }
 
254
 
255
  }
256
 
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.46';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct()
19
+ {
20
 
21
  // Includes
22
+ add_action('init', array($this, 'gmwd_includes'));
23
 
24
 
25
  // Add menu
26
+ add_action('admin_menu', array($this, 'gmwd_options_panel'), 9);
27
  //add_action('admin_init', array($this,'setup_redirect'));
28
 
29
  //Screen options
33
  add_filter('set-screen-option', array($this, 'gmwd_set_option_mapstyles'), 10, 3);
34
 
35
  // Add admin styles and scripts
36
+ add_action('admin_enqueue_scripts', array($this, 'gmwd_styles'));
37
+ add_action('admin_enqueue_scripts', array($this, 'gmwd_scripts'));
38
 
39
  // Add shortcode
40
+ add_action('admin_head', array($this, 'gmwd_admin_ajax'));
41
  add_action('wp_ajax_gmwd_shortcode', array('GMWDAdmin', 'gmwd_ajax'));
42
 
43
  add_filter('mce_buttons', array($this, 'gmwd_add_button'), 0);
54
 
55
 
56
  add_action('wp_ajax_map_data', array('GMWDAdmin', 'gmwd_ajax'));
57
+ }
 
58
  ////////////////////////////////////////////////////////////////////////////////////////
59
  // Public Methods //
60
  ////////////////////////////////////////////////////////////////////////////////////////
84
 
85
  require_once GMWD_DIR . "/update/gmwd_update.php";
86
  gmwd_update();
87
+ if( get_option('wds_bk_notice_status') === false ) {
88
+ add_option('wds_bk_notice_status', '');
89
+ }
90
  }
91
 
92
 
194
  }
195
  if($page == "uninstall_gmwd") {
196
  wp_enqueue_style('gmwd_deactivate-css', GMWD_URL . '/wd/assets/css/deactivate_popup.css', array(), self::$version);
197
+ }
198
+
199
 
200
  }
201
 
254
  "email" => $admin_data->data->user_email,
255
  "plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
256
  ));
257
+ }
258
+
259
 
260
  }
261
 
images/backup_logo.png ADDED
Binary file
images/logo.png ADDED
Binary file
js/wd_bp_install.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function () {
2
+ /*Ajax hide notice forever */
3
+ jQuery(".wd_bp_notice_dissmiss").on("click", function () {
4
+ jQuery("#wd_bp_notice_cont").hide();
5
+ jQuery.post(wd_bp_url);
6
+ })
7
+ });
8
+
9
+ // Set option status 1 - never show again during install btn click in notice
10
+ function wd_bp_notice_install() {
11
+ jQuery.post(wd_bp_url);
12
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: google map, google maps, map, map markers, maps, directions, google map plugin, google maps plugin, map plugin, map widget, wp google map, wp google maps, google map widget, google map shortcode, wp map, google maps directions, google maps builder, google places, google places api, google maps api, google places reviews, contact page map, custom google map, loaction by address, location, map direction, map styles, polygons, simple google map, gmap, google map embed, best google maps, custom google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
- Stable tag: 1.0.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -117,6 +117,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
117
 
118
  == Changelog ==
119
 
 
 
 
120
  = 1.0.45 =
121
  * Fixed: Translations
122
 
4
  Tags: google map, google maps, map, map markers, maps, directions, google map plugin, google maps plugin, map plugin, map widget, wp google map, wp google maps, google map widget, google map shortcode, wp map, google maps directions, google maps builder, google places, google places api, google maps api, google places reviews, contact page map, custom google map, loaction by address, location, map direction, map styles, polygons, simple google map, gmap, google map embed, best google maps, custom google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
+ Stable tag: 1.0.46
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
117
 
118
  == Changelog ==
119
 
120
+ = 1.0.46 =
121
+ * Added: Notice to install Backup WD plugin
122
+
123
  = 1.0.45 =
124
  * Fixed: Translations
125
 
wd-google-maps.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.45
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -53,6 +53,59 @@ function gmwd_map($shortcode_id, $map_id ){
53
  }
54
  require_once( GMWD_DIR. '/widgets.php' );
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  function wd_gmwd_init(){
58
  if( !isset($_REQUEST['ajax']) && is_admin() ){
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.46
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
53
  }
54
  require_once( GMWD_DIR. '/widgets.php' );
55
 
56
+ if (!function_exists('wd_bp_install_notice')) {
57
+ function wd_bp_script_style() {
58
+ wp_enqueue_script('wd_bck_install', GMWD_URL . '/js/wd_bp_install.js', array('jquery'));
59
+ wp_enqueue_style('wd_bck_install', GMWD_URL . '/css/wd_bp_install.css');
60
+ }
61
+ add_action('admin_enqueue_scripts', 'wd_bp_script_style');
62
+
63
+ /**
64
+ * Show notice to install backup plugin
65
+ */
66
+ function wd_bp_install_notice() {
67
+ $prefix = "gmwd";
68
+ $meta_value = get_option('wds_bk_notice_status');
69
+ if ($meta_value === '' || $meta_value === false) {
70
+ ob_start();
71
+ ?>
72
+ <div class="notice notice-info" id="wd_bp_notice_cont">
73
+ <p>
74
+ <img id="wd_bp_logo_notice" src="<?php echo GMWD_URL . '/images/logo.png'; ?>">
75
+ <?php _e("Hey! Install brand new FREE", $prefix) ?>
76
+ <a href="https://wordpress.org/plugins/backup-wd/" title="<?php _e("More details", $prefix) ?>"
77
+ target="_blank"><?php _e("Backup WD", $prefix) ?></a>
78
+ <?php _e("plugin to keep your images and website safe.", $prefix) ?>
79
+ <a class="button button-primary"
80
+ href="<?php echo esc_url(wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=backup-wd'), 'install-plugin_backup-wd')); ?>">
81
+ <span onclick="wd_bp_notice_install()"><?php _e("Install", $prefix); ?></span>
82
+ </a>
83
+ </p>
84
+ <button type="button" class="wd_bp_notice_dissmiss notice-dismiss"><span class="screen-reader-text"></span>
85
+ </button>
86
+ </div>
87
+ <script>wd_bp_url = '<?php echo add_query_arg(array('action' => 'wd_bp_dismiss',), admin_url('admin-ajax.php')); ?>'</script>
88
+ <?php
89
+ echo ob_get_clean();
90
+ }
91
+ }
92
+
93
+ if (!is_dir(plugin_dir_path(__DIR__) . 'backup-wd')) {
94
+ add_action('admin_notices', 'wd_bp_install_notice');
95
+ }
96
+
97
+ /**
98
+ * Add usermeta to db
99
+ *
100
+ * empty: notice,
101
+ * 1 : never show again
102
+ */
103
+ function wd_bp_install_notice_status() {
104
+ update_option('wds_bk_notice_status', '1', 'no');
105
+ }
106
+ add_action('wp_ajax_wd_bp_dismiss', 'wd_bp_install_notice_status');
107
+ }
108
+
109
 
110
  function wd_gmwd_init(){
111
  if( !isset($_REQUEST['ajax']) && is_admin() ){