<?php
/*
 * Plugin Name:       SecureAuth Authenticator 2FA
 * Description:       Menambahkan fitur SecureAuth Authenticator 2FA pada halaman login WordPress
 * Version:           1.0.0
 * Author:            Helmi
 * Author URI:        https://helmimubarak.wordpress.com/
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       secureauth-authenticator-2fa
 * Domain Path:       /languages
 */

// Jika file ini dipanggil langsung, keluar.
if (!defined('WPINC')) {
    die;
}

// Definisikan konstanta plugin
define('SA2FA_VERSION', '1.0.0');
define('SA2FA_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('SA2FA_PLUGIN_URL', plugin_dir_url(__FILE__));

// Sertakan library SecureAuth Authenticator
require_once SA2FA_PLUGIN_DIR . 'includes/class-secureauth-authenticator.php';

// Sertakan file utama plugin
require_once SA2FA_PLUGIN_DIR . 'includes/class-secureauth-authenticator-2fa.php';

// Fungsi yang dijalankan saat plugin diaktifkan
function sa2fa_activate() {
    require_once SA2FA_PLUGIN_DIR . 'includes/class-secureauth-authenticator-2fa-activator.php';
    SA2FA_Activator::activate();
}

// Fungsi yang dijalankan saat plugin dinonaktifkan
function sa2fa_deactivate() {
    require_once SA2FA_PLUGIN_DIR . 'includes/class-secureauth-authenticator-2fa-deactivator.php';
    SA2FA_Deactivator::deactivate();
}

register_activation_hook(__FILE__, 'sa2fa_activate');
register_deactivation_hook(__FILE__, 'sa2fa_deactivate');

// Mulai plugin
$plugin = new SecureAuth_Authenticator_2FA();
$plugin->run();