Completed
Pull Request — master (#2579)
by
unknown
41s
created
classes/helpers/FrmFieldGridHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
 		}
218 218
 
219 219
 		if ( false !== $this->parent_li ) {
220
-			++$this->current_field_count;
220
+			++ $this->current_field_count;
221 221
 			$this->current_list_size += $this->active_field_size;
222 222
 			if ( 12 === $this->current_list_size ) {
223 223
 				$this->close_field_wrapper();
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/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
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 				$content_before_channel_tag,
103 103
 				1
104 104
 			);
105
-			$xml_string                 = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
105
+			$xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position );
106 106
 		}
107 107
 	}
108 108
 
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 			);
192 192
 
193 193
 			if ( $term && is_array( $term ) ) {
194
-				++$imported['imported']['terms'];
195
-				$imported['terms'][ (int) $t->term_id ] = $term['term_id'];
194
+				++ $imported['imported']['terms'];
195
+				$imported['terms'][(int) $t->term_id] = $term['term_id'];
196 196
 			}
197 197
 
198 198
 			unset( $term, $t );
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
 				if ( $form_id ) {
253 253
 					if ( empty( $form['parent_form_id'] ) ) {
254 254
 						// Don't include the repeater form in the imported count.
255
-						++$imported['imported']['forms'];
255
+						++ $imported['imported']['forms'];
256 256
 					}
257 257
 
258 258
 					// Keep track of whether this specific form was updated or not.
259
-					$imported['form_status'][ $form_id ] = 'imported';
259
+					$imported['form_status'][$form_id] = 'imported';
260 260
 				}
261 261
 			}
262 262
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 			// Update field ids/keys to new ones.
272 272
 			do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) );
273 273
 
274
-			$imported['forms'][ (int) $item->id ] = $form_id;
274
+			$imported['forms'][(int) $item->id] = $form_id;
275 275
 
276 276
 			// Send pre 2.0 form options through function that creates actions.
277 277
 			self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true );
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
 		FrmForm::update( $form_id, $form );
359 359
 		if ( empty( $form['parent_form_id'] ) ) {
360 360
 			// Don't include the repeater form in the updated count.
361
-			++$imported['updated']['forms'];
361
+			++ $imported['updated']['forms'];
362 362
 		}
363 363
 
364 364
 		// Keep track of whether this specific form was updated or not
365
-		$imported['form_status'][ $form_id ] = 'updated';
365
+		$imported['form_status'][$form_id] = 'updated';
366 366
 	}
367 367
 
368 368
 	/**
@@ -374,8 +374,8 @@  discard block
 block discarded – undo
374 374
 		$form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' );
375 375
 		$old_fields  = array();
376 376
 		foreach ( $form_fields as $f ) {
377
-			$old_fields[ $f->id ]        = $f;
378
-			$old_fields[ $f->field_key ] = $f->id;
377
+			$old_fields[$f->id]        = $f;
378
+			$old_fields[$f->field_key] = $f->id;
379 379
 			unset( $f );
380 380
 		}
381 381
 		$form_fields = $old_fields;
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 */
436 436
 	private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) {
437 437
 		if ( $parent_form_id ) {
438
-			$child_forms[ $form_id ] = $parent_form_id;
438
+			$child_forms[$form_id] = $parent_form_id;
439 439
 		}
440 440
 	}
441 441
 
@@ -450,9 +450,9 @@  discard block
 block discarded – undo
450 450
 	 */
451 451
 	private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) {
452 452
 		foreach ( $child_forms as $child_form_id => $old_parent_form_id ) {
453
-			if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) {
453
+			if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) {
454 454
 				// Update all children with this old parent_form_id
455
-				$new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ];
455
+				$new_parent_form_id = (int) $imported_forms[$old_parent_form_id];
456 456
 				FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) );
457 457
 				do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id );
458 458
 			}
@@ -488,34 +488,34 @@  discard block
 block discarded – undo
488 488
 
