| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | function sendwp_get_server_url() |
| 4 | 4 | { |
| 5 | - $server_url = ( defined('SENDWP_SERVER_URL') ) ? SENDWP_SERVER_URL : 'https://app.sendwp.com'; | |
| 5 | + $server_url = ( defined('SENDWP_SERVER_URL') ) ? SENDWP_SERVER_URL : 'https://sendwp.com'; | |
| 6 | 6 | return trailingslashit( $server_url ); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | function sendwp_get_request_auth_header() |
| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | function sendwp_get_client_redirect() |
| 25 | 25 | { |
| 26 | - return add_query_arg('page', 'sendwp', get_admin_url(null, 'tools.php') ); | |
| 26 | + return get_admin_url(null, 'tools.php'); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | function sendwp_get_client_secret() |
| 30 | 30 | { |
| @@ -104,14 +104,8 @@ | ||
| 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 | - | |
| 114 | 108 | function sendwp_generate_hash() |
| 115 | 109 | { |
| 116 | 110 | $data = sendwp_get_client_name() . sendwp_get_client_secret(); |
| 117 | 111 | return hash('sha256', $data); |
| @@ -206,38 +200,5 @@ | ||
| 206 | 200 | |
| 207 | 201 | function sendwp_last_pulse_result() |
| 208 | 202 | { |
| 209 | 203 | return get_option('_transient_sendwp_pulse_monitor', 'unknown'); |
| 210 | -} | |
| 211 | - | |
| 212 | -function sendwp_get_client_partner_id() | |
| 213 | -{ | |
| 214 | - if ( defined( 'SENDWP_PARTNER_ID' ) ) { | |
| 215 | - return SENDWP_PARTNER_ID; | |
| 216 | - } | |
| 217 | - | |
| 218 | - return null; | |
| 219 | -} | |
| 220 | - | |
| 221 | -function sendwp_reset_all_plugin_data() | |
| 222 | -{ | |
| 223 | - if (check_admin_referer('reset_sendwp_data' . sendwp_get_client_secret())) { | |
| 224 | - $options = [ | |
| 225 | - 'sendwp_client_secret', | |
| 226 | - 'sendwp_client_connected', | |
| 227 | - 'sendwp_forwarding_enabled', | |
| 228 | - ]; | |
| 229 | - | |
| 230 | - foreach ($options as $option) { | |
| 231 | - if (get_option($option, false) !== false) { | |
| 232 | - delete_option($option); | |
| 233 | - } | |
| 234 | - } | |
| 235 | - | |
| 236 | - sendwp_set_client_secret(sendwp_generate_secret()); | |
| 237 | - } | |
| 238 | - | |
| 239 | - wp_redirect(sendwp_get_client_redirect()); | |
| 240 | - | |
| 241 | - exit; | |
| 242 | -} | |
| 243 | -add_action( 'admin_post_sendwp_reset_plugin_data', 'sendwp_reset_all_plugin_data' ); | |
| 204 | +} | |