Completed
Push — master ( 67005e...6d6fde )
by
unknown
18s
created
stripe/controllers/FrmStrpLiteLinkController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 			'form'  => $entry->form_id,
150 150
 			'value' => $action->post_content['description'],
151 151
 		);
152
-		$new_values     = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
152
+		$new_values = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) );
153 153
 		FrmStrpLiteAppHelper::call_stripe_helper_class( 'update_intent', $intent->id, $new_values );
154 154
 	}
155 155
 
Please login to merge, or discard this patch.
classes/helpers/FrmOnboardingWizardHelper.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
 			'secondary-button-role'      => 'button',
101 101
 			'secondary-button-skip-step' => true,
102 102
 		);
103
-		$args     = wp_parse_args( $args, $defaults );
103
+		$args = wp_parse_args( $args, $defaults );
104 104
 
105 105
 		// Set the primary button attributes.
106 106
 		$primary_button_attributes          = array(
Please login to merge, or discard this patch.
classes/models/FrmEmailStats.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 		// Build total for each currency.
151 151
 		foreach ( $payment_data['total'] as $currency => $amount ) {
152
-			$stats[ 'payments_total_' . $currency ] = array(
152
+			$stats['payments_total_' . $currency] = array(
153 153
 				// translators: currency name.
154 154
 				'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
155 155
 				'count'   => $amount,
@@ -171,23 +171,23 @@  discard block
 block discarded – undo
171 171
 
172 172
 			// Compare total for each currency.
173 173
 			foreach ( $payment_data['total'] as $currency => $amount ) {
174
-				if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) {
175
-					$stats[ 'payments_total_' . $currency ]['compare'] = 1;
174
+				if ( ! isset( $prev_payment_data['total'][$currency] ) ) {
175
+					$stats['payments_total_' . $currency]['compare'] = 1;
176 176
 					continue;
177 177
 				}
178 178
 
179
-				$stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] );
180
-				unset( $prev_payment_data['total'][ $currency ] );
179
+				$stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] );
180
+				unset( $prev_payment_data['total'][$currency] );
181 181
 			}
182 182
 
183 183
 			// If prev month has more currencies.
184 184
 			foreach ( $prev_payment_data['total'] as $currency => $amount ) {
185
-				$stats[ 'payments_total_' . $currency ] = array(
185
+				$stats['payments_total_' . $currency] = array(
186 186
 					// translators: currency name.
187 187
 					'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
188 188
 					'count'   => 0,
189 189
 					'display' => $this->get_formatted_price( 0, $currency ),
190
-					'compare' => -1,
190
+					'compare' => - 1,
191 191
 				);
192 192
 			}
193 193
 		}//end if
Please login to merge, or discard this patch.
classes/models/FrmPluginSearch.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
 			'name'              => sprintf(
81 81
 				/* translators: Formidable addon name */
82 82
 				esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ),
83
-				$addon_list[ $matching_addon ]['name']
83
+				$addon_list[$matching_addon]['name']
84 84
 			),
85
-			'addon'             => $addon_list[ $matching_addon ]['slug'],
86
-			'short_description' => $addon_list[ $matching_addon ]['excerpt'],
85
+			'addon'             => $addon_list[$matching_addon]['slug'],
86
+			'short_description' => $addon_list[$matching_addon]['excerpt'],
87 87
 			'slug'              => self::$slug,
88
-			'version'           => $addon_list[ $matching_addon ]['version'],
88
+			'version'           => $addon_list[$matching_addon]['version'],
89 89
 		);
90 90
 
91
-		if ( ! empty( $addon_list[ $matching_addon ]['external'] ) ) {
91
+		if ( ! empty( $addon_list[$matching_addon]['external'] ) ) {
92 92
 			unset( $overrides['name'] );
93 93
 		}
94 94
 
95 95
 		// Splice in the base addon data.
96
-		$inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides );
96
+		$inject = array_merge( $inject, $addon_list[$matching_addon], $overrides );
97 97
 
