Completed
Pull Request — master (#2624)
by
unknown
42s
created
classes/views/addons/min-version-notice.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,10 @@
 block discarded – undo
14 14
 		);
15 15
 		?>
16 16
 		Please <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( $utm, 'account/downloads/' ) ); ?>">renew now</a> to get the latest version.
17
-	<?php else : ?>
18
-		Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ); ?>">update now</a>.
17
+	<?php else {
18
+	: ?>
19
+		Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) );
20
+}
21
+?>">update now</a>.
19 22
 	<?php endif; ?>
20 23
 </div>
Please login to merge, or discard this patch.
classes/controllers/FrmWelcomeTourController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$active_step = 0;
119 119
 
120 120
 		foreach ( $step_keys as $index => $step_key ) {
121
-			$completed_step = isset( self::$checklist['completed_steps'][ $step_key ] );
121
+			$completed_step = isset( self::$checklist['completed_steps'][$step_key] );
122 122
 
123 123
 			if ( false === $completed_step ) {
124 124
 				switch ( $step_key ) {
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 			}
133 133
 
134 134
 			if ( $completed_step ) {
135
-				self::$checklist['completed_steps'][ $step_key ] = true;
135
+				self::$checklist['completed_steps'][$step_key] = true;
136 136
 			}
137 137
 
138 138
 			// Count completed steps from start until gap found.
139 139
 			if ( $completed_step && $index === $active_step ) {
140
-				$active_step++;
140
+				$active_step ++;
141 141
 			}
142 142
 
143
-			self::$steps['steps'][ $index ]['completed'] = $completed_step;
143
+			self::$steps['steps'][$index]['completed'] = $completed_step;
144 144
 		}//end foreach
145 145
 
146 146
 		self::$checklist['active_step'] = $active_step;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			self::$checklist['done']            = true;
150 150
 			self::$checklist['active_step_key'] = 'completed';
151 151
 		} else {
152
-			self::$checklist['active_step_key'] = $step_keys[ $active_step ];
152
+			self::$checklist['active_step_key'] = $step_keys[$active_step];
153 153
 		}
154 154
 
155 155
 		self::save_checklist();
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	private static function fill_step_completed_data( $steps, $steps_keys ) {
201 201
 		return array_map(
202
-			function ( $step, $step_key ) {
203
-				$step['completed'] = isset( self::$checklist['completed_steps'][ $step_key ] );
202
+			function( $step, $step_key ) {
203
+				$step['completed'] = isset( self::$checklist['completed_steps'][$step_key] );
204 204
 				return $step;
205 205
 			},
206 206
 			$steps,
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 					'target'        => '#frm_style_sidebar .frm-style-card > div',
235 235
 					'left-position' => 'end',
236 236
 					'offset'        => array(
237
-						'top'  => -22,
237
+						'top'  => - 22,
238 238
 						'left' => 16,
239 239
 					),
240 240
 				);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				break;
251 251
 		}//end switch
252 252
 
253
-		return array_merge( self::$steps['steps'][ self::$checklist['active_step'] ], $spotlight_data );
253
+		return array_merge( self::$steps['steps'][self::$checklist['active_step']], $spotlight_data );
254 254
 	}
255 255
 
