feat: add Central API clients, bot rate limiting, and admin API UI
- Add ITK_HP_API and ITK_Bot_API static classes with queue/flush/cron - Add WP-Cron (5 min) + shutdown flush for both API queues - Bot Blocker and Honeypot now queue events to their respective APIs - Admin: Bot Blocker tab gains Central Bot API settings panel (enable, URL, token, test connection, flush queue, historical sync) - Admin: Honeypot tab gains Central Honeypot API settings panel - Admin JS: AJAX handlers for Test Connection and Flush Now buttons - Admin CSS: API card styles (status badge, notices, footer controls) - Add .gitignore (excludes bot-api/ which lives in CloudHost/bot-api) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -174,13 +174,15 @@ class ITK_Honeypot {
|
||||
}
|
||||
|
||||
private function log_block(string $form_type, string $reason): void {
|
||||
ITK_Database::log_honeypot([
|
||||
$event = [
|
||||
'ip' => $this->get_ip(),
|
||||
'form' => $form_type,
|
||||
'reason' => $reason,
|
||||
'uri' => $_SERVER['REQUEST_URI'] ?? '',
|
||||
'ua' => $_SERVER['HTTP_USER_AGENT'] ?? '',
|
||||
]);
|
||||
];
|
||||
ITK_Database::log_honeypot($event);
|
||||
ITK_HP_API::queue($event);
|
||||
}
|
||||
|
||||
public function validate_comment(array $comment_data): array {
|
||||
|
||||
Reference in New Issue
Block a user