98 98
 		// Add it to the top of the list.
99 99
 		array_unshift( $result->plugins, $inject );
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		// Plugin installed, active, feature not enabled; prompt to enable.
309 309
 		if ( ! $is_active && $is_installed ) {
310 310
 			if ( current_user_can( 'activate_plugins' ) ) {
311
-				$activate_url             = add_query_arg(
311
+				$activate_url = add_query_arg(
312 312
 					array(
313 313
 						'action'   => 'activate',
314 314
 						'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin['plugin'] ),
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	 */
353 353
 	protected function is_installed( $plugin ) {
354 354
 		$all_plugins = FrmAppHelper::get_plugins();
355
-		return isset( $all_plugins[ $plugin ] );
355
+		return isset( $all_plugins[$plugin] );
356 356
 	}
357 357
 
358 358
 	/**
Please login to merge, or discard this patch.
classes/controllers/FrmOverlayController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function update_next_execution_time() {
86 86
 		$config_option_name = $this->config['config-option-name'];
87 87
 
88
-		$this->options_data[ $config_option_name ] = $this->get_next_execution();
88
+		$this->options_data[$config_option_name] = $this->get_next_execution();
89 89
 		$this->update_options_data();
90 90
 	}
91 91
 
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 	 * @return bool
105 105
 	 */
106 106
 	private function is_time_to_execute() {
107
-		if ( ! isset( $this->options_data[ $this->config['config-option-name'] ] ) ) {
107
+		if ( ! isset( $this->options_data[$this->config['config-option-name']] ) ) {
108 108
 			return true;
109 109
 		}
110 110
 
111
-		$options = $this->options_data[ $this->config['config-option-name'] ];
111
+		$options = $this->options_data[$this->config['config-option-name']];
112 112
 
113 113
 		return ! ( isset( $options['timestamp'] ) && (int) $options['timestamp'] > $this->get_time() );
114 114
 	}
Please login to merge, or discard this patch.
classes/models/FrmEmail.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
163 163
 		$to = $this->explode_emails( $to );
164 164
 
165
-		$where  = array(
165
+		$where = array(
166 166
 			'it.field_id !' => 0,
167 167
 			'it.item_id'    => $this->entry->id,
168 168
 		);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			'entry'     => $this->entry,
173 173
 			'form'      => $this->form,
174 174
 		);
175
-		$to     = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
175
+		$to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args );
176 176
 
177 177
 		$this->to = array_unique( (array) $to );
178 178
 
@@ -702,11 +702,11 @@  discard block
 block discarded – undo
702 702
 				$name = trim( str_replace( $email, '', $val ) );
703 703
 			} else {
704 704
 				// If user enters a name without an email
705
-				unset( $recipients[ $key ] );
705
+				unset( $recipients[$key] );
706 706
 				continue;
707 707
 			}
708 708
 
709
-			$recipients[ $key ] = $this->format_from_email( $name, $email );
709
+			$recipients[$key] = $this->format_from_email( $name, $email );
710 710
 		}//end foreach
711 711
 
712 712
 		return $recipients;
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 				);
857 857
 
858 858
 				// Remove phone number from to addresses
859
-				unset( $this->to[ $key ] );
859
+				unset( $this->to[$key] );
860 860
 			}//end if
861 861
 		}//end foreach
862 862
 	}
Please login to merge, or discard this patch.
classes/views/dashboard/templates/counters.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,20 +14,26 @@
 block discarded – undo
14 14
 				<h4><?php echo esc_html( $counter['heading'] ); ?></h4>
15 15
 				<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
16 16
 					<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_html( $counter['cta']['title'] ); ?></a>
17
-				<?php else : ?>
17
+				<?php else {
18
+	: ?>
18 19
 					<?php if ( 'currency' === $counter['type'] ) : ?>
19 20
 						<div class="frm-flex-box frm-gap-md">
20 21
 							<?php foreach ( $counter['items'] as $item ) : ?>
21 22
 								<b>
22
-									<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?>
23
+									<?php echo esc_attr( $item['counter_label']['symbol_left'] );
24
+}
25
+?>
23 26
 									<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
