<?php
/**
 * Plugin Name: A1JSpamGuard
 * Plugin URI: https://a1jbot.com/
 * Description: Lightweight spam blocker to prevent bots and spam comments.
 * Version: 1.0.0
 * Author: A1JBot Team
 * Author URI: https://a1jbot.com/
 * License: GPL2
 */

defined('ABSPATH') or die('No script kiddies please!');

// Basic spam block by disabling comments if bot is detected
add_filter('pre_comment_approved', 'a1jspamguard_block_spam', 99, 2);
function a1jspamguard_block_spam($approved, $commentdata) {
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'bot') !== false) {
        return 'spam';
    }
    return $approved;
}
