PluginProbe
YayMail – WooCommerce Email Customizer / trunk
YayMail – WooCommerce Email Customizer vtrunk
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
yaymail / src / Platform / PlatformInterface.php

PlatformInterface.php in YayMail – WooCommerce Email Customizer trunk, at src/Platform/PlatformInterface.php

89 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Platform contract.
4 *
5 * Each product (YayMail for WooCommerce, Yay WP Email Customizer) provides one
6 * implementation and registers it with the PlatformRegistry at bootstrap. Shared
7 * core code reads platform-specific values from the resolved platform instead of
8 * detecting the platform inline via defined()/screen-id/'email-builder' branches.
9 *
10 * @package YayMail\Platform
11 */
12
13 namespace YayMail\Platform;
14
15 defined( 'ABSPATH' ) || exit;
16
17 interface PlatformInterface {
18
19 /**
20 * Stable platform key used across REST params, localize data, and lookups.
21 *
22 * @return string 'yaymail' | 'email-builder'
23 */
24 public function key(): string;
25
26 /**
27 * Absolute filesystem path of the plugin that hosts this platform's assets/core.
28 *
29 * @return string
30 */
31 public function plugin_path(): string;
32
33 /**
34 * Public URL of the plugin that hosts this platform's assets.
35 *
36 * @return string
37 */
38 public function plugin_url(): string;
39
40 /**
41 * WordPress admin screen id (hook suffix) of this platform's settings page.
42 *
43 * @return string
44 */
45 public function hook_suffix(): string;
46
47 /**
48 * Option name prefix for this platform's general attachments.
49 *
50 * @return string
51 */
52 public function attachment_option_name(): string;
53
54 /**
55 * Global header/footer option key for this platform.
56 *
57 * Literals are not derivable by a common suffix rule, so each platform returns
58 * its own exact values.
59 *
60 * @param string $variant 'base' | 'enabled'.
61 * @return string
62 */
63 public function ghf_option_key( string $variant = 'base' ): string;
64
65 /**
66 * The plugin adapter instance for this platform (license/menu config), or null.
67 *
68 * @return object|null
69 */
70 public function adapter();
71
72 /**
73 * Whether this platform IS the WooCommerce product (product identity).
74 *
75 * Distinct from woo_available(): identity is fixed per install, availability is
76 * a runtime capability check.
77 *
78 * @return bool
79 */
80 public function is_woo_product(): bool;
81
82 /**
83 * Whether WooCommerce is active at runtime (capability, not identity).
84 *
85 * @return bool
86 */
87 public function woo_available(): bool;
88 }
89