489 489
 			if ( ! empty( $this_form ) ) {
490 490
 				// check for field to edit by field id
491
-				if ( isset( $form_fields[ $f['id'] ] ) ) {
491
+				if ( isset( $form_fields[$f['id']] ) ) {
492 492
 					FrmField::update( $f['id'], $f );
493
-					++$imported['updated']['fields'];
493
+					++ $imported['updated']['fields'];
494 494
 
495
-					unset( $form_fields[ $f['id'] ] );
495
+					unset( $form_fields[$f['id']] );
496 496
 
497 497
 					// Unset old field key.
498
-					if ( isset( $form_fields[ $f['field_key'] ] ) ) {
499
-						unset( $form_fields[ $f['field_key'] ] );
498
+					if ( isset( $form_fields[$f['field_key']] ) ) {
499
+						unset( $form_fields[$f['field_key']] );
500 500
 					}
501
-				} elseif ( isset( $form_fields[ $f['field_key'] ] ) ) {
502
-					$keys_by_original_field_id[ $f['id'] ] = $f['field_key'];
501
+				} elseif ( isset( $form_fields[$f['field_key']] ) ) {
502
+					$keys_by_original_field_id[$f['id']] = $f['field_key'];
503 503
 
504 504
 					$old_field_id = $f['id'];
505 505
 
506 506
 					// check for field to edit by field key
507 507
 					unset( $f['id'] );
508 508
 
509
-					FrmField::update( $form_fields[ $f['field_key'] ], $f );
510
-					++$imported['updated']['fields'];
509
+					FrmField::update( $form_fields[$f['field_key']], $f );
510
+					++ $imported['updated']['fields'];
511 511
 
512 512
 					self::do_after_field_imported_action( $f, $form_fields, $old_field_id );
513 513
 
514 514
 					// Unset old field id.
515
-					unset( $form_fields[ $form_fields[ $f['field_key'] ] ] );
515
+					unset( $form_fields[$form_fields[$f['field_key']]] );
516 516
 
517 517
 					// Unset old field key.
518
-					unset( $form_fields[ $f['field_key'] ] );
518
+					unset( $form_fields[$f['field_key']] );
519 519
 				} else {
520 520
 					// If no matching field id or key in this form, create the field.
521 521
 					self::create_imported_field( $f, $imported );
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 	 */
556 556
 	private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) {
557 557
 		// Assign field array the update field's ID.
558
-		$field_array['id'] = $form_fields[ $field_array['field_key'] ];
558
+		$field_array['id'] = $form_fields[$field_array['field_key']];
559 559
 
560 560
 		/**
561 561
 		 * Fires when an existing field is imported.
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 		 * @param int   $field_id
567 567
 		 * @param int   $old_field_id
568 568
 		 */
569
-		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id );
569
+		do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id );
570 570
 	}
571 571
 
572 572
 	/**
@@ -675,8 +675,8 @@  discard block
 block discarded – undo
675 675
 		if ( $f['type'] === 'form' || ( $f['type'] === 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) {
676 676
 			if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) {
677 677
 				$form_select = (int) $f['field_options']['form_select'];
678
-				if ( isset( $imported['forms'][ $form_select ] ) ) {
679
-					$f['field_options']['form_select'] = $imported['forms'][ $form_select ];
678
+				if ( isset( $imported['forms'][$form_select] ) ) {
679
+					$f['field_options']['form_select'] = $imported['forms'][$form_select];
680 680
 				}
681 681
 			}
682 682
 		}
@@ -698,8 +698,8 @@  discard block
 block discarded – undo
698 698
 
699 699
 		if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) {
700 700
 			$old_form = $f['field_options']['get_values_form'];
701
-			if ( isset( $imported['forms'][ $old_form ] ) ) {
702
-				$f['field_options']['get_values_form'] = $imported['forms'][ $old_form ];
701
+			if ( isset( $imported['forms'][$old_form] ) ) {
702
+				$f['field_options']['get_values_form'] = $imported['forms'][$old_form];
703 703
 			}
704 704
 		}
705 705
 	}
@@ -726,12 +726,12 @@  discard block
 block discarded – undo
726 726
 	private static function migrate_placeholders( &$f ) {
727 727
 		$update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' );
728 728
 		foreach ( $update_values as $k => $v ) {
729
-			$f[ $k ] = $v;
729
+			$f[$k] = $v;
730 730
 		}
731 731
 
732 732
 		$update_values = self::migrate_field_placeholder( $f, 'default_blank' );
733 733
 		foreach ( $update_values as $k => $v ) {
734
-			$f[ $k ] = $v;
734
+			$f[$k] = $v;
735 735
 		}
736 736
 	}
737 737
 
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 	public static function migrate_field_placeholder( $field, $type ) {
750 750
 		$field         = (array) $field;
751 751
 		$field_options = $field['field_options'];
752
-		if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) {
752
+		if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) {
753 753
 			return array();
754 754
 		}
755 755
 
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 				}
776 776
 
777 777
 				if ( $opt == $default_value ) {
778
-					unset( $options[ $opt_key ] );
778
+					unset( $options[$opt_key] );
779 779
 					break;
780 780
 				}
781 781
 			}
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
 
804 804
 		$new_id = FrmField::create( $f );
805 805
 		if ( $new_id != false ) {
806
-			++$imported['imported']['fields'];
806
+			++ $imported['imported']['fields'];
807 807
 			do_action( 'frm_after_field_is_imported', $f, $new_id );
808 808
 		}
809 809
 	}
@@ -832,10 +832,10 @@  discard block
 block discarded – undo
832 832
 
833 833
 			$image_id = FrmProFileImport::import_attachment( $option['src'], $field_object );
834 834
 			// Remove the src from options as it isn't required after import.
835
-			unset( $field['options'][ $key ]['src'] );
835
+			unset( $field['options'][$key]['src'] );
836 836
 
837 837
 			if ( is_numeric( $image_id ) ) {
838
-				$field['options'][ $key ]['image'] = $image_id;
838
+				$field['options'][$key]['image'] = $image_id;
839 839
 			}
840 840
 		}
841 841
 
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 			} else {
1023 1023
 				if ( $post['post_type'] === 'frm_display' ) {
1024 1024
 					$post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] );
1025
-				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) {
1026
-					$post['post_parent'] = $imported['posts'][ $post['post_parent'] ];
1025
+				} elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) {
1026
+					$post['post_parent'] = $imported['posts'][$post['post_parent']];
1027 1027
 				}
1028 1028
 				// Create/update post now
1029 1029
 				$post_id = wp_insert_post( $post );
@@ -1034,27 +1034,27 @@  discard block
 block discarded – undo
1034 1034
 			}
1035 1035
 
1036 1036
 			if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) {
1037
-				$posts_with_shortcodes[ $post_id ] = $post;
1037
+				$posts_with_shortcodes[$post_id] = $post;
1038 1038
 			}
1039 1039
 
1040 1040
 			self::update_postmeta( $post, $post_id );
1041 1041
 			self::update_layout( $post, $post_id );
1042 1042
 
1043 1043
 			$this_type = 'posts';
1044
-			if ( isset( $post_types[ $post['post_type'] ] ) ) {
1045
-				$this_type = $post_types[ $post['post_type'] ];
1044
+			if ( isset( $post_types[$post['post_type']] ) ) {
1045
+				$this_type = $post_types[$post['post_type']];
1046 1046
 			}
1047 1047
 
1048 1048
 			if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) {
1049
-				++$imported['updated'][ $this_type ];
1049
+				++ $imported['updated'][$this_type];
1050 1050
 			} else {
1051
-				++$imported['imported'][ $this_type ];
1051
+				++ $imported['imported'][$this_type];
1052 1052
 			}
1053 1053
 
1054
-			$imported['posts'][ $old_id ] = $post_id;
1054
+			$imported['posts'][$old_id] = $post_id;
1055 1055
 
1056 1056
 			if ( $post['post_type'] === 'frm_display' ) {
1057
-				$view_ids[ $old_id ] = $post_id;
1057
+				$view_ids[$old_id] = $post_id;
1058 1058
 			}
1059 1059
 
1060 1060
 			do_action( 'frm_after_import_view', $post_id, $post );
@@ -1223,9 +1223,9 @@  discard block
 block discarded – undo
1223 1223
 			$post['attachment_url'] = (string) $item->attachment_url;
1224 1224
 		}
1225 1225
 
1226
-		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) {
1226
+		if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) {
1227 1227
 			// update to new form id
1228
-			$post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ];
1228
+			$post['menu_order'] = $imported['forms'][(int) $post['menu_order']];
1229 1229
 		}
1230 1230
 
1231 1231
 		// Don't allow default styles to take over a site's default style
@@ -1262,8 +1262,8 @@  discard block
 block discarded – undo
1262 1262
 		);
1263 1263
 
1264 1264
 		// Switch old form and field ids to new ones.
1265
-		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) {
1266
-			$m['value'] = $imported['forms'][ (int) $m['value'] ];
1265
+		if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) {
1266
+			$m['value'] = $imported['forms'][(int) $m['value']];
1267 1267
 		} else {
1268 1268
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1269 1269
 
@@ -1274,23 +1274,23 @@  discard block
 block discarded – undo
1274 1274
 				} elseif ( 'frm_options' === $m['key'] ) {
1275 1275
 
1276 1276
 					foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) {
1277
-						if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) {
1278
-							$m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ];
1277
+						if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) {
1278
+							$m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]];
1279 1279
 						}
1280 1280
 					}
1281 1281
 
1282 1282
 					if ( ! empty( $m['value']['map_address_fields'] ) ) {
1283 1283
 						foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) {
1284
-							if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) {
1285
-								$m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ];
1284
+							if ( isset( $frm_duplicate_ids[$address_field_id] ) ) {
1285
+								$m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id];
1286 1286
 							}
1287 1287
 						}
1288 1288
 					}
1289 1289
 
1290 1290
 					if ( ! empty( $m['value']['calendar_options'] ) ) {
1291 1291
 						foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) {
1292
-							if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) {
1293
-								$m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ];
1292
+							if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) {
1293
+								$m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']];
1294 1294
 							}
1295 1295
 						}
1296 1296
 					}
@@ -1298,8 +1298,8 @@  discard block
 block discarded – undo
1298 1298
 					if ( ! empty( $m['value']['timeline_options'] ) ) {
1299 1299
 						foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) {
1300 1300
 							foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) {
1301
-								if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) {
1302
-									$m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ];
1301
+								if ( isset( $frm_duplicate_ids[$timeline_option] ) ) {
1302
+									$m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option];
1303 1303
 								}
1304 1304
 							}
1305 1305
 						}
@@ -1307,8 +1307,8 @@  discard block
 block discarded – undo
1307 1307
 
1308 1308
 					$check_dup_array = array();
1309 1309
 					if ( ! empty( $m['value']['order_by'] ) ) {
1310
-						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) {
1311
-							$m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ];
1310
+						if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) {
1311
+							$m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']];
1312 1312
 						} elseif ( is_array( $m['value']['order_by'] ) ) {
1313 1313
 							$check_dup_array[] = 'order_by';
1314 1314
 						}
@@ -1319,9 +1319,9 @@  discard block
 block discarded – undo
1319 1319
 					}
1320 1320
 
1321 1321
 					foreach ( $check_dup_array as $check_k ) {
1322
-						foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) {
1323
-							if ( isset( $frm_duplicate_ids[ $mv ] ) ) {
1324
-								$m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ];
1322
+						foreach ( (array) $m['value'][$check_k] as $mk => $mv ) {
1323
+							if ( isset( $frm_duplicate_ids[$mv] ) ) {
1324
+								$m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv];
1325 1325
 							}
1326 1326
 							unset( $mk, $mv );
1327 1327
 						}
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 			$m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] );
1335 1335
 		}
1336 1336
 
1337
-		$post['postmeta'][ (string) $meta->meta_key ] = $m['value'];
1337
+		$post['postmeta'][(string) $meta->meta_key] = $m['value'];
1338 1338
 	}
1339 1339
 
1340 1340
 	/**
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 	 * @return void
1345 1345
 	 */
1346 1346
 	private static function populate_layout( &$post, $layout ) {
1347
-		$post['layout'][ (string) $layout->type ] = (string) $layout->data;
1347
+		$post['layout'][(string) $layout->type] = (string) $layout->data;
1348 1348
 	}
1349 1349
 
1350 1350
 	/**
@@ -1372,11 +1372,11 @@  discard block
 block discarded – undo
1372 1372
 				$name = (string) $c;
1373 1373
 			}
1374 1374
 
1375
-			if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) {
1376
-				$post['tax_input'][ $taxonomy ] = array();
1375
+			if ( ! isset( $post['tax_input'][$taxonomy] ) ) {
1376
+				$post['tax_input'][$taxonomy] = array();
1377 1377
 			}
1378 1378
 
1379
-			$post['tax_input'][ $taxonomy ][] = $name;
1379
+			$post['tax_input'][$taxonomy][] = $name;
1380 1380
 			unset( $name );
1381 1381
 		}//end foreach
1382 1382
 	}
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 		$message = '<ul>';
1527 1527
 		foreach ( $result as $type => $results ) {
1528
-			if ( ! isset( $t_strings[ $type ] ) ) {
1528
+			if ( ! isset( $t_strings[$type] ) ) {
1529 1529
 				// only print imported and updated
1530 1530
 				continue;
1531 1531
 			}
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 			}
1538 1538
 
1539 1539
 			if ( ! empty( $s_message ) ) {
1540
-				$message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> ';
1540
+				$message .= '<li><strong>' . $t_strings[$type] . ':</strong> ';
1541 1541
 				$message .= implode( ', ', $s_message );
1542 1542
 				$message .= '</li>';
1543 1543
 			}
@@ -1589,8 +1589,8 @@  discard block
 block discarded – undo
1589 1589
 			'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ),
1590 1590
 		);
1591 1591
 
1592
-		if ( isset( $strings[ $type ] ) ) {
1593
-			$s_message[] = $strings[ $type ];
1592
+		if ( isset( $strings[$type] ) ) {
1593
+			$s_message[] = $strings[$type];
1594 1594
 		} else {
1595 1595
 			$string = ' ' . $m . ' ' . ucfirst( $type );
1596 1596
 
@@ -1749,7 +1749,7 @@  discard block
 block discarded – undo
1749 1749
 
1750 1750
 		foreach ( $options as $key => $option ) {
1751 1751
 			if ( is_array( $option ) && ! empty( $option['image'] ) ) {
1752
-				$options[ $key ]['src'] = wp_get_attachment_url( $option['image'] );
1752
+				$options[$key]['src'] = wp_get_attachment_url( $option['image'] );
1753 1753
 				$updated                = true;
1754 1754
 			}
1755 1755
 		}
@@ -1787,8 +1787,8 @@  discard block
 block discarded – undo
1787 1787
 	 */
1788 1788
 	private static function remove_defaults( $defaults, &$saved ) {
1789 1789
 		foreach ( $saved as $key => $value ) {
1790
-			if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) {
1791
-				unset( $saved[ $key ] );
1790
+			if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) {
1791
+				unset( $saved[$key] );
1792 1792
 			}
1793 1793
 		}
1794 1794
 	}
