TRUEPLAYER_PLUGIN_FILE, 'package_name' => 'TruePlayer', // no translation — runs too early for the textdomain. // Free and Pro are separate StoreEngine products (430 / 431). 'product_id' => 430, 'is_free' => true, 'slug' => TRUEPLAYER_PLUGIN_SLUG, 'basename' => TRUEPLAYER_PLUGIN_BASENAME, 'package_type' => 'plugin', 'package_version' => TRUEPLAYER_VERSION, 'allow_local' => true, // Free is distributed on WordPress.org, so WP core owns updates and // there is no license to manage: no update channel, no REST routes, // no manage-license page. Only the opt-in insights + deactivation // feedback popup is booted. 'use_update' => false, 'init_restapi' => false, 'menu' => false, 'init_insights' => true, 'license_server' => 'https://store.kodezen.com/', 'purchase_url' => 'https://store.kodezen.com/product/trueplayer-pro/', 'product_logo' => self::product_logo(), 'store_dashboard_url' => 'https://store.kodezen.com/dashboard/license-keys/', 'terms_url' => 'https://kodezen.com/terms-and-conditions/', 'privacy_policy_url' => 'https://store.kodezen.com/privacy-policy/', 'ticket_recipient' => 'support@kodezen.com', 'primary_color' => '#008dff', 'first_install_time' => self::first_install_time(), 'optin_notice_delay' => 3 * DAY_IN_SECONDS, ] ); } /** * The plugin mark the SDK shows on its opt-in notice and license screens. * * Returned empty when the file is missing rather than as a URL — the SDK * renders whatever it is handed, so a dead path becomes a broken-image icon * inside the notice. */ private static function product_logo(): string { if ( ! defined( 'TRUEPLAYER_ASSETS_URI' ) || ! defined( 'TRUEPLAYER_ASSETS_DIR_PATH' ) ) { return ''; } $rel = 'images/logo.svg'; return file_exists( TRUEPLAYER_ASSETS_DIR_PATH . $rel ) ? TRUEPLAYER_ASSETS_URI . $rel : ''; } /** * Install time as a Unix timestamp for the SDK's opt-in notice cadence. * * The plugin's installer records `trueplayer_first_install_time` as an ISO-8601 * string (used elsewhere for webhook/log payloads); the SDK requires an int * timestamp, so we convert. Falls back to now when the option is absent. */ private static function first_install_time(): int { $stored = get_option( 'trueplayer_first_install_time' ); if ( empty( $stored ) ) { return time(); } return is_numeric( $stored ) ? (int) $stored : (int) strtotime( (string) $stored ); } public static function get_client(): ?SE_License_SDK_Client { return self::$sdk_client; } } // End of file store-license.php.