Completed
Pull Request — master (#1456)
by Stephanie
52s
created
classes/controllers/FrmSimpleBlocksController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 			return false;
77 77
 		}
78 78
 
79
-		return $addons[ $addon_id ];
79
+		return $addons[$addon_id];
80 80
 	}
81 81
 
82 82
 	/**
Please login to merge, or discard this patch.
classes/models/FrmSettings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 		}
188 188
 
189 189
 		foreach ( $settings as $setting => $default ) {
190
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
191
-				$this->{$setting} = $params[ 'frm_' . $setting ];
190
+			if ( isset( $params['frm_' . $setting] ) ) {
191
+				$this->{$setting} = $params['frm_' . $setting];
192 192
 			} elseif ( ! isset( $this->{$setting} ) ) {
193 193
 				$this->{$setting} = $default;
194 194
 			}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' );
358 358
 		foreach ( $checkboxes as $set ) {
359
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0;
359
+			$this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0;
360 360
 		}
361 361
 	}
362 362
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		$frm_roles = FrmAppHelper::frm_capabilities();
370 370
 		$roles     = get_editable_roles();
371 371
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
372
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
372
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
373 373
 
374 374
 			// Make sure administrators always have permissions
375 375
 			if ( ! in_array( 'administrator', $this->$frm_role ) ) {
Please login to merge, or discard this patch.
classes/factories/FrmFieldFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 			'credit_card' => 'FrmFieldCreditCard',
109 109
 		);
110 110
 
111
-		$class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : '';
111
+		$class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : '';
112 112
 
113 113
 		return apply_filters( 'frm_get_field_type_class', $class, $field_type );
114 114
 	}
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldType.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 		$field_val = '';
145 145
 		if ( is_object( $this->field ) ) {
146 146
 			$field_val = $this->field->{$column};
147
-		} elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) {
148
-			$field_val = $this->field[ $column ];
147
+		} elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) {
148
+			$field_val = $this->field[$column];
149 149
 		}
150 150
 
151 151
 		return $field_val;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		if ( is_object( $this->field ) ) {
160 160
 			$this->field->{$column} = $value;
161 161
 		} elseif ( is_array( $this->field ) ) {
162
-			$this->field[ $column ] = $value;
162
+			$this->field[$column] = $value;
163 163
 		}
164 164
 	}
165 165
 
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 			printf(
549 549
 				/* translators: %s: Field type */
550 550
 				esc_html__( '%s Options', 'formidable' ),
551
-				esc_html( $all_field_types[ $args['display']['type'] ]['name'] )
551
+				esc_html( $all_field_types[$args['display']['type']]['name'] )
552 552
 			);
553 553
 			FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) );
554 554
 			?>
@@ -681,8 +681,8 @@  discard block
 block discarded – undo
681 681
 
682 682
 		$fields = array_merge( $fields, $pro_fields );
683 683
 
684
-		if ( isset( $fields[ $this->type ] ) ) {
685
-			$name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ];
684
+		if ( isset( $fields[$this->type] ) ) {
685
+			$name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type];
686 686
 		}
687 687
 
688 688
 		return $name;
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	 * @return array
700 700
 	 */