@@ -1805,14 +1805,14 @@  discard block
 block discarded – undo
1805 1805
 	 * @return void
1806 1806
 	 */
1807 1807
 	private static function remove_default_html( $html_name, $defaults, &$options ) {
1808
-		if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) {
1808
+		if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) {
1809 1809
 			return;
1810 1810
 		}
1811 1811
 
1812
-		$old_html     = str_replace( "\r\n", "\n", $options[ $html_name ] );
1813
-		$default_html = $defaults[ $html_name ];
1812
+		$old_html     = str_replace( "\r\n", "\n", $options[$html_name] );
1813
+		$default_html = $defaults[$html_name];
1814 1814
 		if ( $old_html == $default_html ) {
1815
-			unset( $options[ $html_name ] );
1815
+			unset( $options[$html_name] );
1816 1816
 
1817 1817
 			return;
1818 1818
 		}
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 		// Account for some of the older field default HTML.
1821 1821
 		$default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html );
1822 1822
 		if ( $old_html === $default_html ) {
1823
-			unset( $options[ $html_name ] );
1823
+			unset( $options[$html_name] );
1824 1824
 		}
1825 1825
 	}
1826 1826
 
@@ -1928,8 +1928,8 @@  discard block
 block discarded – undo
1928 1928
 		);
