PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.5.7
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.5.7
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 +10 -44 6.4.15.5.7 View file →
@@ -11,17 +11,10 @@
11 11
12 12 add_submenu_page( 'formidable', 'Formidable | ' . __( 'Global Settings', 'formidable' ), __( 'Global Settings', 'formidable' ), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route' );
13 13 }
14 14
15 - /**
16 - * Include license box template on demand.
17 - *
18 - * @return void
19 - */
20 15 public static function license_box() {
21 - if ( ! current_user_can( 'activate_plugins' ) ) {
22 - return;
23 - }
16 + $a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'general_settings' );
24 17 include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php' );
25 18 }
26 19
27 20 public static function display_form( $errors = array(), $message = '' ) {
@@ -37,13 +30,8 @@
37 30
38 31 require( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php' );
39 32 }
40 33
41 - /**
42 - * Get sections to use for Global Settings.
43 - *
44 - * @return array<array>
45 - */
46 34 private static function get_settings_tabs() {
47 35 $sections = array(
48 36 'general' => array(
49 37 'class' => __CLASS__,
@@ -62,24 +50,12 @@
62 50 'function' => 'permission_settings',
63 51 'name' => __( 'Permissions', 'formidable' ),
64 52 'icon' => 'frm_icon_font frm_lock_icon',
65 53 ),
66 - 'custom_css' => array(
67 - 'class' => 'FrmStylesController',
68 - 'function' => 'custom_css',
69 - 'name' => __( 'Custom CSS', 'formidable' ),
70 - 'icon' => 'frm_icon_font frm_code_icon',
71 - ),
72 - 'manage_styles' => array(
73 - 'class' => 'FrmStylesController',
74 - 'function' => 'manage',
75 - 'name' => __( 'Manage Styles', 'formidable' ),
76 - 'icon' => 'frm_icon_font frm_pallet_icon',
77 - ),
78 54 'captcha' => array(
79 55 'class' => __CLASS__,
80 56 'function' => 'captcha_settings',
81 - 'name' => __( 'Captcha', 'formidable' ),
57 + 'name' => __( 'CAPTCHA', 'formidable' ),
82 58 'icon' => 'frm_icon_font frm_shield_check_icon',
83 59 ),
84 60 'white_label' => array(
85 61 'name' => __( 'White Labeling', 'formidable' ),
@@ -103,9 +79,9 @@
103 79 ),
104 80 );
105 81
106 82 if ( apply_filters( 'frm_include_addon_page', false ) ) {
107 - // If no addons need a license, skip this page
83 + // if no addons need a license, skip this page
108 84 $show_licenses = false;
109 85 $installed_addons = apply_filters( 'frm_installed_addons', array() );
110 86 foreach ( $installed_addons as $installed_addon ) {
111 87 if ( ! $installed_addon->is_parent_licence && $installed_addon->plugin_name != 'Formidable Pro' && $installed_addon->needs_license ) {
@@ -123,12 +99,8 @@
123 99 'ajax' => true,
124 100 );
125 101 }
126 102 }
127 -
128 - /**
129 - * @param array<array> $sections
130 - */
131 103 $sections = apply_filters( 'frm_add_settings_section', $sections );
132 104
133 105 $sections['misc'] = array(
134 106 'name' => __( 'Miscellaneous', 'formidable' ),
@@ -233,21 +205,14 @@
233 205
234 206 include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/misc.php' );
235 207 }
236 208
237 - /**
238 - * Save form data submitted from the Global settings page.
239 - *
240 - * @param string|bool $stop_load
241 - *
242 - * @return void
243 - */
244 209 public static function process_form( $stop_load = false ) {
245 210 global $frm_vars;
246 211
247 212 $frm_settings = FrmAppHelper::get_settings();
213 +
248 214 $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' );
249 -
250 215 if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) {
251 216 wp_die( esc_html( $frm_settings->admin_permission ) );
252 217 }
253 218
@@ -253,14 +218,14 @@
253 218
254 219 $errors = array();
255 220 $message = '';
256 221
257 - if ( empty( $frm_vars['settings_routed'] ) ) {
222 + if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) {
258 223 $errors = $frm_settings->validate( $_POST, array() );
259 224
260 225 $frm_settings->update( wp_unslash( $_POST ) );
261 226
262 - if ( ! $errors ) {
227 + if ( empty( $errors ) ) {
263 228 $frm_settings->store();
264 229 $message = __( 'Settings Saved', 'formidable' );
265 230 }
266 231 } else {
@@ -266,10 +231,11 @@
266 231 } else {
267 232 $message = __( 'Settings Saved', 'formidable' );
268 233 }
269 234
270 - if ( $stop_load === 'stop_load' ) {
235 + if ( $stop_load == 'stop_load' ) {
271 236 $frm_vars['settings_routed'] = true;
237 +
272 238 return;
273 239 }
274 240
275 241 self::display_form( $errors, $message );
@@ -380,11 +346,11 @@
380 346 wp_send_json( $results );
381 347 }
382 348
383 349 /**
384 - * @deprecated 6.0 use FrmSettingsController::captcha_settings().
350 + * @deprecated x.x use FrmSettingsController::captcha_settings().
385 351 */
386 352 public static function recaptcha_settings() {
387 - _deprecated_function( __FUNCTION__, '6.0', 'FrmSettingsController::captcha_settings()' );
353 + _deprecated_function( __FUNCTION__, 'x.x', 'FrmSettingsController::captcha_settings()' );
388 354 self::captcha_settings();
389 355 }
390 356 }