Completed
Pull Request — master (#2624)
by
unknown
42s
created
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/xml/posts_xml.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@
 block discarded – undo
113 113
 	$label         = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term';
114 114
 	?>
115 115
 	<term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
116
-	if ( ! empty( $parent_slugs[ $term->parent ] ) ) {
117
-		echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>';
116
+	if ( ! empty( $parent_slugs[$term->parent] ) ) {
117
+		echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>';
118 118
 	}
119 119
 	if ( ! empty( $term->name ) ) {
120 120
 		echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
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
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 				$content_before_channel_tag,
105 105
 				1
106 106
 			);
107
-			$xml_string                 = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
107
+			$xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
108 108
 		}
109 109
 	}
110 110
 
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 			);
197 197
 
198 198
 			if ( $term && is_array( $term ) ) {
199
-				++$imported['imported']['terms'];
200
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
199
+				++ $imported['imported']['terms'];
200
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
201 201
 			}
202 202
 
203 203
 			unset( $term, $t );
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 				if ( $form_id ) {
260 260
 					if ( empty( $form['parent_form_id'] ) ) {
261 261
 						// Don't include the repeater form in the imported count.
262
-						++$imported['imported']['forms'];
262
+						++ $imported['imported']['forms'];
263 263
 					}
264 264
 
265 265
 					// Keep track of whether this specific form was updated or not.
266
-					$imported['form_status'][ $form_id ] = 'imported';
266
+					$imported['form_status'][$form_id] = 'imported';
267 267
 				}
268 268
 			}
269 269
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			// Update field ids/keys to new ones.
279 279
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
280 280
 
281
-			$imported['forms'][ (int) $item->id ] = $form_id;
281
+			$imported['forms'][(int) $item->id] = $form_id;
282 282
 
283 283
 			// Send pre 2.0 form options through function that creates actions.
284 284
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -365,11 +365,11 @@  discard block
 block discarded – undo
365 365
 		FrmForm::update( $form_id, $form );
366 366
 		if ( empty( $form['parent_form_id'] ) ) {
367 367
 			// Don't include the repeater form in the updated count.
368
-			++$imported['updated']['forms'];
368
+			++ $imported['updated']['forms'];
369 369
 		}
370 370
 
371 371
 		// Keep track of whether this specific form was updated or not
372
-		$imported['form_status'][ $form_id ] = 'updated';
372
+		$imported['form_status'][$form_id] = 'updated';
373 373
 	}
374 374
 
375 375
 	/**
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
382 382
 		$old_fields  = array();
383 383
 		foreach ( $form_fields as $f ) {
384
-			$old_fields[ $f->id ]        = $f;
385
-			$old_fields[ $f->field_key ] = $f->id;
384
+			$old_fields[$f->id]        = $f;
385
+			$old_fields[$f->field_key] = $f->id;
386 386
 			unset( $f );
387 387
 		}
388 388
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 	 */
445 445
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
446 446
 		if ( $parent_form_id ) {
447
-			$child_forms[ $form_id ] = $parent_form_id;
447
+			$child_forms[$form_id] = $parent_form_id;
448 448
 		}
449 449
 	}
450 450
 
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
 	 */
460 460
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
461 461
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
462
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
462
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
463 463
 				// Update all children with this old parent_form_id
464
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
464
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
465 465
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
466 466
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
467 467
 			}
@@ -497,34 +497,34 @@  discard block
 block discarded – undo
497 497
 
498 498
 			if ( ! empty( $this_form ) ) {
499 499
 				// check for field to edit by field id
500
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
500
+				if ( isset( $form_fields[$f['id']] ) ) {
501 501
 					FrmField::update( $f['id'], $f );
502
-					++$imported['updated']['fields'];
502
+					++ $imported['updated']['fields'];
503 503
 
504
-					unset( $form_fields[ $f['id'] ] );
504
+					unset( $form_fields[$f['id']] );
505 505
 
506 506
 					// Unset old field key.
507
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
508
-						unset( $form_fields[ $f['field_key'] ] );
507
+					if ( isset( $form_fields[$f['field_key']] ) ) {
508
+						unset( $form_fields[$f['field_key']] );
509 509
 					}
510
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
511
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
510
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
511
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
512 512
 
513 513
 					$old_field_id = $f['id'];
514 514
 
515 515
 					// check for field to edit by field key
516 516
 					unset( $f['id'] );
517 517
 
518
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
519
-					++$imported['updated']['fields'];
518
+					FrmField::update( $form_fields[$f['field_key']], $f );
519
+					++ $imported['updated']['fields'];
520 520
 
521 521
 					self::do_after_field_imported_action( $f, $form_fields, $old_field_id );
522 522
 
523 523
 					// Unset old field id.
524
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] );
524
+					unset( $form_fields[$form_fields[$f['field_key']]] );
525 525
 