701 701
 	public function get_default_field_options() {
702
-		$opts       = array(
702
+		$opts = array(
703 703
 			'size'               => '',
704 704
 			'max'                => '',
705 705
 			'label'              => '',
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
 			}
1067 1067
 		} else {
1068 1068
 			$args['save_array'] = $this->is_readonly_array();
1069
-			$hidden             .= $this->show_single_hidden( $selected_value, $args );
1069
+			$hidden .= $this->show_single_hidden( $selected_value, $args );
1070 1070
 		}
1071 1071
 
1072 1072
 		return $hidden;
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
 	protected function show_single_hidden( $selected, $args ) {
1076 1076
 		if ( $args['save_array'] ) {
1077 1077
 			$args['field_name'] .= '[]';
1078
-			$id                 = '';
1078
+			$id = '';
1079 1079
 		} else {
1080 1080
 			$id = ' id="' . esc_attr( $args['html_id'] ) . '"';
1081 1081
 		}
@@ -1091,8 +1091,8 @@  discard block
 block discarded – undo
1091 1091
 		$selected = $values['field_value'];
1092 1092
 
1093 1093
 		if ( isset( $values['combo_name'] ) ) {
1094
-			$options  = $options[ $values['combo_name'] ];
1095
-			$selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : '';
1094
+			$options  = $options[$values['combo_name']];
1095
+			$selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : '';
1096 1096
 		}
1097 1097
 
1098 1098
 		$input = $this->select_tag( $values );
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 	}
1144 1144
 
1145 1145
 	protected function fill_display_field_values( $args = array() ) {
1146
-		$defaults        = array(
1146
+		$defaults = array(
1147 1147
 			'field_name'    => 'item_meta[' . $this->get_field_column( 'id' ) . ']',
1148 1148
 			'field_id'      => $this->get_field_column( 'id' ),
1149 1149
 			'field_plus_id' => '',
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 			}
1197 1197
 		}
1198 1198
 
1199
-		if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) {
1199
+		if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) {
1200 1200
 			if ( $error_comes_first ) {
1201 1201
 				array_unshift( $describedby, 'frm_error_' . $args['html_id'] );
1202 1202
 			} else {
@@ -1275,11 +1275,11 @@  discard block
 block discarded – undo
1275 1275
 
1276 1276
 		$field_id = $this->get_field_column( 'id' );
1277 1277
 		if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) {
1278
-			$frm_validated_unique_values[ $field_id ] = array();
1278
+			$frm_validated_unique_values[$field_id] = array();
1279 1279
 			return false;
1280 1280
 		}
1281 1281
 
1282
-		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true );
1282
+		$already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true );
1283 1283
 		return $already_validated_this_value;
1284 1284
 	}
1285 1285
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 	private function value_validated_as_unique( $value ) {
1305 1305
 		global $frm_validated_unique_values;
1306 1306
 		$field_id                                   = $this->get_field_column( 'id' );
1307
-		$frm_validated_unique_values[ $field_id ][] = $value;
1307
+		$frm_validated_unique_values[$field_id][] = $value;
1308 1308
 	}
1309 1309
 
1310 1310
 	public function get_value_to_save( $value, $atts ) {
@@ -1336,8 +1336,8 @@  discard block
 block discarded – undo
1336 1336
 		$value = $this->prepare_display_value( $value, $atts );
1337 1337
 
1338 1338
 		if ( is_array( $value ) ) {
1339
-			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) {
1340
-				$value = $value[ $atts['show'] ];
1339
+			if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) {
1340
+				$value = $value[$atts['show']];
1341 1341
 			} elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) {
1342 1342
 				$sep   = isset( $atts['sep'] ) ? $atts['sep'] : ', ';
1343 1343
 				$value = implode( $sep, $value );
@@ -1406,8 +1406,8 @@  discard block
 block discarded – undo
1406 1406
 		$saved_entries = $atts['ids'];
1407 1407
 		$new_value     = array();
1408 1408
 		foreach ( (array) $value as $old_child_id ) {
1409
-			if ( isset( $saved_entries[ $old_child_id ] ) ) {
1410
-				$new_value[] = $saved_entries[ $old_child_id ];
1409
+			if ( isset( $saved_entries[$old_child_id] ) ) {
1410
+				$new_value[] = $saved_entries[$old_child_id];
1411 1411
 			}
1412 1412
 		}
1413 1413
 
Please login to merge, or discard this patch.
classes/helpers/FrmAppHelper.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -493,7 +493,8 @@  discard block
 block discarded – undo
493 493
 
494 494
 		if ( $src === 'get' ) {
495 495
 			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
496
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
496
+			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) {
497
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
497 498
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
498 499
 				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
499 500
 			}
@@ -581,7 +582,8 @@  discard block
 block discarded – undo
581 582
 				$value = wp_unslash( $_GET[ $args['param'] ] );
582 583
 			}
583 584
 		} elseif ( $args['type'] === 'post' ) {
584
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
585
+			if ( isset( $_POST[ $args['param'] ] ) ) {
586
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
585 587
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
586 588
 				$value = wp_unslash( $_POST[ $args['param'] ] );
587 589
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
@@ -589,7 +591,8 @@  discard block
 block discarded – undo
589 591
 				}
590 592
 			}
