' . __( 'Submitting form', 'shortpixel-image-optimiser' ) . '
'; $html .= ' '; ?> __('Temporary deactivation', 'shortpixel-image-optimiser'), 'setup' => __( 'Set up is too difficult', 'shortpixel-image-optimiser' ), 'docs' => __( 'Lack of documentation', 'shortpixel-image-optimiser' ), 'features' => __( 'Not the features I wanted', 'shortpixel-image-optimiser' ), 'better-plugin' => __( 'Found a better plugin', 'shortpixel-image-optimiser' ), 'incompatibility' => __( 'Incompatible with theme or plugin', 'shortpixel-image-optimiser' ), 'maintenance' => __( 'Other', 'shortpixel-image-optimiser' ), ); $form['details'] = __( 'How could we improve ?', 'shortpixel-image-optimiser'); return $form; } public function deactivatePluginCallback() { check_ajax_referer( 'shortpixel_deactivate_plugin', 'security' ); Log::addDebug('Deactive Plugin Callback POST', $_POST); if ( isset($_POST['reason']) && isset($_POST['details']) && isset($_POST['anonymous']) ) { require_once(\WPSPIO()->plugin_path() . 'class/view/shortpixel-plugin-request.php'); $anonymous = (intval($_POST['anonymous']) == 1) ? true : false; $args = array( 'key' => $this->key, 'reason' => sanitize_text_field(wp_unslash($_POST['reason'])), 'details' => sanitize_text_field(wp_unslash($_POST['details'])), 'anonymous' => $anonymous ); $request = new ShortPixelPluginRequest( $this->plugin_file, 'http://' . SHORTPIXEL_API . '/v2/feedback.php', $args ); if ( $request->request_successful ) { echo json_encode( array( 'status' => 'ok', ) ); }else{ echo json_encode( array( 'status' => 'nok', ) ); } }else{ echo json_encode( array( 'status' => 'OK', ) ); } die(); } }