1929 1929
 
1930 1930
 		foreach ( $post_settings as $post_setting ) {
1931
-			if ( isset( $form_options[ $post_setting ] ) ) {
1932
-				$new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ];
1931
+			if ( isset( $form_options[$post_setting] ) ) {
1932
+				$new_action['post_content'][$post_setting] = $form_options[$post_setting];
1933 1933
 			}
1934 1934
 			unset( $post_setting );
1935 1935
 		}
@@ -1967,7 +1967,7 @@  discard block
 block discarded – undo
1967 1967
 		if ( ! $exists ) {
1968 1968
 			// this isn't an email, but we need to use a class that will always be included
1969 1969
 			FrmDb::save_json_post( $new_action );
1970
-			++$imported['imported']['actions'];
1970
+			++ $imported['imported']['actions'];
1971 1971
 		}
1972 1972
 	}
1973 1973
 
@@ -2000,11 +2000,11 @@  discard block
 block discarded – undo
2000 2000
 		foreach ( $post_content as $key => $setting ) {
2001 2001
 			if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) {
2002 2002
 				// Replace old IDs with new IDs
2003
-				$post_content[ $key ] = str_replace( $old, $new, $setting );
2003
+				$post_content[$key] = str_replace( $old, $new, $setting );
2004 2004
 			} elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) {
2005 2005
 				foreach ( $setting as $k => $val ) {
2006 2006
 					// Replace old IDs with new IDs
2007
-					$post_content[ $key ][ $k ] = str_replace( $old, $new, $val );
2007
+					$post_content[$key][$k] = str_replace( $old, $new, $val );
2008 2008
 				}
2009 2009
 			}