256 256
 	/**
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		}
378 378
 
379 379
 		self::$checklist                                 = self::get_checklist();
380
-		self::$checklist['completed_steps'][ $step_key ] = true;
380
+		self::$checklist['completed_steps'][$step_key] = true;
381 381
 		self::save_checklist();
382 382
 
383 383
 		wp_send_json_success();
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		$steps      = self::get_steps();
592 592
 
593 593
 		foreach ( $steps as $key => $step ) {
594
-			$usage_data[ 'completed_step_' . $key ] = empty( $option['completed_steps'][ $key ] ) ? 0 : 1;
594
+			$usage_data['completed_step_' . $key] = empty( $option['completed_steps'][$key] ) ? 0 : 1;
595 595
 		}
596 596
 
597 597
 		$usage_data['done'] = empty( $option['done'] ) ? 0 : 1;
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldCombo.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 			if ( is_array( $sub_field ) ) {
62 62
 				$sub_field                 = wp_parse_args( $sub_field, $defaults );
63 63
 				$sub_field['name']         = $name;
64
-				$this->sub_fields[ $name ] = $sub_field;
64
+				$this->sub_fields[$name] = $sub_field;
65 65
 				continue;
66 66
 			}
67 67
 
68 68
 			if ( is_string( $sub_field ) ) {
69
-				$this->sub_fields[ $name ] = wp_parse_args(
69
+				$this->sub_fields[$name] = wp_parse_args(
70 70
 					array(
71 71
 						'name'  => $name,
72 72
 						'label' => $sub_field,
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function set_aria_invalid_error( &$shortcode_atts, $args ) {
91 91
 		foreach ( $this->get_sub_fields() as $sub_field ) {
92
-			$shortcode_atts[ 'aria-invalid-' . $sub_field['name'] ] = isset( $args['errors'][ 'field' . $this->field_id . '-' . $sub_field['name'] ] ) ? 'true' : 'false';
92
+			$shortcode_atts['aria-invalid-' . $sub_field['name']] = isset( $args['errors']['field' . $this->field_id . '-' . $sub_field['name']] ) ? 'true' : 'false';
93 93
 		}
94 94
 	}
95 95
 
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 				}
136 136
 
137 137
 				if ( is_string( $option ) ) {
138
-					$extra_options[ $key . '_' . $option ] = '';
138
+					$extra_options[$key . '_' . $option] = '';
139 139
 				} elseif ( ! empty( $option['name'] ) ) {
140
-					$extra_options[ $key . '_' . $option['name'] ] = '';
140
+					$extra_options[$key . '_' . $option['name']] = '';
141 141
 				}
142 142
 			}
143 143
 		}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		foreach ( $this->sub_fields as $name => $sub_field ) {
164 164
 			$sub_field['name'] = $name;
165 165
 			$wrapper_classes   = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name'];
166
-			if ( ! isset( $processed_sub_fields[ $name ] ) ) {
166
+			if ( ! isset( $processed_sub_fields[$name] ) ) {
167 167
 				// Options for this subfield should be hidden.
168 168
 				$wrapper_classes .= ' frm_hidden';
169 169
 			}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			$default_value = array();
194 194
 
195 195
 			foreach ( $this->sub_fields as $name => $sub_field ) {
196
-				$default_value[ $name ] = '';
196
+				$default_value[$name] = '';
197 197
 			}
198 198
 
199 199
 			return $default_value;
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
 		// Placeholder.
376 376
 		if ( in_array( 'placeholder', $sub_field['options'], true ) ) {
377 377
 			$placeholders = FrmField::get_option( $field, 'placeholder' );
378
-			if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) {
379
-				$field['placeholder'] = $placeholders[ $sub_field['name'] ];
378
+			if ( ! empty( $placeholders[$sub_field['name']] ) ) {
379
+				$field['placeholder'] = $placeholders[$sub_field['name']];
380 380
 			}
381 381
 		}
382 382
 
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
 
438 438
 		// Validate not empty.
439 439
 		foreach ( $sub_fields as $name => $sub_field ) {
440
-			if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) {
441
-				$errors[ 'field' . $args['id'] . '-' . $name ] = '';
442
-				$errors[ 'field' . $args['id'] ]               = $blank_msg;
440
+			if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) {
441
+				$errors['field' . $args['id'] . '-' . $name] = '';
442
+				$errors['field' . $args['id']]               = $blank_msg;
443 443
 			}
444 444
 		}
445 445
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		$field_key  = $this->field->field_key ?? $this->field['field_key'];
459 459
 		$sub_fields = $this->get_processed_sub_fields();
460 460
 		foreach ( $sub_fields as $name => $sub_field ) {
461
-			$headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
461
+			$headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label'];
462 462
 		}
463 463
 
464 464
 		return $headings;
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
 			'value' => '',
522 522
 		);
523 523
 
524
-		if ( ! empty( $args['field']['value'][ $sub_field['name'] ] ) ) {
525
-			$attrs['value']       = $args['field']['value'][ $sub_field['name'] ];
526
-			$attrs['data-frmval'] = $args['field']['value'][ $sub_field['name'] ];
524
+		if ( ! empty( $args['field']['value'][$sub_field['name']] ) ) {
525
+			$attrs['value']       = $args['field']['value'][$sub_field['name']];
526
+			$attrs['data-frmval'] = $args['field']['value'][$sub_field['name']];
527 527
 		}
528 528
 		if ( empty( $args['remove_names'] ) ) {
529 529
 			$attrs['name'] = $args['field_name'] . '[' . $sub_field['name'] . ']';
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$sub_field_class   = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}";
42 42
 			$sub_field_desc    = FrmField::get_option( $field, $name . '_desc' );
43 43
 
44
-			if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) {
44
+			if ( isset( $errors['field' . $field_id . '-' . $name] ) ) {
45 45
 				$sub_field_class .= ' frm_blank_field';
46 46
 			}
47 47
 			?>
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 				}
71 71
 
72 72
 				// Don't show individual field errors when there is a combo field error.
73
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
73
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
74 74
 					?>
75
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
75
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
76 76
 				<?php } ?>
77 77
 			</div>
78 78
 			<?php
Please login to merge, or discard this patch.
classes/models/FrmEntryMeta.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 		global $wpdb;
60 60
 
61
-		$values               = array(
61
+		$values = array(
62 62
 			'item_id'  => $entry_id,
63 63
 			'field_id' => $field_id,
64 64
 		);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				}
139 139
 			}
140 140
 
141
-			$values_indexed_by_field_id[ $field_id ] = $meta_value;
141
+			$values_indexed_by_field_id[$field_id] = $meta_value;
142 142
 
143 143
 			self::get_value_to_save( compact( 'field', 'field_id', 'entry_id' ), $meta_value );
144 144
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 				if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) {
148 148
 					// Remove blank fields.
149
-					unset( $values_indexed_by_field_id[ $field_id ] );
149
+					unset( $values_indexed_by_field_id[$field_id] );
150 150
 				} else {
151 151
 					// if value exists, then update it
152 152
 					self::update_entry_meta( $entry_id, $field_id, '', $meta_value );
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public static function get_meta_value( $entry, $field_id ) {
226 226
 		if ( isset( $entry->metas ) ) {
227
-			return $entry->metas[ $field_id ] ?? false;
227
+			return $entry->metas[$field_id] ?? false;
228 228
 		}
229 229
 		return self::get_entry_meta_by_field( $entry->id, $field_id );
230 230
 	}
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 			$cached   = FrmDb::check_cache( $entry_id, 'frm_entry' );
247 247
 		}
248 248
 
249
-		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
250
-			$result = $cached->metas[ $field_id ];
249
+		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) {
250
+			$result = $cached->metas[$field_id];
251 251
 
252 252
 			return wp_unslash( $result );
253 253
 		}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			'stripslashes' => true,
281 281
 			'is_draft'     => false,
282 282
 		);
283
-		$args     = wp_parse_args( $args, $defaults );
283
+		$args = wp_parse_args( $args, $defaults );
284 284
 
285 285
 		$query = array();
286 286
 		self::meta_field_query( $field_id, $order, $limit, $args, $query );
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 		foreach ( $values as $k => $v ) {
297 297
 			FrmAppHelper::unserialize_or_decode( $v );
298
-			$values[ $k ] = $v;
298
+			$values[$k] = $v;
299 299
 			unset( $k, $v );
300 300
 		}
301 301
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 
363 363
 		foreach ( $results as $k => $result ) {
364 364
 			FrmAppHelper::unserialize_or_decode( $result->meta_value );
365
-			$results[ $k ]->meta_value = wp_unslash( $result->meta_value );
365
+			$results[$k]->meta_value = wp_unslash( $result->meta_value );
366 366
 			unset( $k, $result );
367 367
 		}
368 368
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 			'user_id'  => '',
376 376
 			'group_by' => '',
377 377
 		);
378
-		$args     = wp_parse_args( $args, $defaults );
378
+		$args = wp_parse_args( $args, $defaults );
379 379
 
380 380
 		$query = array();
381 381
 		self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query );
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 			} elseif ( false !== strpos( $args['is_draft'], ',' ) ) {
479 479
 				$is_draft = array_reduce(
480 480
 					explode( ',', $args['is_draft'] ),
481
-					function ( $total, $current ) {
481
+					function( $total, $current ) {
482 482
 						if ( is_numeric( $current ) ) {
483 483
 							$total[] = absint( $current );
484 484
 						}
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			}
217 217
 
218 218
 			if ( $new_val !== $value ) {
219
-				$new_values[ $key ] = $new_val;
219
+				$new_values[$key] = $new_val;
220 220
 			}
221 221
 		}//end foreach
222 222
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 		foreach ( $values as $value_key => $value ) {
255 255
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
256
-				$new_values[ $value_key ] = $value;
256
+				$new_values[$value_key] = $value;
257 257
 			}
258 258
 		}
259 259
 
@@ -338,15 +338,15 @@  discard block
 block discarded – undo
338 338
 		$existing_keys = array_keys( $values['item_meta'] );
339 339
 		foreach ( $all_fields as $fid ) {
340 340
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
341
-				$values['item_meta'][ $fid->id ] = '';
341
+				$values['item_meta'][$fid->id] = '';
342 342
 			}
343
-			$field_array[ $fid->id ] = $fid;
343
+			$field_array[$fid->id] = $fid;
344 344
 		}
345 345
 		unset( $all_fields );
346 346
 
347 347
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
348
-			if ( isset( $field_array[ $field_id ] ) ) {
349
-				$field = $field_array[ $field_id ];
348
+			if ( isset( $field_array[$field_id] ) ) {
349
+				$field = $field_array[$field_id];
350 350
 			} else {
351 351
 				$field = FrmField::getOne( $field_id );
352 352
 			}
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 				continue;
356 356
 			}
357 357
 
358
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
358
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
359 359
 			if ( $is_settings_page ) {
360 360
 				self::get_settings_page_html( $values, $field );
361 361
 
@@ -375,22 +375,22 @@  discard block
 block discarded – undo
375 375
 			}
376 376
 
377 377
 			foreach ( $update_options as $opt => $default ) {
378
-				$field->field_options[ $opt ] = $values['field_options'][ $opt . '_' . $field_id ] ?? $default;
379
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
378
+				$field->field_options[$opt] = $values['field_options'][$opt . '_' . $field_id] ?? $default;
379
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
380 380
 			}
381 381
 
382 382
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
383 383
 
384 384
 			$new_field = array(
385 385
 				'field_options' => $field->field_options,
386
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
386
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
387 387
 			);
388 388
 
389
-			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) {
390
-				foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) {
389
+			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) {
390
+				foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) {
391 391
 					if ( is_array( $option ) ) {
392 392
 						foreach ( $option as $key => $item ) {
393
-							$values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' );
393
+							$values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' );
394 394
 						}
395 395
 					}
396 396
 				}
@@ -420,8 +420,8 @@  discard block
 block discarded – undo
420 420
 	 */
