-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcan-stealth-bot-trap.php
More file actions
36 lines (30 loc) · 1.23 KB
/
can-stealth-bot-trap.php
File metadata and controls
36 lines (30 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Plugin Name: CAN Stealth Bot Trap
* Description: Silently blocks aggressive crawlers using behavior-based detection for logged-out users only.
* Version: 2.6.2
* Author: Creative Applications Network
*/
if (!defined('ABSPATH')) exit;
require_once plugin_dir_path(__FILE__) . 'includes/class-stealth-bot-trap.php';
require_once plugin_dir_path(__FILE__) . 'includes/class-detection-layers.php';
require_once plugin_dir_path(__FILE__) . 'includes/class-admin.php';
require_once plugin_dir_path(__FILE__) . 'includes/class-admin-dashboard.php';
// This global variable is the "Brain" of your plugin
global $sbt_core;
add_action('plugins_loaded', function() {
global $sbt_core;
$sbt_core = new SBT_Stealth_Bot_Trap();
// Pass the core to the other classes so they share settings/database
new SBT_Detection_Layers($sbt_core);
new SBT_Admin($sbt_core);
});
// Activation logic (remains the same)
register_activation_hook(__FILE__, 'sbt_activate_plugin_logic');
function sbt_activate_plugin_logic() {
if (!class_exists('SBT_Stealth_Bot_Trap')) {
require_once plugin_dir_path(__FILE__) . 'includes/class-stealth-bot-trap.php';
}
$installer = new SBT_Stealth_Bot_Trap();
$installer->activate_plugin();
}