591 593
 		} else {
592
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
594
+			if ( isset( $_REQUEST[ $args['param'] ] ) ) {
595
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
593 596
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
594 597
 				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
595 598
 			}
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			'fill'   => '#4d4d4d',
199 199
 			'orange' => '#f05a24',
200 200
 		);
201
-		$atts     = array_merge( $defaults, $atts );
201
+		$atts = array_merge( $defaults, $atts );
202 202
 
203 203
 		return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '">
204 204
 			<path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/>
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @return string
406 406
 	 */
407 407
 	public static function get_server_value( $value ) {
408
-		return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : '';
408
+		return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : '';
409 409
 	}
410 410
 
411 411
 	/**
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$ip         = '';
440 440
 
441 441
 		foreach ( $ip_options as $key ) {
442
-			if ( ! isset( $_SERVER[ $key ] ) ) {
442
+			if ( ! isset( $_SERVER[$key] ) ) {
443 443
 				continue;
444 444
 			}
445 445
 
@@ -508,10 +508,10 @@  discard block
 block discarded – undo
508 508
 		}
509 509
 
510 510
 		if ( $src === 'get' ) {
511
-			$value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
512
-			if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
511
+			$value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
512
+			if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
513 513
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
514
-				$value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) );
514
+				$value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) );
515 515
 			}
516 516
 			self::sanitize_value( $sanitize, $value );
517 517
 		} else {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 				}
533 533
 
534 534
 				$p     = trim( $p, ']' );
535
-				$value = isset( $value[ $p ] ) ? $value[ $p ] : $default;
535
+				$value = isset( $value[$p] ) ? $value[$p] : $default;
536 536
 			}
537 537
 		}
538 538
 
@@ -588,26 +588,26 @@  discard block
 block discarded – undo
588 588
 			'sanitize' => 'sanitize_text_field',
589 589
 			'serialized' => false,
590 590
 		);
591
-		$args     = wp_parse_args( $args, $defaults );
591
+		$args = wp_parse_args( $args, $defaults );
592 592
 
593 593
 		$value = $args['default'];
594 594
 		if ( $args['type'] === 'get' ) {
595
-			if ( $_GET && isset( $_GET[ $args['param'] ] ) ) {
595
+			if ( $_GET && isset( $_GET[$args['param']] ) ) {
596 596
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
597
-				$value = wp_unslash( $_GET[ $args['param'] ] );
597
+				$value = wp_unslash( $_GET[$args['param']] );
598 598
 			}
599 599
 		} elseif ( $args['type'] === 'post' ) {
600
-			if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
600
+			if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
601 601
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
602
-				$value = wp_unslash( $_POST[ $args['param'] ] );
602
+				$value = wp_unslash( $_POST[$args['param']] );
603 603
 				if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) {
604 604
 					self::unserialize_or_decode( $value );
605 605
 				}
606 606
 			}
607 607
 		} else {
608
-			if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
608
+			if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
609 609
 				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
610
-				$value = wp_unslash( $_REQUEST[ $args['param'] ] );
610
+				$value = wp_unslash( $_REQUEST[$args['param']] );
611 611
 			}
612 612
 		}
613 613
 
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 			if ( is_array( $value ) ) {
640 640
 				$temp_values = $value;
641 641
 				foreach ( $temp_values as $k => $v ) {
642
-					self::sanitize_value( $sanitize, $value[ $k ] );
642
+					self::sanitize_value( $sanitize, $value[$k] );
643 643
 				}
644 644
 			} else {
645 645
 				$value = call_user_func( $sanitize, $value );
@@ -650,8 +650,8 @@  discard block
 block discarded – undo
650 650
 	public static function sanitize_request( $sanitize_method, &$values ) {
651 651
 		$temp_values = $values;
652 652
 		foreach ( $temp_values as $k => $val ) {
653
-			if ( isset( $sanitize_method[ $k ] ) ) {
654
-				$values[ $k ] = call_user_func( $sanitize_method[ $k ], $val );
653
+			if ( isset( $sanitize_method[$k] ) ) {
654
+				$values[$k] = call_user_func( $sanitize_method[$k], $val );
655 655
 			}
656 656
 		}
657 657
 	}
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 		if ( is_array( $value ) ) {
675 675
 			$temp_values = $value;
676 676
 			foreach ( $temp_values as $k => $v ) {
677
-				self::decode_specialchars( $value[ $k ] );
677
+				self::decode_specialchars( $value[$k] );
678 678
 			}
679 679
 		} else {
680 680
 			self::decode_amp( $value );
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 	 * @return array
797 797
 	 */