24 27
 									<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?>
25 28
 								</b>
26 29
 							<?php endforeach; ?>
27 30
 						</div>
28
-					<?php else : ?>
31
+					<?php else {
32
+	: ?>
29 33
 						<b>
30
-							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
34
+							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] );
35
+}
36
+?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
31 37
 						</b>
32 38
 					<?php endif; ?>
33 39
 				<?php endif; ?>
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
@@ -126,7 +126,8 @@
 block discarded – undo
126 126
 
127 127
 		if ( empty( $imported['form_status'] ) ) {
128 128
 			// Check for an error message in the XML.
129
-			if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions
129
+			if ( isset( $xml->Code ) && isset( $xml->Message ) ) {
130
+// phpcs:ignore WordPress.NamingConventions
130 131
 				$imported['error'] = (string) $xml->Message; // phpcs:ignore WordPress.NamingConventions
131 132
 			}
132 133
 		}
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 				$content_before_channel_tag,
108 108
 				1
109 109
 			);
110
-			$xml_string                 = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
110
+			$xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
111 111
 		}
112 112
 	}
113 113
 
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 			);
200 200
 
201 201
 			if ( $term && is_array( $term ) ) {
202
-				++$imported['imported']['terms'];
203
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
202
+				++ $imported['imported']['terms'];
203
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
204 204
 			}
205 205
 
206 206
 			unset( $term, $t );
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 				if ( $form_id ) {
267 267
 					if ( empty( $form['parent_form_id'] ) ) {
268 268
 						// Don't include the repeater form in the imported count.
269
-						++$imported['imported']['forms'];
269
+						++ $imported['imported']['forms'];
270 270
 					}
271 271
 
272 272
 					// Keep track of whether this specific form was updated or not.
273
-					$imported['form_status'][ $form_id ] = 'imported';
273
+					$imported['form_status'][$form_id] = 'imported';
274 274
 				}
275 275
 			}
276 276
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			// Update field ids/keys to new ones.
286 286
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
287 287
 
288
-			$imported['forms'][ (int) $item->id ] = $form_id;
288
+			$imported['forms'][(int) $item->id] = $form_id;
289 289
 
290 290
 			// Send pre 2.0 form options through function that creates actions.
291 291
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -375,11 +375,11 @@  discard block
 block discarded – undo
375 375
 
376 376
 		if ( empty( $form['parent_form_id'] ) ) {
377 377
 			// Don't include the repeater form in the updated count.
378
-			++$imported['updated']['forms'];
378
+			++ $imported['updated']['forms'];
379 379
 		}
380 380
 
381 381
 		// Keep track of whether this specific form was updated or not
382
-		$imported['form_status'][ $form_id ] = 'updated';
382
+		$imported['form_status'][$form_id] = 'updated';
383 383
 	}
384 384
 
385 385
 	/**
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 		$old_fields  = array();
393 393
 
394 394
 		foreach ( $form_fields as $f ) {
395
-			$old_fields[ $f->id ]        = $f;
396
-			$old_fields[ $f->field_key ] = $f->id;
395
+			$old_fields[$f->id]        = $f;
396
+			$old_fields[$f->field_key] = $f->id;
397 397
 			unset( $f );
398 398
 		}
399 399
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 	 */
456 456
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
457 457
 		if ( $parent_form_id ) {
458
-			$child_forms[ $form_id ] = $parent_form_id;
458
+			$child_forms[$form_id] = $parent_form_id;
459 459
 		}
460 460
 	}
461 461
 
@@ -470,9 +470,9 @@  discard block
 block discarded – undo
470 470
 	 */
471 471
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
472 472
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
473
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
473
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
474 474
 				// Update all children with this old parent_form_id
475
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
475
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
476 476
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
477 477
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
478 478
 			}
