<?php
/**
 * Plugin Name: Dollie AI - Connect
 * Description: Connect your WordPress site to Dollie — your Agency HQ for the AI Era.
 * Version: 7.0.3
 * Text Domain: dollie
 * Domain Path: /languages/
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

// Bail out if the plugin is already loaded.
if ( defined( 'PLATFORM_VERSION' ) ) {
	return;
}

define( 'PLATFORM_PLUGIN_SLUG', 'platform' );
define( 'PLATFORM_VERSION', '7.0.3' );

if ( defined( 'WPD_PLATFORM_IS_MU' ) && WPD_PLATFORM_IS_MU ) {
	if ( ! defined( 'PLATFORM_PLUGIN_DIR' ) ) {
		define( 'PLATFORM_PLUGIN_DIR', WPMU_PLUGIN_DIR . '/platform/' );
	}
	define( 'PLATFORM_PLUGIN_URL', WPMU_PLUGIN_URL . '/platform/' );
} else {
	define( 'PLATFORM_PLUGIN_FILE', __FILE__ );
	if ( ! defined( 'PLATFORM_PLUGIN_DIR' ) ) {
		define( 'PLATFORM_PLUGIN_DIR', plugin_dir_path( PLATFORM_PLUGIN_FILE ) );
	}
	define( 'PLATFORM_PLUGIN_URL', plugins_url( '/', PLATFORM_PLUGIN_FILE ) );
}

// SDK URL for integration assets (icons, etc.)
if ( ! defined( 'DOLLIE_SDK_URL' ) ) {
	define( 'DOLLIE_SDK_URL', PLATFORM_PLUGIN_URL );
}
if ( ! defined( 'DOLLIE_ASSETS_URL' ) ) {
	define( 'DOLLIE_ASSETS_URL', PLATFORM_PLUGIN_URL . 'assets/' );
}


// Autoload.
require_once 'bootstrap.php';

\WPD_Platform\EarlyLoad::run();

/**
 * Load Dollie AI - Connect
 */

add_action( 'plugins_loaded', function() {
	\WPD_Platform\Plugin::instance();
}, -10 );

// Register the plugin activation hook.
register_activation_hook( __FILE__, function() {
	\WPD_Platform\Plugin::instance()->activate_plugin();
} );
register_uninstall_hook( __FILE__, array( '\WPD_Platform\Plugin', 'uninstall_plugin' ) );

if ( ! defined( 'WPD_PARTNER_ID' ) ) {
	define( 'WPD_PARTNER_ID', '[[partnerId]]' );
}
define( 'WPD_WHITELABEL', '[[whitelabel]]' );