798 798
 	public static function add_allowed_submit_button_tags( $allowed_html ) {
799
-		$allowed_html['input']                    = array(
799
+		$allowed_html['input'] = array(
800 800
 			'type'           => true,
801 801
 			'value'          => true,
802 802
 			'formnovalidate' => true,
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 			$allowed_html = $html;
820 820
 		} elseif ( ! empty( $allowed ) ) {
821 821
 			foreach ( (array) $allowed as $a ) {
822
-				$allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array();
822
+				$allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array();
823 823
 			}
824 824
 		}
825 825
 
@@ -998,8 +998,8 @@  discard block
 block discarded – undo
998 998
 		}
999 999
 
1000 1000
 		global $wp_query;
1001
-		if ( isset( $wp_query->query_vars[ $param ] ) ) {
1002
-			$value = $wp_query->query_vars[ $param ];
1001
+		if ( isset( $wp_query->query_vars[$param] ) ) {
1002
+			$value = $wp_query->query_vars[$param];
1003 1003
 		}
1004 1004
 
1005 1005
 		return $value;
@@ -1028,9 +1028,9 @@  discard block
 block discarded – undo
1028 1028
 			'frm_keyalt_icon'       => 'frm_key_icon',
1029 1029
 			'frm_keyalt_solid_icon' => 'frm_key_solid_icon',
1030 1030
 		);
1031
-		if ( isset( $deprecated[ $icon ] ) ) {
1032
-			$icon  = $deprecated[ $icon ];
1033
-			$class = str_replace( $icon, $deprecated[ $icon ], $class );
1031
+		if ( isset( $deprecated[$icon] ) ) {
1032
+			$icon  = $deprecated[$icon];
1033
+			$class = str_replace( $icon, $deprecated[$icon], $class );
1034 1034
 		}
1035 1035
 
1036 1036
 		if ( $icon === $class ) {
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
 				'new_file_path' => self::plugin_path() . '/js',
1364 1364
 			)
1365 1365
 		);
1366
-		$new_file  = new FrmCreateFile( $file_atts );
1366
+		$new_file = new FrmCreateFile( $file_atts );
1367 1367
 
1368 1368
 		$files = array(
1369 1369
 			self::plugin_path() . '/js/formidable.min.js',
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
 				'new_file_path' => self::plugin_path() . '/js',
1383 1383
 			)
1384 1384
 		);
1385
-		$new_file  = new FrmCreateFile( $file_atts );
1385
+		$new_file = new FrmCreateFile( $file_atts );
1386 1386
 		$files = array(
1387 1387
 			FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js',
1388 1388
 		);
