110 lines
3.5 KiB
PHP
110 lines
3.5 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: WP Multi
|
|
* Plugin URI: https://git.viper.ipv64.net/M_Viper/wp-multi
|
|
* Description: Erweiterter Anti-Spam-Schutz mit Honeypot, Keyword-Filter, Link-Limit und mehr. Jetzt mit Statistik im Dashboard und HappyForms-Integration.
|
|
* Version: 3.6
|
|
* Author: M_Viper
|
|
* Author URI: https://m-viper.de
|
|
* Requires at least: 6.7.2
|
|
* Tested up to: 6.7.2
|
|
* PHP Version: 7.2
|
|
* License: GPL2
|
|
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
|
* Text Domain: wp-multi
|
|
* Tags: anti-spam, security, honeypot, comment-protection, statistics, happyforms
|
|
* Support: [Telegram Support](https://t.me/M_Viper04)
|
|
* Support: [Discord Support](https://discord.com/invite/FdRs4BRd8D)
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
|
|
// Funktion zur Überprüfung des WP Multi Toolkit Plugins
|
|
function wp_multi_check_dependency() {
|
|
if (!function_exists('is_plugin_active')) {
|
|
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
|
}
|
|
|
|
// Prüft, ob WP Multi Toolkit installiert und aktiv ist
|
|
if (!is_plugin_active('wp-multi-toolkit/wp-multi-toolkit.php')) {
|
|
add_action('admin_notices', 'wp_multi_dependency_notice');
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Fehlermeldung für Admin-Bereich mit Download-Button
|
|
function wp_multi_dependency_notice() {
|
|
?>
|
|
<div class="notice notice-error">
|
|
<p>
|
|
<?php _e('Das Plugin "WP Multi" benötigt "WP Multi Toolkit", um zu funktionieren. Bitte installieren und aktivieren Sie "WP Multi Toolkit".', 'wp-multi'); ?>
|
|
<a href="https://git.viper.ipv64.net/M_Viper/wp-multi-toolkit/releases" target="_blank" class="button button-primary" style="margin-left: 10px;">
|
|
<?php _e('WP Multi Toolkit herunterladen', 'wp-multi'); ?>
|
|
</a>
|
|
</p>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
// Plugin nur initialisieren, wenn Abhängigkeit erfüllt ist.
|
|
// Ohne "WP Multi Toolkit" wird die restliche Datei nicht ausgeführt: kein
|
|
// Hook, Shortcode oder Filter dieses Plugins registriert sich dann.
|
|
if (!wp_multi_check_dependency()) {
|
|
add_action('admin_init', function() {
|
|
deactivate_plugins(plugin_basename(__FILE__));
|
|
});
|
|
return;
|
|
}
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Modul-Loader: Jedes Feature liegt als eigene Datei unter includes/.
|
|
// Diese Datei enthält nur noch Plugin-Kopf, Abhängigkeitsprüfung und den Loader.
|
|
// ---------------------------------------------------------------------------
|
|
|
|
define('WP_MULTI_FILE', __FILE__);
|
|
define('WP_MULTI_DIR', plugin_dir_path(__FILE__));
|
|
define('WP_MULTI_URL', plugin_dir_url(__FILE__));
|
|
|
|
$wp_multi_modules = array(
|
|
'admin-banner',
|
|
'update-check',
|
|
'admin-menu',
|
|
'alphabetical-index',
|
|
'disposable-email',
|
|
'copy-protection',
|
|
'disable-login',
|
|
'login-url',
|
|
'login-design',
|
|
'auto-tags',
|
|
'anti-spam',
|
|
'comment-filter',
|
|
'brute-force',
|
|
'message-board',
|
|
'analytics',
|
|
'blocked-users',
|
|
'shortcodes',
|
|
'notify',
|
|
'notify-discord',
|
|
'notify-telegram',
|
|
'notify-dashboard',
|
|
'guest-authors',
|
|
'publication-stats',
|
|
'custom-text',
|
|
'custom-admin-links',
|
|
'post-report',
|
|
'bookmarks',
|
|
'statistik-manager',
|
|
);
|
|
|
|
foreach ($wp_multi_modules as $wp_multi_module) {
|
|
$wp_multi_module_file = WP_MULTI_DIR . 'includes/' . $wp_multi_module . '.php';
|
|
if (file_exists($wp_multi_module_file)) {
|
|
require_once $wp_multi_module_file;
|
|
}
|
|
}
|