PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.10
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.10
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmSettingsController.php +29 -30 6.5.26.10 View file →
@@ -20,9 +20,9 @@
20 20 public static function license_box() {
21 21 if ( ! current_user_can( 'activate_plugins' ) ) {
22 22 return;
23 23 }
24 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' );
24 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php';
25 25 }
26 26
27 27 public static function display_form( $errors = array(), $message = '' ) {
28 28 global $frm_vars;
@@ -34,9 +34,9 @@
34 34
35 35 $sections = self::get_settings_tabs();
36 36 $current = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' );
37 37
38 - require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' );
38 + require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php';
39 39 }
40 40
41 41 /**
42 42 * Get sections to use for Global Settings.
@@ -44,27 +44,27 @@
44 44 * @return array<array>
45 45 */
46 46 private static function get_settings_tabs() {
47 47 $sections = array(
48 - 'general' => array(
48 + 'general' => array(
49 49 'class' => __CLASS__,
50 50 'function' => 'general_settings',
51 51 'name' => __( 'General Settings', 'formidable' ),
52 52 'icon' => 'frm_icon_font frm_settings_icon',
53 53 ),
54 - 'messages' => array(
54 + 'messages' => array(
55 55 'class' => __CLASS__,
56 56 'function' => 'message_settings',
57 57 'name' => __( 'Message Defaults', 'formidable' ),
58 58 'icon' => 'frm_icon_font frm_stamp_icon',
59 59 ),
60 - 'permissions' => array(
60 + 'permissions' => array(
61 61 'class' => __CLASS__,
62 62 'function' => 'permission_settings',
63 63 'name' => __( 'Permissions', 'formidable' ),
64 64 'icon' => 'frm_icon_font frm_lock_icon',
65 65 ),
66 - 'custom_css' => array(
66 + 'custom_css' => array(
67 67 'class' => 'FrmStylesController',
68 68 'function' => 'custom_css',
69 69 'name' => __( 'Custom CSS', 'formidable' ),
70 70 'icon' => 'frm_icon_font frm_code_icon',
@@ -74,15 +74,15 @@
74 74 'function' => 'manage',
75 75 'name' => __( 'Manage Styles', 'formidable' ),
76 76 'icon' => 'frm_icon_font frm_pallet_icon',
77 77 ),
78 - 'captcha' => array(
78 + 'captcha' => array(
79 79 'class' => __CLASS__,
80 80 'function' => 'captcha_settings',
81 81 'name' => __( 'Captcha', 'formidable' ),
82 82 'icon' => 'frm_icon_font frm_shield_check_icon',
83 83 ),
84 - 'white_label' => array(
84 + 'white_label' => array(
85 85 'name' => __( 'White Labeling', 'formidable' ),
86 86 'icon' => 'frm_icon_font frm_ghost_icon',
87 87 'html_class' => 'frm_show_upgrade_tab frm_noallow',
88 88 'data' => array(
@@ -90,9 +90,9 @@
90 90 'upgrade' => __( 'White labeling options', 'formidable' ),
91 91 'screenshot' => 'white-label.png',
92 92 ),
93 93 ),
94 - 'inbox' => array(
94 + 'inbox' => array(
95 95 'name' => __( 'Inbox', 'formidable' ),
96 96 'icon' => 'frm_icon_font frm_email_icon',
97 97 'html_class' => 'frm_show_upgrade_tab frm_noallow',
98 98 'data' => array(
@@ -118,13 +118,13 @@
118 118 $sections['licenses'] = array(
119 119 'class' => 'FrmAddonsController',
120 120 'function' => 'license_settings',
121 121 'name' => __( 'Plugin Licenses', 'formidable' ),
122 - 'icon' => 'frm_icon_font frm_keyalt_icon',
122 + 'icon' => 'frmfont frm_key_icon',
123 123 'ajax' => true,
124 124 );
125 125 }
126 - }
126 + }//end if
127 127
128 128 /**
129 129 * @param array<array> $sections
130 130 */
@@ -158,9 +158,9 @@
158 158 $section['function'] = $original;
159 159 }
160 160
161 161 $sections[ $key ] = $section;
162 - }
162 + }//end foreach
163 163
164 164 return $sections;
165 165 }
166 166
@@ -202,9 +202,9 @@
202 202 /**
203 203 * Render the global currency selector if Pro is up to date.
204 204 *
205 205 * @param FrmSettings $frm_settings
206 - * @param string $more_html
206 + * @param string $more_html
207 207 * @return void
208 208 */
209 209 public static function maybe_render_currency_selector( $frm_settings, $more_html ) {
210 210 if ( false !== strpos( $more_html, 'id="frm_currency"' ) ) {
@@ -222,9 +222,9 @@
222 222 */
223 223 public static function message_settings() {
224 224 $frm_settings = FrmAppHelper::get_settings();
225 225
226 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/messages.php' );
226 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/messages.php';
227 227 }
228 228
229 229 /**
230 230 * @since 4.0
@@ -232,9 +232,9 @@
232 232 public static function captcha_settings() {
233 233 $frm_settings = FrmAppHelper::get_settings();
234 234 $captcha_lang = FrmAppHelper::locales( 'captcha' );
235 235
236 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php' );
236 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php';
237 237 }
238 238
239 239 /**
240 240 * @since 4.0
@@ -242,9 +242,9 @@
242 242 public static function permission_settings() {
243 243 $frm_settings = FrmAppHelper::get_settings();
244 244 $frm_roles = FrmAppHelper::frm_capabilities();
245 245
246 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/permissions.php' );
246 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/permissions.php';
247 247 }
248 248
249 249 /**
250 250 * @since 4.0
@@ -251,15 +251,15 @@
251 251 */
252 252 public static function misc_settings() {
253 253 $frm_settings = FrmAppHelper::get_settings();
254 254
255 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php' );
255 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php';
256 256 }
257 257
258 258 /**
259 259 * Save form data submitted from the Global settings page.
260 260 *
261 - * @param string|bool $stop_load
261 + * @param bool|string $stop_load
262 262 *
263 263 * @return void
264 264 */
265 265 public static function process_form( $stop_load = false ) {
@@ -268,9 +268,15 @@
268 268 $frm_settings = FrmAppHelper::get_settings();
269 269 $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' );
270 270
271 271 if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) {
272 - wp_die( esc_html( $frm_settings->admin_permission ) );
272 + $error_args = array(
273 + 'title' => __( 'Verification failed', 'formidable' ),
274 + 'body' => $frm_settings->admin_permission,
275 + 'cancel_text' => __( 'Cancel', 'formidable' ),
276 + );
277 + FrmAppController::show_error_modal( $error_args );
278 + return;
273 279 }
274 280
275 281 $errors = array();
276 282 $message = '';
@@ -310,9 +316,9 @@
310 316 $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
311 317 $action = FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' );
312 318 FrmAppHelper::include_svg();
313 319
314 - if ( $action == 'process-form' ) {
320 + if ( $action === 'process-form' ) {
315 321 self::process_form( $stop_load );
316 322 } elseif ( $stop_load != 'stop_load' ) {
317 323 self::display_form();
318 324 }
@@ -346,9 +352,9 @@
346 352 __( 'Save draft entries and return later', 'formidable' ),
347 353 __( 'Analyze form data with graphs & stats', 'formidable' ),
348 354 );
349 355
350 - include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/settings_cta.php' );
356 + include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/settings_cta.php';
351 357 }
352 358
353 359 /**
354 360 * Dismiss upgrade notice at the bottom on the plugin settings pages.
@@ -355,8 +361,9 @@
355 361 *
356 362 * @since 3.04.02
357 363 */
358 364 public static function settings_cta_dismiss() {
365 + check_ajax_referer( 'frm_ajax', 'nonce' );
359 366 FrmAppHelper::permission_check( 'frm_change_settings' );
360 367
361 368 update_option( 'frm_lite_settings_upgrade', time(), 'no' );
362 369
@@ -373,9 +380,9 @@
373 380 check_ajax_referer( 'frm_ajax', 'nonce' );
374 381
375 382 global $wpdb;
376 383
377 - $term = FrmAppHelper::get_param( 'term', '', 'get', 'sanitize_text_field' );
384 + $term = FrmAppHelper::get_param( 'term', '', 'get', 'sanitize_text_field' );
378 385 $post_type = FrmAppHelper::get_param( 'post_type', 'page', 'get', 'sanitize_text_field' );
379 386
380 387 $where = array(
381 388 'post_status' => 'publish',
@@ -398,14 +405,6 @@
398 405 );
399 406 }
400 407
401 408 wp_send_json( $results );
402 - }
403 -
404 - /**
405 - * @deprecated 6.0 use FrmSettingsController::captcha_settings().
406 - */
407 - public static function recaptcha_settings() {
408 - _deprecated_function( __FUNCTION__, '6.0', 'FrmSettingsController::captcha_settings()' );
409 - self::captcha_settings();
410 409 }
411 410 }