421 421
 	private static function maybe_update_max_option( $field, $values, &$new_field ) {
422 422
 		if ( $field->type === 'textarea' &&
423
-			! empty( $values['field_options'][ 'type_' . $field->id ] ) &&
424
-			in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
423
+			! empty( $values['field_options']['type_' . $field->id] ) &&
424
+			in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
425 425
 
426 426
 			$new_field['field_options']['max'] = '';
427 427
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 			 * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads.
430 430
 			 * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting.
431 431
 			 */
432
-			$_POST['field_options'][ 'max_' . $field->id ] = '';
432
+			$_POST['field_options']['max_' . $field->id] = '';
433 433
 		}
434 434
 	}
435 435
 
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
 	 * @return void
512 512
 	 */
513 513
 	private static function get_settings_page_html( $values, &$field ) {
514
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
514
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
515 515
 			$prev_opts     = array();
516 516
 			$fallback_html = $field->field_options['custom_html'] ?? FrmFieldsHelper::get_default_html( $field->type );
517 517
 
518
-			$field->field_options['custom_html'] = $values['field_options'][ 'custom_html_' . $field->id ] ?? $fallback_html;
518
+			$field->field_options['custom_html'] = $values['field_options']['custom_html_' . $field->id] ?? $fallback_html;
519 519
 		} elseif ( $field->type === 'hidden' || $field->type === 'user_id' ) {
520 520
 			$prev_opts = $field->field_options;
521 521
 		}
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 		);
541 541
 		foreach ( $field_cols as $col => $default ) {
542 542
 			$default           = $default === '' ? $field->{$col} : $default;
543
-			$new_field[ $col ] = $values['field_options'][ $col . '_' . $field->id ] ?? $default;
543
+			$new_field[$col] = $values['field_options'][$col . '_' . $field->id] ?? $default;
544 544
 		}