526 526
 					// Unset old field key.
527
-					unset( $form_fields[ $f['field_key'] ] );
527
+					unset( $form_fields[$f['field_key']] );
528 528
 				} else {
529 529
 					// If no matching field id or key in this form, create the field.
530 530
 					self::create_imported_field( $f, $imported );
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 	 */
566 566
 	private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) {
567 567
 		// Assign field array the update field's ID.
568
-		$field_array['id'] = $form_fields[ $field_array['field_key'] ];
568
+		$field_array['id'] = $form_fields[$field_array['field_key']];
569 569
 
570 570
 		/**
571 571
 		 * Fires when an existing field is imported.
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 		 * @param int   $field_id
577 577
 		 * @param int   $old_field_id
578 578
 		 */
579
-		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id );
579
+		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id );
580 580
 	}
581 581
 
582 582
 	/**
@@ -689,8 +689,8 @@  discard block
 block discarded – undo
689 689
 		if ( $f['type'] === 'form' || ( $f['type'] === 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
690 690
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
691 691
 				$form_select = (int) $f['field_options']['form_select'];
692
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
693
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
692
+				if ( isset( $imported['forms'][$form_select] ) ) {
693
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
694 694
 				}
695 695
 			}
696 696
 		}
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
 
714 714
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
715 715
 			$old_form = $f['field_options']['get_values_form'];
716
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
717
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
716
+			if ( isset( $imported['forms'][$old_form] ) ) {
717
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
718 718
 			}
719 719
 		}
720 720
 	}
@@ -743,12 +743,12 @@  discard block
 block discarded – undo
743 743
 	private static function migrate_placeholders( &$f ) {
744 744
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
745 745
 		foreach ( $update_values as $k => $v ) {
746
-			$f[ $k ] = $v;
746
+			$f[$k] = $v;
747 747
 		}
748 748
 
749 749
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
750 750
 		foreach ( $update_values as $k => $v ) {
751
-			$f[ $k ] = $v;
751
+			$f[$k] = $v;
752 752
 		}
753 753
 	}
754 754
 
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 	public static function migrate_field_placeholder( $field, $type ) {
767 767
 		$field         = (array) $field;
768 768
 		$field_options = $field['field_options'];
769
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
769
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
770 770
 			return array();
771 771
 		}
772 772
 
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 				}
793 793
 
794 794
 				if ( $opt == $default_value ) {
795
-					unset( $options[ $opt_key ] );
795
+					unset( $options[$opt_key] );
796 796
 					break;
797 797
 				}
798 798
 			}
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 
822 822
 		$new_id = FrmField::create( $f );
823 823
 		if ( $new_id != false ) {
824
-			++$imported['imported']['fields'];
824
+			++ $imported['imported']['fields'];
825 825
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
826 826
 		}
827 827
 	}
@@ -851,10 +851,10 @@  discard block
 block discarded – undo
851 851
 
852 852
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
853 853
 			// Remove the src from options as it isn't required after import.
854
-			unset( $field['options'][ $key ]['src'] );
854
+			unset( $field['options'][$key]['src'] );
855 855
 
856 856
 			if ( is_numeric( $image_id ) ) {
857
-				$field['options'][ $key ]['image'] = $image_id;
857
+				$field['options'][$key]['image'] = $image_id;
858 858
 			}
859 859
 		}
860 860
 
@@ -1046,8 +1046,8 @@  discard block
 block discarded – undo
1046 1046
 			} else {
1047 1047
 				if ( $post['post_type'] === 'frm_display' ) {
1048 1048
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
1049
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
1050
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
1049
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
1050
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
1051 1051
 				}
1052 1052
 				// Create/update post now
1053 1053
 				$post_id = wp_insert_post( $post );
@@ -1058,27 +1058,27 @@  discard block
 block discarded – undo
1058 1058
 			}
1059 1059
 
1060 1060
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
1061
-				$posts_with_shortcodes[ $post_id ] = $post;
1061
+				$posts_with_shortcodes[$post_id] = $post;
1062 1062
 			}
1063 1063
 
1064 1064
 			self::update_postmeta( $post, $post_id );
1065 1065
 			self::update_layout( $post, $post_id );
1066 1066
 
1067 1067
 			$this_type = 'posts';
1068
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
1069
-				$this_type = $post_types[ $post['post_type'] ];
1068
+			if ( isset( $post_types[$post['post_type']] ) ) {
1069
+				$this_type = $post_types[$post['post_type']];
1070 1070
 			}
1071 1071
 
1072 1072
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
1073
-				++$imported['updated'][ $this_type ];
1073
+				++ $imported['updated'][$this_type];
1074 1074
 			} else {
1075
-				++$imported['imported'][ $this_type ];
1075
+				++ $imported['imported'][$this_type];
1076 1076
 			}
1077 1077
 
1078
-			$imported['posts'][ $old_id ] = $post_id;
1078
+			$imported['posts'][$old_id] = $post_id;
1079 1079
 
1080 1080
 			if ( $post['post_type'] === 'frm_display' ) {
1081
-				$view_ids[ $old_id ] = $post_id;
1081
+				$view_ids[$old_id] = $post_id;
1082 1082
 			}
1083 1083
 
1084 1084
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1253,9 +1253,9 @@  discard block
 block discarded – undo
1253 1253
 			$post['attachment_url'] = (string) $item->attachment_url;
1254 1254
 		}
1255 1255
 
1256
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1256
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1257 1257
 			// update to new form id
1258
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1258
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1259 1259
 		}
1260 1260
 
1261 1261
 		// Don't allow default styles to take over a site's default style
@@ -1292,8 +1292,8 @@  discard block
 block discarded – undo
1292 1292
 		);
1293 1293
 
1294 1294
 		// Switch old form and field ids to new ones.
1295
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1296
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1295
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1296
+			$m['value'] = $imported['forms'][(int) $m['value']];
1297 1297
 		} else {
1298 1298
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1299 1299
 
@@ -1304,23 +1304,23 @@  discard block
 block discarded – undo
1304 1304
 				} elseif ( 'frm_options' === $m['key'] ) {
1305 1305
 
1306 1306
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1307
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1308
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1307
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1308
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1309 1309
 						}
1310 1310
 					}
1311 1311
 
1312 1312
 					if ( ! empty( $m['value']['map_address_fields'] ) ) {
1313 1313
 						foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) {
1314
-							if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) {
1315
-								$m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ];
1314
+							if ( isset( $frm_duplicate_ids[$address_field_id] ) ) {
1315
+								$m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id];
1316 1316
 							}
1317 1317
 						}
1318 1318
 					}
1319 1319
 
1320 1320
 					if ( ! empty( $m['value']['calendar_options'] ) ) {
1321 1321
 						foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) {
1322
-							if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) {
1323
-								$m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ];
1322
+							if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) {
1323
+								$m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']];
1324 1324
 							}
1325 1325
 						}
1326 1326
 					}
@@ -1328,8 +1328,8 @@  discard block
 block discarded – undo
1328 1328
 					if ( ! empty( $m['value']['timeline_options'] ) ) {
1329 1329
 						foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) {
1330 1330
 							foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) {
1331
-								if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) {
1332
-									$m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ];
1331
+								if ( isset( $frm_duplicate_ids[$timeline_option] ) ) {
1332
+									$m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option];
1333 1333
 								}
1334 1334
 							}
1335 1335
 						}
@@ -1337,8 +1337,8 @@  discard block
 block discarded – undo
1337 1337
 
1338 1338
 					$check_dup_array = array();
1339 1339
 					if ( ! empty( $m['value']['order_by'] ) ) {
1340
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1341
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1340
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1341
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1342 1342
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1343 1343
 							$check_dup_array[] = 'order_by';
1344 1344
 						}
@@ -1349,9 +1349,9 @@  discard block
 block discarded – undo
1349 1349
 					}
1350 1350
 
1351 1351
 					foreach ( $check_dup_array as $check_k ) {
1352
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1353
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1354
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1352
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1353
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1354
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1355 1355
 							}
1356 1356
 							unset( $mk, $mv );
1357 1357
 						}
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1365 1365
 		}
1366 1366
 
1367
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1367
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1368 1368
 	}
1369 1369
 
1370 1370
 	/**
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 	 * @return void
1375 1375
 	 */
