PluginProbe ʕ •ᴥ•ʔ
Appointment Booking Calendar / 1.3.57
Appointment Booking Calendar v1.3.57
1.4.04 1.4.03 1.4.02 trunk 1.3.51 1.3.52 1.3.53 1.3.54 1.3.55 1.3.56 1.3.57 1.3.58 1.3.59 1.3.60 1.3.61 1.3.62 1.3.63 1.3.64 1.3.65 1.3.66 1.3.67 1.3.68 1.3.69 1.3.70 1.3.71 1.3.72 1.3.73 1.3.74 1.3.75 1.3.76 1.3.77 1.3.78 1.3.79 1.3.80 1.3.81 1.3.82 1.3.83 1.3.84 1.3.85 1.3.86 1.3.87 1.3.88 1.3.89 1.3.90 1.3.91 1.3.92 1.3.93 1.3.94 1.3.95 1.3.96 1.3.97 1.3.98 1.3.99 1.4.01
appointment-booking-calendar / inc / cp-feedback.php
appointment-booking-calendar / inc Last commit date
banner.php 5 years ago cp-feedback.php 5 years ago cp_admin_int_edition.inc.php 5 years ago cpabc_appointments_admin_addbk.inc.php 5 years ago cpabc_appointments_admin_int.inc.php 5 years ago cpabc_appointments_admin_int_bookings_list.inc.php 5 years ago cpabc_appointments_admin_int_calendar_list.inc.php 5 years ago cpabc_apps_go.inc.php 5 years ago cpabc_apps_on.inc.php 5 years ago cpabc_publish_wizzard.inc.php 5 years ago cpabc_scheduler.inc.php 5 years ago index.html 5 years ago
cp-feedback.php
197 lines
1 <?php
2 add_action( 'admin_enqueue_scripts', 'cpabcal_feedback_insert_adminScripts', 1);
3 add_action( 'wp_ajax_cpabcal_feedback', 'cpabcal_feedback' );
4 $cpabcal_plugfile = 'cpabc_appointments.php';
5 $cpabcal_plugslug = 'appointment-booking-calendar';
6 $cpabcal_supportlink = 'https://abc.dwbooster.com/contact-us';
7 $cpabcal_supportlink_full = $cpabcal_supportlink . '?priority-support=yes';
8
9 if (!get_option('installed_'.$cpabcal_plugslug, ''))
10 update_option('installed_'.$cpabcal_plugslug, time() );
11
12 function cpabcal_feedback_insert_adminScripts($hook) {
13 if( 'plugins.php' == $hook )
14 {
15 wp_enqueue_style('wp-jquery-ui-dialog');
16 wp_enqueue_script('jquery');
17 wp_enqueue_script('jquery-ui-dialog');
18 add_action( 'admin_footer', 'cpabcal_feedback_javascript' );
19 }
20 }
21
22
23
24 // This function is used only if explicitly accepted (opt-in) by the user
25 function cpabcal_feedback() {
26 global $cpabcal_plugfile, $cpabcal_plugslug;
27 $cpabcal_plugin_data = get_plugin_data( dirname(dirname(__FILE__)).'/'.$cpabcal_plugfile );
28 $cpabcal_plugin_version = $cpabcal_plugin_data['Version'];
29 $time = time() - get_option('installed_'.$cpabcal_plugslug, '');
30 $data = array(
31 'answer' => sanitize_textarea_field(@$_POST["answer"]),
32 'otherplugin' => sanitize_textarea_field(@$_POST["opinfo"]),
33 'otherinfo' => sanitize_textarea_field(@$_POST["oinfo"]),
34 'plugin' => ($cpabcal_plugin_data['Name']),
35 'pluginv' => ($cpabcal_plugin_version),
36 'wordpress' => (get_bloginfo( 'version' )),
37 'itime' => ($time),
38 'phpversion' => (phpversion ())
39 );
40 if (@$_POST["onymous"] == 'false') // send this data only if explicitly accepted
41 {
42 $current_user = wp_get_current_user();
43 $data['email'] = ($current_user->user_email);
44 $data['website'] = ($_SERVER['HTTP_HOST']);
45 $data['url'] = (get_site_url());
46 // for detecting theme and plugin conflicts:
47 $data['theme'] = (wp_get_theme()->get('Name') . " " .wp_get_theme()->get('Version'));
48 $plist = "";
49 $activeplugins = get_option('active_plugins');
50 $plugins = get_plugins();
51 foreach ($activeplugins as $plugin)
52 $plist .= $plugins[$plugin]["Title"]." ".$plugins[$plugin]["Version"]."\n";
53 $data['plugins'] = ($plist);
54 }
55
56 //extract data from the post
57 //set POST variables
58 $url = 'https://wordpress.dwbooster.com/licensesystem/debug-data.php';
59 $fields = $data;
60
61 wp_remote_post(
62 $url,
63 array ( 'body' => $fields )
64 );
65
66 wp_die(); // this is required to terminate immediately and return a proper response
67 }
68
69
70 function cpabcal_feedback_javascript() {
71 global $cpabcal_plugslug, $cpabcal_supportlink, $cpabcal_supportlink_full;
72 ?>
73 <script type="text/javascript">
74
75 $ = jQuery.noConflict()
76 $(window).on('load',function () {
77 document.querySelector('[data-slug="<?php echo $cpabcal_plugslug; ?>"] .deactivate a').addEventListener('click', function(event){
78 event.preventDefault()
79 var urlRedirect = document.querySelector('[data-slug="<?php echo $cpabcal_plugslug; ?>"] .deactivate a').getAttribute('href');
80
81 $('<div title="QUICK FEEDBACK"><div style="padding:10px;">'+
82 '<style type="text/css">.abcreasonblock { margin-top:8px; }</style>'+
83 '<h3><strong>If you have a moment, please let us know why you are deactivating:</strong></h3>'+
84 '<form id="cpfeedbackform">'+
85
86 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="no-work"> The plugin didn\'t work<br />'+
87 '<div id="abcm_nowork" style="margin-left:25px;display:none;padding:10px;border:1px dotted gray;color:#660000"><strong>We can help!</strong> We offer <strong>free support</strong> for this plugin with <strong>timely answers</strong> and <strong>solution for almost 100% of cases</strong>. <a href="<?php echo $cpabcal_supportlink_full; ?>"><strong>Send a message to support</strong></a> and get a solution.</div></div>'+
88
89
90 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="no-paypal"> Don\'t want to use PayPal<br />'+
91 '<div id="abcm_nopaypal" style="margin-left:25px;display:none;padding:10px;border:1px dotted gray;color:#660000"><strong>No problem, we have a solution!</strong> There is a similar free plugin without PayPal, the <a href="plugin-install.php?tab=plugin-information&plugin=appointment-hour-booking&TB_iframe=true" class="thickbox open-plugin-details-modal" onclick="javascript:cpabcal_apphourbk(this);"><strong>Appointment Hour Booking</strong></a>. Questions? <a href="<?php echo $cpabcal_supportlink_full; ?>"><strong>Send us a message</strong></a> and get a solution.</div></div>'+
92
93
94 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="-"> I don\'t like to share this information with you<br /></div>'+
95
96 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="temporary-deactivation"> It\'s a temporary deactivation. I\'m just debugging an issue.<br /></div>'+
97
98 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="better-plugin"> I found a better plugin<br />'+
99 '<div id="abcm_otherplugin" style="margin-left:25px;display:none;"><input type="text" name="abcm_otherpinfo" placeholder="What\'s the plugin name?" style="width:100%"></div></div>'+
100
101 '<div class="abcreasonblock"><input type="radio" name="abcm_reason" onclick="cpabcal_update_reason(this);" value="other"> Other<br />'+
102 '<div id="abcm_other" style="margin-left:25px;display:none;font-weight:bold;">Kindly tell us the reason so we can improve.<br /><input type="text" name="abcm_otherinfo" style="width:100%"></div></div>'+
103
104 '<div id="abcnofeedback" style="display:none;margin-top:30px;text-align:right"><input type="checkbox" name="cpabcanonymous" value="yes"> Anonymous feedback</div>'+
105
106 '</form>'+
107 '</div></div>'
108 ).dialog({
109 width:'600',
110 dialogClass: 'wp-dialog',
111 modal: true,
112 close: function(event, ui)
113 {
114 $(this).dialog("close");
115 $(this).remove();
116 },
117 closeOnEscape: true,
118 buttons: [
119 {
120 id: 'abcdeactivatebtn',
121 text: "Skip & Deactivate",
122 click: function() {
123 var answer = $("input[name='abcm_reason']:checked").val();
124 if (answer == undefined || answer == '' || answer == '-')
125 window.location.href = urlRedirect;
126 else
127 {
128 var opinfo = $("input[name='abcm_otherpinfo']").val();
129 var oinfo = $("input[name='abcm_otherinfo']").val();
130 var isAnonymous = $("input[name='cpabcanonymous']:checked").length > 0;
131 var data = {
132 'action': 'cpabcal_feedback',
133 'answer': $("input[name='abcm_reason']:checked").val(),
134 'opinfo': $("input[name='abcm_otherpinfo']").val(),
135 'oinfo': $("input[name='abcm_otherinfo']").val(),
136 'onymous': $("input[name='cpabcanonymous']:checked").length > 0
137 };
138 $.post(ajaxurl, data, function(response) {
139 window.location.href = urlRedirect;
140 });
141 }
142 }
143 },
144 {
145 text: "We can help: Support Service",
146 click: function() {
147 window.open('<?php echo $cpabcal_supportlink_full; ?>');
148 $(this).dialog("close");
149 }
150 },
151 {
152 text: "Cancel",
153 "class": 'button button-primary button-close',
154 click: function() {
155 $(this).dialog("close");
156 }
157 }
158 ]
159 });
160 })
161 });
162
163 function cpabcal_apphourbk(item)
164 {
165 $("#abcm_nopaypal").closest('.ui-dialog-content').dialog('close');
166 return true;
167 }
168
169 function cpabcal_update_reason(field)
170 {
171 document.getElementById("abcdeactivatebtn").value = 'Submit & Deactivate';
172 document.getElementById("abcdeactivatebtn").innerHTML = '<span class="ui-button-text">Submit &amp; Deactivate</span>';
173 document.getElementById("abcnofeedback").style.display = '';
174 document.getElementById("abcm_other").style.display = 'none';
175 document.getElementById("abcm_otherplugin").style.display = 'none';
176 document.getElementById("abcm_nowork").style.display = 'none';
177 document.getElementById("abcm_nopaypal").style.display = 'none';
178 if (field.value == '-')
179 {
180 document.getElementById("abcdeactivatebtn").value = 'Skip & Deactivate';
181 document.getElementById("abcdeactivatebtn").innerHTML = '<span class="ui-button-text">Skip &amp; Deactivate</span>';
182 document.getElementById("abcnofeedback").style.display = 'none';
183 }
184 else if (field.value == 'other')
185 document.getElementById("abcm_other").style.display = '';
186 else if (field.value == 'better-plugin')
187 document.getElementById("abcm_otherplugin").style.display = '';
188 else if (field.value == 'no-work')
189 document.getElementById("abcm_nowork").style.display = '';
190 else if (field.value == 'no-paypal')
191 document.getElementById("abcm_nopaypal").style.display = '';
192 }
193
194 </script><?php
195 }
196
197 ?>