Completed
Pull Request — master (#659)
by Burhan
46s
created
css/_single_theme.css.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 <?php } ?>
130 130
 
131 131
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before{
132
-	content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ); ?>";
132
+	content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ); ?>";
133 133
 }
134 134
 
135 135
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_plus_icon:before{
136
-	content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ); ?>";
136
+	content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ); ?>";
137 137
 }
138 138
 
139 139
 .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before,
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
 }
146 146
 
147 147
 .<?php echo esc_html( $style_class ); ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{
148
-	content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ); ?>";
148
+	content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ); ?>";
149 149
 	<?php if ( ! empty( $section_color ) ) { ?>
150 150
 		color:<?php echo esc_html( $section_color . $important ); ?>;
151 151
 	<?php } ?>
152 152
 }
153 153
 
154 154
 .<?php echo esc_html( $style_class ); ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{
155
-	content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ); ?>";
155
+	content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ); ?>";
156 156
 	<?php if ( ! empty( $section_color ) ) { ?>
157 157
 		color:<?php echo esc_html( $section_color . $important ); ?>;
158 158
 	<?php } ?>
Please login to merge, or discard this patch.
classes/models/FrmReviews.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 		$show_intervals = array( 50, 200, 500 );
72 72
 		$asked          = $this->review_status['asked'];
73 73
 
74
-		if ( ! isset( $show_intervals[ $asked ] ) ) {
74
+		if ( ! isset( $show_intervals[$asked] ) ) {
75 75
 			return;
76 76
 		}
77 77
 
78 78
 		$entries = FrmEntry::getRecordCount();
79
-		$count   = $show_intervals[ $asked ];
79
+		$count   = $show_intervals[$asked];
80 80
 		$user    = wp_get_current_user();
81 81
 
82 82
 		// Only show review request if the site has collected enough entries
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$requests = $message->get_messages();
119 119
 		$key      = $this->inbox_key . ( $asked ? $asked : '' );
120 120
 
121
-		if ( isset( $requests[ $key ] ) ) {
121
+		if ( isset( $requests[$key] ) ) {
122 122
 			return;
123 123
 		}
124 124
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 * @since 4.05.02
155 155
 	 */
156 156
 	private function has_later_request( $requests, $asked ) {
157
-		return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] );
157
+		return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] );
158 158
 	}
159 159
 
