get_plugin_slug(), '_wpnonce_send_feature_request');
$name = isset($_POST['name']) ? sanitize_text_field(wp_unslash($_POST['name'])) : "";
$email = isset($_POST['email']) ? sanitize_email(wp_unslash($_POST['email'])) : "";
$description = isset($_POST['description']) ? wp_kses_post(wp_unslash($_POST['description'])) : "";
$workaround = isset($_POST['workaround']) ? wp_kses_post(wp_unslash($_POST['workaround'])) : "";
$attachments = isset($_POST['attachments']) ? wp_kses_post(wp_unslash($_POST['attachments'])) : "";
if ($email && $description) {
$subject = 'Feature request from '. $pluginNameForEmails .' plugin';
$message = 'We received a feature request to the '. $pluginNameForEmails .' plugin from '. $name .' ('. $email .', url: '. get_option('siteurl') .'):
'. $description .'
Current workaround:
'. $workaround .'';
if ($attachments) {
$message .= '
Attached urls:
- '. str_replace("\n", '
- ', $attachments);
}
ob_start();
include $pluginManagerInstance->get_plugin_dir() . 'include' . DIRECTORY_SEPARATOR . 'troubleshooting.php';
$troubleshootingData = ob_get_clean();
$message .= '
Troubleshooting:
'. nl2br(str_replace("\t", " ", $troubleshootingData));
wp_mail('support@trustindex.io', $subject, $message, [ 'From: '. $email, 'Content-Type: text/html; charset=UTF-8' ]);
}
exit;
}
?>