PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 0.0.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v0.0.8
2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 0.0.2 0.0.3 All 96 releases
sureforms / admin / admin.php

admin.php in SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz 0.0.8, at admin/admin.php

558 lines 18.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin Class.
4 *
5 * @package sureforms.
6 */
7
8 namespace SRFM\Admin;
9
10 use SRFM\Inc\Traits\Get_Instance;
11 use SRFM\Inc\AI_Form_Builder\AI_Helper;
12 use SRFM\Inc\Helper;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17 /**
18 * Admin handler class.
19 *
20 * @since 0.0.1
21 */
22 class Admin {
23
24 use Get_Instance;
25
26 /**
27 * Class constructor.
28 *
29 * @return void
30 * @since 0.0.1
31 */
32 public function __construct() {
33 add_action( 'admin_menu', [ $this, 'add_menu_page' ], 9 );
34 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
35 add_action( 'admin_menu', [ $this, 'settings_page' ] );
36 add_action( 'admin_menu', [ $this, 'add_new_form' ] );
37 add_filter( 'plugin_action_links', [ $this, 'add_settings_link' ], 10, 2 );
38 add_action( 'enqueue_block_assets', [ $this, 'enqueue_styles' ] );
39 add_action( 'admin_head', [ $this, 'enqueue_header_styles' ] );
40 add_action( 'admin_body_class', [ $this, 'admin_template_picker_body_class' ] );
41
42 // this action is used to restrict Spectra's quick action bar on SureForms CPTS.
43 add_action( 'uag_enable_quick_action_sidebar', [ $this, 'restrict_spectra_quick_action_bar' ] );
44
45 }
46
47 /**
48 * Sureforms editor header styles.
49 *
50 * @since 0.0.1
51 */
52 public function enqueue_header_styles() {
53 $current_screen = get_current_screen();
54 $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
55 $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
56
57 $css_uri = SRFM_URL . 'assets/css/' . $dir_name . '/';
58
59 /* RTL */
60 if ( is_rtl() ) {
61 $file_prefix .= '-rtl';
62 }
63
64 if ( 'sureforms_form' === $current_screen->id ) {
65 wp_enqueue_style( SRFM_SLUG . '-editor-header-styles', $css_uri . 'header-styles' . $file_prefix . '.css', [], SRFM_VER );
66 }
67 }
68
69 /**
70 * Add menu page.
71 *
72 * @return void
73 * @since 0.0.1
74 */
75 public function add_menu_page() {
76 if ( ! current_user_can( 'manage_options' ) ) {
77 return;
78 }
79
80 $capability = 'manage_options';
81 $menu_slug = 'sureforms_menu';
82
83 $logo = file_get_contents( plugin_dir_path( SRFM_FILE ) . 'images/icon.svg' );
84 add_menu_page(
85 __( 'SureForms', 'sureforms' ),
86 __( 'SureForms', 'sureforms' ),
87 'edit_others_posts',
88 $menu_slug,
89 function () {},
90 'data:image/svg+xml;base64,' . base64_encode( $logo ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
91 30
92 );
93
94 // Add the Dashboard Submenu.
95 add_submenu_page(
96 $menu_slug,
97 __( 'Dashboard', 'sureforms' ),
98 __( 'Dashboard', 'sureforms' ),
99 $capability,
100 $menu_slug,
101 [ $this, 'render_dashboard' ]
102 );
103 }
104
105 /**
106 * Add Settings page.
107 *
108 * @return void
109 * @since 0.0.1
110 */
111 public function settings_page() {
112 $callback = [ $this, 'settings_page_callback' ];
113 add_submenu_page(
114 'sureforms_menu',
115 __( 'Settings', 'sureforms' ),
116 __( 'Settings', 'sureforms' ),
117 'edit_others_posts',
118 'sureforms_form_settings',
119 $callback
120 );
121
122 // Get the current submenu page.
123 $submenu_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- $_GET['page'] does not provide nonce.
124
125 if ( ! isset( $_GET['tab'] ) && 'sureforms_form_settings' === $submenu_page ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- $_GET['page'] does not provide nonce.
126 wp_safe_redirect( admin_url( 'admin.php?page=sureforms_form_settings&tab=general-settings' ) );
127 exit;
128 }
129 }
130
131 /**
132 * Render Admin Dashboard.
133 *
134 * @return void
135 * @since 0.0.1
136 */
137 public function render_dashboard() {
138 echo '<div id="srfm-dashboard-container"></div>';
139 }
140
141 /**
142 * Settings page callback.
143 *
144 * @return void
145 * @since 0.0.1
146 */
147 public function settings_page_callback() {
148 echo '<div id="srfm-settings-container"></div>';
149 }
150
151 /**
152 * Add new form menu item.
153 *
154 * @return void
155 * @since 0.0.1
156 */
157 public function add_new_form() {
158 add_submenu_page(
159 'sureforms_menu',
160 __( 'New Form', 'sureforms' ),
161 __( 'New Form', 'sureforms' ),
162 'edit_others_posts',
163 'add-new-form',
164 [ $this, 'add_new_form_callback' ],
165 2
166 );
167 }
168
169 /**
170 * Add new form mentu item callback.
171 *
172 * @return void
173 * @since 0.0.1
174 */
175 public function add_new_form_callback() {
176 echo '<div id="srfm-add-new-form-container"></div>';
177 }
178
179 /**
180 * Adds a settings link to the plugin action links on the plugins page.
181 *
182 * @param array $links An array of plugin action links.
183 * @param string $file The plugin file path.
184 * @return array The updated array of plugin action links.
185 * @since 0.0.1
186 */
187 public function add_settings_link( $links, $file ) {
188 if ( 'sureforms/sureforms.php' === $file ) {
189 $plugin_links = apply_filters(
190 'sureforms_plugin_action_links',
191 [
192 'sureforms_settings' => '<a href="' . esc_url( admin_url( 'admin.php?page=sureforms_form_settings&tab=general-settings' ) ) . '">' . esc_html__( 'Settings', 'sureforms' ) . '</a>',
193 ]
194 );
195 $links = array_merge( $plugin_links, $links );
196 }
197 return $links;
198 }
199
200 /**
201 * Sureforms block editor styles.
202 *
203 * @since 0.0.1
204 */
205 public function enqueue_styles() {
206 $current_screen = get_current_screen();
207
208 $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
209 $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
210
211 $css_uri = SRFM_URL . 'assets/css/' . $dir_name . '/';
212 $vendor_css_uri = SRFM_URL . 'assets/css/minified/deps/';
213
214 /* RTL */
215 if ( is_rtl() ) {
216 $file_prefix .= '-rtl';
217 }
218
219 // Enqueue editor styles for post and page.
220 if ( SRFM_FORMS_POST_TYPE === $current_screen->post_type ) {
221 wp_enqueue_style( SRFM_SLUG . '-editor', $css_uri . 'backend/editor' . $file_prefix . '.css', [], SRFM_VER );
222 wp_enqueue_style( SRFM_SLUG . '-backend-blocks', $css_uri . 'blocks/default/backend' . $file_prefix . '.css', [], SRFM_VER );
223 wp_enqueue_style( SRFM_SLUG . '-intl', $vendor_css_uri . 'intl/intlTelInput-backend.min.css', [], SRFM_VER );
224 wp_enqueue_style( SRFM_SLUG . '-common', $css_uri . 'common' . $file_prefix . '.css', [], SRFM_VER );
225 wp_enqueue_style( SRFM_SLUG . '-reactQuill', $vendor_css_uri . 'quill/quill.snow.css', [], SRFM_VER );
226 wp_enqueue_style( SRFM_SLUG . '-single-form-modal', $css_uri . 'single-form-setting' . $file_prefix . '.css', [], SRFM_VER );
227 }
228
229 wp_enqueue_style( SRFM_SLUG . '-form-selector', $css_uri . 'srfm-form-selector' . $file_prefix . '.css', [], SRFM_VER );
230 wp_enqueue_style( SRFM_SLUG . '-common-editor', SRFM_URL . 'assets/build/common-editor.css', [], SRFM_VER, 'all' );
231 }
232
233 /**
234 * Get Breadcrumbs for current page.
235 *
236 * @since 0.0.1
237 * @return array Breadcrumbs Array.
238 */
239 public function get_breadcrumbs_for_current_page() {
240 global $post, $pagenow;
241 $breadcrumbs = [];
242
243 if ( 'admin.php' === $pagenow && isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
244 $page_title = get_admin_page_title();
245 $breadcrumbs[] = [
246 'title' => $page_title,
247 'link' => '',
248 ];
249 } elseif ( $post && in_array( $pagenow, [ 'post.php', 'post-new.php', 'edit.php' ], true ) ) {
250 $post_type_obj = get_post_type_object( get_post_type() );
251 if ( $post_type_obj ) {
252 $post_type_plural = $post_type_obj->labels->name;
253 $breadcrumbs[] = [
254 'title' => $post_type_plural,
255 'link' => admin_url( 'edit.php?post_type=' . $post_type_obj->name ),
256 ];
257
258 if ( 'edit.php' === $pagenow && ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
259 $breadcrumbs[ count( $breadcrumbs ) - 1 ]['link'] = '';
260 } else {
261 $breadcrumbs[] = [
262 /* Translators: Post Title. */
263 'title' => sprintf( __( 'Edit %1$s', 'sureforms' ), get_the_title() ),
264 'link' => get_edit_post_link( $post->ID ),
265 ];
266 }
267 }
268 } else {
269 $current_screen = get_current_screen();
270 if ( $current_screen && 'sureforms_form' === $current_screen->post_type ) {
271 $breadcrumbs[] = [
272 'title' => 'Forms',
273 'link' => '',
274 ];
275 } elseif ( $current_screen && 'sureforms_entry' === $current_screen->post_type ) {
276 $breadcrumbs[] = [
277 'title' => 'Entries',
278 'link' => '',
279 ];
280 } else {
281 $breadcrumbs[] = [
282 'title' => '',
283 'link' => '',
284 ];
285 }
286 }
287
288 return $breadcrumbs;
289 }
290
291
292 /**
293 * Enqueue Admin Scripts.
294 *
295 * @return void
296 * @since 0.0.1
297 */
298 public function enqueue_scripts() {
299 $current_screen = get_current_screen();
300
301 $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
302 $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
303 $js_uri = SRFM_URL . 'assets/js/' . $dir_name . '/';
304 $css_uri = SRFM_URL . 'assets/css/' . $dir_name . '/';
305
306 /* RTL */
307 if ( is_rtl() ) {
308 $file_prefix .= '-rtl';
309 }
310
311 $localization_data = [
312 'site_url' => get_site_url(),
313 'breadcrumbs' => $this->get_breadcrumbs_for_current_page(),
314 'sureforms_dashboard_url' => admin_url( '/admin.php?page=sureforms_menu' ),
315 'plugin_version' => SRFM_VER,
316 'global_settings_nonce' => current_user_can( 'manage_options' ) ? wp_create_nonce( 'wp_rest' ) : '',
317 'is_pro_active' => defined( 'SRFM_PRO_VER' ),
318 'pro_plugin_version' => defined( 'SRFM_PRO_VER' ) ? SRFM_PRO_VER : '',
319 'sureforms_pricing_page' => $this->get_sureforms_website_url( 'pricing' ),
320 'field_spacing_vars' => Helper::get_css_vars(),
321 ];
322
323 if ( class_exists( 'SRFM_PRO\Admin\Licensing' ) ) {
324 $license_active = \SRFM_PRO\Admin\Licensing::is_license_active();
325 $localization_data['is_license_active'] = $license_active;
326 }
327
328 if ( SRFM_FORMS_POST_TYPE === $current_screen->post_type || 'toplevel_page_sureforms_menu' === $current_screen->base || SRFM_ENTRIES_POST_TYPE === $current_screen->post_type
329 || 'sureforms_page_sureforms_form_settings' === $current_screen->id
330 ) {
331 $asset_handle = '-dashboard';
332
333 wp_enqueue_style( SRFM_SLUG . $asset_handle . '-font', 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap', [], SRFM_VER );
334
335 $script_asset_path = SRFM_DIR . 'assets/build/dashboard.asset.php';
336 $script_info = file_exists( $script_asset_path )
337 ? include $script_asset_path
338 : [
339 'dependencies' => [],
340 'version' => SRFM_VER,
341 ];
342 wp_enqueue_script( SRFM_SLUG . $asset_handle, SRFM_URL . 'assets/build/dashboard.js', $script_info['dependencies'], SRFM_VER, true );
343
344 wp_localize_script( SRFM_SLUG . $asset_handle, 'scIcons', [ 'path' => SRFM_URL . 'assets/build/icon-assets' ] );
345
346 $localization_data['security_settings_url'] = admin_url( '/admin.php?page=sureforms_form_settings&tab=security-settings' );
347 wp_localize_script(
348 SRFM_SLUG . $asset_handle,
349 SRFM_SLUG . '_admin',
350 apply_filters(
351 SRFM_SLUG . '_admin_filter',
352 $localization_data
353 )
354 );
355 wp_enqueue_style( SRFM_SLUG . '-dashboard', SRFM_URL . 'assets/build/dashboard.css', [], SRFM_VER, 'all' );
356
357 }
358
359 if ( 'sureforms_page_sureforms_form_settings' === $current_screen->id ) {
360 wp_enqueue_style( SRFM_SLUG . '-settings', $css_uri . 'backend/settings' . $file_prefix . '.css', [], SRFM_VER );
361 }
362
363 // Admin Submenu Styles.
364 wp_enqueue_style( SRFM_SLUG . '-admin', $css_uri . 'backend/admin' . $file_prefix . '.css', [], SRFM_VER );
365
366 if ( 'edit-' . SRFM_FORMS_POST_TYPE === $current_screen->id || 'edit-' . SRFM_ENTRIES_POST_TYPE === $current_screen->id ) {
367 $asset_handle = 'page_header';
368
369 $script_asset_path = SRFM_DIR . 'assets/build/' . $asset_handle . '.asset.php';
370 $script_info = file_exists( $script_asset_path )
371 ? include $script_asset_path
372 : [
373 'dependencies' => [],
374 'version' => SRFM_VER,
375 ];
376 wp_enqueue_script( SRFM_SLUG . '-form-page-header', SRFM_URL . 'assets/build/' . $asset_handle . '.js', $script_info['dependencies'], SRFM_VER, true );
377 wp_enqueue_style( SRFM_SLUG . '-form-archive-styles', $css_uri . 'form-archive-styles' . $file_prefix . '.css', [], SRFM_VER );
378 }
379 if ( 'sureforms_page_' . SRFM_FORMS_POST_TYPE . '_settings' === $current_screen->base ) {
380 $asset_handle = 'settings';
381
382 $script_asset_path = SRFM_DIR . 'assets/build/' . $asset_handle . '.asset.php';
383 $script_info = file_exists( $script_asset_path )
384 ? include $script_asset_path
385 : [
386 'dependencies' => [],
387 'version' => SRFM_VER,
388 ];
389
390 wp_enqueue_script( SRFM_SLUG . '-settings', SRFM_URL . 'assets/build/' . $asset_handle . '.js', $script_info['dependencies'], SRFM_VER, true );
391 wp_enqueue_style( SRFM_SLUG . '-setting-styles', SRFM_URL . 'assets/build/' . $asset_handle . '.css', [ 'wp-components' ], SRFM_VER, 'all' );
392 wp_localize_script(
393 SRFM_SLUG . '-settings',
394 SRFM_SLUG . '_admin',
395 $localization_data
396 );
397 }
398 if ( 'edit-' . SRFM_FORMS_POST_TYPE === $current_screen->id ) {
399 wp_enqueue_script( SRFM_SLUG . '-form-archive', $js_uri . 'form-archive' . $file_prefix . '.js', [], SRFM_VER, true );
400 wp_enqueue_script( SRFM_SLUG . '-export', $js_uri . 'export' . $file_prefix . '.js', [ 'wp-i18n' ], SRFM_VER, true );
401 wp_localize_script(
402 SRFM_SLUG . '-export',
403 SRFM_SLUG . '_export',
404 [
405 'ajaxurl' => admin_url( 'admin-ajax.php' ),
406 'srfm_export_nonce' => wp_create_nonce( 'export_form_nonce' ),
407 'site_url' => get_site_url(),
408 'srfm_import_endpoint' => '/wp-json/sureforms/v1/sureforms_import',
409 'import_form_nonce' => ( current_user_can( 'edit_posts' ) ) ? wp_create_nonce( 'wp_rest' ) : '',
410 ]
411 );
412
413 wp_enqueue_script( SRFM_SLUG . '-backend', $js_uri . 'backend' . $file_prefix . '.js', [], SRFM_VER, true );
414 wp_localize_script(
415 SRFM_SLUG . '-backend',
416 SRFM_SLUG . '_backend',
417 [
418 'site_url' => get_site_url(),
419 ]
420 );
421
422 }
423
424 if ( 'sureforms_page_add-new-form' === $current_screen->id ) {
425
426 $file_prefix = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? '' : '.min';
427 $dir_name = defined( 'SRFM_DEBUG' ) && SRFM_DEBUG ? 'unminified' : 'minified';
428
429 $css_uri = SRFM_URL . 'assets/css/' . $dir_name . '/';
430
431 /* RTL */
432 if ( is_rtl() ) {
433 $file_prefix .= '-rtl';
434 }
435
436 wp_enqueue_style( SRFM_SLUG . '-template-picker', $css_uri . 'template-picker' . $file_prefix . '.css', [], SRFM_VER );
437
438 $sureforms_admin = 'templatePicker';
439
440 $script_asset_path = SRFM_DIR . 'assets/build/' . $sureforms_admin . '.asset.php';
441 $script_info = file_exists( $script_asset_path )
442 ? include $script_asset_path
443 : [
444 'dependencies' => [],
445 'version' => SRFM_VER,
446 ];
447 wp_enqueue_script( SRFM_SLUG . '-template-picker', SRFM_URL . 'assets/build/' . $sureforms_admin . '.js', $script_info['dependencies'], SRFM_VER, true );
448
449 wp_localize_script(
450 SRFM_SLUG . '-template-picker',
451 SRFM_SLUG . '_admin',
452 [
453 'site_url' => get_site_url(),
454 'plugin_url' => SRFM_URL,
455 'preview_images_url' => SRFM_URL . 'images/template-previews/',
456 'admin_url' => admin_url( 'admin.php' ),
457 'new_template_picker_base_url' => admin_url( 'post-new.php?post_type=sureforms_form' ),
458 'capability' => current_user_can( 'edit_posts' ),
459 'template_picker_nonce' => current_user_can( 'edit_posts' ) ? wp_create_nonce( 'wp_rest' ) : '',
460 'is_pro_active' => defined( 'SRFM_PRO_VER' ),
461 'srfm_ai_usage_details' => AI_Helper::get_current_usage_details(),
462 'srfm_ai_auth_user_email' => get_option( 'srfm_ai_auth_user_email' ),
463 'pricing_page_url' => $this->get_sureforms_website_url( 'pricing' ),
464 ]
465 );
466 }
467 // Quick action sidebar.
468 $default_allowed_quick_sidebar_blocks = apply_filters(
469 'srfm_quick_sidebar_allowed_blocks',
470 [
471 'srfm/input',
472 'srfm/email',
473 'srfm/textarea',
474 'srfm/checkbox',
475 'srfm/number',
476 'srfm/inline-button',
477 'srfm/advanced-heading',
478 ]
479 );
480 if ( ! is_array( $default_allowed_quick_sidebar_blocks ) ) {
481 $default_allowed_quick_sidebar_blocks = [];
482 }
483
484 $srfm_enable_quick_action_sidebar = get_option( 'srfm_enable_quick_action_sidebar' );
485 if ( ! $srfm_enable_quick_action_sidebar ) {
486 $srfm_enable_quick_action_sidebar = 'disabled';
487 }
488 $quick_sidebar_allowed_blocks = get_option( 'srfm_quick_sidebar_allowed_blocks' );
489 $quick_sidebar_allowed_blocks = ! empty( $quick_sidebar_allowed_blocks ) && is_array( $quick_sidebar_allowed_blocks ) ? $quick_sidebar_allowed_blocks : $default_allowed_quick_sidebar_blocks;
490 $srfm_ajax_nonce = wp_create_nonce( 'srfm_ajax_nonce' );
491 wp_enqueue_script( SRFM_SLUG . '-quick-action-siderbar', SRFM_URL . 'assets/build/quickActionSidebar.js', [], SRFM_VER, true );
492 wp_localize_script(
493 SRFM_SLUG . '-quick-action-siderbar',
494 SRFM_SLUG . '_quick_sidebar_blocks',
495 [
496 'allowed_blocks' => $quick_sidebar_allowed_blocks,
497 'srfm_enable_quick_action_sidebar' => $srfm_enable_quick_action_sidebar,
498 'srfm_ajax_nonce' => $srfm_ajax_nonce,
499 'srfm_ajax_url' => admin_url( 'admin-ajax.php' ),
500 ]
501 );
502
503 /**
504 * Enqueuing SureTriggers Integration script.
505 * This script loads suretriggers iframe in Intergations tab.
506 */
507 if ( SRFM_FORMS_POST_TYPE === $current_screen->post_type ) {
508 wp_enqueue_script( SRFM_SLUG . '-suretriggers-integration', SRFM_SURETRIGGERS_INTERGATION_BASE_URL . 'js/embed.js', [], SRFM_VER, true );
509 }
510 }
511
512 /**
513 * Form Template Picker Admin Body Classes
514 *
515 * @since 0.0.1
516 * @param string $classes Space separated class string.
517 */
518 public function admin_template_picker_body_class( $classes = '' ) {
519 $theme_builder_class = isset( $_GET['page'] ) && 'add-new-form' === $_GET['page'] ? 'srfm-template-picker' : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Fetching a $_GET value, no nonce available to validate.
520 $classes .= ' ' . $theme_builder_class . ' ';
521
522 return $classes;
523
524 }
525
526 /**
527 * Disable spectra's quick action bar in sureforms CPT.
528 *
529 * @param string $status current status of the quick action bar.
530 * @since 0.0.2
531 * @return string
532 */
533 public function restrict_spectra_quick_action_bar( $status ) {
534 $screen = get_current_screen();
535 if ( 'disabled' !== $status && isset( $screen->id ) && 'sureforms_form' === $screen->id ) {
536 $status = 'disabled';
537 }
538
539 return $status;
540 }
541
542 /**
543 * Get SureForms Website URL.
544 *
545 * @param string $trail The URL trail to append to SureForms website URL. The parameter should not include a leading slash as the base URL already ends with a trailing slash.
546 * @since 0.0.7
547 * @return string
548 */
549 public static function get_sureforms_website_url( $trail ) {
550 $url = SRFM_WEBSITE;
551 if ( ! empty( $trail ) && is_string( $trail ) ) {
552 $url = SRFM_WEBSITE . $trail;
553 }
554
555 return esc_url( $url );
556 }
557 }
558