<?php

/**
 * Plugin Name: NudgeSells
 * Plugin URI:  https://nudgesells.com
 * Description: Increase your WooCommerce average order value with helpful product recommendations, discounts, and add-ons that feel like good advice.
 * Version:     1.0.0
 * Author:      Dons Digital
 * Text Domain: nudgesells
 * Domain Path: /languages
 * Requires at least: 5.8
 * Requires PHP: 7.4
 * Requires Plugins: woocommerce
 * License:     GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * 
 */
if ( !defined( 'WPINC' ) ) {
    die;
}
if ( function_exists( 'nud_fs' ) ) {
    nud_fs()->set_basename( false, __FILE__ );
} else {
    if ( !function_exists( 'nud_fs' ) ) {
        function nud_fs() {
            global $nud_fs;
            if ( !isset( $nud_fs ) ) {
                require_once dirname( __FILE__ ) . '/freemius/start.php';
                $nud_fs = fs_dynamic_init( array(
                    'id'               => '34752',
                    'slug'             => 'nudgesells',
                    'premium_slug'     => 'nudgesells-pro',
                    'type'             => 'plugin',
                    'public_key'       => 'pk_76f37c9dfedc738acb934f601494d',
                    'is_premium'       => false,
                    'premium_suffix'   => 'Pro',
                    'has_addons'       => false,
                    'has_paid_plans'   => true,
                    'is_org_compliant' => true,
                    'menu'             => array(
                        'slug'       => 'nudgesells',
                        'first-path' => 'admin.php?page=nudgesells',
                        'contact'    => false,
                        'support'    => false,
                    ),
                    'is_live'          => true,
                ) );
            }
            return $nud_fs;
        }

    }
    nud_fs();
    do_action( 'nud_fs_loaded' );
    define( 'NUDGESELLS_VERSION', '1.0.0' );
    define( 'NUDGESELLS_PLUGIN_FILE', __FILE__ );
    define( 'NUDGESELLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    define( 'NUDGESELLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    define( 'NUDGESELLS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    /**
     * Activate plugin.
     *
     * @return void
     * @since 1.0.0
     */
    function activate_nudgesells() {
        require_once NUDGESELLS_PLUGIN_DIR . 'includes/class-nudgesells-activator.php';
        NudgeSells_Activator::activate();
    }

    /**
     * Deactivate plugin.
     *
     * @return void
     * @since 1.0.0
     */
    function deactivate_nudgesells() {
        require_once NUDGESELLS_PLUGIN_DIR . 'includes/class-nudgesells-deactivator.php';
        NudgeSells_Deactivator::deactivate();
    }

    /**
     * Uninstall plugin.
     *
     * @return void
     * @since 1.0.0
     */
    function uninstall_nudgesells() {
        require_once NUDGESELLS_PLUGIN_DIR . 'includes/class-nudgesells-deactivator.php';
        NudgeSells_Deactivator::uninstall();
    }

    register_activation_hook( __FILE__, 'activate_nudgesells' );
    register_deactivation_hook( __FILE__, 'deactivate_nudgesells' );
    register_uninstall_hook( __FILE__, 'uninstall_nudgesells' );
    require NUDGESELLS_PLUGIN_DIR . 'includes/class-nudgesells.php';
    /**
     * Run nudgesells.
     *
     * @return void
     * @since 1.0.0
     */
    function run_nudgesells() {
        $plugin = new NudgeSells();
        $plugin->run();
    }

    add_action( 'plugins_loaded', 'run_nudgesells' );
}