' . esc_html__( 'Botward is already loaded from another plugin folder (free and Pro versions cannot run together). Deactivate one of them.', 'botward' ) . '

'; } ); return; } define( 'BOTWARD_VERSION', '1.7.5' ); define( 'BOTWARD_FILE', __FILE__ ); define( 'BOTWARD_DIR', plugin_dir_path( __FILE__ ) ); define( 'BOTWARD_URL', plugin_dir_url( __FILE__ ) ); require_once BOTWARD_DIR . 'includes/class-settings.php'; require_once BOTWARD_DIR . 'includes/class-ip.php'; require_once BOTWARD_DIR . 'includes/class-db.php'; require_once BOTWARD_DIR . 'includes/class-risk.php'; require_once BOTWARD_DIR . 'includes/class-beacon.php'; require_once BOTWARD_DIR . 'includes/class-shield.php'; require_once BOTWARD_DIR . 'includes/class-gate.php'; require_once BOTWARD_DIR . 'includes/class-cache.php'; require_once BOTWARD_DIR . 'includes/class-license.php'; // Pro-функции: файлы есть только в сборке Botward Pro и включаются действующей лицензией или пробным периодом. if ( Botward_License::is_pro() ) { require_once BOTWARD_DIR . 'includes/pro/loader.php'; } Botward_License::boot(); // Переводы: на wordpress.org их загружает WordPress. В Pro-сборке есть собственный загрузчик. if ( file_exists( BOTWARD_DIR . 'includes/pro/i18n.php' ) ) { require_once BOTWARD_DIR . 'includes/pro/i18n.php'; } // Миграция настроек при обновлении с предыдущих версий. add_action( 'plugins_loaded', array( 'Botward_Settings', 'maybe_upgrade' ), 0 ); if ( is_admin() ) { require_once BOTWARD_DIR . 'includes/class-dashboard.php'; require_once BOTWARD_DIR . 'includes/class-admin.php'; Botward_Admin::boot(); } Botward_Gate::boot(); Botward_Shield::boot(); Botward_Beacon::boot(); Botward_Cache::boot(); // Ежедневная очистка старых записей. add_action( 'botward_daily_cleanup', array( 'Botward_DB', 'cleanup' ) ); register_activation_hook( __FILE__, static function (): void { Botward_DB::install(); Botward_Settings::secret(); // генерируем секретный ключ при первой активации if ( ! wp_next_scheduled( 'botward_daily_cleanup' ) ) { wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', 'botward_daily_cleanup' ); } Botward_Cache::refresh_wp_rocket(); } ); register_deactivation_hook( __FILE__, static function (): void { wp_clear_scheduled_hook( 'botward_daily_cleanup' ); wp_clear_scheduled_hook( 'botward_tg_tick' ); Botward_Cache::on_deactivate(); } );