load_dependencies(); $this->setup_components(); $this->define_admin_hooks(); $this->define_public_hooks(); } /** * Load required dependencies */ private function load_dependencies(): void { // Integration components require_once AI_BOTKIT_INCLUDES_DIR . 'integration/class-rest-api.php'; require_once AI_BOTKIT_INCLUDES_DIR . 'integration/class-api-handler.php'; // Admin and public require_once AI_BOTKIT_INCLUDES_DIR . 'admin/class-admin.php'; require_once AI_BOTKIT_INCLUDES_DIR . 'admin/class-ajax-handler.php'; require_once AI_BOTKIT_INCLUDES_DIR . 'public/class-shortcode-handler.php'; } /** * Setup plugin components */ private function setup_components(): void { // Initialize integration components $this->rest_api = new REST_API(); $this->api_handler = new \AI_BotKit\Integration\API_Handler(); // Initialize interface components $this->admin = new Admin($this->get_plugin_name(), $this->get_version()); $this->shortcode_handler = new Shortcode_Handler(); } /** * Register admin hooks */ private function define_admin_hooks(): void { // Admin menu and pages add_action('admin_menu', [$this->admin, 'add_plugin_admin_menu']); // Admin assets add_action('admin_enqueue_scripts', [$this->admin, 'enqueue_styles']); add_action('admin_enqueue_scripts', [$this->admin, 'enqueue_scripts']); } /** * Register public hooks */ private function define_public_hooks(): void { add_action('wp_footer', [$this->shortcode_handler, 'render_sitewide_chatbot']); } /** * Run the plugin */ public function run(): void { do_action('ai_botkit_init', $this); } /** * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * * @return string The name of the plugin. */ public function get_plugin_name(): string { return 'ai-botkit-for-lead-generation'; } /** * Retrieve the version number of the plugin. * * @return string The version number of the plugin. */ public function get_version(): string { return defined('AI_BOTKIT_VERSION') ? AI_BOTKIT_VERSION : '1.0.0'; } }