545 545
 
546 546
 		if ( $field->type === 'submit' && isset( $new_field['field_order'] ) && (int) $new_field['field_order'] === FrmSubmitHelper::DEFAULT_ORDER ) {
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 			if ( ! isset( $form->options['trash_time'] ) || $form->options['trash_time'] < $delete_timestamp ) {
735 735
 				self::destroy( $form->id );
736 736
 				if ( empty( $form->parent_form_id ) ) {
737
-					++$count;
737
+					++ $count;
738 738
 				}
739 739
 			}
740 740
 
@@ -961,16 +961,16 @@  discard block
 block discarded – undo
961 961
 		foreach ( $results as $row ) {
962 962
 			if ( 'trash' != $row->status ) {
963 963
 				if ( $row->is_template ) {
964
-					++$counts['template'];
964
+					++ $counts['template'];
965 965
 				} else {
966
-					++$counts['published'];
966
+					++ $counts['published'];
967 967
 				}
968 968
 			} else {
969
-				++$counts['trash'];
969
+				++ $counts['trash'];
970 970
 			}
971 971
 
972 972
 			if ( 'draft' == $row->status ) {
973
-				++$counts['draft'];
973
+				++ $counts['draft'];
974 974
 			}
975 975
 
976 976
 			unset( $row );
@@ -1011,8 +1011,8 @@  discard block
 block discarded – undo
1011 1011
 			self::maybe_get_form( $form );
1012 1012
 		}
1013 1013
 
1014
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
1015
-			return $frm_vars['form_params'][ $form->id ];
1014
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
1015
+			return $frm_vars['form_params'][$form->id];
1016 1016
 		}
