<?php
/**
 * Plugin Name: Visitor Lens
 * Plugin URI:  https://myrecorp.com
 * Description: Lightweight visitor analytics, session recording & replay for WordPress. Track clicks, scrolls, mouse movements, inputs and more — then replay sessions visually.
 * Version:     1.0.0
 * Author:      Rayhan Kabir
 * Author URI:  https://upwork.com/fl/rayhan1
 * License:     GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: visitor-lens
 * Domain Path: /languages
 * Requires at least: 6.2
 * Requires PHP: 7.4
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

define( 'VLENS_VERSION',     '1.0.6' );
define( 'VLENS_PLUGIN_FILE', __FILE__ );
define( 'VLENS_PLUGIN_DIR',  plugin_dir_path( __FILE__ ) );
define( 'VLENS_PLUGIN_URL',  plugin_dir_url( __FILE__ ) );
define( 'VLENS_TABLE_PREFIX', 'vlens_' );

// Capability required to open the VisitorLens admin pages. Site admins get it
// implicitly (see VLENS_Admin_Menu::map_admin_capability); the premium team
// module grants it to team members so they can reach the pages without holding
// manage_options.
define( 'VLENS_CAP', 'vlens_access' );

// Load all includes
require_once VLENS_PLUGIN_DIR . 'includes/class-activator.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-deactivator.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-helpers.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-frontend-scripts.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-admin-menu.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-admin-assets.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-settings.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-cron.php';
require_once VLENS_PLUGIN_DIR . 'rest/class-rest-track.php';
require_once VLENS_PLUGIN_DIR . 'rest/class-rest-record.php';
require_once VLENS_PLUGIN_DIR . 'rest/class-rest-replay.php';
require_once VLENS_PLUGIN_DIR . 'rest/class-rest-stats.php';
require_once VLENS_PLUGIN_DIR . 'rest/class-rest-settings.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-privacy.php';
require_once VLENS_PLUGIN_DIR . 'includes/class-plugin.php';

// Premium features are delivered as a separate plugin (visitor-lens-premium).
// No embedded loading needed here.

// Activation / deactivation hooks
register_activation_hook( __FILE__, [ 'VLENS_Activator', 'activate' ] );
register_deactivation_hook( __FILE__, [ 'VLENS_Deactivator', 'deactivate' ] );

// Boot the plugin
add_action( 'plugins_loaded', [ 'VLENS_Plugin', 'instance' ] );
