'14562', 'slug' => 'countdown-time', 'premium_slug' => 'countdown-time-pro', 'type' => 'plugin', 'public_key' => 'pk_7f62446a2a53154c56c36346db2fa', 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_premium_version' => true, 'has_addons' => false, 'has_paid_plans' => true, 'trial' => [ 'days' => 7, 'is_require_payment' => true, ], 'menu' => [ 'slug' => 'edit.php?post_type=ctb', 'contact' => false, 'support' => false, ], ]; $ctb_fs = ( CTB_HAS_PRO && file_exists( $fsStartPath ) ? fs_dynamic_init( $ctbConfig ) : fs_lite_dynamic_init( $ctbConfig ) ); } return $ctb_fs; } ctb_fs(); do_action( 'ctb_fs_loaded' ); } function ctbIsPremium() { return ( CTB_HAS_PRO ? ctb_fs()->can_use_premium_code() : false ); } require_once CTB_DIR_PATH . '/includes/pattern.php'; require_once CTB_DIR_PATH . '/includes/CustomPost.php'; require_once CTB_DIR_PATH . '/includes/HelpPage.php'; // if( CTB_HAS_FREE ){ // require_once CTB_DIR_PATH . '/includes/UpgradePage.php'; // } class CTBPlugin { function __construct() { add_action( 'init', [$this, 'onInit'] ); add_action( 'wp_ajax_ctbPipeChecker', [$this, 'ctbPipeChecker'] ); add_action( 'wp_ajax_nopriv_ctbPipeChecker', [$this, 'ctbPipeChecker'] ); add_action( 'admin_init', [$this, 'registerSettings'] ); add_action( 'rest_api_init', [$this, 'registerSettings'] ); add_filter( 'block_categories_all', [$this, 'blockCategories'] ); } function onInit() { register_block_type( __DIR__ . '/build' ); } function ctbPipeChecker() { $nonce = $_POST['_wpnonce'] ?? null; if ( !wp_verify_nonce( $nonce, 'wp_ajax' ) ) { wp_send_json_error( 'Invalid Request' ); } wp_send_json_success( [ 'isPipe' => ctbIsPremium(), ] ); } function registerSettings() { register_setting( 'ctbUtils', 'ctbUtils', [ 'show_in_rest' => [ 'name' => 'ctbUtils', 'schema' => [ 'type' => 'string', ], ], 'type' => 'string', 'default' => wp_json_encode( [ 'nonce' => wp_create_nonce( 'wp_ajax' ), ] ), 'sanitize_callback' => 'sanitize_text_field', ] ); } function blockCategories( $categories ) { return array_merge( [[ 'slug' => 'CTBlock', 'title' => 'Countdown Time', ]], $categories ); } } new CTBPlugin(); }