160 160
 	/**
Please login to merge, or discard this patch.
classes/models/FrmEntryFormatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 
162 162
 		$conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' );
163 163
 		foreach ( $conditionally_add as $index ) {
164
-			if ( isset( $atts[ $index ] ) ) {
165
-				$entry_atts[ $index ] = $atts[ $index ];
164
+			if ( isset( $atts[$index] ) ) {
165
+				$entry_atts[$index] = $atts[$index];
166 166
 			}
167 167
 		}
168 168
 
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 
332 332
 		$unset = array( 'id', 'entry', 'form_id', 'format' );
333 333
 		foreach ( $unset as $param ) {
334
-			if ( isset( $atts[ $param ] ) ) {
335
-				unset( $atts[ $param ] );
334
+			if ( isset( $atts[$param] ) ) {
335
+				unset( $atts[$param] );
336 336
 			}
337 337
 		}
338 338
 
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 
486 486
 			$displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() );
487 487
 
488
-			$output[ $this->get_key_or_id( $field_value ) ] = $displayed_value;
488
+			$output[$this->get_key_or_id( $field_value )] = $displayed_value;
489 489
 
490 490
 			$has_separate_value = (bool) $field_value->get_field_option( 'separate_value' );
491 491
 			if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) {
492
-				$output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value();
492
+				$output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value();
493 493
 			}
494 494
 		}
495 495
 	}
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 
877 877
 			if ( is_array( $value ) ) {
878 878
 				foreach ( $value as $key => $single_value ) {
879
-					$value[ $key ] = $this->strip_html( $single_value );
879
+					$value[$key] = $this->strip_html( $single_value );
880 880
 				}
881 881
 			} elseif ( $this->is_plain_text && ! is_array( $value ) ) {
882 882
 				if ( strpos( $value, '<img' ) !== false ) {
Please login to merge, or discard this patch.
classes/views/inbox/list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 			</h3>
30 30
 			<span class="frm_inbox_date">
31 31
 				<?php
32
-				if ( ! isset( $message['read'] ) || ! isset( $message['read'][ $user->ID ] ) ) {
32
+				if ( ! isset( $message['read'] ) || ! isset( $message['read'][$user->ID] ) ) {
33 33
 					$inbox->mark_read( $key );
34 34
 					?>
35 35
 					<span class="frm_inbox_unread"></span>
Please login to merge, or discard this patch.
classes/helpers/FrmXMLHelper.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,8 @@
 block discarded – undo
78 78
 
79 79
 		if ( ! isset( $imported['form_status'] ) || empty( $imported['form_status'] ) ) {
80 80
 			// Check for an error message in the XML.
81
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
81
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
82
+// phpcs:ignore WordPress.NamingConventions
82 83
 				$imported['error'] = reset( $xml->Message ); // phpcs:ignore WordPress.NamingConventions
83 84
 			}
84 85
 		}
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 			if ( $term && is_array( $term ) ) {
131 131
 				$imported['imported']['terms'] ++;
132
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
132
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
133 133
 			}
134 134
 
135 135
 			unset( $term, $t );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 					}
186 186
 
187 187
 					// Keep track of whether this specific form was updated or not.
188
-					$imported['form_status'][ $form_id ] = 'imported';
188
+					$imported['form_status'][$form_id] = 'imported';
189 189
 				}
190 190
 			}
191 191
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			// Update field ids/keys to new ones.
201 201
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
202 202
 
203
-			$imported['forms'][ (int) $item->id ] = $form_id;
203
+			$imported['forms'][(int) $item->id] = $form_id;
204 204
 
205 205
 			// Send pre 2.0 form options through function that creates actions.
206 206
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
 		}
264 264
 
265 265
 		// Keep track of whether this specific form was updated or not
266
-		$imported['form_status'][ $form_id ] = 'updated';
266
+		$imported['form_status'][$form_id] = 'updated';
267 267
 	}
268 268
 
269 269
 	private static function get_form_fields( $form_id ) {
270 270
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
271 271
 		$old_fields  = array();
272 272
 		foreach ( $form_fields as $f ) {
273
-			$old_fields[ $f->id ]        = $f;
274
-			$old_fields[ $f->field_key ] = $f->id;
273
+			$old_fields[$f->id]        = $f;
274
+			$old_fields[$f->field_key] = $f->id;
275 275
 			unset( $f );
276 276
 		}
277 277
 		$form_fields = $old_fields;
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
330 330
 		if ( $parent_form_id ) {
331
-			$child_forms[ $form_id ] = $parent_form_id;
331
+			$child_forms[$form_id] = $parent_form_id;
332 332
 		}
333 333
 	}
334 334
 
@@ -343,9 +343,9 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
345 345
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
346
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
346
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
347 347
 				// Update all children with this old parent_form_id
348
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
348
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
349 349
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
350 350
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
351 351
 			}
@@ -375,27 +375,27 @@  discard block
 block discarded – undo
375 375
 
376 376
 			if ( ! empty( $this_form ) ) {
377 377
 				// check for field to edit by field id
378
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
378
+				if ( isset( $form_fields[$f['id']] ) ) {
379 379
 					FrmField::update( $f['id'], $f );
380 380
 					$imported['updated']['fields'] ++;
381 381
 
382
-					unset( $form_fields[ $f['id'] ] );
382
+					unset( $form_fields[$f['id']] );
383 383
 
384 384
 					//unset old field key
385
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
386
-						unset( $form_fields[ $f['field_key'] ] );
385
+					if ( isset( $form_fields[$f['field_key']] ) ) {
386
+						unset( $form_fields[$f['field_key']] );
387 387
 					}
388
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
389
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
388
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
389
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
390 390
 
391 391
 					// check for field to edit by field key
392 392
 					unset( $f['id'] );
393 393
 
394
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
394
+					FrmField::update( $form_fields[$f['field_key']], $f );
395 395
 					$imported['updated']['fields'] ++;
396 396
 
397
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); //unset old field id
398
-					unset( $form_fields[ $f['field_key'] ] ); //unset old field key
397
+					unset( $form_fields[$form_fields[$f['field_key']]] ); //unset old field id
398
+					unset( $form_fields[$f['field_key']] ); //unset old field key
399 399
 				} else {
400 400
 					// if no matching field id or key in this form, create the field
401 401
 					self::create_imported_field( $f, $imported );
@@ -504,8 +504,8 @@  discard block
 block discarded – undo
504 504
 		if ( $f['type'] == 'form' || ( $f['type'] == 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
505 505
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
506 506
 				$form_select = (int) $f['field_options']['form_select'];
507
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
508
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
507
+				if ( isset( $imported['forms'][$form_select] ) ) {
508
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
509 509
 				}
510 510
 			}
511 511
 		}
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 
527 527
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
528 528
 			$old_form = $f['field_options']['get_values_form'];
529
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
530
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
529
+			if ( isset( $imported['forms'][$old_form] ) ) {
530
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
531 531
 			}
532 532
 		}
533 533
 	}
@@ -548,12 +548,12 @@  discard block
 block discarded – undo
548 548
 	private static function migrate_placeholders( &$f ) {
549 549
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
550 550
 		foreach ( $update_values as $k => $v ) {
551
-			$f[ $k ] = $v;
551
+			$f[$k] = $v;
552 552
 		}
553 553
 
554 554
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
555 555
 		foreach ( $update_values as $k => $v ) {
556
-			$f[ $k ] = $v;
556
+			$f[$k] = $v;
557 557
 		}
558 558
 	}
559 559
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 	public static function migrate_field_placeholder( $field, $type ) {
568 568
 		$field = (array) $field;
569 569
 		$field_options = $field['field_options'];
570
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
570
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
571 571
 			return array();
572 572
 		}
573 573
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 				}
594 594
 
595 595
 				if ( $opt == $default_value ) {
596
-					unset( $options[ $opt_key ] );
596
+					unset( $options[$opt_key] );
597 597
 					break;
598 598
 				}
599 599
 			}
@@ -793,17 +793,17 @@  discard block
 block discarded – undo
793 793
 			self::update_layout( $post, $post_id );
794 794
 
795 795
 			$this_type = 'posts';
796
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
797
-				$this_type = $post_types[ $post['post_type'] ];
796
+			if ( isset( $post_types[$post['post_type']] ) ) {
797
+				$this_type = $post_types[$post['post_type']];
798 798
 			}
799 799
 
800 800
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
801
-				$imported['updated'][ $this_type ] ++;
801
+				$imported['updated'][$this_type] ++;
802 802
 			} else {
803
-				$imported['imported'][ $this_type ] ++;
803
+				$imported['imported'][$this_type] ++;
804 804
 			}
805 805
 
806
-			$imported['posts'][ (int) $old_id ] = $post_id;
806
+			$imported['posts'][(int) $old_id] = $post_id;
807 807
 
808 808
 			do_action( 'frm_after_import_view', $post_id, $post );
809 809
 
@@ -832,9 +832,9 @@  discard block
 block discarded – undo
832 832
 			$post['attachment_url'] = (string) $item->attachment_url;
833 833
 		}
834 834
 
835
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
835
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
836 836
 			// update to new form id
837
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
837
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
838 838
 		}
839 839
 
840 840
 		// Don't allow default styles to take over a site's default style
@@ -871,8 +871,8 @@  discard block
 block discarded – undo
871 871
 		);
872 872
 
873 873
 		//switch old form and field ids to new ones
874
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
875
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
874
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
875
+			$m['value'] = $imported['forms'][(int) $m['value']];
876 876
 		} else {
877 877
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
878 878
 
@@ -883,15 +883,15 @@  discard block
 block discarded – undo
883 883
 				} elseif ( 'frm_options' === $m['key'] ) {
884 884
 
885 885
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
886
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
887
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
886
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
887
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
888 888
 						}
889 889
 					}
890 890
 
891 891
 					$check_dup_array = array();
892 892
 					if ( isset( $m['value']['order_by'] ) && ! empty( $m['value']['order_by'] ) ) {
893
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
894
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
893
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
894
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
895 895
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
896 896
 							$check_dup_array[] = 'order_by';
897 897
 						}
@@ -902,9 +902,9 @@  discard block
 block discarded – undo
902 902
 					}
903 903
 
904 904
 					foreach ( $check_dup_array as $check_k ) {
905
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
906
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
907
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
905
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
906
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
907
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
908 908
 							}
909 909
 							unset( $mk, $mv );
910 910
 						}
@@ -917,11 +917,11 @@  discard block
 block discarded – undo
917 917
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
918 918
 		}
919 919
 
920
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
920
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
921 921
 	}
922 922
 
923 923
 	private static function populate_layout( &$post, $layout ) {
924
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
924
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
925 925
 	}
926 926
 
927 927
 	/**
@@ -949,11 +949,11 @@  discard block
 block discarded – undo
949 949
 				$name = (string) $c;
950 950
 			}
951 951
 
952
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
953
-				$post['tax_input'][ $taxonomy ] = array();
952
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
953
+				$post['tax_input'][$taxonomy] = array();
954 954
 			}
955 955
 
956
-			$post['tax_input'][ $taxonomy ][] = $name;
956
+			$post['tax_input'][$taxonomy][] = $name;
957 957
 			unset( $name );
958 958
 		}
959 959
 	}
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 
1071 1071
 		$message = '<ul>';
1072 1072
 		foreach ( $result as $type => $results ) {
1073
-			if ( ! isset( $t_strings[ $type ] ) ) {
1073
+			if ( ! isset( $t_strings[$type] ) ) {
1074 1074
 				// only print imported and updated
1075 1075
 				continue;
1076 1076
 			}
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 			}
1083 1083
 
1084 1084
 			if ( ! empty( $s_message ) ) {
1085
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1085
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1086 1086
 				$message .= implode( ', ', $s_message );
1087 1087
 				$message .= '</li>';
1088 1088
 			}
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1123 1123
 		);
1124 1124
 
1125
-		$s_message[] = isset( $strings[ $type ] ) ? $strings[ $type ] : ' ' . $m . ' ' . ucfirst( $type );
1125
+		$s_message[] = isset( $strings[$type] ) ? $strings[$type] : ' ' . $m . ' ' . ucfirst( $type );
1126 1126
 	}
1127 1127
 
1128 1128
 	/**
@@ -1252,8 +1252,8 @@  discard block
 block discarded – undo
1252 1252
 	 */