@@ -1873,8 +1873,8 @@  discard block
 block discarded – undo
1873 1873
 			return $error;
1874 1874
 		}
1875 1875
 
1876
-		$nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : '';
1877
-		if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1876
+		$nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : '';
1877
+		if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) {
1878 1878
 			$frm_settings = self::get_settings();
1879 1879
 			$error        = $frm_settings->admin_permission;
1880 1880
 		}
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
 			} else {
1910 1910
 				foreach ( $value as $k => $v ) {
1911 1911
 					if ( ! is_array( $v ) ) {
1912
-						$value[ $k ] = call_user_func( $original_function, $v );
1912
+						$value[$k] = call_user_func( $original_function, $v );
1913 1913
 					}
1914 1914
 				}
1915 1915
 			}
@@ -1934,7 +1934,7 @@  discard block
 block discarded – undo
1934 1934
 				$return = array_merge( $return, self::array_flatten( $value, $keys ) );
1935 1935
 			} else {
1936 1936
 				if ( $keys === 'keep' ) {
1937
-					$return[ $key ] = $value;
1937
+					$return[$key] = $value;
1938 1938
 				} else {
1939 1939
 					$return[] = $value;
1940 1940
 				}
@@ -1987,11 +1987,11 @@  discard block
 block discarded – undo
1987 1987
 		}
1988 1988
 
1989 1989
 		$ver = $default;
1990
-		if ( ! isset( $wp_scripts->registered[ $handle ] ) ) {
1990
+		if ( ! isset( $wp_scripts->registered[$handle] ) ) {
1991 1991
 			return $ver;
1992 1992
 		}
1993 1993
 
1994
-		$query = $wp_scripts->registered[ $handle ];
1994
+		$query = $wp_scripts->registered[$handle];
1995 1995
 		if ( is_object( $query ) && ! empty( $query->ver ) ) {
1996 1996
 			$ver = $query->ver;
1997 1997
 		}
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
 			$suffix = 2;
2098 2098
 			do {
2099 2099
 				$key_check = $key . $separator . $suffix;
2100
-				++$suffix;
2100
+				++ $suffix;
2101 2101
 			} while ( in_array( $key_check, $similar_keys, true ) );
2102 2102
 
2103 2103
 			$key = $key_check;
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
 
2206 2206
 		foreach ( array( 'name', 'description' ) as $var ) {
2207 2207
 			$default_val    = isset( $record->{$var} ) ? $record->{$var} : '';
2208
-			$values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2208
+			$values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' );
2209 2209
 			unset( $var, $default_val );
2210 2210
 		}
2211 2211
 
@@ -2263,9 +2263,9 @@  discard block
 block discarded – undo
2263 2263
 			}
2264 2264
 		}//end if
2265 2265
 
