diff --git a/wp-multi-toolkit.php b/wp-multi-toolkit.php index d5a6d05..41f10fd 100644 --- a/wp-multi-toolkit.php +++ b/wp-multi-toolkit.php @@ -19,6 +19,220 @@ defined('ABSPATH') or die('No direct access allowed.'); + + + + +/* + * Gitea - Ticket - BUG - Report +*/ + +// Funktion zur Erstellung eines Support-Tickets +function send_support_ticket_to_server($plugin_name, $title, $description, $label = 'bug') { + $server_url = 'https://m-viper.de/gitea-issue-creator-2.php'; + + $data = [ + 'plugin' => $plugin_name, + 'title' => $title, + 'description' => $description, + 'label' => $label + ]; + + $args = [ + 'method' => 'POST', + 'body' => json_encode($data), + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'timeout' => 45, + ]; + + $response = wp_remote_post($server_url, $args); + + if (is_wp_error($response)) { + $error_message = $response->get_error_message(); + return "
"; + } + + $response_body = wp_remote_retrieve_body($response); + $response_data = json_decode($response_body, true); + + if (isset($response_data['message']) && $response_data['message'] === 'Issues erfolgreich erstellt') { + return ' '; + } else { + return ' '; + } +} + +// Formular für das Support-Ticket mit Design +function support_ticket_form() { + ?> +