1253 1253
 	private static function remove_defaults( $defaults, &$saved ) {
1254 1254
 		foreach ( $saved as $key => $value ) {
1255
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1256
-				unset( $saved[ $key ] );
1255
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1256
+				unset( $saved[$key] );
1257 1257
 			}
1258 1258
 		}
1259 1259
 	}
@@ -1264,14 +1264,14 @@  discard block
 block discarded – undo
1264 1264
 	 * @since 3.06
1265 1265
 	 */
1266 1266
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1267
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1267
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1268 1268
 			return;
1269 1269
 		}
1270 1270
 
1271
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1272
-		$default_html = $defaults[ $html_name ];
1271
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1272
+		$default_html = $defaults[$html_name];
1273 1273
 		if ( $old_html == $default_html ) {
1274
-			unset( $options[ $html_name ] );
1274
+			unset( $options[$html_name] );
1275 1275
 
1276 1276
 			return;
1277 1277
 		}
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 		// Account for some of the older field default HTML.
1280 1280
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1281 1281
 		if ( $old_html == $default_html ) {
1282
-			unset( $options[ $html_name ] );
1282
+			unset( $options[$html_name] );
1283 1283
 		}
1284 1284
 	}
1285 1285
 
@@ -1366,8 +1366,8 @@  discard block
 block discarded – undo