2266
-		$field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type;
2267
-		if ( isset( $post_values['item_meta'][ $field->id ] ) ) {
2268
-			$new_value = $post_values['item_meta'][ $field->id ];
2266
+		$field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type;
2267
+		if ( isset( $post_values['item_meta'][$field->id] ) ) {
2268
+			$new_value = $post_values['item_meta'][$field->id];
2269 2269
 			self::unserialize_or_decode( $new_value );
2270 2270
 		} else {
2271 2271
 			$new_value = $meta_value;
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
 
2287 2287
 		$field_array = array_merge( (array) $field->field_options, $field_array );
2288 2288
 
2289
-		$values['fields'][ $field->id ] = $field_array;
2289
+		$values['fields'][$field->id] = $field_array;
2290 2290
 	}
2291 2291
 
2292 2292
 	/**
@@ -2336,11 +2336,11 @@  discard block
 block discarded – undo
2336 2336
 		}
2337 2337
 
2338 2338
 		foreach ( $form->options as $opt => $value ) {
2339
-			if ( isset( $post_values[ $opt ] ) ) {
2340
-				$values[ $opt ] = $post_values[ $opt ];
2341
-				self::unserialize_or_decode( $values[ $opt ] );
2339
+			if ( isset( $post_values[$opt] ) ) {
2340
+				$values[$opt] = $post_values[$opt];
2341
+				self::unserialize_or_decode( $values[$opt] );
2342 2342
 			} else {
2343
-				$values[ $opt ] = $value;
2343
+				$values[$opt] = $value;
2344 2344
 			}
2345 2345
 		}
2346 2346
 
@@ -2354,8 +2354,8 @@  discard block
 block discarded – undo
2354 2354
 		$form_defaults = FrmFormsHelper::get_default_opts();
2355 2355
 
2356 2356
 		foreach ( $form_defaults as $opt => $default ) {
2357
-			if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) {
2358
-				$values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default;
2357
+			if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) {
2358
+				$values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default;
2359 2359
 			}
2360 2360
 
2361 2361
 			unset( $opt, $default );
@@ -2366,8 +2366,8 @@  discard block
 block discarded – undo
2366 2366
 		}
2367 2367
 
2368 2368
 		foreach ( array( 'before', 'after', 'submit' ) as $h ) {
2369
-			if ( ! isset( $values[ $h . '_html' ] ) ) {
2370
-				$values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) );
2369
+			if ( ! isset( $values[$h . '_html'] ) ) {
2370
+				$values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) );
2371 2371
 			}
2372 2372
 			unset( $h );
2373 2373
 		}
@@ -2545,25 +2545,25 @@  discard block
 block discarded – undo
2545 2545
 		if ( ! is_numeric( $levels ) ) {
2546 2546
 			// Show time in specified unit.
2547 2547
 			$levels = self::get_unit( $levels );
2548
-			if ( isset( $time_strings[ $levels ] ) ) {
2548
+			if ( isset( $time_strings[$levels] ) ) {
2549 2549
 				$diff = array(
2550 2550
 					$levels => self::time_format( $levels, $diff ),
2551 2551
 				);
2552 2552
 				$time_strings = array(
2553
-					$levels => $time_strings[ $levels ],
2553
+					$levels => $time_strings[$levels],
2554 2554
 				);
2555 2555
 			}
2556 2556
 			$levels = 1;
2557 2557
 		}
2558 2558
 
2559 2559
 		foreach ( $time_strings as $k => $v ) {
2560
-			if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
2561
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
2562
-			} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
2560
+			if ( isset( $diff[$k] ) && $diff[$k] ) {
2561
+				$time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] );
2562
+			} elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) {
2563 2563
 				// Account for 0.
2564
-				$time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1];
2564
+				$time_strings[$k] = $diff[$k] . ' ' . $v[1];
2565 2565
 			} else {
2566
-				unset( $time_strings[ $k ] );
2566
+				unset( $time_strings[$k] );
2567 2567
 			}
2568 2568
 		}
2569 2569
 
@@ -2582,8 +2582,8 @@  discard block
 block discarded – undo
2582 2582
 			'y' => 'y',
2583 2583
 			'd' => 'days',
2584 2584
 		);
2585
-		if ( isset( $return[ $unit ] ) ) {
2586
-			return $diff[ $return[ $unit ] ];
2585
+		if ( isset( $return[$unit] ) ) {
2586
+			return $diff[$return[$unit]];
2587 2587
 		}
2588 2588
 
2589 2589
 		$total = $diff['days'] * self::convert_time( 'd', $unit );
@@ -2591,11 +2591,11 @@  discard block
 block discarded – undo
2591 2591
 		$times = array( 'h', 'i', 's' );
2592 2592
 
2593 2593
 		foreach ( $times as $time ) {
2594
-			if ( ! isset( $diff[ $time ] ) ) {
2594
+			if ( ! isset( $diff[$time] ) ) {
2595 2595
 				continue;
2596 2596
 			}
2597 2597
 
2598
-			$total += $diff[ $time ] * self::convert_time( $time, $unit );
2598
+			$total += $diff[$time] * self::convert_time( $time, $unit );
2599 2599
 		}
2600 2600
 
2601 2601
 		return floor( $total );
@@ -2615,7 +2615,7 @@  discard block
 block discarded – undo
2615 2615
 			'y' => DAY_IN_SECONDS * 365.25,
2616 2616
 		);
2617 2617
 
2618
-		return $convert[ $from ] / $convert[ $to ];
2618
+		return $convert[$from] / $convert[$to];
2619 2619
 	}
2620 2620
 
2621 2621
 	/**
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 	 */
2624 2624
 	private static function get_unit( $unit ) {
2625 2625
 		$units = self::get_time_strings();
2626
-		if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) {
2626
+		if ( isset( $units[$unit] ) || is_numeric( $unit ) ) {
2627 2627
 			return $unit;
2628 2628
 		}
2629 2629
 
@@ -2740,17 +2740,17 @@  discard block
 block discarded – undo
2740 2740
 
2741 2741
 					case 1:
2742 2742
 						$l2 = $name;
2743
-						self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] );
2743
+						self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] );
2744 2744
 						break;