@@ -508,34 +508,34 @@  discard block
 block discarded – undo
508 508
 
509 509
 			if ( ! empty( $this_form ) ) {
510 510
 				// check for field to edit by field id
511
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
511
+				if ( isset( $form_fields[$f['id']] ) ) {
512 512
 					FrmField::update( $f['id'], $f );
513
-					++$imported['updated']['fields'];
513
+					++ $imported['updated']['fields'];
514 514
 
515
-					unset( $form_fields[ $f['id'] ] );
515
+					unset( $form_fields[$f['id']] );
516 516
 
517 517
 					// Unset old field key.
518
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
519
-						unset( $form_fields[ $f['field_key'] ] );
518
+					if ( isset( $form_fields[$f['field_key']] ) ) {
519
+						unset( $form_fields[$f['field_key']] );
520 520
 					}
521
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
522
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
521
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
522
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
523 523
 
524 524
 					$old_field_id = $f['id'];
525 525
 
526 526
 					// check for field to edit by field key
527 527
 					unset( $f['id'] );
528 528
 
529
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
530
-					++$imported['updated']['fields'];
529
+					FrmField::update( $form_fields[$f['field_key']], $f );
530
+					++ $imported['updated']['fields'];
531 531
 
532 532
 					self::do_after_field_imported_action( $f, $form_fields, $old_field_id );
533 533
 
534 534
 					// Unset old field id.
535
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] );
535
+					unset( $form_fields[$form_fields[$f['field_key']]] );
536 536
 
537 537
 					// Unset old field key.
538
-					unset( $form_fields[ $f['field_key'] ] );
538
+					unset( $form_fields[$f['field_key']] );
539 539
 				} else {
540 540
 					// If no matching field id or key in this form, create the field.
541 541
 					self::create_imported_field( $f, $imported );
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	 */
577 577
 	private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) {
578 578
 		// Assign field array the update field's ID.
579
-		$field_array['id'] = $form_fields[ $field_array['field_key'] ];
579
+		$field_array['id'] = $form_fields[$field_array['field_key']];
580 580
 
581 581
 		/**
582 582
 		 * Fires when an existing field is imported.
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 		 * @param int   $field_id
588 588
 		 * @param int   $old_field_id
589 589
 		 */
590
-		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id );
590
+		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id );
591 591
 	}
592 592
 
