<?php
/**
 * Plugin Name: Submission Inbox
 * Description: Create lead forms, save submissions, send WordPress emails through SMTP, and review email status.
 * Version: 1.0.0
 * Requires at least: 6.0
 * Requires PHP: 7.4
 * Author: phpner
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: submission-inbox
 * Domain Path: /languages
 *
 * @package SubmissionInbox
 */

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

define( 'SUBIN_PLUGIN_FILE', __FILE__ );
define( 'SUBIN_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'SUBIN_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SUBIN_PLUGIN_VERSION', '1.0.0' );
define( 'SUBIN_PLUGIN_TEXT_DOMAIN', 'submission-inbox' );

require_once SUBIN_PLUGIN_DIR . 'includes/Settings/SettingsRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormSubmissionContext.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormFieldRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormTemplateRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/DesignSettings.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/ScopedCssGenerator.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormRenderer.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/RecaptchaVerifier.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormSubmissionHandler.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FormShortcode.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplyTemplateLibrary.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplyTemplateRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplyRuleRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplyFormProviderRegistry.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplyRuleSender.php';
require_once SUBIN_PLUGIN_DIR . 'includes/AutoReplies/AutoReplySender.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Leads/LeadRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Leads/LeadFieldRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/MailLog/MailEventRepository.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Mail/EmailErrorClassifier.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Export/CsvExporter.php';
require_once SUBIN_PLUGIN_DIR . 'includes/MailLog/MailLogger.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/ContactForm7Integration.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/WPFormsIntegration.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/FluentFormsIntegration.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/ForminatorIntegration.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Forms/NinjaFormsIntegration.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Mailer/SmtpMailer.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Retention/RetentionService.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Database.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Activator.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Deactivator.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Utils/View.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Utils/Request.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/InboxPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/EmailStatusPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/EmailLogPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/SmtpSettingsPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/FormsPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/AutoRepliesPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/Pages/SettingsPage.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Admin/AdminMenu.php';
require_once SUBIN_PLUGIN_DIR . 'includes/Plugin.php';

register_activation_hook( __FILE__, array( 'SUBIN_Activator', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'SUBIN_Deactivator', 'deactivate' ) );

/**
 * Boot the plugin.
 *
 * @return void
 */
function subin_run_plugin() {
	$plugin = new SUBIN_Plugin();
	$plugin->run();
}
add_action( 'plugins_loaded', 'subin_run_plugin' );
