<?php
// Silence may be golden, but sometimes words paint the canvas of understanding.

/**
 * 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.
 *
 * @since             1.0.0
 * @package           Plugli\Linksy\SearchAndReplace
 *
 * @wordpress-plugin
 * Plugin Name:         Linksy Search and Replace
 * Plugin URI:          https://plugli.com/linksy/
 * Description:         Linksy Search and Replace.
 * Version:             1.0.4
 * Author:              Plugli
 * Author URI:          https://plugli.com/
 * License:             GPL-2.0+
 * License URI:         http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:         linksy-search-and-replace
 */

namespace Plugli\Linksy\SearchAndReplace;

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

// ini_set('memory_limit', '128M'); todo: set in function

/**
 * Define Constants
 */

define('LINKSYAI_SAR_PLUGIN_NAME', 'Linksy');

define('LINKSYAI_SAR_PLUGIN_VERSION', '1.0.4');

define('LINKSYAI_SAR_PLUGIN_FILE', __FILE__);

define('LINKSYAI_SAR_PLUGIN_DIR', plugin_dir_path(__FILE__));

define('LINKSYAI_SAR_PLUGIN_URL', plugin_dir_url(__FILE__));

define('LINKSYAI_SAR_PLUGIN_BASENAME', plugin_basename(__FILE__));

define('LINKSYAI_SAR_PLUGIN_TEXT_DOMAIN', 'linksy');


/**
 * Linksy Constants
 */
require_once(LINKSYAI_SAR_PLUGIN_DIR . 'constants.php');

/**
 * Autoload Classes
 */
require_once(LINKSYAI_SAR_PLUGIN_DIR . 'vendor/autoload.php');


/**
 * Register Activation and Deactivation Hooks
 * This action is documented in inc/core/class-activator.php
 */

register_activation_hook(__FILE__, array('Plugli\Linksy\SearchAndReplace\Core\Activator', 'activate'));

/**
 * The code that runs during plugin deactivation.
 * This action is documented inc/core/class-deactivator.php
 */

register_deactivation_hook(__FILE__, array('Plugli\Linksy\SearchAndReplace\Core\Deactivator', 'deactivate'));


/**
 * 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.
 *
 * Also returns copy of the app object so 3rd party developers
 * can interact with the plugin's hooks contained within.
 **/
function wp_linksyai_init()
{
    (new Core\Init())->run();
}

// Check the minimum required PHP version and run the plugin.
if (version_compare(PHP_VERSION, '7.0', '>=')) {
    wp_linksyai_init();
}
