Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 520426dda2 | |||
| 4486306d7f | |||
| daf673d244 | |||
| aa6e6c8fd0 |
112
README.md
112
README.md
@@ -1,2 +1,112 @@
|
||||
# wp-multi-ticket
|
||||
# WP Multi Ticket Pro 🚀
|
||||
|
||||
Ein leistungsstarkes und einfaches Ticket- und Support-System für WordPress.
|
||||
Es ermöglicht Gästen (ohne Login), Tickets zu erstellen, und bietet Administratoren ein umfassendes Dashboard zur Verwaltung, Analyse und Kommunikation.
|
||||
|
||||
---
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- **Gast-Tickets:** Besucher können Tickets erstellen, ohne sich registrieren zu müssen.
|
||||
- **Frontend Integration:** Einfache Einbindung über Shortcodes auf beliebigen Seiten.
|
||||
- **Intelligente Benachrichtigungen:**
|
||||
- E-Mail-Benachrichtigungen an Admins und Kunden
|
||||
- Discord & Telegram Integration für Echtzeit-Alerts
|
||||
- **Analytics Dashboard:** Visuelle Auswertung (Charts) von Ticket-Statistiken, Arbeitslast und Statusverteilung direkt im Admin-Bereich
|
||||
- **Ticket-Management:**
|
||||
- Status- und Prioritätsverwaltung
|
||||
- Zuweisung an spezifische Abteilungen oder Mitarbeiter
|
||||
- Interne Notizen (für Mitarbeiter) vs. öffentliche Antworten
|
||||
- **CSV-Export:** Exportieren Sie alle Tickets zur externen Analyse
|
||||
- **Textbausteine:** Erstellen Sie Vorlagen für schnelle Antworten
|
||||
- **Datei-Uploads:** Kunden und Admins können Dateien an Tickets anhängen
|
||||
- **Auto-Updates:** Das Plugin prüft automatisch auf Updates (über Gitea)
|
||||
|
||||
---
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
1. Laden Sie das Plugin-Verzeichnis (`wp-multi-ticket`) in den `/wp-content/plugins/` Ordner Ihrer WordPress-Installation hoch, oder installieren Sie es direkt über das WordPress Plugin-Menü ("ZIP hochladen").
|
||||
2. Aktivieren Sie das Plugin im WordPress "Plugins" Menü.
|
||||
3. Gehen Sie zu **Einstellungen > Permalinks** und klicken Sie einmal auf "Änderungen speichern", um sicherzustellen, dass die Links funktionieren.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Nutzung (Shortcodes)
|
||||
|
||||
### Ticket erstellen
|
||||
Fügen Sie diesen Shortcode auf einer Seite ein (z.B. "Support"), wo Kunden neue Tickets eröffnen sollen:
|
||||
|
||||
```text
|
||||
[wmt_form]
|
||||
```
|
||||
|
||||
### Ticket-Status suchen
|
||||
Fügen Sie diesen Shortcode ein, damit Kunden ihre offenen Tickets über ihre E-Mail-Adresse finden können:
|
||||
|
||||
```text
|
||||
[wmt_lookup]
|
||||
```
|
||||
|
||||
### Ticket-Ansicht
|
||||
Dieser Shortcode ist meist nicht nötig manuell einzufügen, da Kunden automatisch per E-Mail-Link zu ihrer Ticket-Ansicht weitergeleitet werden:
|
||||
|
||||
```text
|
||||
[wmt_view]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Konfiguration
|
||||
|
||||
Nach der Installation finden Sie im WordPress-Menü den Punkt **"Tickets Pro"**.
|
||||
|
||||
### 1. Einstellungen
|
||||
Hier passen Sie das System an Ihre Bedürfnisse an:
|
||||
|
||||
- **Kategorien & Abteilungen:** Definieren Sie Themenbereiche und weisen Sie sie Abteilungen zu.
|
||||
- **Status & Prioritäten:** Legen Sie fest, welche Stati (z.B. *Offen*, *In Bearbeitung*) und Prioritäten verfügbar sind.
|
||||
- **Textbausteine:** Erstellen Sie Vorlagen für häufige Antworten (öffentlich oder intern).
|
||||
- **Datei-Uploads:** Legen Sie fest, welche Dateitypen (z.B. pdf, jpg) erlaubt sind.
|
||||
|
||||
### 2. Benachrichtigungen
|
||||
Verbinden Sie Ihre Favoriten-Apps, um nie ein Ticket zu verpassen:
|
||||
|
||||
- **Discord Webhook URL:** Fügen Sie Ihre Discord-Webhook-URL für Push-Nachrichten in einen Channel ein.
|
||||
- **Telegram Bot:** Token und Chat ID eingeben für Telegram-Benachrichtigungen.
|
||||
- **Zusätzliche User:** Wählen Sie spezifische WordPress-Benutzer aus, die bei jedem neuen Ticket per E-Mail benachrichtigt werden sollen.
|
||||
|
||||
### 3. Analytics
|
||||
Unter dem Menüpunkt **Analytics** sehen Sie Diagramme zu:
|
||||
|
||||
- Gesamtanzahl der Tickets
|
||||
- Offene vs. geschlossene Tickets
|
||||
- Tickets der letzten 30 Tage
|
||||
- Workload pro Mitarbeiter (Agent Performance)
|
||||
|
||||
---
|
||||
|
||||
## 📄 Admin-Funktionen
|
||||
|
||||
Im Dashboard finden Sie eine Übersicht offener Tickets.
|
||||
|
||||
- **Antworten:** Nutzen Sie den WordPress Editor für formatierte Antworten.
|
||||
- **Interne Notizen:** Schreiben Notizen, die nur für andere Admins sichtbar sind.
|
||||
- **Drucken:** Erstellen Sie ein sauberes PDF/Print-Layout eines Tickets für Akten.
|
||||
- **Export:** Nutzen Sie den *CSV Export* Button oben in der Liste, um Daten zu sichern.
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Updates
|
||||
|
||||
Das Plugin enthält einen eingebauten **Update-Checker**.
|
||||
Sollte eine neue Version auf **Gitea** veröffentlicht werden, sehen Sie oben im Admin-Bereich eine Hinweismeldung mit einem Download-Link.
|
||||
|
||||
---
|
||||
|
||||
## 🆘 Support
|
||||
|
||||
Bei Fragen oder Problemen kontaktieren Sie bitte:
|
||||
|
||||
- **Telegram Support:** [t.me/M_Viper04](https://t.me/M_Viper04)
|
||||
- **Web:** [m-viper.de](https://m-viper.de)
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: WP Multi Ticket Pro (Secure Guest)
|
||||
Description: Version 10.5 – Fix: Syntax Error in get_option + Chart.js Verbesserungen.
|
||||
Version: 1.0
|
||||
Author: M_Viper
|
||||
* Plugin Name: WP Multi Ticket Pro
|
||||
* Plugin URI: https://git.viper.ipv64.net/M_Viper/wp-multi-ticket
|
||||
* Description: Leistungsstarkes Ticket- und Support-System für WordPress mit Gast-Tickets, Admin-Antworten, CSV-Export, Dashboard-Widgets und integriertem Update-Management über Gitea.
|
||||
* Version: 1.2
|
||||
* Author: M_Viper
|
||||
* Author URI: https://m-viper.de
|
||||
* Requires at least: 6.7.2
|
||||
* Tested up to: 6.7.2
|
||||
* Requires PHP: 7.4
|
||||
* License: GPL-2.0-or-later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: wp-multi-ticket
|
||||
* Domain Path: /languages
|
||||
* Tags: ticket, support, helpdesk, customer-support, guest-tickets, wp-multi
|
||||
* Support: https://t.me/M_Viper04
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
class WP_Multi_Ticket_Pro {
|
||||
|
||||
private $table_tickets;
|
||||
private $table_messages;
|
||||
private $update_url = 'https://git.viper.ipv64.net/M_Viper/wp-multi-ticket/releases';
|
||||
|
||||
public function __construct() {
|
||||
global $wpdb;
|
||||
@@ -30,6 +44,9 @@ class WP_Multi_Ticket_Pro {
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'load_analytics_scripts' ) );
|
||||
|
||||
// Hook für Update-Benachrichtigung
|
||||
add_action( 'admin_notices', array( $this, 'check_plugin_updates' ) );
|
||||
|
||||
add_shortcode( 'wmt_form', array( $this, 'render_creation_form' ) );
|
||||
add_shortcode( 'wmt_view', array( $this, 'render_ticket_view' ) );
|
||||
add_shortcode( 'wmt_lookup', array( $this, 'render_lookup_form' ) );
|
||||
@@ -43,6 +60,95 @@ class WP_Multi_Ticket_Pro {
|
||||
add_action( 'admin_init', array( $this, 'handle_csv_export' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft auf Updates von der Git-URL und zeigt eine Admin-Notice an
|
||||
*/
|
||||
public function check_plugin_updates() {
|
||||
|
||||
if ( ! current_user_can( 'update_plugins' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'get_plugin_data' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
|
||||
$plugin_data = get_plugin_data( __FILE__ );
|
||||
$current_version = $plugin_data['Version'];
|
||||
|
||||
$cache_key = 'wmt_ticket_update_check';
|
||||
$cached = get_transient( $cache_key );
|
||||
|
||||
if ( false === $cached ) {
|
||||
|
||||
$cached = array(
|
||||
'version' => $current_version,
|
||||
'url' => $this->update_url,
|
||||
);
|
||||
|
||||
// Gitea API – Releases
|
||||
$api_url = 'https://git.viper.ipv64.net/api/v1/repos/M_Viper/wp-multi-ticket/releases';
|
||||
|
||||
$response = wp_remote_get( $api_url, array(
|
||||
'timeout' => 10,
|
||||
'headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'User-Agent' => 'WP-Multi-Ticket-Updater',
|
||||
),
|
||||
) );
|
||||
|
||||
if ( ! is_wp_error( $response ) && wp_remote_retrieve_response_code( $response ) === 200 ) {
|
||||
|
||||
$releases = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
||||
if ( is_array( $releases ) && ! empty( $releases ) ) {
|
||||
|
||||
// Neuestes Release (Gitea liefert neueste zuerst)
|
||||
$latest = $releases[0];
|
||||
|
||||
// Version (genau wie im Toolkit)
|
||||
if ( ! empty( $latest['tag_name'] ) ) {
|
||||
$cached['version'] = ltrim( $latest['tag_name'], 'vV' );
|
||||
} elseif ( ! empty( $latest['name'] ) ) {
|
||||
$cached['version'] = ltrim( $latest['name'], 'vV' );
|
||||
}
|
||||
|
||||
// Exaktes ZIP-Asset suchen
|
||||
if ( ! empty( $latest['assets'] ) && is_array( $latest['assets'] ) ) {
|
||||
foreach ( $latest['assets'] as $asset ) {
|
||||
if (
|
||||
! empty( $asset['name'] ) &&
|
||||
! empty( $asset['browser_download_url'] ) &&
|
||||
strtolower( $asset['name'] ) === 'wp-multi-ticket.zip'
|
||||
) {
|
||||
$cached['url'] = $asset['browser_download_url'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cache setzen
|
||||
set_transient( $cache_key, $cached, 12 * HOUR_IN_SECONDS );
|
||||
}
|
||||
|
||||
// Update-Hinweis anzeigen
|
||||
if ( version_compare( $cached['version'], $current_version, '>' ) ) {
|
||||
|
||||
echo '<div class="notice notice-warning is-dismissible">';
|
||||
echo '<p><strong>WP Multi Ticket Pro – Update verfügbar</strong></p>';
|
||||
echo '<p>Neue Version: <strong>' . esc_html( $cached['version'] ) . '</strong><br>';
|
||||
echo 'Installiert: <strong>' . esc_html( $current_version ) . '</strong></p>';
|
||||
echo '<p>';
|
||||
echo '<a href="' . esc_url( $this->update_url ) . '" target="_blank" class="button">Release ansehen</a> ';
|
||||
echo '<a href="' . esc_url( $cached['url'] ) . '" target="_blank" class="button button-primary">Direkter Download (ZIP)</a>';
|
||||
echo '</p>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// *** HIER: korrigierter Hook-Name für die Analytics-Unterseite ***
|
||||
public function load_analytics_scripts( $hook ) {
|
||||
// Für Submenu: parent slug wmt_tickets -> Hook: wmt-tickets_page_wmt_analytics
|
||||
@@ -57,9 +163,18 @@ class WP_Multi_Ticket_Pro {
|
||||
}
|
||||
|
||||
public function enqueue_styles() {
|
||||
// Hier wird die eingestellte Schriftfarbe geholt (Standard: #6b7280 = rgb(107, 114, 128))
|
||||
$custom_font_color = get_option( 'wmt_font_color', '#6b7280' );
|
||||
|
||||
?>
|
||||
<style>
|
||||
.wmt-box { max-width: 800px; margin: 20px auto; background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; }
|
||||
.wmt-box { max-width: 800px; margin: 20px auto; background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; color: <?php echo esc_attr($custom_font_color); ?>; }
|
||||
|
||||
/* Überschriften explizit einfärben */
|
||||
.wmt-box h1, .wmt-box h2, .wmt-box h3 {
|
||||
color: <?php echo esc_attr($custom_font_color); ?>;
|
||||
}
|
||||
|
||||
.wmt-btn { background: #0073aa; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; line-height: 1.4; }
|
||||
.wmt-btn:hover { background: #005177; }
|
||||
.wmt-btn.danger { background: #dc3545; }
|
||||
@@ -123,7 +238,7 @@ class WP_Multi_Ticket_Pro {
|
||||
.wmt-css-label { width: 120px; font-size: 13px; font-weight: 600; text-align: right; margin-right: 10px; }
|
||||
.wmt-css-bar-bg { flex-grow: 1; background: #f3f4f6; height: 24px; border-radius: 4px; overflow: hidden; position: relative; }
|
||||
.wmt-css-bar-fill { height: 100%; background: #3b82f6; display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: 11px; white-space: nowrap; transition: width 0.5s ease; }
|
||||
.wmt-css-bar-val { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #6b7280; font-weight: bold; }
|
||||
.wmt-css-bar-val { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #6c757d; font-weight: bold; }
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
@@ -197,6 +312,7 @@ class WP_Multi_Ticket_Pro {
|
||||
register_setting( 'wmt_settings_group', 'wmt_admin_email' );
|
||||
register_setting( 'wmt_settings_group', 'wmt_templates' );
|
||||
register_setting( 'wmt_settings_group', 'wmt_allowed_filetypes' );
|
||||
register_setting( 'wmt_settings_group', 'wmt_font_color' ); // NEU: Schriftfarbe registrieren
|
||||
|
||||
register_setting( 'wmt_notifications_group', 'wmt_discord_webhook' );
|
||||
register_setting( 'wmt_notifications_group', 'wmt_telegram_token' );
|
||||
@@ -483,6 +599,14 @@ class WP_Multi_Ticket_Pro {
|
||||
<tr><th>Status</th><td><input type="text" name="wmt_statuses" value="<?php echo esc_attr( get_option('wmt_statuses', 'Offen, In Bearbeitung, Wartet auf Antwort, Geschlossen') ); ?>" class="regular-text"></td></tr>
|
||||
<tr><th>Admin E-Mail</th><td><input type="email" name="wmt_admin_email" value="<?php echo esc_attr( get_option('wmt_admin_email', get_option('admin_email') ) ); ?>" class="regular-text"></td></tr>
|
||||
<tr><th>Erlaubte Dateiendungen</th><td><input type="text" name="wmt_allowed_filetypes" value="<?php echo esc_attr( get_option('wmt_allowed_filetypes', 'pdf, doc, docx, jpg, jpeg, png, txt') ); ?>" class="regular-text"><p class="description">Kommagetrennt (z.B. pdf, doc, png).</p></td></tr>
|
||||
<!-- NEU: Schriftfarbe Einstellung -->
|
||||
<tr>
|
||||
<th>Schriftfarbe</th>
|
||||
<td>
|
||||
<input type="color" name="wmt_font_color" value="<?php echo esc_attr( get_option('wmt_font_color', '#6b7280') ); ?>" class="regular-text">
|
||||
<p class="description">Wählen Sie die Standard-Schriftfarbe für das Ticket-System (inkl. Überschriften).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Textbausteine</th>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user