<?php

if ( !defined( 'ABSPATH' ) ) {
    exit;
}
/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * administrative area. This file also includes all of the plugin dependencies.
 *
 * @link              https://thunder-team.com/
 * @since             1.0.0
 * @package           Storyposts
 *
 * @wordpress-plugin
 * Plugin Name:       StoryPosts: Interactive Text, Photo and Video Stories
 * Description:       StoryPosts adds Instagram-style story sliders to your WordPress site — effortlessly create and showcase curated story collections in a beautiful, swipeable stories format.
 * Version:           1.0.0
 * Author:            Thunder Team
 * Author URI:        https://thunder-team.com/
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       storyposts
 * Domain Path:       /languages
 */
// If this file is called directly, abort.
if ( !defined( 'WPINC' ) ) {
    die;
}
/**
 * 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.
 */
if ( !defined( 'STORYPOSTS_VERSION' ) ) {
    define( 'STORYPOSTS_VERSION', '1.0.0' );
}
if ( !defined( 'STORYPOSTS_PATH' ) ) {
    define( 'STORYPOSTS_PATH', plugin_dir_path( __FILE__ ) );
}
if ( !defined( 'STORYPOSTS_URL' ) ) {
    define( 'STORYPOSTS_URL', plugin_dir_url( __FILE__ ) );
}
if ( !function_exists( 'storyposts_fs' ) ) {
    // Create a helper function for easy SDK access.
    function storyposts_fs() {
        global $storyposts_fs;
        if ( !isset( $storyposts_fs ) ) {
            // Include Freemius SDK.
            require_once STORYPOSTS_PATH . 'includes/vendor/freemius/start.php';
            $storyposts_fs = fs_dynamic_init( array(
                'id'               => '25432',
                'slug'             => 'storyposts',
                'premium_slug'     => 'storyposts-pro',
                'type'             => 'plugin',
                'public_key'       => 'pk_fbc9e133ffaffcf1b3044790a8143',
                'is_premium'       => false,
                'has_addons'       => false,
                'has_paid_plans'   => true,
                'is_org_compliant' => true,
                'menu'             => array(
                    'slug' => 'edit.php?post_type=stpo_story',
                ),
                'is_live'          => true,
            ) );
        }
        return $storyposts_fs;
    }

    // Init Freemius.
    storyposts_fs();
    // Signal that SDK was initiated.
    do_action( 'storyposts_fs_loaded' );
    // Show yearly price
    storyposts_fs()->add_filter( 'pricing/show_annual_in_monthly', '__return_false' );
    // Uninstall cleanup — hooked via Freemius so uninstall telemetry is sent first.
    storyposts_fs()->add_action( 'after_uninstall', 'storyposts_fs_uninstall_cleanup' );
}
if ( !function_exists( 'storyposts_fs_uninstall_cleanup' ) ) {
    function storyposts_fs_uninstall_cleanup() {
        delete_option( 'storyposts_options' );
    }

}
/**
 * The code that runs during plugin activation.
 * This action is documented in includes/class-storyposts-activator.php
 */
if ( !function_exists( 'activate_storyposts' ) ) {
    function activate_storyposts() {
        require_once STORYPOSTS_PATH . 'includes/class-storyposts-activator.php';
        Storyposts_Activator::activate();
    }

}
/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-storyposts-deactivator.php
 */
if ( !function_exists( 'deactivate_storyposts' ) ) {
    function deactivate_storyposts() {
        require_once STORYPOSTS_PATH . 'includes/class-storyposts-deactivator.php';
        Storyposts_Deactivator::deactivate();
    }

}
register_activation_hook( __FILE__, 'activate_storyposts' );
register_deactivation_hook( __FILE__, 'deactivate_storyposts' );
/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
if ( !class_exists( 'Storyposts' ) ) {
    require_once STORYPOSTS_PATH . 'includes/class-storyposts.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
 */
if ( !function_exists( 'run_storyposts' ) ) {
    function run_storyposts() {
        $plugin = new Storyposts();
        $plugin->run();
    }

}
run_storyposts();