Version Description
- Changed: Deactivation
Download this release
Release Info
Developer | webdorado |
Plugin | WD Google Maps – Google Maps builder Plugin |
Version | 1.0.34 |
Comparing to | |
See all releases |
Code changes from version 1.0.33 to 1.0.34
- admin/views/GMWDViewMarkers_gmwd.php +6 -2
- admin/views/GMWDViewUninstall_gmwd.php +1 -1
- css/admin_main.css +6 -1
- gmwd_admin_class.php +6 -5
- js/init_map.js +2 -5
- readme.txt +4 -1
- wd-google-maps.php +1 -1
- wd/assets/css/deactivate_popup.css +19 -1
- wd/assets/js/deactivate_popup.js +37 -0
- wd/includes/deactivate.php +34 -19
- wd/templates/display_deactivation_popup.php +5 -8
admin/views/GMWDViewMarkers_gmwd.php
CHANGED
@@ -59,8 +59,12 @@ class GMWDViewMarkers_gmwd extends GMWDView{
|
|
59 |
<tr>
|
60 |
<td><label for="marker_address" title="<?php _e("Search for location or right-click on the map to bring address. Alternatively, add a location manually.","gmwd");?>"><?php _e("Address","gmwd");?>:</label></td>
|
61 |
<td>
|
62 |
-
<input type="text" name="address" id="marker_address" class="wd-form-field wd-poi-required" value="<?php echo $row->address;?>" autocomplete="off"
|
63 |
-
|
|
|
|
|
|
|
|
|
64 |
</td>
|
65 |
|
66 |
<td>
|
59 |
<tr>
|
60 |
<td><label for="marker_address" title="<?php _e("Search for location or right-click on the map to bring address. Alternatively, add a location manually.","gmwd");?>"><?php _e("Address","gmwd");?>:</label></td>
|
61 |
<td>
|
62 |
+
<input type="text" name="address" id="marker_address" class="wd-form-field wd-poi-required" value="<?php echo $row->address;?>" autocomplete="off" >
|
63 |
+
<div class="gmwd_help_small">
|
64 |
+
<small><em><?php _e("Paste the address and press enter ","gmwd");?></em></small><br>
|
65 |
+
<small><em><?php _e("or right click on the Map.","gmwd");?></em></small>
|
66 |
+
</div>
|
67 |
+
|
68 |
</td>
|
69 |
|
70 |
<td>
|
admin/views/GMWDViewUninstall_gmwd.php
CHANGED
@@ -112,7 +112,7 @@ class GMWDViewUninstall_gmwd extends GMWDView{
|
|
112 |
</div>
|
113 |
<div class="wrap">
|
114 |
<h2><?php _e("Uninstall Google Maps WD","gmwd"); ?></h2>
|
115 |
-
<p><strong><a href="<?php echo $deactivate_url; ?>" class="gmwd_deactivate_link"><?php _e("Click Here","gmwd"); ?></a><?php _e(" To Finish the Uninstallation and Google Maps WD will be Deactivated Automatically.","gmwd"); ?></strong></p>
|
116 |
|
117 |
</div>
|
118 |
<?php
|
112 |
</div>
|
113 |
<div class="wrap">
|
114 |
<h2><?php _e("Uninstall Google Maps WD","gmwd"); ?></h2>
|
115 |
+
<p><strong><a href="<?php echo $deactivate_url; ?>" class="gmwd_deactivate_link" data-uninstall="1"><?php _e("Click Here","gmwd"); ?></a><?php _e(" To Finish the Uninstallation and Google Maps WD will be Deactivated Automatically.","gmwd"); ?></strong></p>
|
116 |
|
117 |
</div>
|
118 |
<?php
|
css/admin_main.css
CHANGED
@@ -988,4 +988,9 @@ a.wd-btn-icon{
|
|
988 |
|
989 |
.js .tmce-active .wp-editor-area{
|
990 |
color:#000 !important;
|
991 |
-
}
|
|
|
|
|
|
|
|
|
|
988 |
|
989 |
.js .tmce-active .wp-editor-area{
|
990 |
color:#000 !important;
|
991 |
+
}
|
992 |
+
.gmwd_help_small{
|
993 |
+
color: #0A7393;
|
994 |
+
font-weight: bold;
|
995 |
+
}
|
996 |
+
|
gmwd_admin_class.php
CHANGED
@@ -11,7 +11,7 @@ class GMWDAdmin{
|
|
11 |
// Variables //
|
12 |
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
protected static $instance = null;
|
14 |
-
private static $version = '1.0.
|
15 |
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
// Constructor & Destructor //
|
17 |
////////////////////////////////////////////////////////////////////////////////////////
|
@@ -235,12 +235,13 @@ class GMWDAdmin{
|
|
235 |
}
|
236 |
if($page == "uninstall_gmwd") {
|
237 |
wp_enqueue_script('gmwd-deactivate-popup', GMWD_URL.'/wd/assets/js/deactivate_popup.js', array(), self::$version, true );
|
|
|
238 |
|
239 |
wp_localize_script( 'gmwd-deactivate-popup', 'WDDeactivateVars', array(
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
));
|
245 |
}
|
246 |
|
11 |
// Variables //
|
12 |
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
protected static $instance = null;
|
14 |
+
private static $version = '1.0.34';
|
15 |
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
// Constructor & Destructor //
|
17 |
////////////////////////////////////////////////////////////////////////////////////////
|
235 |
}
|
236 |
if($page == "uninstall_gmwd") {
|
237 |
wp_enqueue_script('gmwd-deactivate-popup', GMWD_URL.'/wd/assets/js/deactivate_popup.js', array(), self::$version, true );
|
238 |
+
$admin_data = wp_get_current_user();
|
239 |
|
240 |
wp_localize_script( 'gmwd-deactivate-popup', 'WDDeactivateVars', array(
|
241 |
+
"prefix" => "gmwd" ,
|
242 |
+
"deactivate_class" => 'gmwd_deactivate_link',
|
243 |
+
"email" => $admin_data->data->user_email,
|
244 |
+
"plugin_wd_url" => "https://web-dorado.com/products/wordpress-google-maps-plugin.html",
|
245 |
));
|
246 |
}
|
247 |
|
js/init_map.js
CHANGED
@@ -82,13 +82,10 @@ function gmwdSetMapMarkers(_key){
|
|
82 |
contentString = '';
|
83 |
|
84 |
if(gmwdmapData["infoWindowInfo" + _key].indexOf("title") != -1){
|
85 |
-
contentString += mapMarker.title;
|
86 |
}
|
87 |
if(gmwdmapData["infoWindowInfo" + _key].indexOf("address") != -1){
|
88 |
-
|
89 |
-
contentString += "<br>";
|
90 |
-
}
|
91 |
-
contentString += mapMarker.address;
|
92 |
}
|
93 |
|
94 |
infoWindow = new google.maps.InfoWindow({
|
82 |
contentString = '';
|
83 |
|
84 |
if(gmwdmapData["infoWindowInfo" + _key].indexOf("title") != -1){
|
85 |
+
contentString += '<div class="gmwd-infowindow-title">' + mapMarker.title + '</div>';
|
86 |
}
|
87 |
if(gmwdmapData["infoWindowInfo" + _key].indexOf("address") != -1){
|
88 |
+
contentString += '<div class="gmwd-infowindow-address">' + mapMarker.address + '</div>';
|
|
|
|
|
|
|
89 |
}
|
90 |
|
91 |
infoWindow = new google.maps.InfoWindow({
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
|
|
4 |
Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.7
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -113,6 +113,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
116 |
= 1.0.33 =
|
117 |
* Added: Multicategory markers
|
118 |
|
4 |
Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 4.7
|
7 |
+
Stable tag: 1.0.34
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 1.0.34 =
|
117 |
+
* Changed: Deactivation
|
118 |
+
|
119 |
= 1.0.33 =
|
120 |
* Added: Multicategory markers
|
121 |
|
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.
|
8 |
* Author: WebDorado
|
9 |
* Author URI: http://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
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.34
|
8 |
* Author: WebDorado
|
9 |
* Author URI: http://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
wd/assets/css/deactivate_popup.css
CHANGED
@@ -19,11 +19,13 @@
|
|
19 |
background: #fff;
|
20 |
z-index: 999999;
|
21 |
width: 600px;
|
22 |
-
height:
|
23 |
margin: auto;
|
24 |
display: none;
|
25 |
box-sizing: border-box;
|
26 |
}
|
|
|
|
|
27 |
.wd-deactivate-popup-header{
|
28 |
border-bottom: 1px solid #ccc;
|
29 |
padding: 18px 40px;
|
@@ -34,6 +36,9 @@
|
|
34 |
padding: 20px 40px;
|
35 |
border-bottom: 1px solid #ccc;
|
36 |
}
|
|
|
|
|
|
|
37 |
.wd-btns{
|
38 |
padding: 20px 40px;
|
39 |
text-align: right;
|
@@ -43,3 +48,16 @@
|
|
43 |
.additional_details_wrap{
|
44 |
margin-top: 20px;
|
45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
background: #fff;
|
20 |
z-index: 999999;
|
21 |
width: 600px;
|
22 |
+
height: 280px;
|
23 |
margin: auto;
|
24 |
display: none;
|
25 |
box-sizing: border-box;
|
26 |
}
|
27 |
+
|
28 |
+
|
29 |
.wd-deactivate-popup-header{
|
30 |
border-bottom: 1px solid #ccc;
|
31 |
padding: 18px 40px;
|
36 |
padding: 20px 40px;
|
37 |
border-bottom: 1px solid #ccc;
|
38 |
}
|
39 |
+
.wd-deactivate-popup-body input[type=text]{
|
40 |
+
width: 220px;
|
41 |
+
}
|
42 |
.wd-btns{
|
43 |
padding: 20px 40px;
|
44 |
text-align: right;
|
48 |
.additional_details_wrap{
|
49 |
margin-top: 20px;
|
50 |
}
|
51 |
+
|
52 |
+
.wd-additional-active{
|
53 |
+
background: rgba(204, 204, 204, 0.18);
|
54 |
+
padding: 15px;
|
55 |
+
margin: 14px 0px 5px;
|
56 |
+
}
|
57 |
+
.wd-popup-active1{
|
58 |
+
height: 522px !important;
|
59 |
+
}
|
60 |
+
|
61 |
+
.wd-popup-active2{
|
62 |
+
height: 425px !important
|
63 |
+
}
|
wd/assets/js/deactivate_popup.js
CHANGED
@@ -8,6 +8,8 @@
|
|
8 |
// Variables //
|
9 |
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
var deactivated = false;
|
|
|
|
|
11 |
////////////////////////////////////////////////////////////////////////////////////////
|
12 |
// Constructor & Destructor //
|
13 |
////////////////////////////////////////////////////////////////////////////////////////
|
@@ -15,10 +17,45 @@ jQuery(document).ready(function () {
|
|
15 |
jQuery(document).on("click", "." + WDDeactivateVars.deactivate_class, function(){
|
16 |
jQuery(".wd-" + WDDeactivateVars.prefix + "-opacity").show();
|
17 |
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").show();
|
|
|
|
|
|
|
|
|
18 |
return false;
|
19 |
});
|
20 |
|
21 |
jQuery(document).on("change", "[name=" + WDDeactivateVars.prefix + "_reasons]", function(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
jQuery("#wd-" + WDDeactivateVars.prefix + "-deactivate").hide();
|
23 |
jQuery("#wd-" + WDDeactivateVars.prefix + "-submit-and-deactivate").show();
|
24 |
|
8 |
// Variables //
|
9 |
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
var deactivated = false;
|
11 |
+
var additionalInfo = "";
|
12 |
+
var btnVal = 3;
|
13 |
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
// Constructor & Destructor //
|
15 |
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
jQuery(document).on("click", "." + WDDeactivateVars.deactivate_class, function(){
|
18 |
jQuery(".wd-" + WDDeactivateVars.prefix + "-opacity").show();
|
19 |
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").show();
|
20 |
+
if(jQuery(this).attr("data-uninstall") == "1"){
|
21 |
+
btnVal = 2 ;
|
22 |
+
}
|
23 |
+
|
24 |
return false;
|
25 |
});
|
26 |
|
27 |
jQuery(document).on("change", "[name=" + WDDeactivateVars.prefix + "_reasons]", function(){
|
28 |
+
|
29 |
+
jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").html("");
|
30 |
+
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2");
|
31 |
+
if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
|
32 |
+
|
33 |
+
additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
|
34 |
+
'<textarea name="' + WDDeactivateVars.prefix + '_additional_details" cols = "70" rows = "4"></textarea><br>' +
|
35 |
+
'<div>Our support will contact <input type="text" name="' + WDDeactivateVars.prefix + '_email" value="' +WDDeactivateVars.email + '"> shortly.</div>'+
|
36 |
+
'<br><div><button class="button button-primary wd-' + WDDeactivateVars.prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
|
37 |
+
jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
|
38 |
+
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active1");
|
39 |
+
|
40 |
+
}
|
41 |
+
else if(jQuery(this).val() == "reason_free_version_limited"){
|
42 |
+
additionalInfo = '<div class="wd-additional-active">' +
|
43 |
+
'<div><strong>We believe our premium version will fit your needs.</strong></div>' +
|
44 |
+
'<div><a href="' + WDDeactivateVars.plugin_wd_url+ '" target="_blank">Try with 30 day money back guarantee.</a></div>';
|
45 |
+
|
46 |
+
jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
|
47 |
+
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active2");
|
48 |
+
}
|
49 |
+
else if(jQuery(this).val() == "reason_premium_expensive"){
|
50 |
+
additionalInfo = '<div class="wd-additional-active">' +
|
51 |
+
'<div><strong>We have a special offer for you.</strong></div>' +
|
52 |
+
'<div>Submit this form to get the offer to <input type="text" name="' + WDDeactivateVars.prefix + '_email" value="' + WDDeactivateVars.email + '"></div>' +
|
53 |
+
'<br><div><button class="button button-primary wd-' + WDDeactivateVars.prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
|
54 |
+
|
55 |
+
jQuery("." + WDDeactivateVars.prefix + "_additional_details_wrap").append(additionalInfo);
|
56 |
+
jQuery(".wd-" + WDDeactivateVars.prefix + "-deactivate-popup").addClass("wd-popup-active2");
|
57 |
+
}
|
58 |
+
|
59 |
jQuery("#wd-" + WDDeactivateVars.prefix + "-deactivate").hide();
|
60 |
jQuery("#wd-" + WDDeactivateVars.prefix + "-submit-and-deactivate").show();
|
61 |
|
wd/includes/deactivate.php
CHANGED
@@ -16,7 +16,8 @@
|
|
16 |
public $deactivate_reasons = array();
|
17 |
// Reason IDs
|
18 |
const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
|
19 |
-
const
|
|
|
20 |
const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
|
21 |
const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
|
22 |
|
@@ -32,14 +33,18 @@
|
|
32 |
'text' => __( 'Technical problems / hard to use', $wd_options->prefix ),
|
33 |
),
|
34 |
2 => array(
|
35 |
-
'id' => self::
|
36 |
-
'text' => __( 'Free version is limited
|
37 |
-
),
|
38 |
3 => array(
|
|
|
|
|
|
|
|
|
39 |
'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
|
40 |
'text' => __( 'Upgrading to paid version', $wd_options->prefix ),
|
41 |
),
|
42 |
-
|
43 |
'id' => self::REASON_TEMPORARY_DEACTIVATION,
|
44 |
'text' => __( 'Temporary deactivation', $wd_options->prefix ),
|
45 |
),
|
@@ -64,10 +69,12 @@
|
|
64 |
global $wd_options;
|
65 |
wp_enqueue_style( $wd_options->prefix . '-deactivate-popup', WD_URL_CSS . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
|
66 |
wp_enqueue_script( $wd_options->prefix . '-deactivate-popup', WD_URL_JS . '/deactivate_popup.js');
|
67 |
-
|
68 |
wp_localize_script( $wd_options->prefix . '-deactivate-popup', 'WDDeactivateVars', array(
|
69 |
"prefix" => $wd_options->prefix ,
|
70 |
-
"deactivate_class" => $wd_options->prefix . '_deactivate_link'
|
|
|
|
|
71 |
));
|
72 |
|
73 |
}
|
@@ -75,7 +82,7 @@
|
|
75 |
global $wd_options;
|
76 |
if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
|
77 |
|
78 |
-
if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 ){
|
79 |
$api = new WDApi();
|
80 |
$hash = $api->get_hash();
|
81 |
if($hash != null){
|
@@ -84,7 +91,14 @@
|
|
84 |
$data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? $_POST[$wd_options->prefix . "_reasons"] : "";
|
85 |
$data["site_url"] = site_url();
|
86 |
$data["plugin_slug"] = $wd_options->plugin_wordpress_slug;
|
|
|
87 |
$data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? $_POST[$wd_options->prefix . "_additional_details"] : "";
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
$data["hash"] = $hash;
|
89 |
$response = wp_remote_post( "http://api.web-dorado.com/deactivatereasons", array(
|
90 |
'method' => 'POST',
|
@@ -104,17 +118,18 @@
|
|
104 |
}
|
105 |
}
|
106 |
}
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
118 |
|
119 |
}
|
120 |
}
|
16 |
public $deactivate_reasons = array();
|
17 |
// Reason IDs
|
18 |
const REASON_PLUGIN_IS_HARD_TO_USE_TECHNICAL_PROBLEMS = "reason_plugin_is_hard_to_use_technical_problems";
|
19 |
+
const REASON_FREE_VERSION_IS_LIMITED = "reason_free_version_limited";
|
20 |
+
const REASON_PRO_EXPENSIVE = "reason_premium_expensive";
|
21 |
const REASON_UPGRADING_TO_PAID_VERSION = "reason_upgrading_to_paid_version";
|
22 |
const REASON_TEMPORARY_DEACTIVATION = "reason_temporary_deactivation";
|
23 |
|
33 |
'text' => __( 'Technical problems / hard to use', $wd_options->prefix ),
|
34 |
),
|
35 |
2 => array(
|
36 |
+
'id' => self::REASON_FREE_VERSION_IS_LIMITED,
|
37 |
+
'text' => __( 'Free version is limited', $wd_options->prefix ),
|
38 |
+
),
|
39 |
3 => array(
|
40 |
+
'id' => self::REASON_PRO_EXPENSIVE,
|
41 |
+
'text' => __( 'Premium is expensive', $wd_options->prefix ),
|
42 |
+
),
|
43 |
+
4 => array(
|
44 |
'id' => self::REASON_UPGRADING_TO_PAID_VERSION,
|
45 |
'text' => __( 'Upgrading to paid version', $wd_options->prefix ),
|
46 |
),
|
47 |
+
5 => array(
|
48 |
'id' => self::REASON_TEMPORARY_DEACTIVATION,
|
49 |
'text' => __( 'Temporary deactivation', $wd_options->prefix ),
|
50 |
),
|
69 |
global $wd_options;
|
70 |
wp_enqueue_style( $wd_options->prefix . '-deactivate-popup', WD_URL_CSS . '/deactivate_popup.css', array(), get_option($wd_options->prefix . "_version" ) );
|
71 |
wp_enqueue_script( $wd_options->prefix . '-deactivate-popup', WD_URL_JS . '/deactivate_popup.js');
|
72 |
+
$admin_data = wp_get_current_user();
|
73 |
wp_localize_script( $wd_options->prefix . '-deactivate-popup', 'WDDeactivateVars', array(
|
74 |
"prefix" => $wd_options->prefix ,
|
75 |
+
"deactivate_class" => $wd_options->prefix . '_deactivate_link',
|
76 |
+
"email" => $admin_data->data->user_email,
|
77 |
+
"plugin_wd_url" => $wd_options->plugin_wd_url,
|
78 |
));
|
79 |
|
80 |
}
|
82 |
global $wd_options;
|
83 |
if( isset( $_POST[$wd_options->prefix . "_submit_and_deactivate"] ) ){
|
84 |
|
85 |
+
if( $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 3 ){
|
86 |
$api = new WDApi();
|
87 |
$hash = $api->get_hash();
|
88 |
if($hash != null){
|
91 |
$data["reason"] = isset($_POST[$wd_options->prefix . "_reasons"]) ? $_POST[$wd_options->prefix . "_reasons"] : "";
|
92 |
$data["site_url"] = site_url();
|
93 |
$data["plugin_slug"] = $wd_options->plugin_wordpress_slug;
|
94 |
+
|
95 |
$data["additional_details"] = isset($_POST[$wd_options->prefix . "_additional_details"]) ? $_POST[$wd_options->prefix . "_additional_details"] : "";
|
96 |
+
$admin_data = wp_get_current_user();
|
97 |
+
$data["email"] = isset($_POST[$wd_options->prefix . "_email"]) ? $_POST[$wd_options->prefix . "_email"] : $admin_data->data->user_email;
|
98 |
+
$user_first_name = get_user_meta( $admin_data->ID, "first_name", true );
|
99 |
+
$user_last_name = get_user_meta( $admin_data->ID, "last_name", true );
|
100 |
+
|
101 |
+
$data["name"] = $user_first_name || $user_last_name ? $user_first_name . " " . $user_last_name : $admin_data->data->user_login;
|
102 |
$data["hash"] = $hash;
|
103 |
$response = wp_remote_post( "http://api.web-dorado.com/deactivatereasons", array(
|
104 |
'method' => 'POST',
|
118 |
}
|
119 |
}
|
120 |
}
|
121 |
+
if($_POST[$wd_options->prefix . "_submit_and_deactivate"] == 2 || $_POST[$wd_options->prefix . "_submit_and_deactivate"] == 1 ){
|
122 |
+
$deactivate_url =
|
123 |
+
add_query_arg(
|
124 |
+
array(
|
125 |
+
'action' => 'deactivate',
|
126 |
+
'plugin' => plugin_basename( $wd_options->plugin_main_file ),
|
127 |
+
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . plugin_basename( $wd_options->plugin_main_file ) )
|
128 |
+
),
|
129 |
+
admin_url( 'plugins.php' )
|
130 |
+
);
|
131 |
+
wp_redirect( $deactivate_url );
|
132 |
+
}
|
133 |
|
134 |
}
|
135 |
}
|
wd/templates/display_deactivation_popup.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
|
3 |
<form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
|
4 |
<div class="wd-deactivate-popup-header">
|
5 |
-
<?php _e( "
|
6 |
</div>
|
7 |
|
8 |
<div class="wd-deactivate-popup-body">
|
@@ -12,15 +12,12 @@
|
|
12 |
<label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
|
13 |
</div>
|
14 |
<?php } ?>
|
15 |
-
<div class="
|
16 |
-
<label for="additional_details"><?php echo __( "Additional details", $wd_options->prefix );?></label><br>
|
17 |
-
<textarea id="additional_details" cols="70" rows="4" name="<?php echo $wd_options->prefix; ?>_additional_details"></textarea>
|
18 |
-
</div>
|
19 |
</div>
|
20 |
<div class="wd-btns">
|
21 |
-
<a href="#" class="button button-secondary
|
22 |
-
<a href="#" data-val="
|
23 |
-
<a href="#"
|
24 |
</div>
|
25 |
<input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
|
26 |
</form>
|
2 |
<div class="wd-deactivate-popup wd-<?php echo $wd_options->prefix; ?>-deactivate-popup">
|
3 |
<form method="post" id="<?php echo $wd_options->prefix; ?>_deactivate_form">
|
4 |
<div class="wd-deactivate-popup-header">
|
5 |
+
<?php _e( "Please let us know why you are deactivating. Your answer will help us to serve you better", $wd_options->prefix ); ?>:
|
6 |
</div>
|
7 |
|
8 |
<div class="wd-deactivate-popup-body">
|
12 |
<label for="<?php echo $wd_options->prefix . "-" . $deactivate_reason["id"]; ?>"><?php echo $deactivate_reason["text"];?></label>
|
13 |
</div>
|
14 |
<?php } ?>
|
15 |
+
<div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
|
|
|
|
|
|
|
16 |
</div>
|
17 |
<div class="wd-btns">
|
18 |
+
<a href="#" data-val="1" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Deactivate" , $wd_options->prefix ); ?></a>
|
19 |
+
<a href="#" data-val="2" class="button button-secondary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and deactivate" , $wd_options->prefix ); ?></a>
|
20 |
+
<a href="#" class="button button-primary wd-<?php echo $wd_options->prefix; ?>-cancel"><?php _e( "Cancel" , $wd_options->prefix ); ?></a>
|
21 |
</div>
|
22 |
<input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
|
23 |
</form>
|