PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.6.0
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.6.0
3.6.0 3.5.3 3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / addons / StyleCustomizer / V2 / Engine.php
everest-forms / addons / StyleCustomizer / V2 Last commit date
assets 1 week ago BuilderPanel.php 1 week ago Compiler.php 1 week ago Engine.php 1 week ago FrontendEnqueue.php 1 week ago Migrator.php 1 week ago Palettes.php 1 week ago PreviewDraft.php 1 week ago RestController.php 1 week ago Sanitizer.php 1 week ago Schema.php 1 week ago Templates.php 1 week ago
Engine.php
92 lines
1 <?php
2 /**
3 * Style Customizer v2 — Engine gate.
4 *
5 * The single place that answers "is v2 active?" and "is this form a v2 form?". v2 is ON by
6 * default; {@see self::enabled()} only exposes an off-switch.
7 *
8 * @package EverestForms\Addons\StyleCustomizer\V2
9 * @since x.x.x
10 */
11
12 namespace EverestForms\Addons\StyleCustomizer\V2;
13
14 defined( 'ABSPATH' ) || exit;
15
16 /**
17 * The v2 feature gate.
18 */
19 final class Engine {
20
21 /**
22 * Is the v2 engine enabled? ON by default; `EVF_STYLE_V2` and the `evf_style_v2_enabled`
23 * filter are the off-switch.
24 *
25 * @return bool
26 */
27 public static function enabled() {
28 $enabled = defined( 'EVF_STYLE_V2' ) ? (bool) \EVF_STYLE_V2 : true;
29
30 /**
31 * Filter whether the Style Customizer v2 engine is active.
32 *
33 * @param bool $enabled Whether v2 is active (default true).
34 */
35 return (bool) apply_filters( 'evf_style_v2_enabled', $enabled );
36 }
37
38 /**
39 * Is a stored record a v2 record? Derived from the presence of `schema_version`.
40 *
41 * @param mixed $record Stored `everest_forms_styles[form_id]` record.
42 * @return bool
43 */
44 public static function is_v2_record( $record ) {
45 return is_array( $record ) && isset( $record['schema_version'] );
46 }
47
48 /**
49 * Is the Pro tier active? The single, server-side authoritative gate for every pro-tier
50 * feature; defaults to whether Everest Forms Pro is loaded, filterable to a licence check.
51 *
52 * @return bool
53 */
54 public static function pro_active() {
55 /**
56 * Filter whether the Style Customizer v2 Pro tier is active.
57 *
58 * @param bool $active Default: the Everest Forms Pro plugin is loaded.
59 */
60 return (bool) apply_filters( 'evf_style_v2_pro_active', defined( 'EFP_PLUGIN_FILE' ) );
61 }
62
63 /**
64 * Boot the v2 engine. No-op unless enabled; safe to call more than once.
65 */
66 public static function boot() {
67 if ( ! self::enabled() ) {
68 return;
69 }
70
71 // Engine-aware frontend rendering (v2-compiled vs legacy per form).
72 FrontendEnqueue::register();
73
74 // Reusable custom colour palettes (registers the schema filter; must run before REST).
75 Palettes::register();
76
77 // REST read/save for the builder panel.
78 RestController::register();
79
80 // Live Fields → Style sync for the style-preview iframe.
81 PreviewDraft::register();
82
83 // Builder "Style" tab + React panel.
84 BuilderPanel::register();
85
86 /**
87 * Fires once the v2 engine boots.
88 */
89 do_action( 'evf_style_v2_booted' );
90 }
91 }
92