593 593
 	/**
@@ -701,8 +701,8 @@  discard block
 block discarded – undo
701 701
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
702 702
 				$form_select = (int) $f['field_options']['form_select'];
703 703
 
704
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
705
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
704
+				if ( isset( $imported['forms'][$form_select] ) ) {
705
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
706 706
 				}
707 707
 			}
708 708
 		}
@@ -726,8 +726,8 @@  discard block
 block discarded – undo
726 726
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
727 727
 			$old_form = $f['field_options']['get_values_form'];
728 728
 
729
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
730
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
729
+			if ( isset( $imported['forms'][$old_form] ) ) {
730
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
731 731
 			}
732 732
 		}
733 733
 	}
@@ -757,13 +757,13 @@  discard block
 block discarded – undo
757 757
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
758 758
 
759 759
 		foreach ( $update_values as $k => $v ) {
760
-			$f[ $k ] = $v;
760
+			$f[$k] = $v;
761 761
 		}
762 762
 
763 763
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
764 764
 
765 765
 		foreach ( $update_values as $k => $v ) {
766
-			$f[ $k ] = $v;
766
+			$f[$k] = $v;
767 767
 		}
768 768
 	}
769 769
 
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 		$field         = (array) $field;
783 783
 		$field_options = $field['field_options'];
784 784
 
785
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
785
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
786 786
 			return array();
787 787
 		}
788 788
 
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 				}
811 811
 
812 812
 				if ( $opt == $default_value ) {
813
-					unset( $options[ $opt_key ] );
813
+					unset( $options[$opt_key] );
814 814
 					break;
815 815
 				}
816 816
 			}
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
 		$new_id = FrmField::create( $f );
841 841
 
842 842
 		if ( $new_id != false ) {
843
-			++$imported['imported']['fields'];
843
+			++ $imported['imported']['fields'];
844 844
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
845 845
 		}
846 846
 	}
@@ -870,10 +870,10 @@  discard block
 block discarded – undo
870 870
 
871 871
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
872 872
 			// Remove the src from options as it isn't required after import.
873
-			unset( $field['options'][ $key ]['src'] );
873
+			unset( $field['options'][$key]['src'] );
874 874
 
875 875
 			if ( is_numeric( $image_id ) ) {
876
-				$field['options'][ $key ]['image'] = $image_id;
876
+				$field['options'][$key]['image'] = $image_id;
877 877
 			}
878 878
 		}
879 879
 
@@ -1068,8 +1068,8 @@  discard block
 block discarded – undo
1068 1068
 			} else {
1069 1069
 				if ( $post['post_type'] === 'frm_display' ) {
1070 1070
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
1071
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
1072
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
1071
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
1072
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
1073 1073
 				}
1074 1074
 				// Create/update post now
1075 1075
 				$post_id = wp_insert_post( $post );
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
 			}
1081 1081
 
1082 1082
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
1083
-				$posts_with_shortcodes[ $post_id ] = $post;
1083
+				$posts_with_shortcodes[$post_id] = $post;
1084 1084
 			}
1085 1085
 
1086 1086
 			self::update_postmeta( $post, $post_id );
@@ -1088,20 +1088,20 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
 			$this_type = 'posts';
1090 1090
 
1091
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
1092
-				$this_type = $post_types[ $post['post_type'] ];
1091
+			if ( isset( $post_types[$post['post_type']] ) ) {
1092
+				$this_type = $post_types[$post['post_type']];
1093 1093
 			}
1094 1094
 
1095 1095
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
1096
-				++$imported['updated'][ $this_type ];
1096
+				++ $imported['updated'][$this_type];
1097 1097
 			} else {
1098
-				++$imported['imported'][ $this_type ];
1098
+				++ $imported['imported'][$this_type];
1099 1099
 			}
1100 1100
 
1101
-			$imported['posts'][ $old_id ] = $post_id;
1101
+			$imported['posts'][$old_id] = $post_id;
1102 1102
 
1103 1103
 			if ( $post['post_type'] === 'frm_display' ) {
1104
-				$view_ids[ $old_id ] = $post_id;
1104
+				$view_ids[$old_id] = $post_id;
1105 1105
 			}
1106 1106
 
1107 1107
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1279,9 +1279,9 @@  discard block
 block discarded – undo
1279 1279
 			$post['attachment_url'] = (string) $item->attachment_url;
1280 1280
 		}
1281 1281
 
1282
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1282
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1283 1283
 			// update to new form id
1284
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1284
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1285 1285
 		}
1286 1286
 
1287 1287
 		// Don't allow default styles to take over a site's default style
@@ -1318,8 +1318,8 @@  discard block
 block discarded – undo
1318 1318
 		);
1319 1319
 
1320 1320
 		// Switch old form and field ids to new ones.
1321
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1322
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1321
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1322
+			$m['value'] = $imported['forms'][(int) $m['value']];
1323 1323
 		} else {
1324 1324
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1325 1325
 
@@ -1330,23 +1330,23 @@  discard block
 block discarded – undo
1330 1330
 				} elseif ( 'frm_options' === $m['key'] ) {
1331 1331
 
1332 1332
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1333
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1334
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1333
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1334
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1335 1335
 						}
1336 1336
 					}
1337 1337
 
1338 1338
 					if ( ! empty( $m['value']['map_address_fields'] ) ) {
1339 1339
 						foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) {
1340
-							if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) {
1341
-								$m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ];
1340
+							if ( isset( $frm_duplicate_ids[$address_field_id] ) ) {
1341
+								$m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id];
1342 1342
 							}
1343 1343
 						}
1344 1344
 					}
1345 1345
 
1346 1346
 					if ( ! empty( $m['value']['calendar_options'] ) ) {
1347 1347
 						foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) {
1348
-							if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) {
1349
-								$m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ];
1348
+							if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) {
1349
+								$m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']];
1350 1350
 							}
1351 1351
 						}
1352 1352
 					}
@@ -1354,8 +1354,8 @@  discard block
 block discarded – undo
1354 1354
 					if ( ! empty( $m['value']['timeline_options'] ) ) {
1355 1355
 						foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) {
1356 1356
 							foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) {
1357
-								if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) {
1358
-									$m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ];
1357
+								if ( isset( $frm_duplicate_ids[$timeline_option] ) ) {
1358
+									$m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option];
1359 1359
 								}
1360 1360
 							}
1361 1361
 						}
@@ -1364,8 +1364,8 @@  discard block
 block discarded – undo
1364 1364
 					$check_dup_array = array();
1365 1365
 
1366 1366
 					if ( ! empty( $m['value']['order_by'] ) ) {
1367
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1368
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1367
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1368
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1369 1369
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1370 1370
 							$check_dup_array[] = 'order_by';
1371 1371
 						}
@@ -1376,9 +1376,9 @@  discard block
 block discarded – undo
1376 1376
 					}
1377 1377
 
1378 1378
 					foreach ( $check_dup_array as $check_k ) {
1379
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1380
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1381
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1379
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1380
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1381
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1382 1382
 							}
1383 1383
 							unset( $mk, $mv );
1384 1384
 						}
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1392 1392
 		}
1393 1393
 
1394
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1394
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1395 1395
 	}
1396 1396
 
1397 1397
 	/**
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 	 * @return void
1402 1402
 	 */
