@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // Get posted data. |
| 83 | 83 | $plugin_slug = FrmAppHelper::get_post_param( 'plugin', '', 'sanitize_text_field' ); |
| 84 | 84 | |
| 85 | - if ( ! empty( get_plugins()[ $plugin_slug ] ) ) { |
|
| 85 | + if ( ! empty( get_plugins()[$plugin_slug] ) ) { |
|
| 86 | 86 | $activate = activate_plugin( $plugin_slug ); |
| 87 | 87 | } else { |
| 88 | 88 | // Include necessary files for plugin installation. |
@@ -163,6 +163,6 @@ discard block |
||
| 163 | 163 | * @return bool |
| 164 | 164 | */ |
| 165 | 165 | private static function is_plugin_installed( $plugin_file ) { |
| 166 | - return isset( get_plugins()[ $plugin_file ] ); |
|
| 166 | + return isset( get_plugins()[$plugin_file] ); |
|
| 167 | 167 | } |
| 168 | 168 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | |
| 6 | 6 | add_filter( |
| 7 | 7 | 'document_title', |
| 8 | - function ( $title ) use ( $form ) { |
|
| 8 | + function( $title ) use ( $form ) { |
|
| 9 | 9 | $form_name = '' === $form->name ? FrmFormsHelper::get_no_title_text() : $form->name; |
| 10 | 10 | return get_bloginfo( 'name', 'display' ) . ' | ' . wp_strip_all_tags( $form_name ); |
| 11 | 11 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | |
| 76 | 76 | foreach ( $forms as $form ) { |
| 77 | 77 | $form_title = '' === $form->name ? FrmFormsHelper::get_no_title_text() : FrmAppHelper::truncate( $form->name, 50 ); |
| 78 | - $options[ $form->id ] = esc_html( $form_title ); |
|
| 78 | + $options[$form->id] = esc_html( $form_title ); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $options; |
@@ -133,15 +133,15 @@ |
||
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if ( ! isset( $flows_data[ $key ] ) ) { |
|
| 137 | - $flows_data[ $key ] = array(); |
|
| 136 | + if ( ! isset( $flows_data[$key] ) ) { |
|
| 137 | + $flows_data[$key] = array(); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if ( ! isset( $flows_data[ $key ][ $value ] ) ) { |
|
| 141 | - $flows_data[ $key ][ $value ] = 0; |
|
| 140 | + if ( ! isset( $flows_data[$key][$value] ) ) { |
|
| 141 | + $flows_data[$key][$value] = 0; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $flows_data[ $key ][ $value ]++; |
|
| 144 | + $flows_data[$key][$value] ++; |
|
| 145 | 145 | update_option( self::FLOWS_ACTION_NAME, $flows_data ); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $contextual_shortcodes = self::get_contextual_shortcodes(); |
| 75 | 75 | $result = array(); |
| 76 | 76 | foreach ( $contextual_shortcodes as $type => $shortcodes ) { |
| 77 | - $result[ $type ] = array_keys( $shortcodes ); |
|
| 77 | + $result[$type] = array_keys( $shortcodes ); |
|
| 78 | 78 | } |
| 79 | 79 | return $result; |
| 80 | 80 | } |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | $with_tags = $args['conditional_check'] ? 3 : 2; |
| 116 | - if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) { |
|
| 117 | - $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] ); |
|
| 116 | + if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) { |
|
| 117 | + $tag = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] ); |
|
| 118 | 118 | $tag = str_replace( ']', '', $tag ); |
| 119 | 119 | $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag ); |
| 120 | 120 | $tags = preg_split( '/\s+/', $tag, 2 ); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $tag = $tags[0]; |
| 123 | 123 | } |
| 124 | 124 | } else { |
| 125 | - $tag = $shortcodes[ $with_tags - 1 ][ $short_key ]; |
|
| 125 | + $tag = $shortcodes[$with_tags - 1][$short_key]; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | return $tag; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param array $keys |
| 39 | 39 | */ |
| 40 | - self::$keys = apply_filters( |
|
| 40 | + self::$keys = apply_filters( |
|
| 41 | 41 | 'frm_application_data_keys', |
| 42 | 42 | array( 'key', 'name', 'description', 'link', 'categories', 'views', 'forms', 'used_addons' ) |
| 43 | 43 | ); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | self::get_template_keys_with_local_png_images(), |
| 46 | 46 | self::get_template_keys_with_local_webp_images() |
| 47 | 47 | ); |
| 48 | - self::$categories = array(); |
|
| 48 | + self::$categories = array(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -144,20 +144,20 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $application = array(); |
| 146 | 146 | foreach ( self::$keys as $key ) { |
| 147 | - if ( ! isset( $this->api_data[ $key ] ) ) { |
|
| 147 | + if ( ! isset( $this->api_data[$key] ) ) { |
|
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $value = $this->api_data[ $key ]; |
|
| 151 | + $value = $this->api_data[$key]; |
|
| 152 | 152 | |
| 153 | 153 | if ( 'icon' === $key ) { |
| 154 | 154 | // Icon is an array. The first array item is the image URL. |
| 155 | - $application[ $key ] = reset( $value ); |
|
| 155 | + $application[$key] = reset( $value ); |
|
| 156 | 156 | } elseif ( 'categories' === $key ) { |
| 157 | - $application[ $key ] = array_values( |
|
| 157 | + $application[$key] = array_values( |
|
| 158 | 158 | array_filter( |
| 159 | 159 | $value, |
| 160 | - function ( $category ) { |
|
| 160 | + function( $category ) { |
|
| 161 | 161 | return false === strpos( $category, '+Views' ); |
| 162 | 162 | } |
| 163 | 163 | ) |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // Strip off the " Template" text at the end of the name as it takes up space. |
| 174 | 174 | $value = substr( $value, 0, -9 ); |
| 175 | 175 | } |
| 176 | - $application[ $key ] = $value; |
|
| 176 | + $application[$key] = $value; |
|
| 177 | 177 | }//end if |
| 178 | 178 | }//end foreach |
| 179 | 179 | |
@@ -197,7 +197,8 @@ discard block |
||
| 197 | 197 | return false; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 200 | + if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { |
|
| 201 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 201 | 202 | return false; |
| 202 | 203 | } |
| 203 | 204 | |
@@ -300,7 +301,8 @@ discard block |
||
| 300 | 301 | * @param mixed $value |
| 301 | 302 | */ |
| 302 | 303 | private static function get_posted_field_setting( $setting, &$value ) { |
| 303 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 304 | + if ( ! isset( $_POST['field_options'][ $setting ] ) ) { |
|
| 305 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 304 | 306 | return; |
| 305 | 307 | } |
| 306 | 308 | |
@@ -1353,7 +1355,8 @@ discard block |
||
| 1353 | 1355 | |
| 1354 | 1356 | // Check posted vals before checking saved values |
| 1355 | 1357 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1356 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1358 | + if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
| 1359 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1357 | 1360 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1358 | 1361 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1359 | 1362 | $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
@@ -1364,7 +1367,8 @@ discard block |
||
| 1364 | 1367 | return $other_val; |
| 1365 | 1368 | } |
| 1366 | 1369 | |
| 1367 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1370 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
| 1371 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1368 | 1372 | // For normal fields |
| 1369 | 1373 | |
| 1370 | 1374 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
| 39 | 39 | $values['field_options']['data_type'] = $setting; |
| 40 | 40 | } else { |
| 41 | - $values['field_options'][ $setting ] = 1; |
|
| 41 | + $values['field_options'][$setting] = 1; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | foreach ( $defaults as $opt => $default ) { |
| 167 | - $values[ $opt ] = $field->field_options[ $opt ] ?? $default; |
|
| 167 | + $values[$opt] = $field->field_options[$opt] ?? $default; |
|
| 168 | 168 | |
| 169 | 169 | if ( $check_post ) { |
| 170 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 170 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | return self::$context_is_safe_to_load_field_options_from_request_data; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - $function = function () { |
|
| 187 | + $function = function() { |
|
| 188 | 188 | if ( ! FrmAppHelper::is_admin_page() ) { |
| 189 | 189 | return false; |
| 190 | 190 | } |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | * @param mixed $value |
| 293 | 293 | */ |
| 294 | 294 | private static function get_posted_field_setting( $setting, &$value ) { |
| 295 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 295 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 296 | 296 | return; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if ( strpos( $setting, 'html' ) !== false ) { |
| 300 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 300 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 301 | 301 | |
| 302 | 302 | // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. |
| 303 | 303 | if ( ! FrmAppHelper::allow_unfiltered_html() ) { |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 307 | 307 | // TODO: Remove stripslashes on output, and use on input only. |
| 308 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 308 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 309 | 309 | } else { |
| 310 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 310 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 311 | 311 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 312 | 312 | } |
| 313 | 313 | } |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 381 | 381 | |
| 382 | 382 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 383 | - $values[ $col ] = $field->{$col}; |
|
| 383 | + $values[$col] = $field->{$col}; |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $defaults = apply_filters( 'frm_default_field_validation_messages', $defaults, $field ); |
| 424 | 424 | |
| 425 | 425 | $msg = FrmField::get_option( $field, $error ); |
| 426 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 426 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 427 | 427 | $msg = do_shortcode( $msg ); |
| 428 | 428 | |
| 429 | 429 | $msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | 'inside_class' => 'inside', |
| 694 | 694 | 'dismiss-icon' => true, |
| 695 | 695 | ); |
| 696 | - $args = array_merge( $defaults, $args ); |
|
| 696 | + $args = array_merge( $defaults, $args ); |
|
| 697 | 697 | |
| 698 | 698 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 699 | 699 | } |
@@ -931,7 +931,7 @@ discard block |
||
| 931 | 931 | continue; |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 934 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 935 | 935 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 936 | 936 | |
| 937 | 937 | $atts['entry'] = $entry; |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | if ( $replace_with !== null ) { |
| 942 | 942 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 943 | 943 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 944 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 944 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | unset( $atts, $replace_with ); |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | $supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' ); |
| 960 | 960 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 961 | 961 | foreach ( $included_atts as $included_att ) { |
| 962 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 962 | + if ( '0' === $atts[$included_att] ) { |
|
| 963 | 963 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 964 | 964 | continue; |
| 965 | 965 | } |
@@ -1037,8 +1037,8 @@ discard block |
||
| 1037 | 1037 | |
| 1038 | 1038 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
| 1039 | 1039 | |
| 1040 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 1041 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 1040 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 1041 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 1042 | 1042 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
| 1043 | 1043 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 1044 | 1044 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1262,8 +1262,8 @@ discard block |
||
| 1262 | 1262 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1263 | 1263 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1264 | 1264 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1265 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1266 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1265 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1266 | + $field_types[$type] = $field_selection[$type]; |
|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | foreach ( $inputs as $input ) { |
| 1306 | 1306 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
| 1307 | 1307 | if ( array_key_exists( $input, $fields ) ) { |
| 1308 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1308 | + $field_types[$input] = $fields[$input]; |
|
| 1309 | 1309 | } |
| 1310 | 1310 | unset( $input ); |
| 1311 | 1311 | } |
@@ -1338,7 +1338,7 @@ discard block |
||
| 1338 | 1338 | 'parent' => false, |
| 1339 | 1339 | 'pointer' => false, |
| 1340 | 1340 | ); |
| 1341 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1341 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1342 | 1342 | |
| 1343 | 1343 | $opt_key = $args['opt_key']; |
| 1344 | 1344 | $field = $args['field']; |
@@ -1354,25 +1354,25 @@ discard block |
||
| 1354 | 1354 | |
| 1355 | 1355 | // Check posted vals before checking saved values |
| 1356 | 1356 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1357 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1357 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1358 | 1358 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1359 | 1359 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1360 | - $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1360 | + $other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1361 | 1361 | } else { |
| 1362 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1362 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1363 | 1363 | } |
| 1364 | 1364 | |
| 1365 | 1365 | return $other_val; |
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1368 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1369 | 1369 | // For normal fields |
| 1370 | 1370 | |
| 1371 | 1371 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1372 | 1372 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1373 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1373 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1374 | 1374 | } else { |
| 1375 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1375 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | return $other_val; |
@@ -1382,8 +1382,8 @@ discard block |
||
| 1382 | 1382 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1383 | 1383 | // Check if there is an "other" val in saved value and make sure the |
| 1384 | 1384 | // "other" val is not equal to the Other checkbox option |
| 1385 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1386 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1385 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1386 | + $other_val = $field['value'][$opt_key]; |
|
| 1387 | 1387 | } |
| 1388 | 1388 | } else { |
| 1389 | 1389 | /** |
@@ -1395,8 +1395,8 @@ discard block |
||
| 1395 | 1395 | // Multi-select dropdowns - key is not preserved |
| 1396 | 1396 | if ( is_array( $field['value'] ) ) { |
| 1397 | 1397 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1398 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1399 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1398 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1399 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1400 | 1400 | } |
| 1401 | 1401 | } elseif ( $temp_val == $field['value'] ) { |
| 1402 | 1402 | // For radio and regular dropdowns |
@@ -1607,11 +1607,11 @@ discard block |
||
| 1607 | 1607 | foreach ( $val as $k => $v ) { |
| 1608 | 1608 | if ( is_string( $v ) ) { |
| 1609 | 1609 | if ( 'custom_html' === $k ) { |
| 1610 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1610 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1611 | 1611 | unset( $k, $v ); |
| 1612 | 1612 | continue; |
| 1613 | 1613 | } |
| 1614 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1614 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1615 | 1615 | unset( $k, $v ); |
| 1616 | 1616 | } |
| 1617 | 1617 | } |
@@ -1640,8 +1640,8 @@ discard block |
||
| 1640 | 1640 | if ( false === $index ) { |
| 1641 | 1641 | continue; |
| 1642 | 1642 | } |
| 1643 | - unset( $replace[ $index ] ); |
|
| 1644 | - unset( $replace_with[ $index ] ); |
|
| 1643 | + unset( $replace[$index] ); |
|
| 1644 | + unset( $replace_with[$index] ); |
|
| 1645 | 1645 | } |
| 1646 | 1646 | $value = str_replace( $replace, $replace_with, $value ); |
| 1647 | 1647 | return $value; |
@@ -1989,7 +1989,7 @@ discard block |
||
| 1989 | 1989 | $countries['class'] = 'frm-countries-opts'; |
| 1990 | 1990 | } |
| 1991 | 1991 | |
| 1992 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 1992 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 1993 | 1993 | |
| 1994 | 1994 | // State abv. |
| 1995 | 1995 | $states = self::get_us_states(); |
@@ -1999,7 +1999,7 @@ discard block |
||
| 1999 | 1999 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 2000 | 2000 | } |
| 2001 | 2001 | |
| 2002 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 2002 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 2003 | 2003 | |
| 2004 | 2004 | // States. |
| 2005 | 2005 | $states = array_values( $states ); |
@@ -2008,7 +2008,7 @@ discard block |
||
| 2008 | 2008 | $states['class'] = 'frm-states-opts'; |
| 2009 | 2009 | } |
| 2010 | 2010 | |
| 2011 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 2011 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 2012 | 2012 | unset( $state_abv, $states ); |
| 2013 | 2013 | |
| 2014 | 2014 | // Age. |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | $ages['class'] = 'frm-age-opts'; |
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 2029 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 2030 | 2030 | |
| 2031 | 2031 | // Satisfaction. |
| 2032 | 2032 | $satisfaction = array( |
@@ -2041,7 +2041,7 @@ discard block |
||
| 2041 | 2041 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 2042 | 2042 | } |
| 2043 | 2043 | |
| 2044 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 2044 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 2045 | 2045 | |
| 2046 | 2046 | // Importance. |
| 2047 | 2047 | $importance = array( |
@@ -2056,7 +2056,7 @@ discard block |
||
| 2056 | 2056 | $importance['class'] = 'frm-importance-opts'; |
| 2057 | 2057 | } |
| 2058 | 2058 | |
| 2059 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 2059 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 2060 | 2060 | |
| 2061 | 2061 | // Agreement. |
| 2062 | 2062 | $agreement = array( |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | $agreement['class'] = 'frm-agreement-opts'; |
| 2072 | 2072 | } |
| 2073 | 2073 | |
| 2074 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 2074 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 2075 | 2075 | |
| 2076 | 2076 | // Likely. |
| 2077 | 2077 | $likely = array( |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | $likely['class'] = 'frm-likely-opts'; |
| 2087 | 2087 | } |
| 2088 | 2088 | |
| 2089 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 2089 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 2090 | 2090 | |
| 2091 | 2091 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 2092 | 2092 | } |
@@ -2307,16 +2307,16 @@ discard block |
||
| 2307 | 2307 | */ |
| 2308 | 2308 | private static function fill_image_setting_options( $options, &$args ) { |
| 2309 | 2309 | foreach ( $options as $key => $option ) { |
| 2310 | - $args['options'][ $key ] = $option; |
|
| 2310 | + $args['options'][$key] = $option; |
|
| 2311 | 2311 | |
| 2312 | 2312 | if ( ! empty( $option['addon'] ) ) { |
| 2313 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2313 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2314 | 2314 | } |
| 2315 | 2315 | |
| 2316 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2316 | + unset( $args['options'][$key]['addon'] ); |
|
| 2317 | 2317 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2318 | 2318 | foreach ( $fill as $f ) { |
| 2319 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2319 | + unset( $args['options'][$key][$f], $f ); |
|
| 2320 | 2320 | } |
| 2321 | 2321 | } |
| 2322 | 2322 | } |
@@ -2337,8 +2337,8 @@ discard block |
||
| 2337 | 2337 | |
| 2338 | 2338 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2339 | 2339 | foreach ( $fill as $f ) { |
| 2340 | - if ( isset( $option[ $f ] ) ) { |
|
| 2341 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2340 | + if ( isset( $option[$f] ) ) { |
|
| 2341 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2342 | 2342 | } |
| 2343 | 2343 | } |
| 2344 | 2344 | |
@@ -2404,7 +2404,7 @@ discard block |
||
| 2404 | 2404 | |
| 2405 | 2405 | return array_filter( |
| 2406 | 2406 | $rows, |
| 2407 | - function ( $row ) { |
|
| 2407 | + function( $row ) { |
|
| 2408 | 2408 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2409 | 2409 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2410 | 2410 | } |
@@ -2467,7 +2467,7 @@ discard block |
||
| 2467 | 2467 | if ( empty( $attributes['data-fid'] ) ) { |
| 2468 | 2468 | unset( $data['plugin-status'] ); |
| 2469 | 2469 | foreach ( $data as $key => $value ) { |
| 2470 | - $attributes[ 'data-' . $key ] = $value; |
|
| 2470 | + $attributes['data-' . $key] = $value; |
|
| 2471 | 2471 | } |
| 2472 | 2472 | } |
| 2473 | 2473 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | 'convertkit' => 'convertkit', |
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | - $icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[ $slug ] . '_icon' : 'frm_logo_icon'; |
|
| 174 | + $icon = array_key_exists( $slug, $icons_map ) ? 'frm_' . $icons_map[$slug] . '_icon' : 'frm_logo_icon'; |
|
| 175 | 175 | if ( 'ai' === $slug ) { |
| 176 | 176 | $icon = str_replace( '_', '-', $icon ); |
| 177 | 177 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | ?> |
| 272 | 272 | <span style="color: <?php echo esc_attr( $color ); ?>;"> |
| 273 | 273 | <?php |
| 274 | - for ( $i = 0; $i < 5; $i++ ) { |
|
| 274 | + for ( $i = 0; $i < 5; $i ++ ) { |
|
| 275 | 275 | echo $icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 276 | 276 | } |
| 277 | 277 | ?> |
@@ -113,19 +113,19 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | foreach ( $action_controls as $action ) { |
| 116 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 116 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $this_group = $action->action_options['group']; |
| 121 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 121 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 122 | 122 | $this_group = 'misc'; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 126 | - $groups[ $this_group ]['actions'] = array(); |
|
| 125 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 126 | + $groups[$this_group]['actions'] = array(); |
|
| 127 | 127 | } |
| 128 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 128 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 129 | 129 | |
| 130 | 130 | unset( $action ); |
| 131 | 131 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | return $a; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - $actions[ $a->id_base ] = $a; |
|
| 282 | + $actions[$a->id_base] = $a; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | return $actions; |
@@ -313,18 +313,18 @@ discard block |
||
| 313 | 313 | $action_map = array(); |
| 314 | 314 | |
| 315 | 315 | foreach ( $action_controls as $key => $control ) { |
| 316 | - $action_map[ $control->id_base ] = $key; |
|
| 316 | + $action_map[$control->id_base] = $key; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | self::maybe_show_limit_warning( $form->id, $form_actions ); |
| 320 | 320 | |
| 321 | 321 | foreach ( $form_actions as $action ) { |
| 322 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 322 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 323 | 323 | // don't try and show settings if action no longer exists |
| 324 | 324 | continue; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 327 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
@@ -592,8 +592,8 @@ discard block |
||
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | // Store actions so they can be triggered with the correct priority. |
| 595 | - $stored_actions[ $action->ID ] = $action; |
|
| 596 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 595 | + $stored_actions[$action->ID] = $action; |
|
| 596 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 597 | 597 | |
| 598 | 598 | unset( $action ); |
| 599 | 599 | }//end foreach |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | new FrmNotification(); |
| 606 | 606 | |
| 607 | 607 | foreach ( $action_priority as $action_id => $priority ) { |
| 608 | - $action = $stored_actions[ $action_id ]; |
|
| 608 | + $action = $stored_actions[$action_id]; |
|
| 609 | 609 | |
| 610 | 610 | /** |
| 611 | 611 | * Allows custom form action trigger. |
@@ -669,12 +669,12 @@ discard block |
||
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | public function register( $action_class ) { |
| 672 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 672 | + $this->actions[$action_class] = new $action_class(); |
|
| 673 | 673 | } |
| 674 | 674 | |
| 675 | 675 | public function unregister( $action_class ) { |
| 676 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 677 | - unset( $this->actions[ $action_class ] ); |
|
| 676 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 677 | + unset( $this->actions[$action_class] ); |
|
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
@@ -683,8 +683,8 @@ discard block |
||
| 683 | 683 | |
| 684 | 684 | foreach ( $keys as $key ) { |
| 685 | 685 | // don't register new action if old action with the same id is already registered |
| 686 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 687 | - $this->actions[ $key ]->_register(); |
|
| 686 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 687 | + $this->actions[$key]->_register(); |
|
| 688 | 688 | } |
| 689 | 689 | } |
| 690 | 690 | } |