1376 1376
 	private static function populate_layout( &$post, $layout ) {
1377
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1377
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1378 1378
 	}
1379 1379
 
1380 1380
 	/**
@@ -1402,11 +1402,11 @@  discard block
 block discarded – undo
1402 1402
 				$name = (string) $c;
1403 1403
 			}
1404 1404
 
1405
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1406
-				$post['tax_input'][ $taxonomy ] = array();
1405
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1406
+				$post['tax_input'][$taxonomy] = array();
1407 1407
 			}
1408 1408
 
1409
-			$post['tax_input'][ $taxonomy ][] = $name;
1409
+			$post['tax_input'][$taxonomy][] = $name;
1410 1410
 			unset( $name );
1411 1411
 		}//end foreach
1412 1412
 	}
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
 
1557 1557
 		$message = '<ul>';
1558 1558
 		foreach ( $result as $type => $results ) {
1559
-			if ( ! isset( $t_strings[ $type ] ) ) {
1559
+			if ( ! isset( $t_strings[$type] ) ) {
1560 1560
 				// only print imported and updated
1561 1561
 				continue;
1562 1562
 			}
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 			}
1569 1569
 
1570 1570
 			if ( ! empty( $s_message ) ) {
1571
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1571
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1572 1572
 				$message .= implode( ', ', $s_message );
1573 1573
 				$message .= '</li>';
1574 1574
 			}
@@ -1620,8 +1620,8 @@  discard block
 block discarded – undo
1620 1620
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1621 1621
 		);
1622 1622
 
1623
-		if ( isset( $strings[ $type ] ) ) {
1624
-			$s_message[] = $strings[ $type ];
1623
+		if ( isset( $strings[$type] ) ) {
1624
+			$s_message[] = $strings[$type];
1625 1625
 		} else {
1626 1626
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1627 1627
 
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
 
1784 1784
 		foreach ( $options as $key => $option ) {
1785 1785
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1786
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1786
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1787 1787
 				$updated                = true;
1788 1788
 			}
1789 1789
 		}
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
 	 */