1403 1403
 	private static function populate_layout( &$post, $layout ) {
1404
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1404
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1405 1405
 	}
1406 1406
 
1407 1407
 	/**
@@ -1432,11 +1432,11 @@  discard block
 block discarded – undo
1432 1432
 				$name = (string) $c;
1433 1433
 			}
1434 1434
 
1435
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1436
-				$post['tax_input'][ $taxonomy ] = array();
1435
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1436
+				$post['tax_input'][$taxonomy] = array();
1437 1437
 			}
1438 1438
 
1439
-			$post['tax_input'][ $taxonomy ][] = $name;
1439
+			$post['tax_input'][$taxonomy][] = $name;
1440 1440
 			unset( $name );
1441 1441
 		}//end foreach
1442 1442
 	}
@@ -1592,7 +1592,7 @@  discard block
 block discarded – undo
1592 1592
 		$message = '<ul>';
1593 1593
 
1594 1594
 		foreach ( $result as $type => $results ) {
1595
-			if ( ! isset( $t_strings[ $type ] ) ) {
1595
+			if ( ! isset( $t_strings[$type] ) ) {
1596 1596
 				// only print imported and updated
1597 1597
 				continue;
1598 1598
 			}
@@ -1605,7 +1605,7 @@  discard block
 block discarded – undo
1605 1605
 			}
1606 1606
 
1607 1607
 			if ( ! empty( $s_message ) ) {
1608
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1608
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1609 1609
 				$message .= implode( ', ', $s_message );
1610 1610
 				$message .= '</li>';
1611 1611
 			}
@@ -1657,8 +1657,8 @@  discard block
 block discarded – undo
1657 1657
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1658 1658
 		);
1659 1659
 
1660
-		if ( isset( $strings[ $type ] ) ) {
1661
-			$s_message[] = $strings[ $type ];
1660
+		if ( isset( $strings[$type] ) ) {
1661
+			$s_message[] = $strings[$type];
1662 1662
 		} else {
1663 1663
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1664 1664
 
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
 
1826 1826
 		foreach ( $options as $key => $option ) {
1827 1827
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1828
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1828
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1829 1829
 				$updated                = true;
1830 1830
 			}
1831 1831
 		}
@@ -1864,8 +1864,8 @@  discard block
 block discarded – undo
1864 1864
 	 */