1017 1017
 
1018 1018
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -1041,15 +1041,15 @@  discard block
 block discarded – undo
1041 1041
 			// If there are two forms on the same page, make sure not to submit both.
1042 1042
 			foreach ( $default_values as $var => $default ) {
1043 1043
 				if ( $var === 'action' ) {
1044
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
1044
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
1045 1045
 				} else {
1046
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1046
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1047 1047
 				}
1048 1048
 				unset( $var, $default );
1049 1049
 			}
1050 1050
 		} else {
1051 1051
 			foreach ( $default_values as $var => $default ) {
1052
-				$values[ $var ] = $default;
1052
+				$values[$var] = $default;
1053 1053
 				unset( $var, $default );
1054 1054
 			}
1055 1055
 		}
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 			'sdir'     => '',
1076 1076
 		);
1077 1077
 		foreach ( $defaults as $var => $default ) {
1078
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1078
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1079 1079
 		}
1080 1080
 
1081 1081
 		return $values;
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 			'keep_post' => '',
1104 1104
 		);
1105 1105
 		foreach ( $defaults as $var => $default ) {
1106
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1106
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1107 1107
 		}
1108 1108
 
1109 1109
 		return $values;
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 		$form    = $atts['form'];
1218 1218
 		$default = $atts['default'] ?? '';
1219 1219
 
1220
-		return $form->options[ $atts['option'] ] ?? $default;
1220
+		return $form->options[$atts['option']] ?? $default;
1221 1221
 	}
1222 1222
 
1223 1223
 	/**
Please login to merge, or discard this patch.
classes/helpers/FrmEntriesHelper.php 2 patches
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,13 +134,16 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public static function value_is_posted( $field, $args ) {
136 136
 		$value_is_posted = false;
137
-		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
137
+		if ( $_POST ) {
138
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
138 139
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
139 140
 			if ( $repeating ) {
140
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
141
+				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) {
142
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
141 143
 					$value_is_posted = true;
142 144
 				}
143
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
145
+			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) {
146
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
144 147
 				$value_is_posted = true;
145 148
 			}
146 149
 		}
@@ -363,8 +366,10 @@  discard block
 block discarded – undo
363 366
 	 * @return void
364 367
 	 */
365 368
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
366
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
367
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
369
+		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) {
370
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
371
+			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) {
372
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
368 373
 				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
369 374
 			}
370 375
 		} else {
@@ -446,7 +451,8 @@  discard block
 block discarded – undo
446 451
 		self::set_other_repeating_vals( $field, $value, $args );
447 452
 
448 453
 		// Check if there are any posted "Other" values.
449
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
454
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) {
455
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
450 456
 
451 457
 			// Save original value.
452 458
 			$args['temp_value'] = $value;
@@ -476,7 +482,8 @@  discard block
 block discarded – undo
476 482
 		}
477 483
 
478 484
 		// Check if there are any other posted "other" values for this field.
479
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
485
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) {
486
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
480 487
 			// Save original value
481 488
 			$args['temp_value'] = $value;
482 489
 			$args['other']      = true;
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
146 146
 			$repeating = isset( $args['repeating'] ) && $args['repeating'];
147 147
 			if ( $repeating ) {
148
-				if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
148
+				if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
149 149
 					$value_is_posted = true;
150 150
 				}
151
-			} elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
151
+			} elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
152 152
 				$value_is_posted = true;
