<?php

/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * admin area. This file also includes all of the dependencies used by the plugin,
 * registers the activation and deactivation functions, and defines a function
 * that starts the plugin.
 *
 * @link               https://instantpopupbuilder.com
 * @since             1.0.0
 * @package           Instant_Popup_Builder
 *
 * @wordpress-plugin
 * Plugin Name:       Instant Popup Builder
 * Plugin URI:        https://instantpopupbuilder.com/
 * Description:       Create high-converting, mobile-friendly popups with advanced targeting, versatile triggers, and customizable templates.
 *
 * Version:           2.0.2
 *
 * Author:            Instant Popup Builder
 * Author URI:        https://instantpopupbuilder.com/about-us/
 * Text Domain:       instant-popup-builder
 *
 *
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 *
 * Requires PHP:       7.4
 * Requires at least:  6.0
 * Tested up to:       7.0
 *
 * Domain Path:       /languages
 */

// If this file is called directly, abort.
if (!defined('WPINC')) {
	die;
}

/**
 * Currently plugin version.
 * Start at version 1.0.0 and use SemVer - https://semver.org
 * Rename this for your plugin and update it as you release new versions.
 */
define('INSTANT_POPUP_BUILDER_VERSION', '2.0.2');
define('INSTANT_POPUP_BUILDER_DB_VERSION', '2.0.2');
// Transient expiration time: 30 days in seconds
define('INSTANT_POPUP_BUILDER_TRANSIENT_EXPIRATION', 30 * 24 * 60 * 60);
/**
 * The code that runs during plugin activation.
 * This action is documented in includes/class-instant-popup-builder-activator.php
 */
function instant_popup_builder_activate()
{
	require_once plugin_dir_path(__FILE__) . 'includes/class-instant-popup-builder-activator.php';
	Instant_Popup_Builder_Activator::activate();
}

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-instant-popup-builder-deactivator.php
 */
function instant_popup_builder_deactivate()
{
	require_once plugin_dir_path(__FILE__) . 'includes/class-instant-popup-builder-deactivator.php';
	Instant_Popup_Builder_Deactivator::deactivate();
}

register_activation_hook(__FILE__, 'instant_popup_builder_activate');
register_deactivation_hook(__FILE__, 'instant_popup_builder_deactivate');

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path(__FILE__) . 'includes/class-instant-popup-builder.php';

// Run additive database upgrades once per schema version. This also covers
// normal dashboard updates, where WordPress does not run the activation hook.
require_once plugin_dir_path(__FILE__) . 'includes/class-instant-popup-builder-activator.php';
Instant_Popup_Builder_Activator::maybe_upgrade();

/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * @since    1.0.0
 */
function instant_popup_builder_run()
{

	$plugin = new Instant_Popup_Builder();
	$plugin->run();
}
instant_popup_builder_run();