1822 1822
 	private static function remove_defaults( $defaults, &$saved ) {
1823 1823
 		foreach ( $saved as $key => $value ) {
1824
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1825
-				unset( $saved[ $key ] );
1824
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1825
+				unset( $saved[$key] );
1826 1826
 			}
1827 1827
 		}
1828 1828
 	}
@@ -1839,14 +1839,14 @@  discard block
 block discarded – undo
1839 1839
 	 * @return void
1840 1840
 	 */
1841 1841
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1842
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1842
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1843 1843
 			return;
1844 1844
 		}
1845 1845
 
1846
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1847
-		$default_html = $defaults[ $html_name ];
1846
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1847
+		$default_html = $defaults[$html_name];
1848 1848
 		if ( $old_html == $default_html ) {
1849
-			unset( $options[ $html_name ] );
1849
+			unset( $options[$html_name] );
1850 1850
 
1851 1851
 			return;
1852 1852
 		}
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
 		// Account for some of the older field default HTML.
1855 1855
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1856 1856
 		if ( $old_html === $default_html ) {
1857
-			unset( $options[ $html_name ] );
1857
+			unset( $options[$html_name] );
1858 1858
 		}
1859 1859
 	}
1860 1860
 
@@ -1962,8 +1962,8 @@  discard block
 block discarded – undo
1962 1962
 		);
1963 1963
 
1964 1964
 		foreach ( $post_settings as $post_setting ) {
1965
-			if ( isset( $form_options[ $post_setting ] ) ) {
1966
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1965
+			if ( isset( $form_options[$post_setting] ) ) {
1966
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1967 1967
 			}
1968 1968
 			unset( $post_setting );
1969 1969
 		}
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
 		if ( ! $exists ) {
2002 2002
 			// this isn't an email, but we need to use a class that will always be included
2003 2003
 			FrmDb::save_json_post( $new_action );
2004
-			++$imported['imported']['actions'];
2004
+			++ $imported['imported']['actions'];
2005 2005
 		}
2006 2006
 	}