2745 2745
 
2746 2746
 					case 2:
2747 2747
 						$l3 = $name;
2748
-						self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] );
2748
+						self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] );
2749 2749
 						break;
2750 2750
 
2751 2751
 					case 3:
2752 2752
 						$l4 = $name;
2753
-						self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] );
2753
+						self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] );
2754 2754
 				}
2755 2755
 
2756 2756
 				unset( $this_val, $n );
@@ -2769,8 +2769,8 @@  discard block
 block discarded – undo
2769 2769
 	public static function add_value_to_array( $name, $l1, $val, &$vars ) {
2770 2770
 		if ( $name == '' ) {
2771 2771
 			$vars[] = $val;
2772
-		} elseif ( ! isset( $vars[ $l1 ] ) ) {
2773
-			$vars[ $l1 ] = $val;
2772
+		} elseif ( ! isset( $vars[$l1] ) ) {
2773
+			$vars[$l1] = $val;
2774 2774
 		}
2775 2775
 	}
2776 2776
 
@@ -2787,7 +2787,7 @@  discard block
 block discarded – undo
2787 2787
 			'new_tab'       => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ),
2788 2788
 		);
2789 2789
 
2790
-		if ( ! isset( $tooltips[ $name ] ) ) {
2790
+		if ( ! isset( $tooltips[$name] ) ) {
2791 2791
 			return;
2792 2792
 		}
2793 2793
 
@@ -2797,7 +2797,7 @@  discard block
 block discarded – undo
2797 2797
 			echo ' class="frm_help"';
2798 2798
 		}
2799 2799
 
2800
-		echo ' title="' . esc_attr( $tooltips[ $name ] );
2800
+		echo ' title="' . esc_attr( $tooltips[$name] );
2801 2801
 
2802 2802
 		if ( 'open' != $class ) {
2803 2803
 			echo '"';
@@ -2856,13 +2856,13 @@  discard block
 block discarded – undo
2856 2856
 	}
2857 2857
 
2858 2858
 	private static function prepare_action_slashes( $val, $key, &$post_content ) {
2859
-		if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) {
2859
+		if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) {
2860 2860
 			return;
2861 2861
 		}
2862 2862
 
2863 2863
 		if ( is_array( $val ) ) {
2864 2864
 			foreach ( $val as $k1 => $v1 ) {
2865
-				self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] );
2865
+				self::prepare_action_slashes( $v1, $k1, $post_content[$key] );
2866 2866
 				unset( $k1, $v1 );
2867 2867
 			}