153 153
 			}
154 154
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER );
193 193
 
194 194
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
195
-			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
195
+			$add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
196 196
 			if ( ! empty( $add_atts ) ) {
197 197
 				$this_atts = array_merge( $atts, $add_atts );
198 198
 			} else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			$default = FrmEntriesController::show_entry_shortcode( $this_atts );
203 203
 
204 204
 			// Add the default message.
205
-			$message = str_replace( $shortcodes[0][ $short_key ], $default, $message );
205
+			$message = str_replace( $shortcodes[0][$short_key], $default, $message );
206 206
 		}
207 207
 
208 208
 		return $message;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @return string
216 216
 	 */
217 217
 	public static function prepare_display_value( $entry, $field, $atts ) {
218
-		$field_value = $entry->metas[ $field->id ] ?? false;
218
+		$field_value = $entry->metas[$field->id] ?? false;
219 219
 
220 220
 		if ( FrmAppHelper::pro_is_installed() ) {
221 221
 			$empty = empty( $field_value );
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 			$child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true );
244 244
 		} else {
245 245
 			// Get all values for this field.
246
-			$child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false;
246
+			$child_values = $entry->metas[$atts['embedded_field_id']] ?? false;
247 247
 
248 248
 			if ( $child_values ) {
249 249
 				$child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) );
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			$value = $args['temp_value'];
373 373
 		}
374 374
 		if ( empty( $args['parent_field_id'] ) ) {
375
-			$_POST['item_meta'][ $field->id ] = $value;
375
+			$_POST['item_meta'][$field->id] = $value;
376 376
 		} else {
377 377
 			self::set_parent_field_posted_value( $field, $value, $args );
378 378
 		}
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
 	 * @return void
391 391
 	 */
392 392
 	private static function set_parent_field_posted_value( $field, $value, $args ) {
393
-		if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
394
-			if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
395
-				$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
393
+		if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
394
+			if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
395
+				$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
396 396
 			}
397 397
 		} else {
398 398
 			// All of the section was probably removed.
399
-			$_POST['item_meta'][ $args['parent_field_id'] ]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
400
-			$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
399
+			$_POST['item_meta'][$args['parent_field_id']]                         = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
400
+			$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing
401 401
 		}
402 402
 
403
-		$_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
403
+		$_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing
404 404
 	}
405 405
 
406 406
 	/**
@@ -447,9 +447,9 @@  discard block
 block discarded – undo
447 447
 	private static function get_posted_meta( $field_id, $args ) {
448 448
 		if ( empty( $args['parent_field_id'] ) ) {
449 449
 			// Sanitizing is done next.
450
-			$value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
450
+			$value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
451 451
 		} else {
452
-			$value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
452
+			$value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
453 453
 		}
454 454
 		return $value;
455 455
 	}
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
 		self::set_other_repeating_vals( $field, $value, $args );
481 481
 
482 482
 		// Check if there are any posted "Other" values.
483
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
483
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
484 484
 
485 485
 			// Save original value.
486 486
 			$args['temp_value'] = $value;
487 487
 			$args['other']      = true;
488 488
 
489 489
 			// Sanitizing is done next.
490
-			$other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
490
+			$other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
491 491
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
492 492
 
493 493
 			// Set the validation value now
@@ -510,12 +510,12 @@  discard block
 block discarded – undo
510 510
 		}
511 511
 
512 512
 		// Check if there are any other posted "other" values for this field.
513
-		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
513
+		if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
514 514
 			// Save original value
515 515
 			$args['temp_value'] = $value;
516 516
 			$args['other']      = true;
517 517
 
518
-			$other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
518
+			$other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
519 519
 			FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals );
520 520
 
521 521
 			// Set the validation value now.
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 		if ( is_array( $value ) && $field->type === 'checkbox' ) {
543 543
 			// Combine "Other" values with checked values. "Other" values will override checked box values.
544 544
 			foreach ( $other_vals as $k => $v ) {
545
-				if ( isset( $value[ $k ] ) && trim( $v ) === '' ) {
545
+				if ( isset( $value[$k] ) && trim( $v ) === '' ) {
546 546
 					// If the other box is checked, but doesn't have a value.
547 547
 					$value = '';
548 548
 					break;
@@ -559,25 +559,25 @@  discard block
 block discarded – undo
559 559
 
560 560
 			// Multi-select dropdown.
561 561
 			if ( is_array( $value ) ) {
562
-				$o_key = array_search( $field->options[ $other_key ], $value );
562
+				$o_key = array_search( $field->options[$other_key], $value );
563 563
 
564 564
 				if ( $o_key !== false ) {
565 565
 					// Modify the original value so other key will be preserved.
566
-					$value[ $other_key ] = $value[ $o_key ];
566
+					$value[$other_key] = $value[$o_key];
567 567
 
568 568
 					// By default, the array keys will be numeric for multi-select dropdowns.
569 569
 					// If going backwards and forwards between pages, the array key will match the other key.
570 570
 					if ( $o_key !== $other_key ) {
571
-						unset( $value[ $o_key ] );
571
+						unset( $value[$o_key] );
572 572
 					}
573 573
 
574 574
 					$args['temp_value']  = $value;
575
-					$value[ $other_key ] = reset( $other_vals );
576
-					if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) {
577
-						unset( $value[ $other_key ] );
575
+					$value[$other_key] = reset( $other_vals );
576
+					if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) {
577
+						unset( $value[$other_key] );
578 578
 					}
579 579
 				}
580
-			} elseif ( $field->options[ $other_key ] == $value ) {
580
+			} elseif ( $field->options[$other_key] == $value ) {
581 581
 				$value = $other_vals;
582 582
 			}//end if
583 583
 		}//end if
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 	 * @return void
832 832
 	 */