2007 2007
 
@@ -2034,11 +2034,11 @@  discard block
 block discarded – undo
2034 2034
 		foreach ( $post_content as $key => $setting ) {
2035 2035
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
2036 2036
 				// Replace old IDs with new IDs
2037
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
2037
+				$post_content[$key] = str_replace( $old, $new, $setting );
2038 2038
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
2039 2039
 				foreach ( $setting as $k => $val ) {
2040 2040
 					// Replace old IDs with new IDs
2041
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
2041
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
2042 2042
 				}
2043 2043
 			}
2044 2044
 			unset( $key, $setting );
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 
2107 2107
 			if ( empty( $exists ) ) {
2108 2108
 				FrmDb::save_json_post( $new_notification );
2109
-				++$imported['imported']['actions'];
2109
+				++ $imported['imported']['actions'];
2110 2110
 			}
2111 2111
 			unset( $new_notification );
2112 2112
 		}//end foreach
@@ -2127,8 +2127,8 @@  discard block
 block discarded – undo
2127 2127
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
2128 2128
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
2129 2129
 		foreach ( $delete_settings as $index ) {
2130
-			if ( isset( $form_options[ $index ] ) ) {
2131
-				unset( $form_options[ $index ] );
2130
+			if ( isset( $form_options[$index] ) ) {
2131
+				unset( $form_options[$index] );
2132 2132
 			}
2133 2133
 		}
2134 2134
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -2198,12 +2198,12 @@  discard block
 block discarded – undo
2198 2198
 			'reply_to_name' => '',
2199 2199
 		);
2200 2200
 		foreach ( $reply_fields as $f => $val ) {
2201
-			if ( isset( $notification[ $f ] ) ) {
2202
-				$atts[ $f ] = $notification[ $f ];
2203
-				if ( 'custom' == $notification[ $f ] ) {
2204
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
2205
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
2206
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
2201
+			if ( isset( $notification[$f] ) ) {
2202
+				$atts[$f] = $notification[$f];
2203
+				if ( 'custom' == $notification[$f] ) {
2204
+					$atts[$f] = $notification['cust_' . $f];
2205
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
2206
+					$atts[$f] = '[' . $atts[$f] . ']';
2207 2207
 				}
2208 2208
 			}
2209 2209
 			unset( $f, $val );
@@ -2242,13 +2242,13 @@  discard block
 block discarded – undo
2242 2242
 		foreach ( $atts['email_to'] as $key => $email_field ) {
2243 2243
 
2244 2244
 			if ( is_numeric( $email_field ) ) {
2245
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
2245
+				$atts['email_to'][$key] = '[' . $email_field . ']';
2246 2246
 			}
2247 2247
 
2248 2248
 			if ( strpos( $email_field, '|' ) ) {
2249 2249
 				$email_opt = explode( '|', $email_field );
2250 2250
 				if ( isset( $email_opt[0] ) ) {
2251
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2251
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2252 2252
 				}
2253 2253
 				unset( $email_opt );
2254 2254
 			}
@@ -2278,12 +2278,12 @@  discard block
 block discarded – undo
2278 2278
 		// Add more fields to the new notification
2279 2279
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
2280 2280
 		foreach ( $add_fields as $add_field ) {
2281
-			if ( isset( $notification[ $add_field ] ) ) {
2282
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
2281
+			if ( isset( $notification[$add_field] ) ) {
2282
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
2283 2283
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
2284
-				$new_notification['post_content'][ $add_field ] = 0;
2284
+				$new_notification['post_content'][$add_field] = 0;
2285 2285
 			} else {
2286
-				$new_notification['post_content'][ $add_field ] = '';
2286
+				$new_notification['post_content'][$add_field] = '';
2287 2287
 			}
2288 2288
 			unset( $add_field );
2289 2289
 		}
@@ -2309,7 +2309,7 @@  discard block
 block discarded – undo
2309 2309
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
2310 2310
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
2311 2311
 				if ( is_numeric( $email_key ) ) {
2312
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2312
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2313 2313
 				}
2314 2314
 				unset( $email_key, $val );
2315 2315
 			}
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.