Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
d02bba1447 | |||
1003f7f0ec | |||
aa8ba05b7f | |||
e7fce1d49b |
54
README.md
54
README.md
@ -1,2 +1,54 @@
|
||||
# wp-multi-toolkit
|
||||
# WP Multi Toolkit - Update-Management und Support
|
||||
|
||||
## Beschreibung
|
||||
|
||||
Das WP Multi Toolkit ist ein **wichtiges Pflichtplugin** der WP Multi Plugin-Reihe. Es dient primär der zentralen Update-Verwaltung aller zugehörigen WP Multi Plugins und bietet eine einfache Möglichkeit, Support-Anfragen (Issues) direkt aus dem WordPress-Backend zu erstellen.
|
||||
|
||||
## Funktionen
|
||||
|
||||
* **Zentrales Update-Management:** Überprüft und benachrichtigt über verfügbare Updates für alle WP Multi Plugins.
|
||||
* **Support-Ticket-System:** Ermöglicht das Erstellen von Support-Tickets (Issues) direkt aus dem WordPress-Backend, die an ein Gitea-Repository gesendet werden.
|
||||
* **Pre-Release-Management:** Aktivieren Sie Pre-Releases, um Vorabversionen von WP Multi-Plugin zu testen.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Lade das Plugin als ZIP-Datei herunter.
|
||||
2. Gehe im WordPress-Backend zu "Plugins" > "Installieren".
|
||||
3. Lade die ZIP-Datei hoch und aktiviere das Plugin.
|
||||
|
||||
## Verwendung
|
||||
|
||||
### Update-Management
|
||||
|
||||
* Ein Dashboard-Widget zeigt verfügbare Updates für die WP Multi Plugin-Reihe an.
|
||||
* Updates werden stündlich über einen Cron-Job überprüft.
|
||||
* Pre-Releases können auf der Einstellungsseite aktiviert werden.
|
||||
|
||||
### Support-Ticket-System
|
||||
|
||||
* Gehe im WordPress-Backend zum Menüpunkt "WP-Multi Support".
|
||||
* Wähle das Plugin, für das du ein Ticket erstellen möchtest.
|
||||
* Fülle das Formular mit Titel und Beschreibung aus und wähle eine passende Kategorie.
|
||||
* Das Ticket wird als Issue im zugehörigen Gitea-Repository erstellt.
|
||||
|
||||
## Support
|
||||
|
||||
* [Microsoft Teams Support](https://teams.live.com/l/community/FEAzokphpZTJ2u6OgI)
|
||||
* [Telegram Support](https://t.me/M_Viper04)
|
||||
|
||||
## Technische Details
|
||||
|
||||
* **Plugin Name:** WP Multi Toolkit
|
||||
* **Plugin URI:** [https://git.viper.ipv64.net/M\_Viper/wp-multi-toolkit](https://git.viper.ipv64.net/M_Viper/wp-multi-toolkit)
|
||||
* **Version:** 1.0.1
|
||||
* **Author:** M\_Viper
|
||||
* **Author URI:** [https://m-viper.de](https://m-viper.de)
|
||||
* **Requires at least:** 6.7.2
|
||||
* **Tested up to:** 6.7.2
|
||||
* **License:** GPL2
|
||||
* **License URI:** [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html)
|
||||
* **Text Domain:** wp-multi-toolkit
|
||||
|
||||
## Lizenz
|
||||
|
||||
Dieses Plugin ist unter der GPL2-Lizenz lizenziert.
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Plugin Name: WP Multi Toolkit
|
||||
* Plugin URI: https://git.viper.ipv64.net/M_Viper/wp-multi-toolkit
|
||||
* Description: Ein umfassendes Toolkit inklusive WP Multi Funktionen und Update-Management für zugehörige Plugins.
|
||||
* Version: 1.0.1
|
||||
* Version: 1.0.3
|
||||
* Author: M_Viper
|
||||
* Author URI: https://m-viper.de
|
||||
* Requires at least: 6.7.2
|
||||
@ -16,9 +16,279 @@
|
||||
* Support: [Telegram Support](https://t.me/M_Viper04)
|
||||
*/
|
||||
|
||||
|
||||
defined('ABSPATH') or die('No direct access allowed.');
|
||||
|
||||
// Funktion, um zukünftige Posts zu veröffentlichen
|
||||
function pubMissedPosts() {
|
||||
if (is_front_page() || is_single()) {
|
||||
|
||||
global $wpdb;
|
||||
$now = gmdate('Y-m-d H:i:00');
|
||||
|
||||
// Überprüfe, ob benutzerdefinierte Beitragstypen vorhanden sind
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'_builtin' => false,
|
||||
);
|
||||
|
||||
$output = 'names'; // names oder objects, names ist der Standard
|
||||
$operator = 'and'; // 'and' oder 'or'
|
||||
$post_types = get_post_types($args, $output, $operator);
|
||||
|
||||
if (count($post_types) === 0) {
|
||||
$sql = "SELECT ID FROM $wpdb->posts WHERE post_type IN ('post', 'page') AND post_status = 'future' AND post_date_gmt < '$now'";
|
||||
} else {
|
||||
$str = implode('\',\'', $post_types);
|
||||
$sql = "SELECT ID FROM $wpdb->posts WHERE post_type IN ('page', 'post', '$str') AND post_status = 'future' AND post_date_gmt < '$now'";
|
||||
}
|
||||
|
||||
$resulto = $wpdb->get_results($sql);
|
||||
if ($resulto) {
|
||||
foreach ($resulto as $thisarr) {
|
||||
wp_publish_post($thisarr->ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Die Funktion beim Laden der Seite aufrufen
|
||||
add_action('wp_head', 'pubMissedPosts');
|
||||
|
||||
|
||||
/*
|
||||
* Abhängigkeitsprüfung: WP Multi Kategorie
|
||||
*/
|
||||
function wp_multi_toolkit_check_kategorie_dependency() {
|
||||
if (!function_exists('is_plugin_active')) {
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
}
|
||||
|
||||
// Prüfen, ob WP Multi Kategorie installiert und aktiv ist
|
||||
if (!is_plugin_active('wp-multi-kategorie/wp-multi-kategorie.php')) {
|
||||
add_action('admin_notices', 'wp_multi_toolkit_kategorie_dependency_notice');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Admin-Hinweis, falls Abhängigkeit fehlt
|
||||
function wp_multi_toolkit_kategorie_dependency_notice() {
|
||||
?>
|
||||
<div class="notice notice-warning">
|
||||
<p>
|
||||
<?php _e('Das Plugin "WP Multi Toolkit" empfiehlt die Installation von "WP Multi Kategorie", um alle Funktionen nutzen zu können.', 'wp-multi-toolkit'); ?>
|
||||
<a href="https://git.viper.ipv64.net/M_Viper/WP-Multi-Kategorie/releases" target="_blank" class="button button-primary" style="margin-left: 10px;">
|
||||
<?php _e('WP Multi Kategorie herunterladen', 'wp-multi-toolkit'); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
wp_multi_toolkit_check_kategorie_dependency();
|
||||
|
||||
|
||||
/*
|
||||
* Gitea - Ticket - BUG - Report
|
||||
*/
|
||||
|
||||
function send_support_ticket_to_server($plugin_name, $title, $description, $label = 'bug') {
|
||||
$server_url = 'https://m-viper.de/gitea-issue-creator.php';
|
||||
|
||||
// Hier wird das Plugin korrekt übergeben
|
||||
$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 "<span class='error-message'>Es gab einen Fehler bei der Ticketübertragung: $error_message</span>";
|
||||
}
|
||||
|
||||
$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 '<span class="success-message">Issues erfolgreich erstellt</span>';
|
||||
} else {
|
||||
return '<span class="error-message">Es gab einen Fehler: ' . esc_html($response_body) . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
// Support-Ticket Formular
|
||||
function support_ticket_form() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1 class="wp-multi-support-title">WP-Multi Support</h1>
|
||||
<div class="support-form-container">
|
||||
<form method="post" class="wp-multi-support-form">
|
||||
<div class="form-group">
|
||||
<label for="plugin_name">Wählen Sie das Plugin</label>
|
||||
<select name="plugin_name" id="plugin_name" required>
|
||||
<option value="wp-multi">WP Multi</option>
|
||||
<option value="wp-multi-search">WP Multi Search</option>
|
||||
<option value="wp-multi-toolkit">WP Multi Toolkit</option>
|
||||
<option value="wp-multi-comment-notifications">WP Multi Comment Notifications</option>
|
||||
<option value="wp-multi-kategorie">WP Multi Kategorie</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ticket_title">Ticket-Titel</label>
|
||||
<input type="text" name="ticket_title" id="ticket_title" required placeholder="Geben Sie den Titel ein" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ticket_description">Ticket-Beschreibung</label>
|
||||
<textarea name="ticket_description" id="ticket_description" required placeholder="Beschreiben Sie Ihr Anliegen"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="ticket_label">Kategorie</label>
|
||||
<select name="ticket_label" id="ticket_label" required>
|
||||
<option value="bug">Bug (Etwas funktioniert nicht)</option>
|
||||
<option value="enhancement">Verbesserung (Neue Funktion)</option>
|
||||
<option value="question">Frage (Mehr Infos benötigt)</option>
|
||||
<option value="help wanted">Hilfe benötigt</option>
|
||||
<option value="invalid">Ungültig (Etwas ist falsch)</option>
|
||||
<option value="duplicate">Duplikat (Bereits vorhanden)</option>
|
||||
<option value="wontfix">Wird nicht behoben</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="submit" name="submit_ticket" value="Ticket absenden" class="submit-button" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if (isset($_POST['submit_ticket'])) {
|
||||
$plugin_name = sanitize_text_field($_POST['plugin_name']);
|
||||
$title = sanitize_text_field($_POST['ticket_title']);
|
||||
$description = sanitize_textarea_field($_POST['ticket_description']);
|
||||
$label = sanitize_text_field($_POST['ticket_label']);
|
||||
// Übergebe die richtigen Werte an die Ticket-Erstellung
|
||||
$result = send_support_ticket_to_server($plugin_name, $title, $description, $label);
|
||||
echo '<div class="response-message">' . $result . '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (isset($_GET['page']) && $_GET['page'] === 'wp_multi_support') {
|
||||
?>
|
||||
<style>
|
||||
.wp-multi-support-title {
|
||||
font-size: 28px;
|
||||
color: #23282d;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.support-form-container {
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.wp-multi-support-form .form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wp-multi-support-form label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.wp-multi-support-form input[type="text"],
|
||||
.wp-multi-support-form textarea,
|
||||
.wp-multi-support-form select {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wp-multi-support-form textarea {
|
||||
height: 120px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.wp-multi-support-form .submit-button {
|
||||
background-color: #0073aa;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.wp-multi-support-form .submit-button:hover {
|
||||
background-color: #005d82;
|
||||
}
|
||||
|
||||
.response-message {
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.success-message {
|
||||
color: #155724;
|
||||
background-color: #d4edda;
|
||||
border: 1px solid #c3e6cb;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
color: #721c24;
|
||||
background-color: #f8d7da;
|
||||
border: 1px solid #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
// Menüseite hinzufügen
|
||||
function add_support_ticket_page() {
|
||||
add_menu_page(
|
||||
'WP-Multi Support',
|
||||
'WP-Multi Support',
|
||||
'manage_options',
|
||||
'wp_multi_support',
|
||||
'support_ticket_form'
|
||||
);
|
||||
}
|
||||
|
||||
add_action('admin_menu', 'add_support_ticket_page');
|
||||
|
||||
|
||||
/*
|
||||
// ### Update Funktion ###
|
||||
*/
|
||||
|
||||
define('WPMT_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
|
||||
// Textdomain laden
|
||||
@ -50,17 +320,6 @@ function wpmt_enable_multi_callback() {
|
||||
echo '<input type="checkbox" name="wpmt_multi_settings[enable_multi]" value="1" ' . checked(1, $options['enable_multi'], false) . ' />';
|
||||
}
|
||||
|
||||
function wpmt_add_admin_menu() {
|
||||
add_options_page(
|
||||
__('WP Multi Toolkit Einstellungen', 'wp-multi-toolkit'),
|
||||
__('WP Multi Toolkit', 'wp-multi-toolkit'),
|
||||
'manage_options',
|
||||
'wpmt_settings',
|
||||
'wpmt_settings_page'
|
||||
);
|
||||
}
|
||||
add_action('admin_menu', 'wpmt_add_admin_menu');
|
||||
|
||||
function wpmt_settings_page() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
@ -86,6 +345,110 @@ function wpmt_multi_shortcode($atts) {
|
||||
}
|
||||
add_shortcode('wpmt_multi', 'wpmt_multi_shortcode');
|
||||
|
||||
// ### Automatisierte Plugin-Dokumentation ###
|
||||
|
||||
// Funktion zur Generierung der Dokumentation
|
||||
function wpmt_generate_plugin_docs() {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
$installed_plugins = get_plugins();
|
||||
$wp_multi_plugins = array(
|
||||
'wp-multi-toolkit' => array(
|
||||
'file' => 'wp-multi-toolkit/wp-multi-toolkit.php',
|
||||
'name' => 'WP Multi Toolkit',
|
||||
'description' => __('Zentrales Toolkit für die WP Multi Plugin-Reihe mit Update-Management und Support-Funktionen.', 'wp-multi-toolkit'),
|
||||
'repo' => 'wp-multi-toolkit'
|
||||
),
|
||||
'wp-multi' => array(
|
||||
'file' => 'WP-Multi/wp-multi.php',
|
||||
'name' => 'WP Multi',
|
||||
'description' => __('Hauptplugin für Multi-Funktionen mit Shortcode-Unterstützung.', 'wp-multi-toolkit'),
|
||||
'repo' => 'wp-multi'
|
||||
),
|
||||
'wp-multi-search' => array(
|
||||
'file' => 'wp-multi-search/wp-multi-search.php',
|
||||
'name' => 'WP Multi Search',
|
||||
'description' => __('Erweiterte Suchfunktionen für WordPress.', 'wp-multi-toolkit'),
|
||||
'repo' => 'WP-Multi-Search'
|
||||
),
|
||||
'wp-multi-comment-notifications' => array(
|
||||
'file' => 'wp-multi-comment-notifications/wp-multi-comment-notifications.php',
|
||||
'name' => 'WP Multi Comment Notifications',
|
||||
'description' => __('Automatische Benachrichtigungen für neue Kommentare.', 'wp-multi-toolkit'),
|
||||
'repo' => 'wp-multi-comment-notifications'
|
||||
),
|
||||
'wp-multi-kategorie' => array(
|
||||
'file' => 'wp-multi-kategorie/wp-multi-kategorie.php',
|
||||
'name' => 'WP Multi Kategorie',
|
||||
'repo' => 'wp-multi-kategorie'
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php echo esc_html__('WP Multi Plugin-Dokumentation', 'wp-multi-toolkit'); ?></h1>
|
||||
<p><?php echo esc_html__('Hier finden Sie eine Übersicht aller WP Multi Plugins, einschließlich Versionen und grundlegender Informationen.', 'wp-multi-toolkit'); ?></p>
|
||||
|
||||
<?php foreach ($wp_multi_plugins as $key => $plugin) : ?>
|
||||
<div class="wpmt-docs-section">
|
||||
<h2><?php echo esc_html($plugin['name']); ?></h2>
|
||||
<?php
|
||||
$is_installed = array_key_exists($plugin['file'], $installed_plugins);
|
||||
if ($is_installed) {
|
||||
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin['file']);
|
||||
$is_active = is_plugin_active($plugin['file']);
|
||||
?>
|
||||
<p><strong><?php echo esc_html__('Status', 'wp-multi-toolkit'); ?>:</strong> <?php echo $is_active ? esc_html__('Aktiv', 'wp-multi-toolkit') : esc_html__('Inaktiv', 'wp-multi-toolkit'); ?></p>
|
||||
<p><strong><?php echo esc_html__('Version', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html($plugin_data['Version']); ?></p>
|
||||
<p><strong><?php echo esc_html__('Beschreibung', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html($plugin_data['Description']); ?></p>
|
||||
<p><strong><?php echo esc_html__('Plugin-URI', 'wp-multi-toolkit'); ?>:</strong> <a href="<?php echo esc_url($plugin_data['PluginURI']); ?>" target="_blank"><?php echo esc_url($plugin_data['PluginURI']); ?></a></p>
|
||||
<?php if (!empty($plugin_data['RequiresWP'])) : ?>
|
||||
<p><strong><?php echo esc_html__('Benötigt WordPress', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html($plugin_data['RequiresWP']); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($plugin_data['TestedWP'])) : ?>
|
||||
<p><strong><?php echo esc_html__('Getestet bis WordPress', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html($plugin_data['TestedWP']); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php } else { ?>
|
||||
<p><strong><?php echo esc_html__('Status', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html__('Nicht installiert', 'wp-multi-toolkit'); ?></p>
|
||||
<p><strong><?php echo esc_html__('Beschreibung', 'wp-multi-toolkit'); ?>:</strong> <?php echo esc_html($plugin['description']); ?></p>
|
||||
<p><strong><?php echo esc_html__('Download', 'wp-multi-toolkit'); ?>:</strong> <a href="https://git.viper.ipv64.net/M_Viper/<?php echo esc_attr($plugin['repo']); ?>/releases" target="_blank"><?php echo esc_html__('Download-Seite', 'wp-multi-toolkit'); ?></a></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.wpmt-docs-section {
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
}
|
||||
.wpmt-docs-section h2 {
|
||||
margin-top: 0;
|
||||
color: #23282d;
|
||||
}
|
||||
.wpmt-docs-section p {
|
||||
margin: 5px 0;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Menüseite für Dokumentation hinzufügen
|
||||
function wpmt_add_docs_page() {
|
||||
add_submenu_page(
|
||||
'wp_multi_support', // Eltern-Slug
|
||||
__('WP Multi Dokumentation', 'wp-multi-toolkit'), // Seitentitel
|
||||
__('Dokumentation', 'wp-multi-toolkit'), // Menüname
|
||||
'manage_options', // Berechtigung
|
||||
'wpmt_docs', // Slug
|
||||
'wpmt_generate_plugin_docs' // Funktion
|
||||
);
|
||||
}
|
||||
add_action('admin_menu', 'wpmt_add_docs_page');
|
||||
|
||||
// ### Update-Management ###
|
||||
|
||||
// Widget zum Admin-Dashboard hinzufügen
|
||||
@ -193,7 +556,7 @@ function wpmt_update_check() {
|
||||
if ($valid_release) {
|
||||
$latest_version = $valid_release['tag_name'];
|
||||
$release_notes = $valid_release['body'] ?? '';
|
||||
$is_prerelease = isset($valid_release['prerelease']) && $valid_release['prerelease'];
|
||||
$is_prerelease = isset($release['prerelease']) && $release['prerelease'];
|
||||
|
||||
update_option("wpmt_update_latest_version_{$repo}", $latest_version);
|
||||
update_option("wpmt_update_release_notes_{$repo}", $release_notes);
|
||||
@ -204,13 +567,27 @@ function wpmt_update_check() {
|
||||
}
|
||||
add_action('wpmt_update_check_event', 'wpmt_update_check');
|
||||
|
||||
// Callback-Funktion für das Widget
|
||||
// Funktion zur Überprüfung des Update-Server-Status
|
||||
function wpmt_check_update_server_status() {
|
||||
$update_server_url = 'https://git.viper.ipv64.net';
|
||||
$response = wp_remote_head($update_server_url, array('timeout' => 5));
|
||||
return !is_wp_error($response) && wp_remote_retrieve_response_code($response) == 200;
|
||||
}
|
||||
|
||||
// Callback-Funktion für das Widget mit nur Offline-Anzeige
|
||||
function wpmt_update_dashboard_widget_content() {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
$installed_plugins = get_plugins();
|
||||
$show_prereleases = get_option('wpmt_update_show_prereleases', false);
|
||||
|
||||
// Update-Server-Status nur bei Offline anzeigen
|
||||
$server_online = wpmt_check_update_server_status();
|
||||
if (!$server_online) {
|
||||
echo '<p style="text-align: center; color: red;">🔴 ' . __('Update Server offline', 'wp-multi-toolkit') . '</p>';
|
||||
echo '<hr style="margin: 20px 0;">';
|
||||
}
|
||||
|
||||
$plugins_to_check = array(
|
||||
'wp-multi-toolkit' => array(
|
||||
'file' => 'wp-multi-toolkit/wp-multi-toolkit.php',
|
||||
@ -231,6 +608,11 @@ function wpmt_update_dashboard_widget_content() {
|
||||
'file' => 'wp-multi-comment-notifications/wp-multi-comment-notifications.php',
|
||||
'name' => 'WP Multi Comment Notifications',
|
||||
'repo' => 'wp-multi-comment-notifications'
|
||||
),
|
||||
'wp-multi-kategorie' => array(
|
||||
'file' => 'wp-multi-kategorie/wp-multi-kategorie.php',
|
||||
'name' => 'WP Multi Kategorie',
|
||||
'repo' => 'wp-multi-kategorie'
|
||||
)
|
||||
);
|
||||
|
||||
@ -247,7 +629,7 @@ function wpmt_update_dashboard_widget_content() {
|
||||
|
||||
echo '<h4>' . esc_html($plugin['name']) . '</h4>';
|
||||
if ($valid_release === false) {
|
||||
printf('<p>%s</p>', esc_html__('Fehler beim Abrufen der Versionsinformationen von Gitea.', 'wp-multi-toolkit'));
|
||||
printf('<p>%s</p>', esc_html__('Fehler beim Abrufen der Versionsinformationen.', 'wp-multi-toolkit'));
|
||||
} elseif ($valid_release) {
|
||||
$latest_version = $valid_release['tag_name'];
|
||||
$release_notes = $valid_release['body'] ?? '';
|
||||
@ -332,6 +714,11 @@ function wpmt_update_dashboard_widget_content() {
|
||||
'file' => 'wp-multi-comment-notifications/wp-multi-comment-notifications.php',
|
||||
'download_url' => 'https://git.viper.ipv64.net/M_Viper/wp-multi-comment-notifications/releases',
|
||||
'description' => __('Kommentar-Benachrichtigungen.', 'wp-multi-toolkit')
|
||||
),
|
||||
'wp-multi-kategorie' => array(
|
||||
'file' => 'wp-multi-kategorie/wp-multi-kategorie.php',
|
||||
'download_url' => 'https://git.viper.ipv64.net/M_Viper/wp-multi-kategorie/releases',
|
||||
'description' => __('Erweiterte Kategorie-Funktionen für WP Multi.', 'wp-multi-toolkit')
|
||||
)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user