1865 1865
 	private static function remove_defaults( $defaults, &$saved ) {
1866 1866
 		foreach ( $saved as $key => $value ) {
1867
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1868
-				unset( $saved[ $key ] );
1867
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1868
+				unset( $saved[$key] );
1869 1869
 			}
1870 1870
 		}
1871 1871
 	}
@@ -1882,15 +1882,15 @@  discard block
 block discarded – undo
1882 1882
 	 * @return void
1883 1883
 	 */
1884 1884
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1885
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1885
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1886 1886
 			return;
1887 1887
 		}
1888 1888
 
1889
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1890
-		$default_html = $defaults[ $html_name ];
1889
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1890
+		$default_html = $defaults[$html_name];
1891 1891
 
1892 1892
 		if ( $old_html == $default_html ) {
1893
-			unset( $options[ $html_name ] );
1893
+			unset( $options[$html_name] );
1894 1894
 
1895 1895
 			return;
1896 1896
 		}
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1900 1900
 
1901 1901
 		if ( $old_html === $default_html ) {
1902
-			unset( $options[ $html_name ] );
1902
+			unset( $options[$html_name] );
1903 1903
 		}
1904 1904
 	}
1905 1905
 
@@ -2008,8 +2008,8 @@  discard block
 block discarded – undo
2008 2008
 		);
2009 2009
 
2010 2010
 		foreach ( $post_settings as $post_setting ) {
2011
-			if ( isset( $form_options[ $post_setting ] ) ) {
2012
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
2011
+			if ( isset( $form_options[$post_setting] ) ) {
2012
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
2013 2013
 			}
2014 2014
 			unset( $post_setting );
2015 2015
 		}
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
 		if ( ! $exists ) {
2048 2048
 			// this isn't an email, but we need to use a class that will always be included
2049 2049
 			FrmDb::save_json_post( $new_action );
2050
-			++$imported['imported']['actions'];
2050
+			++ $imported['imported']['actions'];
2051 2051
 		}
2052 2052
 	}
2053 2053
 
@@ -2080,11 +2080,11 @@  discard block
 block discarded – undo
2080 2080
 		foreach ( $post_content as $key => $setting ) {
2081 2081
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
2082 2082
 				// Replace old IDs with new IDs
2083
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
2083
+				$post_content[$key] = str_replace( $old, $new, $setting );
2084 2084
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
2085 2085
 				foreach ( $setting as $k => $val ) {
2086 2086
 					// Replace old IDs with new IDs
2087
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
2087
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
2088 2088
 				}
2089 2089
 			}
2090 2090
 			unset( $key, $setting );
@@ -2152,7 +2152,7 @@  discard block
 block discarded – undo
2152 2152
 
2153 2153
 			if ( empty( $exists ) ) {
2154 2154
 				FrmDb::save_json_post( $new_notification );
2155
-				++$imported['imported']['actions'];
2155
+				++ $imported['imported']['actions'];
2156 2156
 			}
2157 2157
 			unset( $new_notification );
2158 2158
 		}//end foreach
@@ -2174,8 +2174,8 @@  discard block
 block discarded – undo
2174 2174
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
2175 2175
 
2176 2176
 		foreach ( $delete_settings as $index ) {
2177
-			if ( isset( $form_options[ $index ] ) ) {
2178
-				unset( $form_options[ $index ] );
2177
+			if ( isset( $form_options[$index] ) ) {
2178
+				unset( $form_options[$index] );
2179 2179
 			}
2180 2180
 		}
2181 2181
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -2246,13 +2246,13 @@  discard block
 block discarded – undo
2246 2246
 		);
2247 2247
 