833 833
 	public static function maybe_render_captcha_score( $entry_id ) {
834
-		$query                 = array(
834
+		$query = array(
835 835
 			'item_id'  => (int) $entry_id,
836 836
 			'field_id' => 0,
837 837
 		);
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 	public static function get_entry_status_label( $status ) {
886 886
 		$statuses = self::get_entry_statuses();
887 887
 
888
-		return $statuses[ self::get_entry_status( $status ) ];
888
+		return $statuses[self::get_entry_status( $status )];
889 889
 	}
890 890
 
891 891
 	/**
Please login to merge, or discard this patch.
classes/controllers/FrmEntriesController.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -152,20 +152,20 @@  discard block
 block discarded – undo
152 152
 		global $frm_vars;
153 153
 		$form_id = FrmForm::get_current_form_id();
154 154
 
155
-		$columns[ $form_id . '_id' ]       = 'ID';
156
-		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
155
+		$columns[$form_id . '_id']       = 'ID';
156
+		$columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' );
157 157
 
158 158
 		if ( $form_id ) {
159 159
 			self::get_columns_for_form( $form_id, $columns );
160 160
 		} else {
161
-			$columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' );
162
-			$columns[ $form_id . '_name' ]    = esc_html__( 'Entry Name', 'formidable' );
163
-			$columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' );
161
+			$columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' );
162
+			$columns[$form_id . '_name']    = esc_html__( 'Entry Name', 'formidable' );
163
+			$columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' );
164 164
 		}
165 165
 
166
-		$columns[ $form_id . '_is_draft' ]   = esc_html__( 'Entry Status', 'formidable' );
167
-		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
168
-		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
166
+		$columns[$form_id . '_is_draft']   = esc_html__( 'Entry Status', 'formidable' );
167
+		$columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' );
168
+		$columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' );
169 169
 		self::maybe_add_ip_col( $form_id, $columns );
170 170
 
171 171
 		$frm_vars['cols'] = $columns;
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
 
230 230
 		foreach ( $sub_form_cols as $k => $sub_form_col ) {
231 231
 			if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
232
-				unset( $sub_form_cols[ $k ] );
232
+				unset( $sub_form_cols[$k] );
233 233
 				continue;
234 234
 			}
235
-			$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
235
+			$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
236 236
 			unset( $sub_form_col );
237 237
 		}
238 238
 	}
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 		$is_post_status             = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status';
257 257
 		$include_column_for_sep_val = $has_separate_value && ! $is_post_status;
258 258
 		if ( $include_column_for_sep_val ) {
259
-			$columns[ $form_id . '_frmsep_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val );
259
+			$columns[$form_id . '_frmsep_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val );
260 260
 		}
261 261
 
262
-		$columns[ $form_id . '_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false );
262
+		$columns[$form_id . '_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false );
263 263
 	}
264 264
 
265 265
 	/**
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	 */
292 292
 	private static function maybe_add_ip_col( $form_id, &$columns ) {
293 293
 		if ( FrmAppHelper::ips_saved() ) {
294
-			$columns[ $form_id . '_ip' ] = 'IP';
294
+			$columns[$form_id . '_ip'] = 'IP';
295 295
 		}
296 296
 	}
297 297
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 		foreach ( $meta_value as $mk => $mv ) {
347 347
 			// Remove blank values.
348 348
 			if ( empty( $mv ) ) {
349
-				unset( $meta_value[ $mk ] );
349
+				unset( $meta_value[$mk] );
350 350
 			}
351 351
 		}
352 352
 
@@ -423,14 +423,14 @@  discard block
 block discarded – undo
423 423
 		);
424 424
 
425 425
 		if ( ! $form_id ) {
426
-			$columns[ $form_id . '_user_id' ] = 'user_id';
427
-			$columns[ $form_id . '_name' ]    = 'name';
428
-			$columns[ $form_id . '_form_id' ] = 'form_id';
426
+			$columns[$form_id . '_user_id'] = 'user_id';
427
+			$columns[$form_id . '_name']    = 'name';
428
+			$columns[$form_id . '_form_id'] = 'form_id';
429 429
 		}
430 430
 
431 431
 		foreach ( $fields as $field ) {
432 432
 			if ( self::field_supports_sorting( $field ) ) {
433
-				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
433
+				$columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id;
434 434
 			}
435 435
 		}
436 436
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 			$atts['form_id'] . '_item_key' => '',
519 519
 			$atts['form_id'] . '_id'       => '',
520 520
 		);
