<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
 * Plugin Name: SyncKube - Products Sync for Shopify
 * Description: Seamlessly sync your Shopify products into WordPress. SyncKube automates product import, updates inventory, and keeps product data consistent between Shopify and your WordPress site.
 * Version: 1.0.2
 * Author: sakurapixel
 * License: GPL-3.0-only
 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
 * Text Domain: synckube-products-sync-for-shopify
 * Domain Path: /languages
 * Requires at least: 6.4
 * Requires PHP: 8.2
 */

require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
define('SHOPYPRESS_APP_PUBLIC_URL', plugins_url('',  __FILE__ ));
define('SHOPYPRESS_APP_PATH', plugin_dir_path(__FILE__));


add_action( 'spsfs_fs_loaded', function () {
    \ShopyPress\App::init(__FILE__);
    \ShopyPress\App::run();
} );
if ( !function_exists( 'spsfs_fs' ) ) {
    // Create a helper function for easy SDK access.
    function spsfs_fs() {
        global $spsfs_fs;
        if ( !isset( $spsfs_fs ) ) {
            // Include Freemius SDK.
            require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
            $spsfs_fs = fs_dynamic_init( array(
                'id'             => '22462',
                'slug'           => 'synckube-products-sync',
                'premium_slug'   => 'synckube-pro',
                'type'           => 'plugin',
                'public_key'     => 'pk_37d00375af5ccc4af99939d88440a',
                'is_premium'     => false,
                'has_addons'     => false,
                'has_paid_plans' => true,
                'trial'          => array(
                    'days'               => 14,
                    'is_require_payment' => true,
                ),
                'menu'           => array(
                    'slug'    => 'shopypress-app-settings-page',
                    'support' => false,
                ),
                'is_live'        => true,
            ) );
        }
        return $spsfs_fs;
    }

    // Init Freemius.
    spsfs_fs();
    // Signal that SDK was initiated.
    do_action( 'spsfs_fs_loaded' );
}