<?php
use CouponsPlus\Original\Events\Registrator\EventsRegistrator;
use CouponsPlus\Original\Installation;

/*
 * Plugin Name:       Coupons+
 * Plugin URI:        https://couponspluspro.com
 * Description:       Next-generation coupon offers engine for WooCommerce. Create advanced deals, smart BOGO offers, and more!
 * Version:           1.3.0
 * Author:            Neblabs
 * Author URI:        https://neblabs.com
 * Text Domain:       coupons-plus-for-woocommerce
 * Domain Path:       /international
 * Requires at least: 5.8
 * Requires PHP:      7.4
 * Requires Plugins:  woocommerce
 * License: GPLv3
 */

/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++                                                                                                      ++
++                                                  +                                                                     ++
++                                         +     Coupons+    +                                          ++
++                                                  +                                                                     ++
++                                                                                                      ++
++                 This is a read-only directory.                                                       ++
++                 DO NOT try to edit the contents of this code base as                                 ++
++                 custom edits will be removed with future updates. If                                 ++
++                 you need to extend the default functionality provided                                ++
++                 with the current version of this plugin, please contact us.                          ++
++                                                                                                      ++
++                 The interfaces in this codebase (interfaces, classes, event hooks, etc)              ++
                   are meant to be private and as such are prone to change at any time and              ++
                    without previous notice. Only use the APIs that                                     ++
++                 we explicitly document as public online (if any).                                    ++
++                                                                                                      ++
++                 It is recommended to browse this code base using a                                   ++
++                 code editor or an IDE with namespace -> filename support.                            ++
++                                                                                                      ++
++                 CouponsPlus logic is located under the app/ directory.                               ++
++                                                                                                      ++
++                 All classes are namespaced. Namespaces are mapped 1:1 to file                        ++
++                 names and directories, with the exception of the ID.                                 ++
++                 For example, the namespace:                                                          ++
++                 -- CouponsPlus\App\Handlers\CouponsManagerHandler                                    ++
++                 is mapped to a class with the filename:                                              ++
++                 -- app/handlers/couponsmanagerhandler.php                                            ++
++                                                                                                      ++
++                 All CouponsPlus event handlers are registered at:                                    ++
++                     - app/events/actions.php                                                         ++
++                                                                                                      ++
++                 Third Party packages are located under the vendor/ directory                         ++
++                  and are autoloaded using Composer's autoloader.                                     ++
++                                                                                                      ++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

if (class_exists('CouponsPlus\\App\\Coupon\\CouponsManager')) {
    add_action('admin_notices', function() {
        echo '<div class="notice notice-error"><p>';
        echo '<strong>' . esc_html__('Coupons+ For WooCommerce:', 'coupons-plus-for-woocommerce') . '</strong> ';
        echo esc_html__('A legacy version of Coupons+ is already active. Please deactivate and remove the old version before activating this plugin.', 'coupons-plus-for-woocommerce');
        echo '</p></div>';
    });
    return;
}

require_once plugin_dir_path(__FILE__) . 'bootstrap.php';

/**
 * This only registers the installation hooks (e.g. register_activation_hook)
 */
new Installation\Installator;

(new EventsRegistrator)->registerEvents();
