feat: plugin bootstrap, autoloader, activation/deactivation hooks

This commit is contained in:
Vladimir Bryzgalov
2026-04-17 23:02:20 +05:00
parent a9d19a75a3
commit 0c1be5b4cd
2 changed files with 86 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* Plugin Name: CF7 Spam → Telegram
* Description: Пересылает spam-заявки Contact Form 7 в Telegram-группу с эвристической оценкой.
* Version: 1.0.0
* Author: Vladimir Bryzgalov
* Requires PHP: 7.4
* Requires at least: 6.0
* License: GPLv2 or later
* Text Domain: cf7-spam-to-telegram
*/
declare(strict_types=1);
if (!defined('ABSPATH')) exit;
define('CF7STG_PLUGIN_FILE', __FILE__);
define('CF7STG_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('CF7STG_PLUGIN_URL', plugin_dir_url(__FILE__));
define('CF7STG_VERSION', '1.0.0');
require_once CF7STG_PLUGIN_DIR . 'includes/class-plugin.php';
\Cf7stg\Plugin::register_autoloader();
register_activation_hook(__FILE__, ['\\Cf7stg\\Activator', 'activate']);
register_deactivation_hook(__FILE__, ['\\Cf7stg\\Activator', 'deactivate']);
add_action('plugins_loaded', static function (): void {
\Cf7stg\Plugin::instance()->boot();
});