2868 2868
 		} else {
@@ -2870,7 +2870,7 @@  discard block
 block discarded – undo
2870 2870
 			$val = stripslashes( $val );
2871 2871
 
2872 2872
 			// Add backslashes before double quotes and forward slashes only
2873
-			$post_content[ $key ] = addcslashes( $val, '"\\/' );
2873
+			$post_content[$key] = addcslashes( $val, '"\\/' );
2874 2874
 		}
2875 2875
 	}
2876 2876
 
@@ -2991,14 +2991,14 @@  discard block
 block discarded – undo
2991 2991
 				continue;
2992 2992
 			}
2993 2993
 			$key = $input['name'];
2994
-			if ( isset( $formatted[ $key ] ) ) {
2995
-				if ( is_array( $formatted[ $key ] ) ) {
2996
-					$formatted[ $key ][] = $input['value'];
2994
+			if ( isset( $formatted[$key] ) ) {
2995
+				if ( is_array( $formatted[$key] ) ) {
2996
+					$formatted[$key][] = $input['value'];
2997 2997
 				} else {
2998
-					$formatted[ $key ] = array( $formatted[ $key ], $input['value'] );
2998
+					$formatted[$key] = array( $formatted[$key], $input['value'] );
2999 2999
 				}
3000 3000
 			} else {
3001
-				$formatted[ $key ] = $input['value'];
3001
+				$formatted[$key] = $input['value'];
3002 3002
 			}
3003 3003
 		}
3004 3004
 
@@ -3695,8 +3695,8 @@  discard block
 block discarded – undo
3695 3695
 		}
3696 3696
 
3697 3697
 		foreach ( $keys as $key ) {
3698
-			if ( isset( $values[ $key ] ) ) {
3699
-				$values[ $key ] = self::kses( $values[ $key ], 'all' );
3698
+			if ( isset( $values[$key] ) ) {
3699
+				$values[$key] = self::kses( $values[$key], 'all' );
3700 3700
 			}
3701 3701
 		}
3702 3702
 
@@ -3855,7 +3855,7 @@  discard block
 block discarded – undo
3855 3855
 			return 0;
3856 3856
 		}
3857 3857
 
3858
-		return strlen( $parts[ count( $parts ) - 1 ] );
3858
+		return strlen( $parts[count( $parts ) - 1] );
3859 3859
 	}
3860 3860
 
3861 3861
 	/**
Please login to merge, or discard this patch.
stripe/controllers/FrmStrpLiteEventsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -464,8 +464,8 @@
 block discarded – undo
464 464
 			'charge.refunded'               => 'refunded',
465 465
 		);
466 466
 
467
-		if ( isset( $events[ $this->event->type ] ) ) {
468
-			$this->status = $events[ $this->event->type ];
467
+		if ( isset( $events[$this->event->type] ) ) {
468
+			$this->status = $events[$this->event->type];
469 469
 			$this->set_payment_status();
470 470
 		} elseif ( $this->event->type === 'customer.deleted' ) {
471 471
 			$this->reset_customer();
Please login to merge, or discard this patch.
stripe/controllers/FrmTransLiteListsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
 			'sort'   => '',
101 101
 			'sdir'   => '',
102 102
 		) as $var => $default ) {
103
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default );
103
+			$values[$var] = FrmAppHelper::get_param( $var, $default );
104 104
 		}
105 105
 
106 106
 		return $values;
Please login to merge, or discard this patch.
stripe/models/FrmStrpLiteSettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@
 block discarded – undo
84 84
 		$settings = $this->default_options();
85 85
 
86 86
 		foreach ( $settings as $setting => $default ) {
87
-			if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) {
88
-				$this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) );
87
+			if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) {
88
+				$this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) );
89 89
 			}
90 90
 		}
91 91
 
Please login to merge, or discard this patch.
stripe/models/FrmTransLiteAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 				$has_field  = true;
166 166
 				$key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content );
167 167
 				?>
168
-				<option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>>
168
+				<option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>>
169 169
 					<?php echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) ); ?>
170 170
 				</option>
171 171
 				<?php
Please login to merge, or discard this patch.