<?php
/**
 * Licence helper. Wraps Freemius so the rest of the codebase never calls
 * ssaa_fs() directly. Degrades gracefully while the SDK is not yet vendored.
 *
 * NOTE: features are never gated by these checks (file absence, not
 * licence checks - see _standards/docs/DECISIONS.md). These helpers exist
 * for read-time settings enforcement and marketing-surface visibility.
 *
 * @package search-social-appearance-audit
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class SSAA_License {

	public static function init() {
		// No hooks needed yet.
	}

	/**
	 * Whether premium code may run (paying or in trial).
	 *
	 * @return bool
	 */
	public static function is_premium() {
		if ( ! function_exists( 'ssaa_fs' ) ) {
			return false;
		}
		return ssaa_fs()->can_use_premium_code();
	}

	/**
	 * Freemius upgrade/pricing URL. Empty string while the SDK is absent.
	 *
	 * @return string
	 */
	public static function upgrade_url() {
		if ( ! function_exists( 'ssaa_fs' ) ) {
			return '';
		}
		return (string) ssaa_fs()->get_upgrade_url();
	}
}
