| @@ -4,11 +4,11 @@ | ||
| 4 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | 5 | exit; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -if( ! class_exists( 'Qcld_Wp_Usage_Feedback') ) { | |
| 8 | +if( ! class_exists( 'Wp_Usage_Feedback') ) { | |
| 9 | 9 | |
| 10 | - class Qcld_Wp_Usage_Feedback { | |
| 10 | + class Wp_Usage_Feedback { | |
| 11 | 11 | |
| 12 | 12 | private $wpbot_version = '1.0.0'; |
| 13 | 13 | private $home_url = ''; |
| 14 | 14 | private $plugin_file = ''; |
| @@ -58,9 +58,9 @@ | ||
| 58 | 58 | |
| 59 | 59 | // Deactivation |
| 60 | 60 | add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) ); |
| 61 | 61 | add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) ); |
| 62 | - add_action( 'wp_ajax_qcld_goodbye_form', array( $this, 'qcld_goodbye_form_callback' ) ); | |
| 62 | + add_action( 'wp_ajax_goodbye_form', array( $this, 'goodbye_form_callback' ) ); | |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | } |
| 66 | 66 | |
| @@ -126,9 +126,9 @@ | ||
| 126 | 126 | $plugin = $this->plugin_data(); |
| 127 | 127 | if( empty( $plugin ) ) { |
| 128 | 128 | // We can't find the plugin data |
| 129 | 129 | // Send a message back to our home site |
| 130 | - $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'chatbot' ); | |
| 130 | + $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'wpchatbot' ); | |
| 131 | 131 | $body['status'] = 'Data not found'; // Never translated |
| 132 | 132 | } else { |
| 133 | 133 | if( isset( $plugin['Name'] ) ) { |
| 134 | 134 | $body['plugin'] = sanitize_text_field( $plugin['Name'] ); |
| @@ -205,19 +205,19 @@ | ||
| 205 | 205 | * @since 1.0.0 |
| 206 | 206 | */ |
| 207 | 207 | public function form_default_text() { |
| 208 | 208 | $form = array(); |
| 209 | - $form['heading'] = __( 'Sorry to see you go', 'chatbot' ); | |
| 210 | - $form['body'] = ''; | |
| 209 | + $form['heading'] = __( 'Sorry to see you go', 'wpchatbot' ); | |
| 210 | + $form['body'] = __( '', 'wpchatbot' ); | |
| 211 | 211 | $form['options'] = array( |
| 212 | - __( 'Found a Bug', 'chatbot' ), | |
| 213 | - __( 'Need More Features', 'chatbot' ), | |
| 214 | - __( 'Deactivating Temporarily', 'chatbot' ), | |
| 215 | - __( 'Upgrading to Pro', 'chatbot' ), | |
| 212 | + __( 'Found a Bug', 'wpchatbot' ), | |
| 213 | + __( 'Need More Features', 'wpchatbot' ), | |
| 214 | + __( 'Deactivating Temporarily', 'wpchatbot' ), | |
| 215 | + __( 'Upgrading to Pro', 'wpchatbot' ), | |
| 216 | 216 | |
| 217 | 217 | ); |
| 218 | - $form['email'] = __( 'Please provide email so we can contact with bug fixes', 'chatbot' ); | |
| 219 | - $form['details'] = __( 'Please provide some details so we can improve the plugin', 'chatbot' ); | |
| 218 | + $form['email'] = __( 'Please provide email so we can contact with bug fixes', 'wpchatbot' ); | |
| 219 | + $form['details'] = __( 'Please provide some details so we can improve the plugin', 'wpchatbot' ); | |
| 220 | 220 | return $form; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
| @@ -259,10 +259,9 @@ | ||
| 259 | 259 | |
| 260 | 260 | $html .= '</div><!-- .wpb-goodbye-options -->'; |
| 261 | 261 | } |
| 262 | 262 | $html .= '</div><!-- .wpb-goodbye-form-body -->'; |
| 263 | - $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'chatbot' ) . '</p>'; | |
| 264 | - | |
| 263 | + $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'wpbot-plugin' ) . '</p>'; | |
| 265 | 264 | ?> |
| 266 | 265 | <div class="wpb-goodbye-form-bg"></div> |
| 267 | 266 | <style type="text/css"> |
| 268 | 267 | .wpb-form-active .wpb-goodbye-form-bg { |
| @@ -366,9 +365,9 @@ | ||
| 366 | 365 | }); |
| 367 | 366 | var email = $('#wpb-goodbye-email').val(); |
| 368 | 367 | var details = $('#wpb-goodbye-reasons').val(); |
| 369 | 368 | var data = { |
| 370 | - 'action': 'qcld_goodbye_form', | |
| 369 | + 'action': 'goodbye_form', | |
| 371 | 370 | 'values': values, |
| 372 | 371 | 'details': details, |
| 373 | 372 | 'email': email, |
| 374 | 373 | 'security': "<?php echo sanitize_key( wp_create_nonce( 'wpbot_goodbye_form' ) ); ?>", |
| @@ -397,13 +396,13 @@ | ||
| 397 | 396 | /** |
| 398 | 397 | * AJAX callback when the form is submitted |
| 399 | 398 | * @since 1.0.0 |
| 400 | 399 | */ |
| 401 | - public function qcld_goodbye_form_callback() { | |
| 400 | + public function goodbye_form_callback() { | |
| 402 | 401 | check_ajax_referer( 'wpbot_goodbye_form', 'security' ); |
| 403 | 402 | |
| 404 | 403 | if( isset( $_POST['details'] ) ) { |
| 405 | - $details = sanitize_text_field(wp_unslash($_POST['details'])); | |
| 404 | + $details = sanitize_text_field( $_POST['details'] ); | |
| 406 | 405 | update_option( 'wpbot_deactivation_details_' . $this->plugin_name, $details ); |
| 407 | 406 | } |
| 408 | 407 | |
| 409 | 408 | echo 'success'; |