<?php

if ( !defined( 'ABSPATH' ) ) {
    exit;
}
if ( !function_exists( 'coresocial_fs' ) ) {
    // Create a helper function for easy SDK access.
    function coresocial_fs() {
        global $coresocial_fs;
        if ( !isset( $coresocial_fs ) ) {
            // Manually include the Freemius SDK (not needed if using Composer).
            require_once dirname( CORESOCIAL_FILE ) . '/vendor/freemius/wordpress-sdk/start.php';
            $coresocial_fs = fs_dynamic_init( array(
                'id'             => '17258',
                'slug'           => 'coresocial',
                'premium_slug'   => 'coresocial-pro',
                'type'           => 'plugin',
                'public_key'     => 'pk_f8774a75f6f097e530fcb619654f4',
                'is_premium'     => false,
                'premium_suffix' => 'Pro',
                'has_addons'     => false,
                'has_paid_plans' => true,
                'trial'          => array(
                    'days'               => 7,
                    'is_require_payment' => true,
                ),
                'menu'           => array(
                    'slug'    => 'coresocial-dashboard',
                    'contact' => false,
                ),
                'is_live'        => true,
            ) );
        }
        return $coresocial_fs;
    }

    // Init Freemius.
    coresocial_fs();
    // Signal that SDK was initiated.
    do_action( 'coresocial_fs_loaded' );
    function coresocial_premium_support_forum_url(  $support_forum_url  ) : string {
        return 'https://support.dev4press.com/forums/forum/plugins/coresocial/';
    }

    if ( coresocial_fs()->is_premium() ) {
        coresocial_fs()->add_filter( 'support_forum_url', 'coresocial_premium_support_forum_url' );
    }
    coresocial_fs()->add_filter( 'pricing/disable_single_package', '__return_true' );
    coresocial_fs()->add_filter( 'pricing/show_annual_in_monthly', '__return_false' );
}