1366 1366
 		);
1367 1367
 
1368 1368
 		foreach ( $post_settings as $post_setting ) {
1369
-			if ( isset( $form_options[ $post_setting ] ) ) {
1370
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1369
+			if ( isset( $form_options[$post_setting] ) ) {
1370
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1371 1371
 			}
1372 1372
 			unset( $post_setting );
1373 1373
 		}
@@ -1438,11 +1438,11 @@  discard block
 block discarded – undo
1438 1438
 		foreach ( $post_content as $key => $setting ) {
1439 1439
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
1440 1440
 				// Replace old IDs with new IDs
1441
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
1441
+				$post_content[$key] = str_replace( $old, $new, $setting );
1442 1442
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
1443 1443
 				foreach ( $setting as $k => $val ) {
1444 1444
 					// Replace old IDs with new IDs
1445
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
1445
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
1446 1446
 				}
1447 1447
 			}
1448 1448
 			unset( $key, $setting );
@@ -1518,8 +1518,8 @@  discard block
 block discarded – undo
1518 1518
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
1519 1519
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
1520 1520
 		foreach ( $delete_settings as $index ) {
1521
-			if ( isset( $form_options[ $index ] ) ) {
1522
-				unset( $form_options[ $index ] );
1521
+			if ( isset( $form_options[$index] ) ) {
1522
+				unset( $form_options[$index] );
1523 1523
 			}
1524 1524
 		}
1525 1525
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -1572,12 +1572,12 @@  discard block
 block discarded – undo
1572 1572
 			'reply_to_name' => '',
1573 1573
 		);
1574 1574
 		foreach ( $reply_fields as $f => $val ) {
1575
-			if ( isset( $notification[ $f ] ) ) {
1576
-				$atts[ $f ] = $notification[ $f ];
1577
-				if ( 'custom' == $notification[ $f ] ) {
1578
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
1579
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
1580
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
1575
+			if ( isset( $notification[$f] ) ) {
1576
+				$atts[$f] = $notification[$f];
1577
+				if ( 'custom' == $notification[$f] ) {
1578
+					$atts[$f] = $notification['cust_' . $f];
1579
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
1580
+					$atts[$f] = '[' . $atts[$f] . ']';
1581 1581
 				}
1582 1582
 			}
1583 1583
 			unset( $f, $val );
@@ -1608,13 +1608,13 @@  discard block
 block discarded – undo
1608 1608
 		foreach ( $atts['email_to'] as $key => $email_field ) {
1609 1609
 
1610 1610
 			if ( is_numeric( $email_field ) ) {
1611
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
1611
+				$atts['email_to'][$key] = '[' . $email_field . ']';
1612 1612
 			}
1613 1613
 
1614 1614
 			if ( strpos( $email_field, '|' ) ) {
1615 1615
 				$email_opt = explode( '|', $email_field );
1616 1616
 				if ( isset( $email_opt[0] ) ) {
1617
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1617
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
1618 1618
 				}
1619 1619
 				unset( $email_opt );
1620 1620
 			}
@@ -1635,12 +1635,12 @@  discard block
 block discarded – undo
1635 1635
 		// Add more fields to the new notification
1636 1636
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
1637 1637
 		foreach ( $add_fields as $add_field ) {
1638
-			if ( isset( $notification[ $add_field ] ) ) {
1639
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
1638
+			if ( isset( $notification[$add_field] ) ) {
1639
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
1640 1640
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
1641
-				$new_notification['post_content'][ $add_field ] = 0;
1641
+				$new_notification['post_content'][$add_field] = 0;
1642 1642
 			} else {
1643
-				$new_notification['post_content'][ $add_field ] = '';
1643
+				$new_notification['post_content'][$add_field] = '';
1644 1644
 			}
1645 1645
 			unset( $add_field );
1646 1646
 		}
@@ -1664,7 +1664,7 @@  discard block
 block discarded – undo
1664 1664
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
1665 1665
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
1666 1666
 				if ( is_numeric( $email_key ) ) {
1667
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1667
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
1668 1668
 				}
1669 1669
 				unset( $email_key, $val );
1670 1670
 			}
Please login to merge, or discard this patch.
classes/models/FrmSolution.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function add_settings( $sections ) {
161 161
 		wp_enqueue_style( 'formidable-pro-fields' );
162
-		$sections[ $this->plugin_slug ] = array(
162
+		$sections[$this->plugin_slug] = array(
163 163
 			'class'    => $this,
164 164
 			'function' => 'settings_page',
165 165
 			'name'     => $this->plugin_name(),
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
 			// Set the current step.
317 317
 			if ( ! isset( $step['current'] ) ) {
318 318
 				if ( $step['complete'] ) {
319
-					$steps[ $k ]['current'] = false;
319
+					$steps[$k]['current'] = false;
320 320
 				} else {
321
-					$steps[ $k ]['current'] = ! $has_current;
321
+					$steps[$k]['current'] = ! $has_current;
322 322
 					$has_current = true;
323 323
 				}
324 324
 			} elseif ( $step['current'] ) {
@@ -328,10 +328,10 @@  discard block
 block discarded – undo
328 328
 			// Set disabled buttons.
329 329
 			$class = isset( $step['button_class'] ) ? $step['button_class'] : '';
330 330
 			$class .= ' button-primary frm-button-primary';
331
-			if ( ! $steps[ $k ]['current'] ) {
331
+			if ( ! $steps[$k]['current'] ) {
332 332
 				$class .= ' frm_grey disabled';
333 333
 			}
334
-			$steps[ $k ]['button_class'] = $class;
334
+			$steps[$k]['button_class'] = $class;
335 335
 		}
336 336
 
337 337
 		return $steps;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			if ( $plugin['status'] === 'active' ) {
354 354
 				continue;
355 355
 			}
356
-			$links[ $plugin_key ] = $plugin;
356
+			$links[$plugin_key] = $plugin;
357 357
 			if ( isset( $plugin['url'] ) ) {
358 358
 				$rel[] = $plugin['url'];
359 359
 			} else {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		$addons = $api->get_api_info();
469 469
 
470 470
 		$id = $this->download_id();
471
-		$has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
471
+		$has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] );
472 472
 
473 473
 		if ( ! $step['current'] ) {
474 474
 			?>
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
 
484 484
 		if ( ! $has_file ) {
485 485
 			echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
486
-		} elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
486
+		} elseif ( ! isset( $addons[$id]['beta']['package'] ) ) {
487 487
 			echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
488 488
 		} else {
489
-			$xml = $addons[ $id ]['beta']['package'];
489
+			$xml = $addons[$id]['beta']['package'];
490 490
 			if ( is_array( $xml ) ) {
491 491
 				$xml = reset( $xml );
492 492
 			}
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 		foreach ( $forms as $form ) {
625 625
 			$was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
626 626
 			if ( $was_imported ) {
627
-				$imported[ $form['form'] ] = $was_imported;
627
+				$imported[$form['form']] = $was_imported;
628 628
 			}
629 629
 		}
630 630
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@
 block discarded – undo
42 42
 		}
43 43
 
44 44
 		// Only do this for single site installs.
45
-		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
45
+		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) {
46
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
46 47
 			return;
47 48
 		}
48 49
 
Please login to merge, or discard this patch.
classes/models/FrmFieldFormHtml.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 * @param array $atts
42 42
 	 */
43 43
 	private function _set( $param, $atts ) {
44
-		if ( isset( $atts[ $param ] ) ) {
45
-			$this->{$param} = $atts[ $param ];
44
+		if ( isset( $atts[$param] ) ) {
45
+			$this->{$param} = $atts[$param];
46 46
 		}
47 47
 	}
48 48
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$exclude = array( 'field_obj', 'html' );
88 88
 		foreach ( $exclude as $ex ) {
89
-			if ( isset( $atts[ $ex ] ) ) {
90
-				unset( $this->pass_args[ $ex ] );
89
+			if ( isset( $atts[$ex] ) ) {
90
+				unset( $this->pass_args[$ex] );
91 91
 			}
92 92
 		}
93 93
 	}
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	 * @param array $set
100 100
 	 */
101 101
 	private function set_from_field( $atts, $set ) {
102
-		if ( isset( $atts[ $set['param'] ] ) ) {
103
-			$this->{$set['param']} = $atts[ $set['param'] ];
102
+		if ( isset( $atts[$set['param']] ) ) {
103
+			$this->{$set['param']} = $atts[$set['param']];
104 104
 		} else {
105 105
 			$this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] );
106 106
 		}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private function replace_error_shortcode() {
227 227
 		$this->maybe_add_error_id();
228
-		$error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false;
228
+		$error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false;
229 229
 		FrmShortcodeHelper::remove_inline_conditions( ! empty( $error ), 'error', $error, $this->html );
230 230
 	}
231 231
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	 * @since 3.06.02
237 237
 	 */
238 238
 	private function maybe_add_error_id() {
239
-		if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) {
239
+		if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) {
240 240
 			return;
241 241
 		}
242 242
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER );
317 317
 
318 318
 		foreach ( $shortcodes[0] as $short_key => $tag ) {
319
-			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] );
319
+			$shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] );
320 320
 			$tag            = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
321 321
 
322 322
 			$replace_with = '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 				$replace_with = $this->replace_input_shortcode( $shortcode_atts );
328 328
 			}
329 329
 
330
-			$this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html );
330
+			$this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html );
331 331
 		}