2010 2010
 			unset( $key, $setting );
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
 
2073 2073
 			if ( empty( $exists ) ) {
2074 2074
 				FrmDb::save_json_post( $new_notification );
2075
-				++$imported['imported']['actions'];
2075
+				++ $imported['imported']['actions'];
2076 2076
 			}
2077 2077
 			unset( $new_notification );
2078 2078
 		}//end foreach
@@ -2093,8 +2093,8 @@  discard block
 block discarded – undo
2093 2093
 	private static function remove_deprecated_notification_settings( $form_id, $form_options ) {
2094 2094
 		$delete_settings = array( 'notification', 'autoresponder', 'email_to' );
2095 2095
 		foreach ( $delete_settings as $index ) {
2096
-			if ( isset( $form_options[ $index ] ) ) {
2097
-				unset( $form_options[ $index ] );
2096
+			if ( isset( $form_options[$index] ) ) {
2097
+				unset( $form_options[$index] );
2098 2098
 			}
2099 2099
 		}
2100 2100
 		FrmForm::update( $form_id, array( 'options' => $form_options ) );
@@ -2164,12 +2164,12 @@  discard block
 block discarded – undo
2164 2164
 			'reply_to_name' => '',
2165 2165
 		);
2166 2166
 		foreach ( $reply_fields as $f => $val ) {
2167
-			if ( isset( $notification[ $f ] ) ) {
2168
-				$atts[ $f ] = $notification[ $f ];
2169
-				if ( 'custom' == $notification[ $f ] ) {
2170
-					$atts[ $f ] = $notification[ 'cust_' . $f ];
2171
-				} elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) {
2172
-					$atts[ $f ] = '[' . $atts[ $f ] . ']';
2167
+			if ( isset( $notification[$f] ) ) {
2168
+				$atts[$f] = $notification[$f];
2169
+				if ( 'custom' == $notification[$f] ) {
2170
+					$atts[$f] = $notification['cust_' . $f];
2171
+				} elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) {
2172
+					$atts[$f] = '[' . $atts[$f] . ']';
2173 2173
 				}
2174 2174
 			}
2175 2175
 			unset( $f, $val );
@@ -2208,13 +2208,13 @@  discard block
 block discarded – undo
2208 2208
 		foreach ( $atts['email_to'] as $key => $email_field ) {
2209 2209
 
2210 2210
 			if ( is_numeric( $email_field ) ) {
2211
-				$atts['email_to'][ $key ] = '[' . $email_field . ']';
2211
+				$atts['email_to'][$key] = '[' . $email_field . ']';
2212 2212
 			}
2213 2213
 
2214 2214
 			if ( strpos( $email_field, '|' ) ) {
2215 2215
 				$email_opt = explode( '|', $email_field );
2216 2216
 				if ( isset( $email_opt[0] ) ) {
2217
-					$atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2217
+					$atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']';
2218 2218
 				}
2219 2219
 				unset( $email_opt );
2220 2220
 			}
@@ -2244,12 +2244,12 @@  discard block
 block discarded – undo
2244 2244
 		// Add more fields to the new notification
2245 2245
 		$add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' );
2246 2246
 		foreach ( $add_fields as $add_field ) {
2247
-			if ( isset( $notification[ $add_field ] ) ) {
2248
-				$new_notification['post_content'][ $add_field ] = $notification[ $add_field ];
2247
+			if ( isset( $notification[$add_field] ) ) {
2248
+				$new_notification['post_content'][$add_field] = $notification[$add_field];
2249 2249
 			} elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) {
2250
-				$new_notification['post_content'][ $add_field ] = 0;
2250
+				$new_notification['post_content'][$add_field] = 0;
2251 2251
 			} else {
2252
-				$new_notification['post_content'][ $add_field ] = '';
2252
+				$new_notification['post_content'][$add_field] = '';
2253 2253
 			}
2254 2254
 			unset( $add_field );
2255 2255
 		}
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
 		if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) {
2276 2276
 			foreach ( $post_content['conditions'] as $email_key => $val ) {
2277 2277
 				if ( is_numeric( $email_key ) ) {
2278
-					$post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2278
+					$post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) );
2279 2279
 				}
2280 2280
 				unset( $email_key, $val );
2281 2281
 			}
Please login to merge, or discard this patch.