<?php
/**
 * Single source of truth for "Pro version" information surfaced in free.
 *
 * Provides the themerex.net landing URL plus the feature/comparison data
 * (via the Upgrade\Catalog facade) rendered on the informational Pro Version
 * page. Per wp.org Guideline 5 the free plugin carries NO pricing, checkout
 * parameters, or store identifiers — purchasing happens entirely off-site
 * (stripped in the 2026-07 review round 2).
 *
 * Filterable via:
 *   - `trx_ad_pro_features` — re-order or extend feature cards
 *   - `trx_ad_pro_comparison_rows` — re-order or extend comparison matrix
 *   - `trx_ad_pro_landing_url` — landing URL override
 *
 * @package ThemeREX\AutoDealer\Admin
 */

declare(strict_types=1);

namespace ThemeREX\AutoDealer\Admin;

defined( 'ABSPATH' ) || exit;

use ThemeREX\AutoDealer\Admin\Upgrade\Catalog;

final class ProUpgrade {

	/**
	 * Marketing landing page for the separately-distributed Pro plugin.
	 * Currently the shared plugin page (a dedicated Pro page can replace it
	 * later — sites can also override via the `trx_ad_pro_landing_url`
	 * filter without a plugin update).
	 */
	public const URL_EDD = 'https://themerex.net/trx-auto-dealer/';

	/**
	 * URL of the dedicated marketing landing page on themerex.net.
	 */
	public static function landingPageUrl(): string {
		return (string) apply_filters( 'trx_ad_pro_landing_url', self::URL_EDD );
	}

	/**
	 * The headline Pro features surfaced on the Pro Version page + readme.txt.
	 * Each row is a {key, name, summary, icon} tuple. The order is the order
	 * shown on the page; sites can re-order or add via the filter.
	 *
	 * @return list<array{key:string,name:string,summary:string,icon:string}>
	 */
	public static function proFeatures(): array {
		return (array) apply_filters( 'trx_ad_pro_features', Catalog::features() );
	}

	/**
	 * Free-vs-Pro comparison rows for the comparison table.
	 *
	 * @return list<array{capability:string,free:string,pro:string}>
	 */
	public static function comparisonRows(): array {
		return (array) apply_filters( 'trx_ad_pro_comparison_rows', Catalog::comparisonRows() );
	}
}