332 332
 	}
333 333
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			unset( $shortcode_atts['class'] );
360 360
 		}
361 361
 
362
-		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false';
362
+		$shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false';
363 363
 
364 364
 		$this->field_obj->set_field_column( 'shortcodes', $shortcode_atts );
365 365
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	 */
415 415
 	private function get_field_div_classes() {
416 416
 		// Add error class
417
-		$classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : '';
417
+		$classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : '';
418 418
 
419 419
 		// Add label position class
420 420
 		$settings = $this->field_obj->display_field_settings();
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			return;
122 122
 		}
123 123
 
124
-		$selected_xml  = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
124
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
125 125
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
126 126
 			return;
127 127
 		}
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @since 4.06.02
134 134
 	 */
135 135
 	private static function get_selected_in_form( $form, $value = 'form' ) {
136
-		if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) {
137
-			return $form[ $value ];
136
+		if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) {
137
+			return $form[$value];
138 138
 		}
139 139
 
140 140
 		return '';
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			}
164 164
 
165 165
 			if ( $for === 'view' ) {
166
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
166
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
167 167
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
168 168
 			} elseif ( $for === 'form' ) {
169 169
 				$item_key = $form_key;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				continue;
179 179
 			}
180 180
 
181
-			$page_ids[ $for ] = wp_insert_post(
181
+			$page_ids[$for] = wp_insert_post(
182 182
 				array(
183 183
 					'post_title'   => $name,
184 184
 					'post_type'    => 'page',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
320 320
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
321 321
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
322
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
322
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
323 323
 			// allow other file types to be imported
324 324
 			do_action( 'frm_before_import_' . $file_type );
325 325
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		foreach ( $type as $tb_type ) {
403 403
 			$where = array();
404 404
 			$join  = '';
405
-			$table = $tables[ $tb_type ];
405
+			$table = $tables[$tb_type];
406 406
 
407 407
 			$select     = $table . '.id';
408 408
 			$query_vars = array();
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 							$table . '.parent_form_id' => $args['ids'],
418 418
 						);
419 419
 					} else {
420
-						$where[ $table . '.status !' ] = 'draft';
420
+						$where[$table . '.status !'] = 'draft';
421 421
 					}
422 422
 					break;
423 423
 				case 'actions':
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 				case 'items':
431 431
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
432 432
 					if ( $args['ids'] ) {
433
-						$where[ $table . '.form_id' ] = $args['ids'];
433
+						$where[$table . '.form_id'] = $args['ids'];
434 434
 					}
435 435
 					break;
436 436
 				case 'styles':
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 					}
472 472
 			}
473 473
 
474
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
474
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
475 475
 			unset( $tb_type );
476 476
 		}
477 477
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$no_export_fields = FrmField::no_save_fields();
617 617
 		foreach ( $csv_fields as $k => $f ) {
618 618
 			if ( in_array( $f->type, $no_export_fields, true ) ) {
619
-				unset( $csv_fields[ $k ] );
619
+				unset( $csv_fields[$k] );
620 620
 			}
621 621
 		}
622 622
 
Please login to merge, or discard this patch.
classes/views/frm-fields/back-end/field-multiple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,6 +9,6 @@
 block discarded – undo
9 9
 	$type = $field['type'];
10 10
 	do_action( 'frm_after_checkbox', compact( 'field', 'field_name', 'type' ) );
11 11
 } else {
12
-	$read_only  = $field['read_only'];
12
+	$read_only = $field['read_only'];
13 13
 	include dirname( __FILE__ ) . '/' . $field['type'] . '-field.php';
14 14
 }
Please login to merge, or discard this patch.