LicenseConfigAdapter.php
53 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WhatsappScoped\YayCommerce\AdminShell\License\Contracts; |
| 4 | |
| 5 | use WhatsappScoped\YayCommerce\AdminShell\Contracts\PluginMenuAdapter; |
| 6 | /** |
| 7 | * Per-plugin configuration for the license subsystem. |
| 8 | * Extends PluginMenuAdapter — pro plugins implement this single interface. |
| 9 | * |
| 10 | * APPEND-ONLY — adding methods requires a MAJOR version bump per CONTRIBUTING.md. |
| 11 | * @internal |
| 12 | */ |
| 13 | interface LicenseConfigAdapter extends PluginMenuAdapter |
| 14 | { |
| 15 | /** |
| 16 | * Plugin slug used as the wp_options key prefix. |
| 17 | * |
| 18 | * MUST be byte-exact wp_options prefix — changing this loses customer license keys. |
| 19 | * Quirks: |
| 20 | * - yay-wholesale-b2b-pro (hyphens are valid in option keys) |
| 21 | * - yay_currency (underscore between yay and currency, NOT yaycurrency) |
| 22 | * - yay_swatches (same underscore pattern) |
| 23 | * |
| 24 | * Option keys derived: {slug}_license_key, {slug}_license_info |
| 25 | */ |
| 26 | public function get_plugin_slug() : string; |
| 27 | /** |
| 28 | * Human-readable display name for the license card, |
| 29 | * e.g. 'YayMail Pro – WooCommerce Email Customizer'. |
| 30 | */ |
| 31 | public function get_plugin_name() : string; |
| 32 | /** |
| 33 | * Current plugin version string, e.g. '4.4'. |
| 34 | */ |
| 35 | public function get_plugin_version() : string; |
| 36 | /** |
| 37 | * Absolute path to the main plugin file. |
| 38 | */ |
| 39 | public function get_plugin_file() : string; |
| 40 | /** |
| 41 | * EDD download ID (numeric). |
| 42 | */ |
| 43 | public function get_item_id() : int; |
| 44 | /** |
| 45 | * EDD store URL. Default: 'https://yaycommerce.com/'. |
| 46 | */ |
| 47 | public function get_store_url() : string; |
| 48 | /** |
| 49 | * Product page URL used for "Buy a license" CTA. |
| 50 | */ |
| 51 | public function get_store_link() : string; |
| 52 | } |
| 53 |