<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
 * Plugin Name: FtlCommerce - Instant Product Search
 * Description: Instant, lightning-fast product search for WooCommerce using Fuse.js. Fully client-side, zero delays, seamless user experience.
 * Version: 1.0.0
 * Plugin URI: https://www.sakuraleaf.com
 * Author URI: https://sakuraleaf.com/support
 * Author: sakurapixel
 * License: GPL-3.0-only
 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
 * Text Domain: ftlcommerce-instant-product-search
 * Domain Path: /languages
 * Requires at least: 6.4
 * Requires PHP: 8.2
 */

require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
define('FUSE_COM_APP_PUBLIC_URL', plugins_url('',  __FILE__ ));
define('FUSE_COM_APP_PATH', plugin_dir_path(__FILE__));

add_action( 'fp_fscommerce_loaded', function () {
    \FuseCommerce\App::run(__FILE__);
} );
if ( !function_exists( 'fp_fscommerce' ) ) {
    // Create a helper function for easy SDK access.
    function fp_fscommerce() {
        global $fp_fscommerce;
        if ( !isset( $fp_fscommerce ) ) {
            // Include Freemius SDK.
            require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
            $fp_fscommerce = fs_dynamic_init( array(
                'id'             => '22125',
                'slug'           => 'ftlcommerce-instant-product-search',
                'premium_slug'   => 'ftlcommerce-pro',
                'type'           => 'plugin',
                'public_key'     => 'pk_b7addd0936e3b226dc6e0d8f28b16',
                'is_premium'     => false,
                'premium_suffix' => 'Pro',
                'has_addons'     => false,
                'has_paid_plans' => true,
                'trial'          => array(
                    'days'               => 14,
                    'is_require_payment' => true,
                ),
                'menu'           => array(
                    'slug'       => 'fuse-comm-app-settings-page',
                    'first-path' => 'admin.php?page=fuse-comm-app-settings-page',
                    'support'    => false,
                ),
                'is_live'        => true,
            ) );
        }
        return $fp_fscommerce;
    }

    // Init Freemius.
    fp_fscommerce();
    // Signal that SDK was initiated.
    do_action( 'fp_fscommerce_loaded' );
}