2248 2248
 		foreach ( $reply_fields as $f => $val ) {
2249
-			if ( isset( $notification[ $f ] ) ) {
2250
-				$atts[ $f ] = $notification[ $f ];
2249
+			if ( isset( $notification[$f] ) ) {
2250
+				$atts[$f] = $notification[$f];
2251 2251
 
2252
-				if ( 'custom' == $notification[ $f ] ) {
2253
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
2254
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
2255
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
2252
+				if ( 'custom' == $notification[$f] ) {
2253
+					$atts[$f] = $notification['cust_' . $f];
2254
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
2255
+					$atts[$f] = '[' . $atts[$f] . ']';
2256 2256
 				}
2257 2257
 			}
2258 2258
 			unset( $f, $val );
@@ -2292,14 +2292,14 @@  discard block
 block discarded – undo
2292 2292
 		foreach ( $atts['email_to'] as $key => $email_field ) {
2293 2293
 
2294 2294
 			if ( is_numeric( $email_field ) ) {
2295
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
2295
+				$atts['email_to'][$key] = '[' . $email_field . ']';
2296 2296
 			}
2297 2297
 
2298 2298
 			if ( strpos( $email_field, '|' ) ) {
2299 2299
 				$email_opt = explode( '|', $email_field );
2300 2300
 
2301 2301
 				if ( isset( $email_opt[0] ) ) {
2302
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2302
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2303 2303
 				}
2304 2304
 				unset( $email_opt );
2305 2305
 			}
@@ -2330,12 +2330,12 @@  discard block
 block discarded – undo
2330 2330
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
2331 2331
 
2332 2332
 		foreach ( $add_fields as $add_field ) {
2333
-			if ( isset( $notification[ $add_field ] ) ) {
2334
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
2333
+			if ( isset( $notification[$add_field] ) ) {
2334
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
2335 2335
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
2336
-				$new_notification['post_content'][ $add_field ] = 0;
2336
+				$new_notification['post_content'][$add_field] = 0;
2337 2337
 			} else {
2338
-				$new_notification['post_content'][ $add_field ] = '';
2338
+				$new_notification['post_content'][$add_field] = '';
2339 2339
 			}
2340 2340
 			unset( $add_field );
2341 2341
 		}
@@ -2361,7 +2361,7 @@  discard block
 block discarded – undo
2361 2361
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
2362 2362
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
2363 2363
 				if ( is_numeric( $email_key ) ) {
2364
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2364
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2365 2365
 				}
2366 2366
 				unset( $email_key, $val );
2367 2367
 			}
Please login to merge, or discard this patch.
classes/models/FrmEntryValues.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 	 * @return array
178 178
 	 */
179 179
 	private function prepare_array_property( $index, $atts ) {
180
-		if ( ! empty( $atts[ $index ] ) ) {
180
+		if ( ! empty( $atts[$index] ) ) {
181 181
 
182
-			if ( is_array( $atts[ $index ] ) ) {
183
-				$property = $atts[ $index ];
182
+			if ( is_array( $atts[$index] ) ) {
183
+				$property = $atts[$index];
184 184
 			} else {
185
-				$property = explode( ',', $atts[ $index ] );
185
+				$property = explode( ',', $atts[$index] );
186 186
 			}
187 187
 		} else {
188 188
 			$property = array();
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
 			);
263 263
 		}
264 264
 
265
-		$ip       = array(
265
+		$ip = array(
266 266
 			'label' => __( 'IP Address', 'formidable' ),
267 267
 			'value' => $this->entry->ip,
268 268
 		);
269
-		$browser  = array(
269
+		$browser = array(
270 270
 			'label' => __( 'User-Agent (Browser/OS)', 'formidable' ),
271 271
 			'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '',
272 272
 		);
@@ -353,6 +353,6 @@  discard block
 block discarded – undo
353 353
 	 * @return void
354 354
 	 */
355 355
 	protected function add_field_values( $field ) {
356
-		$this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry );
356
+		$this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry );
357 357
 	}
358 358
 }
Please login to merge, or discard this patch.