<?php

/**
 * 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.
 *
 * @link              http://example.com
 * @since             1.0.0
 * @package           Ultimate_3D_Model_Viewer
 *
 * @wordpress-plugin
 * Plugin Name:       Ultimate 3D Model Viewer
 * Description:       Ultimate 3D Model Viewer is a powerful WordPress plugin that lets you effortlessly embed interactive 3D models on WooCommerce products, Elementor layouts, and Gutenberg blocks.
 * Version:           1.0.2
 * Requires at least: 6.8
 * Author:            Alexander Dort GmbH
 * Author URI:        https://www.alexanderdort.com
 * License:           GPL2
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       ultimate-3d-model-viewer
 * Domain Path:       /languages
 */



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

if (function_exists('u3mv_fs')) {
    u3mv_fs()->set_basename( true, __FILE__ );
} else {
    if ( ! function_exists( 'u3mv_fs' ) ) {
    // Create a helper function for easy SDK access.
    function u3mv_fs() {
        global $u3mv_fs;

        if ( ! isset( $u3mv_fs ) ) {
            // Include Freemius SDK.
        require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
        $u3mv_fs = fs_dynamic_init( array(
                'id'                  => '19657',
                'slug'                => 'ultimate-3d-model-viewer',
                'type'                => 'plugin',
                'public_key'          => 'pk_ad701dc0ce6b2e668efea92bc6cd8',
                'is_premium'          => true,
                'premium_suffix'      => 'Premium',
                // If your plugin is a serviceware, set this option to false.
                'has_premium_version' => true,
                'has_addons'          => false,
                'has_paid_plans'      => true,
                'is_org_compliant'    => true,
                'menu'                => array(
                    'first-path'     => 'plugins.php',
                    'support'        => false,
                ),
            ) );
        }

        return $u3mv_fs;
    }

        // Init Freemius.
        u3mv_fs();
        // Signal that SDK was initiated.
        do_action( 'u3mv_fs_loaded' );
    }
}

/**
 * Currently plugin version.
 * Start at version 1.0.0 and use SemVer - https://semver.org
 * Rename this for your plugin and update it as you release new versions.
 */
define( 'ULTIMATE_3D_MODEL_VIEWER_VERSION', '1.0.2' );

/**
 * The code that runs during plugin activation.
 * This action is documented in includes/model-viewer-widget-activator.php
 */
function u3dmv_activate_ultimate_3d_model_viewer() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/ultimate-3d-model-viewer-activator.php';
	Ultimate_3D_Model_Viewer_Activator::activate();
}

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-plugin-name-deactivator.php
 */
function u3dmv_deactivate_ultimate_3d_model_viewer() {
	require_once plugin_dir_path( __FILE__ ) . 'includes/ultimate-3d-model-viewer-deactivator.php';
	Ultimate_3D_Model_Viewer_Deactivator::deactivate();
}

register_activation_hook( __FILE__, 'u3dmv_activate_ultimate_3d_model_viewer' );
register_deactivation_hook( __FILE__, 'u3dmv_deactivate_ultimate_3d_model_viewer' );

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path( __FILE__ ) . 'includes/ultimate-3d-model-viewer.php';

/**
 * 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.
 *
 * @since    1.0.0
 */
function u3dmv_run_ultimate_3d_model_viewer() {

	$plugin = new Ultimate_3D_Model_Viewer();
	$plugin->run();

}
u3dmv_run_ultimate_3d_model_viewer();
