PluginProbe
SendWP / 1.2.5
SendWP v1.2.5
trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1 1.2.10 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.4.4 1.4.5 1.4.6 1.4.8
← All changes | includes/functions.php +29 -1 1.11.2.5 View file →
@@ -104,8 +104,14 @@
104 104 {
105 105 return sendwp_generate_hash() === $hash;
106 106 }
107 107
108 +
109 +function sendwp_get_hash()
110 +{
111 + return sendwp_generate_hash();
112 +}
113 +
108 114 function sendwp_generate_hash()
109 115 {
110 116 $data = sendwp_get_client_name() . sendwp_get_client_secret();
111 117 return hash('sha256', $data);
@@ -200,5 +206,27 @@
200 206
201 207 function sendwp_last_pulse_result()
202 208 {
203 209 return get_option('_transient_sendwp_pulse_monitor', 'unknown');
204 -}
210 +}
211 +
212 +function sendwp_reset_all_plugin_data()
213 +{
214 + if (check_admin_referer('reset_sendwp_data' . sendwp_get_client_secret())) {
215 + $options = [
216 + 'sendwp_client_secret',
217 + ];
218 +
219 + foreach ($options as $option) {
220 + if (get_option($option, false) !== false) {
221 + delete_option($option);
222 + }
223 + }
224 +
225 + sendwp_set_client_secret(sendwp_generate_secret());
226 + }
227 +
228 + wp_redirect(sendwp_get_client_redirect());
229 +
230 + exit;
231 +}
232 +add_action( 'admin_post_sendwp_reset_plugin_data', 'sendwp_reset_all_plugin_data' );