'19835', 'slug' => '3d-image-gallery', 'type' => 'plugin', 'public_key' => 'pk_b2e7f3ea20771578177abd884c97d', 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_premium_version' => true, 'has_addons' => false, 'has_paid_plans' => true, 'trial' => array( 'days' => 7, 'is_require_payment' => false, ), 'menu' => array( 'slug' => '3d-image-gallery-dashboard', 'first-path' => 'tools.php?page=3d-image-gallery-dashboard#/welcome', 'support' => false, 'parent' => array( 'slug' => 'tools.php', ), ), ); $ig_fs = ( BIGB_HAS_PRO ? fs_dynamic_init( $ig_Config ) : fs_lite_dynamic_init( $ig_Config ) ); } return $ig_fs; } // Init Freemius. ig_fs(); // Signal that SDK was initiated. do_action( 'ig_fs_loaded' ); } function ig_IsPremium() { return ( BIGB_HAS_PRO ? ig_fs()->can_use_premium_code() : false ); } // ... Your plugin's main file logic ... class BIGBImageGallery { function __construct() { add_action( 'init', [$this, 'onInit'] ); add_action( 'wp_ajax_ig_PremiumChecker', [$this, 'ig_PremiumChecker'] ); add_action( 'wp_ajax_nopriv_ig_PremiumChecker', [$this, 'ig_PremiumChecker'] ); add_action( 'admin_init', [$this, 'registerSettings'] ); add_action( 'rest_api_init', [$this, 'registerSettings'] ); } function ig_PremiumChecker() { $nonce = sanitize_text_field( $_POST['_wpnonce'] ?? null ); if ( !wp_verify_nonce( $nonce, 'wp_ajax' ) ) { wp_send_json_error( 'Invalid Request' ); } wp_send_json_success( [ 'isPipe' => ig_IsPremium(), ] ); } function registerSettings() { register_setting( 'ig_Utils', 'ig_Utils', [ 'show_in_rest' => [ 'name' => 'ig_Utils', 'schema' => [ 'type' => 'string', ], ], 'type' => 'string', 'default' => wp_json_encode( [ 'nonce' => wp_create_nonce( 'wp_ajax' ), ] ), 'sanitize_callback' => 'sanitize_text_field', ] ); } function onInit() { register_block_type( __DIR__ . '/build' ); } } new BIGBImageGallery(); } require_once BIGB_DIR_PATH . '/inc/adminMenu.php'; require_once BIGB_DIR_PATH . '/inc/upgradePage.php';