<?php
/**
 * Base Add-On Class
 *
 * This abstract class provides the base functionality for all add-ons,
 * including automatic initialization of helpers and handlers, and
 * registration of the settings page display hook.
 *
 * @package miniorange-sms-order-notification-otp-verification/objects
 */

namespace WCSMSOTP\Objects;

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

/**
 * This abstract class is used to define the base class of the add-ons
 * created for the miniorange-sms-order-notification-otp-verification plugin.
 * Defines the hooks they will need to hook into and the functions that they
 * need to implement.
 */
if ( ! class_exists( 'BaseAddOn' ) ) {
	/**
	 * Base Add-On Class
	 *
	 * Abstract base class that all add-ons must extend. Provides common
	 * initialization functionality and automatically registers the settings
	 * page display hook.
	 */
	abstract class BaseAddOn implements AddOnInterface {

		/**
		 * Constructor
		 *
		 * Initializes helpers and handlers, and registers the add-on settings
		 * page display hook.
		 */
		public function __construct() {
			$this->initialize_helpers();
			$this->initialize_handlers();
			add_action( 'mowc_otp_verification_add_on_controller', array( $this, 'show_addon_settings_page' ), 1, 1 );
		}
	}
}
