<?php
/**
 * Tools Module Bootstrap
 *
 * @package VMPFence
 * @subpackage Tools
 * @since 2.1.0
 * @since 2.2.0 Load Diagnostic models
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

// Load models early (before hooks)
require_once plugin_dir_path(__FILE__) . 'models/class-request-model.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic-logger.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic-filter.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic-filter-collection.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic-groupby.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic-query.php';
require_once plugin_dir_path(__FILE__) . 'models/class-live-traffic.php';

// Load Diagnostic models
require_once plugin_dir_path(__FILE__) . 'models/class-diagnostic.php';
require_once plugin_dir_path(__FILE__) . 'models/class-diagnostic-report.php';

// Load WHOIS Lookup class (needed for AJAX)
require_once plugin_dir_path(__FILE__) . 'class-whois-lookup.php';

/**
 * Initialize Tools Module
 *
 * @since 2.1.0
 */
function vmpfence_tools_init() {
    // Load AJAX handlers
    if (is_admin()) {
        require_once plugin_dir_path(__FILE__) . 'ajax/tools-ajax.php';
    }
}

add_action('init', 'vmpfence_tools_init');
