<?php
/**
 * PHP version 7.4
 *
 * Plugin wp-irent is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Plugin Name: i-rent.net
 * Description: Property management system for holiday homes (PMS)
 * Author: i-rent.net
 * Author URI:  https://i-rent.net
 * Version:     2.3.1
 * Requires at least: 4.7
 * Requires PHP: 7.4
 * Text Domain: single-page-booking-system
 * License:     GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Icon: assets/img/Icon.svg
 *
 * @category   Plugins
 * @package    Wordpress_I-rent.net
 * @subpackage I-rent.net/WordpressPMS
 * @author     Irent <soporte@i-rent.net>
 * @license    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL-2.0-or-later
 * @link       https://i-rent.net
 */

// Prevent direct execution of the script if accessed outside of WordPress
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}

define('IRENT_PLUGIN_VERSION', get_file_data(__FILE__, ['Version' => 'Version'])['Version']);

// Hook to initialize plugin access for admin users
add_action('admin_init', 'Irent_Grant_Access');

// Register a function to execute when the plugin is activated
register_activation_hook(__FILE__, 'Irent_Plugin_activate');

// Register a function to execute when the plugin is deactivated
register_deactivation_hook(__FILE__, 'Irent_Plugin_deactivate');

// Register the admin menu for the plugin
add_action('admin_menu', 'Irent_Plugin_menu');

// Register the shortcode for users to generate a script
add_shortcode('irent_script', 'Irent_Generate_ShortCode_Script');

// Register the shortcode for users to use the quick search functionality
add_shortcode('irent_quicksearch', 'Irent_Generate_ShortCode_QuickSearch');

// Set translations for the text domain
add_action('init', 'Irent_Load_Translations');

// Include additional PHP files for utility functions and components
include 'config.php';                      // Environment configuration
include 'includes/functions.php';          // Utility functions
include 'views/admin/options-page.php';    // Options page for the plugin
include 'views/public/quick-search.php';   // Quick search functionality
include 'views/public/script.php';         // Script functions