521
-		$cols         = $remove_first + array_reverse( $frm_vars['cols'], true );
521
+		$cols = $remove_first + array_reverse( $frm_vars['cols'], true );
522 522
 
523 523
 		$i = $atts['i'];
524 524
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 
530 530
 			if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
531 531
 				$result[] = $col_key;
532
-				--$i;
532
+				-- $i;
533 533
 			}
534 534
 
535 535
 			unset( $col_key, $col );
@@ -677,9 +677,9 @@  discard block
 block discarded – undo
677 677
 		if ( ! isset( $frm_vars['form_params'] ) ) {
678 678
 			$frm_vars['form_params'] = array();
679 679
 		}
680
-		$frm_vars['form_params'][ $form->id ] = $params;
680
+		$frm_vars['form_params'][$form->id] = $params;
681 681
 
682
-		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
682
+		if ( isset( $frm_vars['created_entries'][$form_id] ) ) {
683 683
 			return;
684 684
 		}
685 685
 
@@ -695,16 +695,16 @@  discard block
 block discarded – undo
695 695
 		 */
696 696
 		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
697 697
 
698
-		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
698
+		$frm_vars['created_entries'][$form_id] = array( 'errors' => $errors );
699 699
 
700 700
 		if ( empty( $errors ) ) {
701 701
 			$_POST['frm_skip_cookie'] = 1;
702 702
 			$do_success               = false;
703 703
 			if ( $params['action'] === 'create' ) {
704
-				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
705
-					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
704
+				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) {
705
+					$frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
706 706
 
707
-					$params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
707
+					$params['id'] = $frm_vars['created_entries'][$form_id]['entry_id'];
708 708
 					$do_success   = true;
709 709
 				}
710 710
 			}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -712,7 +712,8 @@
 block discarded – undo
712 712
 	 */
713 713
 	public static function process_entry( $errors = '', $ajax = false ) {
714 714
 		$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
715
-		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
715
+		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) {
716
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
716 717
 			return;
717 718
 		}
718 719
 
Please login to merge, or discard this patch.
classes/models/FrmFormState.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * @return void
60 60
 	 */
61 61
 	public function set( $key, $value ) {
62
-		$this->state[ $key ] = $value;
62
+		$this->state[$key] = $value;
63 63
 	}
64 64
 
65 65
 	/**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 * @return mixed
82 82
 	 */
83 83
 	public function get( $key, $default ) {
84
-		return $this->state[ $key ] ?? $default;
84
+		return $this->state[$key] ?? $default;
85 85
 	}
86 86
 
87 87
 	/**
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	private function compressed_state() {
193 193
 		$compressed = array();
194 194
 		foreach ( $this->state as $key => $value ) {
195
-			$compressed[ self::compressed_key( $key ) ] = $value;
195
+			$compressed[self::compressed_key( $key )] = $value;
196 196
 		}
197 197
 		return $compressed;
198 198
 	}
Please login to merge, or discard this patch.