<?php
/**
 * Plugin Name:       VMPlayer
 * Plugin URI:        https://gandenterprisesinc.com/vmplayer
 * Description:       A modern streaming radio player with Shoutcast, Icecast, HLS, and direct stream support. Up to 5 station presets, live metadata, EQ visualizer, and pop-out window.
 * Version:           1.1.5
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * Author:            G & D Enterprises Inc
 * Author URI:        https://gandenterprisesinc.com
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       vmplayer
 * Domain Path:       /languages
 *
 * @package VMPlayer
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Plugin version.
 */
define( 'VMPLAYER_VERSION', '1.1.5' );

/**
 * Absolute path to main plugin file.
 */
define( 'VMPLAYER_PLUGIN_FILE', __FILE__ );

/**
 * Plugin directory path with trailing slash.
 */
define( 'VMPLAYER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

/**
 * Plugin directory URL with trailing slash.
 */
define( 'VMPLAYER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );

/**
 * Plugin basename for use in hooks.
 */
define( 'VMPLAYER_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

/**
 * Minimum required PHP version.
 */
define( 'VMPLAYER_MIN_PHP', '7.4' );

/**
 * Minimum required WordPress version.
 */
define( 'VMPLAYER_MIN_WP', '5.8' );

/**
 * Plugin slug, used as text domain and option prefix.
 */
define( 'VMPLAYER_SLUG', 'vmplayer' );

/**
 * Plugin activation callback.
 *
 * @return void
 */
function vmplayer_activate() {
    require_once VMPLAYER_PLUGIN_DIR . 'includes/class-vmplayer-activator.php';
    VMPlayer_Activator::activate();
}

/**
 * Plugin deactivation callback.
 *
 * @return void
 */
function vmplayer_deactivate() {
    require_once VMPLAYER_PLUGIN_DIR . 'includes/class-vmplayer-deactivator.php';
    VMPlayer_Deactivator::deactivate();
}

register_activation_hook( __FILE__, 'vmplayer_activate' );
register_deactivation_hook( __FILE__, 'vmplayer_deactivate' );

/**
 * Load required core class files.
 */
require_once VMPLAYER_PLUGIN_DIR . 'includes/class-vmplayer-loader.php';
require_once VMPLAYER_PLUGIN_DIR . 'includes/class-vmplayer.php';

/**
 * Bootstrap the plugin.
 *
 * Instantiates the main plugin class on plugins_loaded so all WordPress
 * core APIs are available. Uses get_instance() to enforce singleton pattern.
 *
 * @return void
 */
function vmplayer_run() {
    $plugin = VMPlayer::get_instance();
    $plugin->run();
}

add_action( 'plugins_loaded', 'vmplayer_run' );
