PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 4.0.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v4.0.0
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / admin / pages / class-page-settings.php
superb-blocks / src / admin / pages Last commit date
wizard 2 months ago class-page-additional-css.php 2 months ago class-page-dashboard.php 2 months ago class-page-form.php 2 months ago class-page-settings.php 2 months ago class-page-support.php 2 months ago
class-page-settings.php
968 lines
1 <?php
2
3 namespace SuperbAddons\Admin\Pages;
4
5 defined('ABSPATH') || exit();
6
7 use SuperbAddons\Admin\Controllers\DashboardController;
8 use SuperbAddons\Admin\Controllers\RewriteCheckController;
9 use SuperbAddons\Admin\Controllers\SettingsController;
10 use SuperbAddons\Admin\Utils\AdminLinkSource;
11 use SuperbAddons\Admin\Utils\AdminLinkUtil;
12 use SuperbAddons\Components\Admin\EnhancementSettingsComponent;
13 use SuperbAddons\Components\Admin\InputCheckbox;
14 use SuperbAddons\Components\Admin\Modal;
15 use SuperbAddons\Components\Admin\PremiumBox;
16 use SuperbAddons\Data\Controllers\KeyController;
17
18 use SuperbAddons\Components\Admin\EncryptionNotice;
19 use SuperbAddons\Components\Admin\InputApiKey;
20 use SuperbAddons\Components\Admin\ReviewBox;
21 use SuperbAddons\Components\Admin\SupportBox;
22 use SuperbAddons\Components\Admin\SupportLinkBoxes;
23 use SuperbAddons\Data\Controllers\CompatibilitySettingsOptionKey;
24 use SuperbAddons\Data\Controllers\OptionController;
25 use SuperbAddons\Data\Controllers\SettingsOptionKey;
26 use SuperbAddons\Data\Utils\KeyType;
27 use SuperbAddons\Gutenberg\Controllers\GutenbergController;
28 use SuperbAddons\Gutenberg\Controllers\GutenbergEnhancementsController;
29 use SuperbAddons\Gutenberg\Form\FormAccessControl;
30 use SuperbAddons\Gutenberg\Form\FormPermissions;
31 use SuperbAddons\Gutenberg\Form\FormSettings;
32
33 class SettingsPage
34 {
35 private $HasRegisteredKey = false;
36 private $KeyTypeLabel = false;
37 private $KeyStatus = false;
38 private $KeyHasIssue = false;
39 private $Settings = false;
40 private $Incompatibilities = false;
41 private $CompatibilitySettings = false;
42 private $MailchimpConfigured = false;
43 private $MailchimpMaskedKey = '';
44 private $BrevoConfigured = false;
45 private $BrevoMaskedKey = '';
46 private $GoogleSheetsConfigured = false;
47 private $GoogleSheetsClientEmail = '';
48 private $EditorEnabledCount = 0;
49 private $EditorTotalCount = 0;
50 private $IntegrationCount = 0;
51 private $IntegrationTotalCount = 0;
52 private $GlobalEnhancementOptions = array();
53 private $GlobalEnabledCount = 0;
54 private $GlobalTotalCount = 0;
55 private $DisabledBlocks = array();
56 private $DisabledBlockCount = 0;
57 private $ActiveBlockCount = 0;
58 private $TotalBlockCount = 0;
59
60 // CAPTCHA config
61 private $HcaptchaConfigured = false;
62 private $HcaptchaMaskedSecret = '';
63 private $HcaptchaSiteKey = '';
64 private $RecaptchaConfigured = false;
65 private $RecaptchaMaskedSecret = '';
66 private $RecaptchaSiteKey = '';
67 private $TurnstileConfigured = false;
68 private $TurnstileMaskedSecret = '';
69 private $TurnstileSiteKey = '';
70
71 // Forms settings
72 private $DataRetentionDays = 0;
73 private $DefaultEmail = array();
74 private $FormPermissions = array();
75
76 public function __construct()
77 {
78 $this->HasRegisteredKey = KeyController::HasRegisteredKey();
79 if ($this->HasRegisteredKey) {
80 $this->KeyTypeLabel = KeyController::GetCurrentKeyTypeLabel();
81 $this->KeyStatus = KeyController::GetKeyStatus();
82 $this->KeyHasIssue = $this->KeyStatus['expired'] || !$this->KeyStatus['active'] || !$this->KeyStatus['verified'] || $this->KeyStatus['exceeded'];
83 }
84
85 $this->Settings = SettingsController::GetSettings();
86
87 $this->Incompatibilities = SettingsController::GetRelevantCompatibilitySettings();
88 if (count($this->Incompatibilities) > 0) {
89 $this->CompatibilitySettings = SettingsController::GetCompatibilitySettings();
90 }
91
92 // Enhancement counts: global keys for the card badge, all keys for the status bar
93 $this->GlobalEnhancementOptions = GutenbergEnhancementsController::GetGlobalEnhancementsOptions();
94 $user_options = GutenbergEnhancementsController::GetEnhancementsOptions(get_current_user_id());
95 $global_keys = array(
96 GutenbergEnhancementsController::RESPONSIVE_KEY,
97 GutenbergEnhancementsController::ANIMATIONS_KEY,
98 GutenbergEnhancementsController::CONDITIONS_KEY,
99 GutenbergEnhancementsController::DYNAMIC_CONTENT_KEY,
100 GutenbergEnhancementsController::NAVIGATION_KEY,
101 GutenbergEnhancementsController::RICHTEXT_KEY,
102 GutenbergEnhancementsController::SOCIAL_ICONS_KEY,
103 GutenbergEnhancementsController::DASHBOARD_SHORTCUTS_KEY,
104 GutenbergEnhancementsController::STICKY_KEY,
105 GutenbergEnhancementsController::Z_INDEX_KEY,
106 );
107 $user_keys = array(
108 GutenbergEnhancementsController::HIGHLIGHTS_KEY,
109 );
110 $this->GlobalTotalCount = count($global_keys);
111 foreach ($global_keys as $key) {
112 if (isset($this->GlobalEnhancementOptions[$key]) && $this->GlobalEnhancementOptions[$key]) {
113 $this->GlobalEnabledCount++;
114 }
115 }
116 // Status bar total = global + per-user
117 $this->EditorTotalCount = $this->GlobalTotalCount + count($user_keys);
118 $this->EditorEnabledCount = $this->GlobalEnabledCount;
119 foreach ($user_keys as $key) {
120 if (isset($user_options[$key]) && $user_options[$key]) {
121 $this->EditorEnabledCount++;
122 }
123 }
124
125 // Disabled blocks
126 $this->DisabledBlocks = OptionController::GetDisabledBlocks();
127 $this->DisabledBlockCount = count($this->DisabledBlocks);
128 $this->TotalBlockCount = GutenbergController::GetDiscoverableBlockTotal();
129 $this->ActiveBlockCount = GutenbergController::GetDiscoverableBlockActiveCount($this->DisabledBlocks);
130
131 // Integrations
132 $this->IntegrationTotalCount++;
133 $this->MailchimpConfigured = FormSettings::HasValue(FormSettings::OPTION_MAILCHIMP_API_KEY);
134 if ($this->MailchimpConfigured) {
135 $this->MailchimpMaskedKey = FormSettings::GetMasked(FormSettings::OPTION_MAILCHIMP_API_KEY);
136 $this->IntegrationCount++;
137 }
138 $this->IntegrationTotalCount++;
139 $this->BrevoConfigured = FormSettings::HasValue(FormSettings::OPTION_BREVO_API_KEY);
140 if ($this->BrevoConfigured) {
141 $this->BrevoMaskedKey = FormSettings::GetMasked(FormSettings::OPTION_BREVO_API_KEY);
142 $this->IntegrationCount++;
143 }
144 $this->IntegrationTotalCount++;
145 $this->GoogleSheetsConfigured = FormSettings::HasValue(FormSettings::OPTION_GOOGLE_SHEETS_CLIENT_EMAIL) && FormSettings::HasValue(FormSettings::OPTION_GOOGLE_SHEETS_PRIVATE_KEY);
146 if ($this->GoogleSheetsConfigured) {
147 $this->GoogleSheetsClientEmail = FormSettings::Get(FormSettings::OPTION_GOOGLE_SHEETS_CLIENT_EMAIL);
148 $this->IntegrationCount++;
149 }
150
151 // CAPTCHA settings
152 $this->IntegrationTotalCount++;
153 $this->HcaptchaConfigured = FormSettings::HasValue(FormSettings::OPTION_HCAPTCHA_SITE_KEY) && FormSettings::HasValue(FormSettings::OPTION_HCAPTCHA_SECRET_KEY);
154 if ($this->HcaptchaConfigured) {
155 $this->HcaptchaMaskedSecret = FormSettings::GetMasked(FormSettings::OPTION_HCAPTCHA_SECRET_KEY);
156 $this->HcaptchaSiteKey = FormSettings::Get(FormSettings::OPTION_HCAPTCHA_SITE_KEY);
157 $this->IntegrationCount++;
158 }
159 $this->IntegrationTotalCount++;
160 $this->RecaptchaConfigured = FormSettings::HasValue(FormSettings::OPTION_RECAPTCHA_SITE_KEY) && FormSettings::HasValue(FormSettings::OPTION_RECAPTCHA_SECRET_KEY);
161 if ($this->RecaptchaConfigured) {
162 $this->RecaptchaMaskedSecret = FormSettings::GetMasked(FormSettings::OPTION_RECAPTCHA_SECRET_KEY);
163 $this->RecaptchaSiteKey = FormSettings::Get(FormSettings::OPTION_RECAPTCHA_SITE_KEY);
164 $this->IntegrationCount++;
165 }
166 $this->IntegrationTotalCount++;
167 $this->TurnstileConfigured = FormSettings::HasValue(FormSettings::OPTION_TURNSTILE_SITE_KEY) && FormSettings::HasValue(FormSettings::OPTION_TURNSTILE_SECRET_KEY);
168 if ($this->TurnstileConfigured) {
169 $this->TurnstileMaskedSecret = FormSettings::GetMasked(FormSettings::OPTION_TURNSTILE_SECRET_KEY);
170 $this->TurnstileSiteKey = FormSettings::Get(FormSettings::OPTION_TURNSTILE_SITE_KEY);
171 $this->IntegrationCount++;
172 }
173
174 // Forms settings
175 $this->DataRetentionDays = intval(get_option('superbaddons_form_data_retention', 0));
176 $this->DefaultEmail = get_option('superbaddons_form_default_email', array());
177 if (!is_array($this->DefaultEmail)) {
178 $this->DefaultEmail = array();
179 }
180 $this->FormPermissions = FormPermissions::GetAll();
181
182 $this->Render();
183 }
184
185 private function Render()
186 {
187 $license_status_class = 'superbaddons-status-dot--gray';
188 $license_status_label = __('No License', 'superb-blocks');
189 if ($this->HasRegisteredKey) {
190 if ($this->KeyHasIssue) {
191 $license_status_class = 'superbaddons-status-dot--red';
192 $license_status_label = __('Issue Detected', 'superb-blocks');
193 } else {
194 $license_status_class = 'superbaddons-status-dot--green';
195 $license_status_label = $this->KeyTypeLabel;
196 }
197 }
198
199 $enhancement_dot = 'superbaddons-status-dot--gray';
200 if ($this->EditorEnabledCount >= 4) {
201 $enhancement_dot = 'superbaddons-status-dot--green';
202 } elseif ($this->EditorEnabledCount > 0) {
203 $enhancement_dot = 'superbaddons-status-dot--yellow';
204 }
205 ?>
206 <!-- Status Dashboard Header -->
207 <div class="superbaddons-settings-status-bar superbaddons-dashboard-welcome-strip">
208 <span class="superbaddons-dashboard-welcome-title"><?php esc_html_e("Settings", "superb-blocks"); ?></span>
209 <div class="superbaddons-dashboard-stat-items">
210 <a href="#license" class="superbaddons-settings-status-item" data-tab-link="license">
211 <span class="superbaddons-status-dot <?php echo esc_attr($license_status_class); ?>"></span>
212 <?php echo esc_html__('License:', 'superb-blocks'); ?> <?php echo esc_html($license_status_label); ?>
213 </a>
214 <a href="#modules" class="superbaddons-settings-status-item" data-tab-link="modules">
215 <span class="superbaddons-status-dot <?php echo $this->DisabledBlockCount === 0 ? 'superbaddons-status-dot--green' : 'superbaddons-status-dot--yellow'; ?>"></span>
216 <?php echo esc_html(sprintf(
217 /* translators: %1$d: active block count, %2$d: total block count */
218 __('Blocks: %1$d/%2$d', 'superb-blocks'),
219 $this->ActiveBlockCount,
220 $this->TotalBlockCount
221 )); ?>
222 </a>
223 <a href="#modules" class="superbaddons-settings-status-item" data-tab-link="modules">
224 <span class="superbaddons-status-dot <?php echo esc_attr($enhancement_dot); ?>"></span>
225 <?php echo esc_html(sprintf(
226 /* translators: %1$d: enabled enhancement count, %2$d: total enhancement count */
227 __('Enhancements: %1$d/%2$d', 'superb-blocks'),
228 $this->EditorEnabledCount,
229 $this->EditorTotalCount
230 )); ?>
231 </a>
232 <a href="#integrations" class="superbaddons-settings-status-item" data-tab-link="integrations">
233 <span class="superbaddons-status-dot <?php echo $this->IntegrationCount >= 1 ? 'superbaddons-status-dot--green' : 'superbaddons-status-dot--gray'; ?>"></span>
234 <?php echo esc_html(sprintf(
235 /* translators: %1$d: number of connected integrations, %2$d: total integrations */
236 __('Integrations: %1$d/%2$d', 'superb-blocks'),
237 $this->IntegrationCount,
238 $this->IntegrationTotalCount
239 )); ?>
240 </a>
241 <a href="#advanced" class="superbaddons-settings-status-item" data-tab-link="advanced">
242 <span class="superbaddons-status-dot <?php echo $this->Settings[SettingsOptionKey::LOGS_ENABLED] ? 'superbaddons-status-dot--green' : 'superbaddons-status-dot--gray'; ?>"></span>
243 <?php echo esc_html__('Logs:', 'superb-blocks'); ?> <?php echo $this->Settings[SettingsOptionKey::LOGS_ENABLED] ? esc_html__('Enabled', 'superb-blocks') : esc_html__('Disabled', 'superb-blocks'); ?>
244 </a>
245 </div>
246 </div>
247
248 <!-- Settings Search -->
249 <div class="superbaddons-settings-search-wrapper">
250 <input type="text" class="superbaddons-settings-search" placeholder="<?php echo esc_attr__('Search settings...', 'superb-blocks'); ?>" />
251 </div>
252
253 <!-- Settings Tabs -->
254 <div class="superbaddons-settings-tabs">
255 <button class="superbaddons-settings-tab superbaddons-settings-tab--active" data-tab="license" type="button"><?php echo esc_html__('License & Account', 'superb-blocks'); ?></button>
256 <button class="superbaddons-settings-tab" data-tab="modules" type="button"><?php echo esc_html__('Blocks & Enhancements', 'superb-blocks'); ?></button>
257 <button class="superbaddons-settings-tab" data-tab="integrations" type="button"><?php echo esc_html__('Integrations', 'superb-blocks'); ?></button>
258 <button class="superbaddons-settings-tab" data-tab="forms" type="button"><?php echo esc_html__('Forms', 'superb-blocks'); ?></button>
259 <button class="superbaddons-settings-tab" data-tab="advanced" type="button"><?php echo esc_html__('Advanced', 'superb-blocks'); ?></button>
260 </div>
261
262 <div class="superbaddons-admindashboard-sidebarlayout">
263 <div class="superbaddons-admindashboard-sidebarlayout-left">
264
265 <!-- Tab: License & Account -->
266 <div class="superbaddons-settings-tab-content superbaddons-settings-tab-content--active" data-tab-content="license">
267 <div class="superbaddons-license-key-wrapper superbaddons-settings-section">
268 <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("License Key", "superb-blocks"); ?></h4>
269 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Manage your Superb Addons license key.", "superb-blocks"); ?></p>
270 <?php $this->MaybeDisplayRewriteIssue(); ?>
271 <?php if ($this->HasRegisteredKey) : ?>
272 <div class="superbaddons-license-key-body">
273 <?php $this->MaybeDisplayKeyIssue(); ?>
274 <?php $this->MaybeDisplayPremiumPluginMissingNotice(); ?>
275 <p class="superbaddons-element-text-sm"><?php echo esc_html__('Current License: ', "superb-blocks"); ?><span class="superbaddons-element-text-800"><?php echo esc_html($this->KeyTypeLabel); ?></span></p>
276 <button id="spbaddons-license-remove-btn" class="superbaddons-element-button spbaddons-admin-btn-danger" type="button"><?php echo esc_html__('Remove License Key', "superb-blocks"); ?></button>
277 </div>
278 <?php else : ?>
279 <div class="superbaddons-license-key-body superbaddons-license-key-body-flex">
280 <div class="superbaddons-license-key-input-wrapper">
281 <img class="spbaddons-license-result-icon spbaddons-license-error" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . "/img/color-warning-octagon.svg"); ?>" style="display:none;" />
282 <input id="superbaddons-license-key-input" type="text" placeholder="XXXXX-XXXXX-XXXXX-XXXXX" maxlength="23" />
283 </div>
284 <button id="spbaddons-license-submit-btn" class="superbaddons-element-button" type="button" disabled><?php echo esc_html__('Add License Key', "superb-blocks"); ?></button>
285 </div>
286 <?php endif; ?>
287 <div class="superbaddons-spinner-wrapper" style="display:none;">
288 <img class="spbaddons-spinner" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . "/img/blocks-spinner.svg"); ?>" />
289 </div>
290 </div>
291 <div class="superbaddons-admindashboard-linkbox-wrapper">
292 <?php new SupportLinkBoxes(); ?>
293 </div>
294 </div>
295
296 <!-- Tab: Modules -->
297 <div class="superbaddons-settings-tab-content" data-tab-content="modules">
298 <div class="superbaddons-settings-section">
299 <div class="superbaddons-dashboard-section-header">
300 <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Gutenberg Blocks", "superb-blocks"); ?></h4>
301 <span class="superbaddons-dashboard-count-badge"><?php echo esc_html(sprintf(
302 /* translators: %1$d: active, %2$d: total */
303 __('%1$d/%2$d Active', 'superb-blocks'),
304 $this->ActiveBlockCount,
305 $this->TotalBlockCount
306 )); ?></span>
307 </div>
308 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Toggle blocks on or off. Disabled blocks can no longer be inserted, but existing content will continue to render.", "superb-blocks"); ?></p>
309 <div class="superbaddons-modules-block-grid">
310 <?php
311 $block_data = array(
312 'author-box' => array('label' => __('About the Author', 'superb-blocks'), 'icon' => 'purple-identification-badge.svg'),
313 'ratings' => array('label' => __('Rating Block', 'superb-blocks'), 'icon' => 'purple-star.svg'),
314 'table-of-contents' => array('label' => __('Table of Contents', 'superb-blocks'), 'icon' => 'purple-list-bullets.svg'),
315 'recent-posts' => array('label' => __('Recent Posts', 'superb-blocks'), 'icon' => 'purple-note.svg'),
316 'cover-image' => array('label' => __('Cover Image', 'superb-blocks'), 'icon' => 'purple-image.svg'),
317 'google-maps' => array('label' => __('Google Maps', 'superb-blocks'), 'icon' => 'purple-pin.svg'),
318 'reveal-buttons' => array('label' => __('Reveal Buttons', 'superb-blocks'), 'icon' => 'purple-pointing.svg'),
319 'accordion' => array('label' => __('Toggle', 'superb-blocks'), 'icon' => 'accordion-icon-purple.svg'),
320 'carousel' => array('label' => __('Carousel Slider', 'superb-blocks'), 'icon' => 'icon-carousel.svg'),
321 'countdown' => array('label' => __('Countdown', 'superb-blocks'), 'icon' => 'icon-countdown.svg'),
322 'progress-bar' => array('label' => __('Progress Bar', 'superb-blocks'), 'icon' => 'icon-progressbar.svg'),
323 'popup' => array('label' => __('Popup', 'superb-blocks'), 'icon' => 'icon-popup.svg'),
324 'form' => array('label' => __('Form & Multi-Step Form', 'superb-blocks'), 'icon' => 'icon-form.svg'),
325 'add-to-cart' => array('label' => __('Add to Cart & Buy Now', 'superb-blocks'), 'icon' => 'purple-shopping-cart.svg'),
326 );
327 foreach (GutenbergController::TOGGLEABLE_BLOCKS as $block_slug) :
328 $is_enabled = !in_array($block_slug, $this->DisabledBlocks, true);
329 $data = isset($block_data[$block_slug]) ? $block_data[$block_slug] : array('label' => $block_slug, 'icon' => 'purple-cube.svg');
330 ?>
331 <div class="superb-addons-checkbox-input-wrapper superbaddons-modules-block-item">
332 <label class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-inlineflex-center superbaddons-element-relative">
333 <input name="superbaddons-block-<?php echo esc_attr($block_slug); ?>" class="superbaddons-inputcheckbox-input superbaddons-block-toggle-input" data-block="<?php echo esc_attr($block_slug); ?>" type="checkbox" <?php echo $is_enabled ? 'checked="checked"' : ''; ?> />
334 <span class="superb-addons-checkbox-checkmark"><img class="superbaddons-admindashboard-content-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" /></span>
335 <img class="superbaddons-modules-block-item-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/' . $data['icon']); ?>" aria-hidden="true" />
336 <span><?php echo esc_html($data['label']); ?></span>
337 </label>
338 </div>
339 <?php endforeach; ?>
340 </div>
341 </div>
342 <div class="superbaddons-settings-section">
343 <div class="superbaddons-dashboard-section-header">
344 <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Editor Enhancements", "superb-blocks"); ?></h4>
345 <span class="superbaddons-dashboard-count-badge"><?php echo esc_html(sprintf(
346 /* translators: %1$d: active, %2$d: total */
347 __('%1$d/%2$d Active', 'superb-blocks'),
348 $this->GlobalEnabledCount,
349 $this->GlobalTotalCount
350 )); ?></span>
351 </div>
352 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Toggle editor enhancements on or off. These settings apply to all users on the site.", "superb-blocks"); ?></p>
353 <div class="superbaddons-modules-block-grid superbaddons-modules-block-grid--enhancements">
354 <?php
355 $enhancement_data = array(
356 array('id' => 'superbaddons-enhancement-responsive-input', 'key' => GutenbergEnhancementsController::RESPONSIVE_KEY, 'label' => __('Responsive Controls', 'superb-blocks'), 'icon' => 'devices-duotone.svg', 'desc' => __('Per-device visibility toggles, spacing, font size, alignment overrides, and more for all blocks.', 'superb-blocks')),
357 array('id' => 'superbaddons-enhancement-animations-input', 'key' => GutenbergEnhancementsController::ANIMATIONS_KEY, 'label' => __('Animations', 'superb-blocks'), 'icon' => 'sneaker-move-duotone.svg', 'desc' => __('40+ block animations, letter effects, and typing & counting animations for all blocks.', 'superb-blocks')),
358 array('id' => 'superbaddons-enhancement-conditions-input', 'key' => GutenbergEnhancementsController::CONDITIONS_KEY, 'label' => __('Block Conditions', 'superb-blocks'), 'icon' => 'target-duotone.svg', 'desc' => __('Show or hide blocks based on user status, roles, post type, categories, and more.', 'superb-blocks')),
359 array('id' => 'superbaddons-enhancement-dynamiccontent-input', 'key' => GutenbergEnhancementsController::DYNAMIC_CONTENT_KEY, 'label' => __('Dynamic Content', 'superb-blocks'), 'icon' => 'brackets-curly-duotone.svg', 'desc' => __('Insert post data, author info, dates, and custom fields dynamically into any text block.', 'superb-blocks')),
360 array('id' => 'superbaddons-enhancement-navigation-input', 'key' => GutenbergEnhancementsController::NAVIGATION_KEY, 'label' => __('Navigation Enhancements', 'superb-blocks'), 'icon' => 'purple-list-bullets.svg', 'desc' => __('Mobile overlay justification options and submenu layout improvements for the navigation block.', 'superb-blocks')),
361 array('id' => 'superbaddons-enhancement-richtext-input', 'key' => GutenbergEnhancementsController::RICHTEXT_KEY, 'label' => __('Rich Text', 'superb-blocks'), 'icon' => 'purple-aa.svg', 'desc' => __('Rich text enhancements such as justify text alignment for text-based blocks.', 'superb-blocks')),
362 array('id' => 'superbaddons-enhancement-socialicons-input', 'key' => GutenbergEnhancementsController::SOCIAL_ICONS_KEY, 'label' => __('Extra Social Icons', 'superb-blocks'), 'icon' => 'purple-chat.svg', 'desc' => __('Adds 20+ additional icons to the core Social Icons block (Bilibili, Ko-fi, Signal, Slack, Steam, Substack, and more).', 'superb-blocks')),
363 array('id' => 'superbaddons-enhancement-dashboardshortcuts-input', 'key' => GutenbergEnhancementsController::DASHBOARD_SHORTCUTS_KEY, 'label' => __('Admin Shortcuts', 'superb-blocks'), 'icon' => 'purple-gauge.svg', 'desc' => __('Adds handy block theme shortcuts such as Edit Front Page and Style Book.', 'superb-blocks')),
364 array('id' => 'superbaddons-enhancement-sticky-input', 'key' => GutenbergEnhancementsController::STICKY_KEY, 'label' => __('Sticky Positioning', 'superb-blocks'), 'icon' => 'pushpin-duotone.svg', 'desc' => __('Pin any block to the top or bottom of the screen as visitors scroll, with scope and per-device control.', 'superb-blocks')),
365 array('id' => 'superbaddons-enhancement-zindex-input', 'key' => GutenbergEnhancementsController::Z_INDEX_KEY, 'label' => __('Stacking Order', 'superb-blocks'), 'icon' => 'stack-simple-duotone.svg', 'desc' => __('Adds a z-index control to the Advanced panel of any block, with quick presets for common stacking levels.', 'superb-blocks')),
366 );
367 foreach ($enhancement_data as $enh) :
368 $is_enabled = isset($this->GlobalEnhancementOptions[$enh['key']]) && $this->GlobalEnhancementOptions[$enh['key']];
369 ?>
370 <div class="superb-addons-checkbox-input-wrapper superbaddons-modules-block-item">
371 <label class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-inlineflex-center superbaddons-element-relative">
372 <input id="<?php echo esc_attr($enh['id']); ?>" name="<?php echo esc_attr($enh['id']); ?>" class="superbaddons-inputcheckbox-input" data-action="<?php echo esc_attr($enh['key']); ?>" type="checkbox" <?php echo $is_enabled ? 'checked="checked"' : ''; ?> />
373 <span class="superb-addons-checkbox-checkmark"><img class="superbaddons-admindashboard-content-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" /></span>
374 <img class="superbaddons-modules-block-item-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/' . $enh['icon']); ?>" aria-hidden="true" />
375 <span><?php echo esc_html($enh['label']); ?></span>
376 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
377 </label>
378 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html($enh['desc']); ?></p>
379 </div>
380 <?php endforeach; ?>
381 </div>
382 </div>
383 <div class="superbaddons-editor-settings-wrapper superbaddons-settings-section">
384 <?php new EnhancementSettingsComponent(); ?>
385 </div>
386 </div>
387
388 <!-- Tab: Integrations -->
389 <div class="superbaddons-settings-tab-content" data-tab-content="integrations">
390 <div class="superbaddons-form-settings-wrapper superbaddons-settings-section" id="form-settings">
391 <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Integrations", "superb-blocks"); ?></h4>
392 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Connect third-party services to your website.", "superb-blocks"); ?></p>
393 <?php new EncryptionNotice(); ?>
394 <div class="superbaddons-integration-cards">
395 <?php
396 new InputApiKey(
397 'superbaddons-mailchimp-key',
398 'mailchimp',
399 __("Mailchimp", "superb-blocks"),
400 __("Connect form submissions to your Mailchimp audiences.", "superb-blocks"),
401 'https://admin.mailchimp.com/account/api/',
402 __("Get API key from Mailchimp", "superb-blocks"),
403 $this->MailchimpConfigured,
404 $this->MailchimpMaskedKey,
405 __("Enter Mailchimp API key", "superb-blocks")
406 );
407 new InputApiKey(
408 'superbaddons-brevo-key',
409 'brevo',
410 __("Brevo (Sendinblue)", "superb-blocks"),
411 __("Connect form submissions to your Brevo contact lists.", "superb-blocks"),
412 'https://app.brevo.com/settings/keys/api',
413 __("Get API key from Brevo", "superb-blocks"),
414 $this->BrevoConfigured,
415 $this->BrevoMaskedKey,
416 __("Enter Brevo API key", "superb-blocks")
417 );
418 $this->RenderGoogleSheetsCard();
419 $this->RenderCaptchaCard('hcaptcha', __('hCaptcha', 'superb-blocks'), __('Privacy-focused challenge widget for your forms.', 'superb-blocks'), $this->HcaptchaConfigured, $this->HcaptchaSiteKey, $this->HcaptchaMaskedSecret, 'https://dashboard.hcaptcha.com/signup', __('Get keys from hCaptcha Dashboard', 'superb-blocks'));
420 $this->RenderCaptchaCard('recaptcha', __('reCAPTCHA (Google)', 'superb-blocks'), __('Works with both reCAPTCHA v2 and v3 for your forms.', 'superb-blocks'), $this->RecaptchaConfigured, $this->RecaptchaSiteKey, $this->RecaptchaMaskedSecret, 'https://www.google.com/recaptcha/admin', __('Get keys from Google reCAPTCHA', 'superb-blocks'));
421 $this->RenderCaptchaCard('turnstile', __('Cloudflare Turnstile', 'superb-blocks'), __('Non-intrusive Cloudflare challenge for your forms.', 'superb-blocks'), $this->TurnstileConfigured, $this->TurnstileSiteKey, $this->TurnstileMaskedSecret, 'https://dash.cloudflare.com/?to=:/turnstile', __('Get keys from Cloudflare Dashboard', 'superb-blocks'));
422 ?>
423 </div>
424 </div>
425 </div>
426
427 <!-- Tab: Forms -->
428 <div class="superbaddons-settings-tab-content" data-tab-content="forms">
429 <?php $this->RenderFormsTabContent(); ?>
430 </div>
431
432 <!-- Tab: Advanced -->
433 <div class="superbaddons-settings-tab-content" data-tab-content="advanced">
434 <div class="superbaddons-additional-content-wrapper superbaddons-settings-section">
435 <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Advanced Settings", "superb-blocks"); ?></h4>
436 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Manage your advanced settings for Superb Addons.", "superb-blocks"); ?></p>
437
438 <div class="superbaddons-error-logs-settings-wrapper">
439 <!-- Error Logs Settings -->
440 <h5 class="superbaddons-element-flex-center superbaddons-element-text-xs superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-mb1"><img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-bug.svg'); ?>" /><?php echo esc_html__("Error Logs", "superb-blocks"); ?></h5>
441 <?php new InputCheckbox('superbaddons-enable-logs-input', SettingsOptionKey::LOGS_ENABLED, __("Enable Error Logs", "superb-blocks"), __("If issues or errors occur in the plugin when this setting is enabled, the error messages will be logged and can be viewed and shared with our support team and developers.", "superb-blocks"), $this->Settings[SettingsOptionKey::LOGS_ENABLED]); ?>
442 <div class="superbaddons-maybe-hide-element" <?php echo $this->Settings[SettingsOptionKey::LOGS_ENABLED] ? '' : 'style="display:none;"'; ?>>
443 <?php new InputCheckbox('superbaddons-share-logs-input', SettingsOptionKey::LOG_SHARE_ENABLED, __("Share Error Logs", "superb-blocks"), __("When this setting is enabled, error logs will be shared anonymously with our support team and developers to help improve the plugin. Only the error messages shown in the error logs will be shared.", "superb-blocks"), $this->Settings[SettingsOptionKey::LOG_SHARE_ENABLED], '/img/cloud-arrow-up.svg'); ?>
444 </div>
445 <button type="button" class="superbaddons-element-button superbaddons-element-mr1" id="superbaddons-view-logs-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/list-magnifying-glass.svg'); ?>" /><?php echo esc_html__("View Logs", "superb-blocks"); ?></button>
446 </div>
447
448 <div class="superbaddons-compatibility-settings-wrapper">
449 <!-- Compatibility Settings -->
450 <?php if (count($this->Incompatibilities) > 0) : ?>
451 <div class="superbaddons-element-separator"></div>
452 <h5 class="superbaddons-element-flex-center superbaddons-element-text-xs superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-mb1"><img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-plugs.svg'); ?>" /><?php echo esc_html__("Compatibility", "superb-blocks"); ?></h5>
453 <?php if (isset($this->Incompatibilities[CompatibilitySettingsOptionKey::SPECTRA_BLOCK_SPACING])) :
454 new InputCheckbox('superbaddons-spectra-compat', CompatibilitySettingsOptionKey::SPECTRA_BLOCK_SPACING, __("Fix Block Spacing", "superb-blocks"), __("The Spectra plugin features an option to apply a fixed block spacing between all blocks while in the editor. Unfortunately this option overrides custom block spacing and can result in blocks and patterns appearing strange in the editor. When this setting is enabled, custom block spacing will appear correctly in the editor.", "superb-blocks"), $this->CompatibilitySettings[CompatibilitySettingsOptionKey::SPECTRA_BLOCK_SPACING]);
455 endif; ?>
456 <?php endif; ?>
457 </div>
458 </div>
459
460 <!-- Danger Zone -->
461 <div class="superbaddons-danger-zone">
462 <h5 class="superbaddons-danger-zone-title">
463 <img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-warning-octagon.svg'); ?>" />
464 <?php echo esc_html__("Danger Zone", "superb-blocks"); ?>
465 </h5>
466 <div class="superbaddons-danger-zone-item">
467 <div class="superbaddons-danger-zone-item-info">
468 <strong><?php echo esc_html__("Clear Cache", "superb-blocks"); ?></strong>
469 <p><?php echo esc_html__("Removes all cached plugin data. Only clear if experiencing issues.", "superb-blocks"); ?></p>
470 </div>
471 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-element-button-sm" id="superbaddons-clear-cache-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Clear", "superb-blocks"); ?></button>
472 </div>
473 <div class="superbaddons-danger-zone-item">
474 <div class="superbaddons-danger-zone-item-info">
475 <strong><?php echo esc_html__("Clear Restoration Points", "superb-blocks"); ?></strong>
476 <p><?php echo esc_html__("Removes all saved theme designer template restore points. Auto-deleted after 2 months.", "superb-blocks"); ?></p>
477 </div>
478 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-element-button-sm" id="superbaddons-clear-restoration-points-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Clear", "superb-blocks"); ?></button>
479 </div>
480 <div class="superbaddons-danger-zone-item">
481 <div class="superbaddons-danger-zone-item-info">
482 <strong><?php echo esc_html__("Clear Error Logs", "superb-blocks"); ?></strong>
483 <p><?php echo esc_html__("Permanently deletes all recorded error logs.", "superb-blocks"); ?></p>
484 </div>
485 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-element-button-sm" id="superbaddons-clear-logs-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Clear", "superb-blocks"); ?></button>
486 </div>
487 <div class="superbaddons-danger-zone-item">
488 <div class="superbaddons-danger-zone-item-info">
489 <strong><?php echo esc_html__("Remove All Plugin Data", "superb-blocks"); ?></strong>
490 <p><?php echo esc_html__("Permanently removes every plugin option, setting, user preference, integration key, license, and scheduled task. Use this before uninstalling for a clean removal.", "superb-blocks"); ?></p>
491 </div>
492 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-element-button-sm" id="superbaddons-remove-all-data-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Remove", "superb-blocks"); ?></button>
493 </div>
494 </div>
495 </div>
496
497 </div>
498 <div class="superbaddons-admindashboard-sidebarlayout-right">
499 <?php new PremiumBox(AdminLinkSource::SETTINGS); ?>
500 <!-- Sidebar: License tab -->
501 <div class="superbaddons-settings-tab-sidebar superbaddons-settings-tab-sidebar--active" data-tab-sidebar="license">
502 <?php new ReviewBox(); ?>
503 </div>
504 <!-- Sidebar: Editor tab -->
505 <div class="superbaddons-settings-tab-sidebar" data-tab-sidebar="modules">
506 <?php new ReviewBox(); ?>
507 </div>
508 <!-- Sidebar: Integrations tab -->
509 <div class="superbaddons-settings-tab-sidebar" data-tab-sidebar="integrations">
510 <?php new SupportBox(); ?>
511 </div>
512 <!-- Sidebar: Forms tab -->
513 <div class="superbaddons-settings-tab-sidebar" data-tab-sidebar="forms">
514 <?php new SupportBox(); ?>
515 </div>
516 <!-- Sidebar: Advanced tab -->
517 <div class="superbaddons-settings-tab-sidebar" data-tab-sidebar="advanced">
518 <?php new SupportBox(); ?>
519 </div>
520 </div>
521 </div>
522 <?php new Modal(); ?>
523 <?php
524 }
525
526 private function RenderGoogleSheetsCard()
527 {
528 ?>
529 <div class="superbaddons-integration-card <?php echo $this->GoogleSheetsConfigured ? 'superbaddons-integration-card--connected' : ''; ?>" data-integration="google_sheets">
530 <div class="superbaddons-integration-card-header">
531 <img class="superbaddons-integration-card-logo" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/google-sheets-icon.svg'); ?>" />
532 <h5 class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Google Sheets", "superb-blocks"); ?></h5>
533 <?php if ($this->GoogleSheetsConfigured) : ?>
534 <span class="superbaddons-integration-card-badge superbaddons-integration-card-badge--connected"><?php echo esc_html__("Connected", "superb-blocks"); ?></span>
535 <?php else : ?>
536 <span class="superbaddons-integration-card-badge"><?php echo esc_html__("Not Connected", "superb-blocks"); ?></span>
537 <?php endif; ?>
538 </div>
539 <div class="superbaddons-integration-card-body">
540 <?php if ($this->GoogleSheetsConfigured) : ?>
541 <div class="superbaddons-integration-card-connected-info">
542 <code class="superbaddons-input-api-key-masked"><?php echo esc_html($this->GoogleSheetsClientEmail); ?></code>
543 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-element-button-sm superbaddons-input-api-key-remove-btn" id="superbaddons-google-sheets-key-remove-btn"><img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Disconnect", "superb-blocks"); ?></button>
544 </div>
545 <?php else : ?>
546 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-integration-card-description" style="flex:0;"><?php echo esc_html__("Append form submissions as rows to a Google spreadsheet.", "superb-blocks"); ?></p>
547 <div class="superbaddons-input-api-key-input-row" style="flex:1;">
548 <textarea id="superbaddons-google-sheets-key-input" class="superbaddons-input-api-key-input" rows="3" placeholder="<?php echo esc_attr__("Paste Service Account JSON key", "superb-blocks"); ?>" autocomplete="off"></textarea>
549 <button type="button" class="superbaddons-element-button superbaddons-element-button-sm superbaddons-input-api-key-save-btn" id="superbaddons-google-sheets-key-save-btn" disabled><?php echo esc_html__("Connect", "superb-blocks"); ?></button>
550 </div>
551
552 <div class="superbaddons-spinner-wrapper superbaddons-input-api-key-spinner" id="superbaddons-google-sheets-key-spinner" style="display:none;">
553 <img class="spbaddons-spinner" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . "/img/blocks-spinner.svg"); ?>" />
554 </div>
555 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray"><a href="https://console.cloud.google.com/iam-admin/serviceaccounts" target="_blank" rel="noopener noreferrer"><?php echo esc_html__("Create a Service Account in Google Cloud Console", "superb-blocks"); ?></a></p>
556 <?php endif; ?>
557 </div>
558 </div>
559 <?php
560 }
561
562 private function RenderCaptchaCard($provider, $title, $description, $configured, $site_key, $masked_secret, $dashboard_url, $dashboard_label)
563 {
564 $usage_count = FormSettings::CountFormsUsingCaptchaProvider($provider);
565 $icon_path = SUPERBADDONS_ASSETS_PATH . '/img/' . $provider . '-icon.svg';
566 ?>
567 <div class="superbaddons-captcha-card <?php echo $configured ? 'superbaddons-captcha-card--connected' : ''; ?>" data-captcha-provider="<?php echo esc_attr($provider); ?>">
568 <div class="superbaddons-captcha-card-header">
569 <img class="superbaddons-integration-card-logo" src="<?php echo esc_url($icon_path); ?>" />
570 <h5 class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html($title); ?></h5>
571 <?php if ($configured) : ?>
572 <span class="superbaddons-integration-card-badge superbaddons-integration-card-badge--connected"><?php echo esc_html__("Connected", "superb-blocks"); ?></span>
573 <?php else : ?>
574 <span class="superbaddons-integration-card-badge"><?php echo esc_html__("Not Connected", "superb-blocks"); ?></span>
575 <?php endif; ?>
576 <?php if ($usage_count > 0) : ?>
577 <span class="superbaddons-integration-usage-badge" data-usage-count="<?php echo intval($usage_count); ?>"><?php echo esc_html(sprintf(
578 /* translators: %d: number of forms */
579 __('In use on %d forms', 'superb-blocks'),
580 $usage_count
581 )); ?></span>
582 <?php endif; ?>
583 </div>
584 <div class="superbaddons-captcha-card-body">
585 <?php if ($configured) : ?>
586 <div class="superbaddons-captcha-card-connected-info">
587 <div class="superbaddons-captcha-card-field">
588 <label class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Site Key", "superb-blocks"); ?></label>
589 <code class="superbaddons-input-api-key-masked"><?php echo esc_html($site_key); ?></code>
590 </div>
591 <div class="superbaddons-captcha-card-field">
592 <label class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Secret Key", "superb-blocks"); ?></label>
593 <code class="superbaddons-input-api-key-masked"><?php echo esc_html($masked_secret); ?></code>
594 </div>
595 <button type="button" class="superbaddons-element-button spbaddons-admin-btn-danger superbaddons-input-api-key-save-btn superbaddons-captcha-remove-btn"
596 data-provider="<?php echo esc_attr($provider); ?>"
597 data-usage-count="<?php echo intval($usage_count); ?>">
598 <img class="superbaddons-element-button-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/trash-light.svg'); ?>" /><?php echo esc_html__("Remove Keys", "superb-blocks"); ?>
599 </button>
600 </div>
601 <?php else : ?>
602 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-captcha-card-description"><?php echo esc_html($description); ?></p>
603 <div class="superbaddons-captcha-key-inputs">
604 <div class="superbaddons-captcha-input-row">
605 <input id="superbaddons-captcha-<?php echo esc_attr($provider); ?>-site-key" type="text" class="superbaddons-input-api-key-input superbaddons-captcha-site-key-input" placeholder="<?php echo esc_attr__("Enter site key", "superb-blocks"); ?>" autocomplete="off" />
606 </div>
607 <div class="superbaddons-captcha-input-row">
608 <input id="superbaddons-captcha-<?php echo esc_attr($provider); ?>-secret-key" type="text" class="superbaddons-input-api-key-input superbaddons-captcha-secret-key-input superbaddons-input-masked" placeholder="<?php echo esc_attr__("Enter secret key", "superb-blocks"); ?>" autocomplete="off" />
609 </div>
610 <button type="button" class="superbaddons-element-button superbaddons-input-api-key-save-btn superbaddons-captcha-save-btn" data-provider="<?php echo esc_attr($provider); ?>" disabled>
611 <?php echo esc_html__("Save Keys", "superb-blocks"); ?>
612 </button>
613 </div>
614 <div class="superbaddons-spinner-wrapper superbaddons-captcha-spinner" style="display:none;">
615 <img class="spbaddons-spinner" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . "/img/blocks-spinner.svg"); ?>" />
616 </div>
617 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray"><a href="<?php echo esc_url($dashboard_url); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($dashboard_label); ?></a></p>
618 <?php endif; ?>
619 </div>
620 </div>
621 <?php
622 }
623
624 private function RenderFormsTabContent()
625 {
626 $configurable_roles = FormPermissions::GetConfigurableRoles();
627 $capabilities = FormPermissions::GetCapabilities();
628 $access_control_enabled = FormAccessControl::IsEnabled();
629
630 $cap_labels = array(
631 'view' => __('View Forms & Submissions', 'superb-blocks'),
632 'delete' => __('Delete Submissions', 'superb-blocks'),
633 'export' => __('Export Submissions', 'superb-blocks'),
634 'sensitive' => __('View Sensitive Fields', 'superb-blocks'),
635 'notes' => __('Manage Notes', 'superb-blocks'),
636 'spam' => __('Manage Spam', 'superb-blocks'),
637 'create' => __('Create Forms', 'superb-blocks'),
638 'edit' => __('Edit Forms', 'superb-blocks'),
639 'configure' => __('Configure Forms', 'superb-blocks'),
640 );
641 $cap_descriptions = array(
642 'view' => __('Access the Forms admin page, view forms and their submissions lists, and read individual form entries.', 'superb-blocks'),
643 'delete' => __('Permanently remove individual or multiple submissions.', 'superb-blocks'),
644 'export' => __('Export & download submissions.', 'superb-blocks'),
645 'sensitive' => __('View the full value of fields marked as sensitive. If disabled, see masked values.', 'superb-blocks'),
646 'notes' => __('Add, view, and delete internal notes on submissions.', 'superb-blocks'),
647 'spam' => __('View spam-filtered submissions and mark them as valid.', 'superb-blocks'),
648 'create' => __('Insert new form blocks into posts and pages. If disabled, form blocks are hidden from the block inserter.', 'superb-blocks'),
649 'edit' => __('Allow editing of form field structure, labels, display settings, colors, and validation rules on existing forms.', 'superb-blocks'),
650 'configure' => __('Allow editing of sensitive form settings: email recipients, anti-spam, integrations, data storage, redirect URLs, and the sensitive field attribute.', 'superb-blocks'),
651 );
652
653 // Split capabilities into groups
654 $submission_caps = array('view', 'delete', 'export', 'sensitive', 'notes', 'spam');
655 $editor_caps = array('create', 'edit', 'configure');
656 ?>
657 <!-- Section A: Access Control -->
658 <div class="superbaddons-settings-section">
659 <div class="superbaddons-section-header superbaddons-section-header--sticky">
660 <h4 class="superbaddons-element-flex-center superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0">
661 <img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-shield-check.svg'); ?>" aria-hidden="true" /><?php echo esc_html__("Access Control", "superb-blocks"); ?>
662 </h4>
663 <div class="superbaddons-save-wrap" id="superbaddons-permissions-save-wrap">
664 <span class="superbaddons-unsaved-label" style="display:none;"><?php echo esc_html__("You have unsaved changes", "superb-blocks"); ?></span>
665 <button type="button" class="superbaddons-element-button superbaddons-element-m0" id="superbaddons-save-permissions-btn"><?php echo esc_html__("Save Access Settings", "superb-blocks"); ?></button>
666 </div>
667 </div>
668 <p class="superbaddons-element-text-xs superbaddons-element-text-gray"><?php echo esc_html__("Control which roles can access forms, form submissions, and related features. By default, all roles with editor access have full permissions.", "superb-blocks"); ?></p>
669
670 <!-- Editor Restrictions Toggle -->
671 <div class="superb-addons-checkbox-input-wrapper" style="margin-bottom: 16px;">
672 <label class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-inlineflex-center superbaddons-element-relative">
673 <input type="checkbox" id="superbaddons-form-access-control-toggle" <?php echo $access_control_enabled ? 'checked' : ''; ?> />
674 <span class="superb-addons-checkbox-checkmark"><img class="superbaddons-admindashboard-content-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" /></span>
675 <span><?php echo esc_html__("Restrict form access by role", "superb-blocks"); ?></span>
676 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
677 </label>
678 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text superbaddons-help-text--expanded">
679 <?php echo esc_html__("When disabled, all roles with editor access have full form and forms page permissions by default.", "superb-blocks"); ?>
680 <span style="display: block; margin-top: 4px;"><?php echo esc_html__("When enabled, each role must be granted permissions explicitly. Only administrators and roles with explicit permissions can access forms, create new form blocks, or modify settings on existing form blocks.", "superb-blocks"); ?></span>
681 </p>
682 </div>
683
684 <div class="superbaddons-role-cards-actions">
685 <button type="button" class="superbaddons-element-colorlink" id="superbaddons-roles-expand-all"><?php echo esc_html__("Expand All", "superb-blocks"); ?></button>
686 <span class="superbaddons-role-cards-actions-separator"></span>
687 <button type="button" class="superbaddons-element-colorlink" id="superbaddons-roles-collapse-all"><?php echo esc_html__("Collapse All", "superb-blocks"); ?></button>
688 </div>
689
690 <div class="superbaddons-role-cards">
691 <!-- Administrator card (locked) -->
692 <details class="superbaddons-role-card superbaddons-role-card--locked">
693 <summary class="superbaddons-role-card-header">
694 <span class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-text-800"><?php echo esc_html__("Administrator", "superb-blocks"); ?></span>
695 <div class="superbaddons-role-badges">
696 <span class="superbaddons-role-badge superbaddons-role-badge--green"><?php echo esc_html__("Full Forms Page Access", "superb-blocks"); ?></span>
697 <span class="superbaddons-role-badge superbaddons-role-badge--green"><?php echo esc_html__("Full Block Access", "superb-blocks"); ?></span>
698 </div>
699 </summary>
700 <div class="superbaddons-role-card-caps">
701 <p class="superbaddons-default-access-notice superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Administrators always have full access to all form features.", "superb-blocks"); ?></p>
702 <span class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-element-text-700"><?php echo esc_html__("Forms Page Permissions", "superb-blocks"); ?></span>
703 <?php foreach ($submission_caps as $cap) : ?>
704 <div class="superb-addons-checkbox-input-wrapper">
705 <label class="spbaddons-checkbox-wrap superbaddons-element-text-gray">
706 <input type="checkbox" checked disabled />
707 <span class="spbaddons-checkbox-mark"><img src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" alt="" aria-hidden="true" /></span>
708 <?php echo esc_html(isset($cap_labels[$cap]) ? $cap_labels[$cap] : $cap); ?>
709 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
710 </label>
711 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html(isset($cap_descriptions[$cap]) ? $cap_descriptions[$cap] : ''); ?></p>
712 </div>
713 <?php endforeach; ?>
714 <div class="superbaddons-editor-caps-group">
715 <span class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-element-text-700"><?php echo esc_html__("Form Block Permissions", "superb-blocks"); ?></span>
716 <?php foreach ($editor_caps as $cap) : ?>
717 <div class="superb-addons-checkbox-input-wrapper">
718 <label class="spbaddons-checkbox-wrap superbaddons-element-text-gray">
719 <input type="checkbox" checked disabled />
720 <span class="spbaddons-checkbox-mark"><img src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" alt="" aria-hidden="true" /></span>
721 <?php echo esc_html(isset($cap_labels[$cap]) ? $cap_labels[$cap] : $cap); ?>
722 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
723 </label>
724 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html(isset($cap_descriptions[$cap]) ? $cap_descriptions[$cap] : ''); ?></p>
725 </div>
726 <?php endforeach; ?>
727 </div>
728 </div>
729 </details>
730 <!-- Configurable role cards -->
731 <?php foreach ($configurable_roles as $role_slug => $role_name) :
732 $role_obj = get_role($role_slug);
733 $has_edit_posts = $role_obj && $role_obj->has_cap('edit_posts');
734 $has_default_access = !$access_control_enabled && $has_edit_posts;
735 ?>
736 <details class="superbaddons-role-card" data-role="<?php echo esc_attr($role_slug); ?>" data-has-editor="<?php echo $has_edit_posts ? '1' : '0'; ?>">
737 <summary class="superbaddons-role-card-header">
738 <span class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-element-text-800"><?php echo esc_html($role_name); ?></span>
739 <div class="superbaddons-role-badges"></div>
740 </summary>
741 <div class="superbaddons-role-card-caps">
742 <?php if (!$has_edit_posts) : ?>
743 <p class="superbaddons-default-access-notice superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("This role does not have editor access. Form block permissions are not available.", "superb-blocks"); ?></p>
744 <?php elseif ($has_default_access) : ?>
745 <p class="superbaddons-default-access-notice superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("This role has full access by default. Enable access control above to customize permissions.", "superb-blocks"); ?></p>
746 <?php else : ?>
747 <p class="superbaddons-default-access-notice superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Configure which form features this role can access.", "superb-blocks"); ?></p>
748 <?php endif; ?>
749 <span class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-element-text-700"><?php echo esc_html__("Forms Page Permissions", "superb-blocks"); ?></span>
750 <?php foreach ($submission_caps as $cap) :
751 $checked = isset($this->FormPermissions[$role_slug][$cap]) && $this->FormPermissions[$role_slug][$cap];
752 ?>
753 <div class="superb-addons-checkbox-input-wrapper">
754 <label class="spbaddons-checkbox-wrap superbaddons-element-text-gray">
755 <input type="checkbox" class="superbaddons-permission-checkbox"
756 data-role="<?php echo esc_attr($role_slug); ?>"
757 data-cap="<?php echo esc_attr($cap); ?>"
758 data-saved="<?php echo $checked ? '1' : '0'; ?>"
759 <?php echo ($has_default_access || $checked) ? 'checked' : ''; ?>
760 <?php echo $has_default_access ? 'disabled' : ''; ?> />
761 <span class="spbaddons-checkbox-mark"><img src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" alt="" aria-hidden="true" /></span>
762 <?php echo esc_html(isset($cap_labels[$cap]) ? $cap_labels[$cap] : $cap); ?>
763 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
764 </label>
765 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html(isset($cap_descriptions[$cap]) ? $cap_descriptions[$cap] : ''); ?></p>
766 </div>
767 <?php endforeach; ?>
768 <div class="superbaddons-editor-caps-group" style="<?php echo ($access_control_enabled || $has_default_access || !$has_edit_posts) ? '' : 'display:none;'; ?>">
769 <span class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-element-text-700"><?php echo esc_html__("Form Block Permissions", "superb-blocks"); ?></span>
770 <?php foreach ($editor_caps as $cap) :
771 $checked = isset($this->FormPermissions[$role_slug][$cap]) && $this->FormPermissions[$role_slug][$cap];
772 $force_disabled = $has_default_access || !$has_edit_posts;
773 ?>
774 <div class="superb-addons-checkbox-input-wrapper<?php echo !$has_edit_posts ? ' superbaddons-cap-disabled' : ''; ?>">
775 <label class="spbaddons-checkbox-wrap superbaddons-element-text-gray">
776 <input type="checkbox" class="superbaddons-permission-checkbox"
777 data-role="<?php echo esc_attr($role_slug); ?>"
778 data-cap="<?php echo esc_attr($cap); ?>"
779 data-saved="<?php echo $checked ? '1' : '0'; ?>"
780 <?php echo ($has_default_access || $checked) && $has_edit_posts ? 'checked' : ''; ?>
781 <?php echo $force_disabled ? 'disabled' : ''; ?> />
782 <span class="spbaddons-checkbox-mark"><img src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/checkmark.svg'); ?>" alt="" aria-hidden="true" /></span>
783 <?php echo esc_html(isset($cap_labels[$cap]) ? $cap_labels[$cap] : $cap); ?>
784 <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button>
785 </label>
786 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html(isset($cap_descriptions[$cap]) ? $cap_descriptions[$cap] : ''); ?></p>
787 </div>
788 <?php endforeach; ?>
789 </div>
790 </div>
791 </details>
792 <?php endforeach; ?>
793 </div>
794 </div>
795
796 <!-- Section B: Outgoing Email -->
797 <div class="superbaddons-settings-section">
798 <div class="superbaddons-section-header">
799 <h4 class="superbaddons-element-flex-center superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0">
800 <img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-envelope-simple.svg'); ?>" aria-hidden="true" /><?php echo esc_html__("Outgoing Email", "superb-blocks"); ?>
801 </h4>
802 <div class="superbaddons-save-wrap" id="superbaddons-email-save-wrap">
803 <span class="superbaddons-unsaved-label" style="display:none;"><?php echo esc_html__("You have unsaved changes", "superb-blocks"); ?></span>
804 <button type="button" class="superbaddons-element-button superbaddons-element-m0" id="superbaddons-save-default-email-btn"><?php echo esc_html__("Save Email Settings", "superb-blocks"); ?></button>
805 </div>
806 </div>
807 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Configure sender details for all form notification emails.", "superb-blocks"); ?></p>
808
809 <div class="superbaddons-general-settings">
810 <div class="superbaddons-setting-row">
811 <div class="superbaddons-setting-row-label">
812 <label class="superbaddons-element-text-xs superbaddons-element-text-gray" for="superbaddons-default-from-name"><?php echo esc_html__('"From" Name', "superb-blocks"); ?></label>
813 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("The sender name used in form notification emails.", "superb-blocks"); ?></p>
814 </div>
815 <div class="superbaddons-setting-row-control">
816 <input id="superbaddons-default-from-name" type="text" class="superbaddons-input-api-key-input"
817 value="<?php echo esc_attr(isset($this->DefaultEmail['from_name']) ? $this->DefaultEmail['from_name'] : ''); ?>"
818 placeholder="<?php echo esc_attr(get_bloginfo('name')); ?>"
819 maxlength="100" />
820 <p class="superbaddons-field-error" id="superbaddons-from-name-error"></p>
821 </div>
822 </div>
823
824 <div class="superbaddons-setting-row">
825 <div class="superbaddons-setting-row-label">
826 <label class="superbaddons-element-text-xs superbaddons-element-text-gray" for="superbaddons-default-from-email"><?php echo esc_html__('"From" Email', "superb-blocks"); ?></label>
827 <p class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("The sender address used in form notification emails.", "superb-blocks"); ?></p>
828 </div>
829 <div class="superbaddons-setting-row-control">
830 <input id="superbaddons-default-from-email" type="email" class="superbaddons-input-api-key-input"
831 value="<?php echo esc_attr(isset($this->DefaultEmail['from_email']) ? $this->DefaultEmail['from_email'] : ''); ?>"
832 placeholder="<?php echo esc_attr(get_option('admin_email')); ?>" />
833 <p class="superbaddons-field-error" id="superbaddons-from-email-error"></p>
834 </div>
835 </div>
836
837 </div>
838 </div>
839
840 <!-- Section C: Data Retention -->
841 <div class="superbaddons-settings-section">
842 <h4 class="superbaddons-element-flex-center superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0">
843 <img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-clock-countdown.svg'); ?>" aria-hidden="true" /><?php echo esc_html__("Data Retention", "superb-blocks"); ?>
844 </h4>
845 <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("Automatically delete old submissions for GDPR compliance. Spam entries have their own 30-day purge cycle.", "superb-blocks"); ?></p>
846
847 <div class="superbaddons-general-settings">
848 <div class="superbaddons-setting-row">
849 <div class="superbaddons-setting-row-label">
850 <label class="superbaddons-element-text-xs superbaddons-element-text-gray" for="superbaddons-data-retention-select"><?php echo esc_html__("Delete submissions", "superb-blocks"); ?></label>
851 </div>
852 <div class="superbaddons-setting-row-control">
853 <div class="superbaddons-data-retention-wrapper">
854 <select id="superbaddons-data-retention-select" class="superbaddons-data-retention-select">
855 <option value="0" <?php selected($this->DataRetentionDays, 0); ?>><?php echo esc_html__("Never", "superb-blocks"); ?></option>
856 <option value="30" <?php selected($this->DataRetentionDays, 30); ?>><?php echo esc_html__("After 30 days", "superb-blocks"); ?></option>
857 <option value="60" <?php selected($this->DataRetentionDays, 60); ?>><?php echo esc_html__("After 60 days", "superb-blocks"); ?></option>
858 <option value="90" <?php selected($this->DataRetentionDays, 90); ?>><?php echo esc_html__("After 90 days", "superb-blocks"); ?></option>
859 <option value="180" <?php selected($this->DataRetentionDays, 180); ?>><?php echo esc_html__("After 180 days", "superb-blocks"); ?></option>
860 <option value="365" <?php selected($this->DataRetentionDays, 365); ?>><?php echo esc_html__("After 365 days", "superb-blocks"); ?></option>
861 </select>
862 <?php if ($this->DataRetentionDays > 0) : ?>
863 <div class="superbaddons-data-retention-warning" id="superbaddons-data-retention-warning">
864 <img class="superbaddons-admindashboard-content-icon" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-warning-octagon.svg'); ?>" />
865 <span class="superbaddons-element-text-xxs"><?php echo esc_html(sprintf(
866 /* translators: %d: number of days */
867 __('Submissions older than %d days are automatically deleted.', 'superb-blocks'),
868 $this->DataRetentionDays
869 )); ?></span>
870 </div>
871 <?php endif; ?>
872 </div>
873 </div>
874 </div>
875 </div>
876 </div>
877 <?php
878 }
879
880 private function MaybeDisplayKeyIssue()
881 {
882 if (!$this->KeyHasIssue) {
883 return;
884 }
885 ?>
886 <div class="spbaddons-license-issue-wrapper">
887 <?php printf('<img src="%s" alt="%s"/>', esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-warning-octagon.svg'), esc_attr__("Issue Detected", "superb-blocks")); ?>
888 <p>
889 <?php
890 if (
891 $this->KeyStatus['expired']
892 ) {
893 esc_html_e('It looks like your subscription has expired. Please renew your subscription or contact support for assistance.', "superb-blocks");
894 } elseif (
895 !$this->KeyStatus['active']
896 ) {
897 esc_html_e('It looks like your license key has been disabled. Please contact support for assistance.', "superb-blocks");
898 } elseif (
899 !$this->KeyStatus['verified']
900 ) {
901 esc_html_e('It seems that your license key verification for this website is no longer valid. Run the automatic scan on the Get Help page to resolve this automatically.', "superb-blocks");
902 } elseif (
903 $this->KeyStatus['exceeded']
904 ) {
905 esc_html_e('It looks like your license key has been activated on too many domains. Please renew your subscription, deactivate your license key on some of your domains, or contact support for assistance.', "superb-blocks");
906 }
907 ?>
908 <?php if ($this->KeyStatus['expired'] || $this->KeyStatus['exceeded']): ?>
909 <br />
910 <a href="<?php echo esc_url(AdminLinkUtil::GetLink(AdminLinkSource::DEFAULT, array("url" => "https://superbthemes.com/renew-subscription/"))); ?>" target="_blank" class="superbaddons-element-colorlink">
911 <?php echo esc_html__("Renew License", "superb-blocks"); ?>
912 </a>
913 <br />
914 <small>
915 <?php echo esc_html__("If you have already renewed your subscription, run the automatic scan to re-verify your license.", "superb-blocks"); ?>
916 <a href="<?php echo esc_url(admin_url('admin.php?page=' . DashboardController::SUPPORT)); ?>" class="superbaddons-element-colorlink">
917 <?php echo esc_html__("Run Automatic Scan", "superb-blocks"); ?>
918 </a>
919 </small>
920 <?php endif; ?>
921 </p>
922 <?php
923 if (!$this->KeyStatus['verified']) : ?>
924 <a href="<?php echo esc_url(admin_url('admin.php?page=' . DashboardController::SUPPORT)); ?>" class="superbaddons-element-button">
925 <?php echo esc_html__("Run Automatic Scan", "superb-blocks"); ?>
926 </a>
927 <?php endif; ?>
928 </div>
929 <?php
930 }
931
932 private function MaybeDisplayPremiumPluginMissingNotice()
933 {
934 if (!KeyController::HasValidKey()) {
935 return;
936 }
937 ?>
938 <div id="spbaddons-premium-plugin-missing-notice" class="spbaddons-license-issue-wrapper" style="display:none;">
939 <?php printf('<img src="%s" alt="%s"/>', esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-warning-octagon.svg'), esc_attr__("Premium Plugin Required", "superb-blocks")); ?>
940 <p>
941 <?php esc_html_e('Your license key is active, but the required premium plugin is not installed on this site. Some premium features will not be available until it is installed and activated.', "superb-blocks"); ?>
942 </p>
943 <a href="<?php echo esc_url(AdminLinkUtil::GetLink(AdminLinkSource::DEFAULT, array("url" => "https://superbthemes.com/license-key/"))); ?>" target="_blank" rel="noopener" class="superbaddons-element-button">
944 <?php echo esc_html__("View Installation Guide", "superb-blocks"); ?>
945 </a>
946 </div>
947 <?php
948 }
949
950 private function MaybeDisplayRewriteIssue()
951 {
952 if (!RewriteCheckController::HasDetectedIssue()) {
953 return;
954 }
955 ?>
956 <div class="spbaddons-license-issue-wrapper">
957 <?php printf('<img src="%s" alt="%s"/>', esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-warning-octagon.svg'), esc_attr__("Issue Detected", "superb-blocks")); ?>
958 <p>
959 <?php esc_html_e('A permalink configuration issue has been detected that may prevent license key activation and other features from working correctly. This can be resolved automatically on the Get Help page.', "superb-blocks"); ?>
960 </p>
961 <a href="<?php echo esc_url(admin_url('admin.php?page=' . DashboardController::SUPPORT)); ?>" class="superbaddons-element-button">
962 <?php echo esc_html__("Go to Get Help", "superb-blocks"); ?>
963 </a>
964 </div>
965 <?php
966 }
967 }
968