Completed
Pull Request — master (#200)
by Stephanie
02:23
created
classes/models/FrmSolution.php 3 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,8 @@
 block discarded – undo
125 125
 		}
126 126
 
127 127
 		// Only do this for single site installs.
128
-		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // WPCS: CSRF ok.
128
+		if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) {
129
+// WPCS: CSRF ok.
129 130
 			return;
130 131
 		}
131 132
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -546,6 +546,9 @@
 block discarded – undo
546 546
 		$this->show_import_options( $this->view_options(), 'view' );
547 547
 	}
548 548
 
549
+	/**
550
+	 * @param string $importing
551
+	 */
549 552
 	protected function show_import_options( $options, $importing, $xml = '' ) {
550 553
 		if ( empty( $options ) ) {
551 554
 			return;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	public static function add_settings( $sections ) {
169 169
 		wp_enqueue_style( 'formidable-pro-fields' );
170
-		$sections[ $this->plugin_slug ] = array(
170
+		$sections[$this->plugin_slug] = array(
171 171
 			'class'    => $this,
172 172
 			'function' => 'settings_page',
173 173
 			'name'     => $this->plugin_name(),
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
 			// Set the current step.
325 325
 			if ( ! isset( $step['current'] ) ) {
326 326
 				if ( $step['complete'] ) {
327
-					$steps[ $k ]['current'] = false;
327
+					$steps[$k]['current'] = false;
328 328
 				} else {
329
-					$steps[ $k ]['current'] = ! $has_current;
329
+					$steps[$k]['current'] = ! $has_current;
330 330
 					$has_current = true;
331 331
 				}
332 332
 			} elseif ( $step['current'] ) {
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 			// Set disabled buttons.
337 337
 			$class = isset( $step['button_class'] ) ? $step['button_class'] : '';
338 338
 			$class .= ' button-primary frm-button-primary';
339
-			if ( ! $steps[ $k ]['current'] ) {
339
+			if ( ! $steps[$k]['current'] ) {
340 340
 				$class .= ' frm_grey disabled';
341 341
 			}
342
-			$steps[ $k ]['button_class'] = $class;
342
+			$steps[$k]['button_class'] = $class;
343 343
 		}
344 344
 
345 345
 		return $steps;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 			if ( $plugin['status'] === 'active' ) {
362 362
 				continue;
363 363
 			}
364
-			$links[ $plugin_key ] = $plugin;
364
+			$links[$plugin_key] = $plugin;
365 365
 			if ( isset( $plugin['url'] ) ) {
366 366
 				$rel[] = $plugin['url'];
367 367
 			} else {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		$addons = $api->get_api_info();
477 477
 
478 478
 		$id = $this->download_id();
479
-		$has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
479
+		$has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] );
480 480
 
481 481
 		if ( ! $step['current'] ) {
482 482
 			?>
@@ -491,10 +491,10 @@  discard block
 block discarded – undo
491 491
 
492 492
 		if ( ! $has_file ) {
493 493
 			echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
494
-		} elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
494
+		} elseif ( ! isset( $addons[$id]['beta']['package'] ) ) {
495 495
 			echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
496 496
 		} else {
497
-			$xml = $addons[ $id ]['beta']['package'];
497
+			$xml = $addons[$id]['beta']['package'];
498 498
 			if ( is_array( $xml ) ) {
499 499
 				$xml = reset( $xml );
500 500
 			}
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 		foreach ( $forms as $form ) {
633 633
 			$was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
634 634
 			if ( $was_imported ) {
635
-				$imported[ $form['form'] ] = $was_imported;
635
+				$imported[$form['form']] = $was_imported;
636 636
 			}
637 637
 		}
638 638
 		
Please login to merge, or discard this patch.
classes/controllers/FrmXMLController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			return;
122 122
 		}
123 123
 
124
-		$selected_xml  = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : '';
124
+		$selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : '';
125 125
 		if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) {
126 126
 			return;
127 127
 		}
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 	 * @since 4.06.02
134 134
 	 */
135 135
 	private static function get_selected_in_form( $form, $value = 'form' ) {
136
-		if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) {
137
-			return $form[ $value ];
136
+		if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) {
137
+			return $form[$value];
138 138
 		}
139 139
 
140 140
 		return '';
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 			}
164 164
 
165 165
 			if ( $for === 'view' ) {
166
-				$item_key  = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys;
166
+				$item_key  = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys;
167 167
 				$shortcode = '[display-frm-data id=%1$s filter=limited]';
168 168
 			} elseif ( $for === 'form' ) {
169 169
 				$item_key = $form_key;
170 170
 				$shortcode = '[formidable id=%1$s]';
171 171
 			} else {
172 172
 				$item_key  = self::get_selected_in_form( $form, 'form' );
173
-				$shortcode = '[' . esc_html( $for ) .' id=%1$s]';
173
+				$shortcode = '[' . esc_html( $for ) . ' id=%1$s]';
174 174
 			}
175 175
 
176 176
 			if ( empty( $item_key ) ) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				continue;
179 179
 			}
180 180
 
181
-			$page_ids[ $for ] = wp_insert_post(
181
+			$page_ids[$for] = wp_insert_post(
182 182
 				array(
183 183
 					'post_title'   => $name,
184 184
 					'post_type'    => 'page',
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
320 320
 		$file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] );
321 321
 		$file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) );
322
-		if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
322
+		if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) {
323 323
 			// allow other file types to be imported
324 324
 			do_action( 'frm_before_import_' . $file_type );
325 325
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 		foreach ( $type as $tb_type ) {
403 403
 			$where = array();
404 404
 			$join  = '';
405
-			$table = $tables[ $tb_type ];
405
+			$table = $tables[$tb_type];
406 406
 
407 407
 			$select     = $table . '.id';
408 408
 			$query_vars = array();
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 							$table . '.parent_form_id' => $args['ids'],
418 418
 						);
419 419
 					} else {
420
-						$where[ $table . '.status !' ] = 'draft';
420
+						$where[$table . '.status !'] = 'draft';
421 421
 					}
422 422
 					break;
423 423
 				case 'actions':
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 				case 'items':
431 431
 					// $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)";
432 432
 					if ( $args['ids'] ) {
433
-						$where[ $table . '.form_id' ] = $args['ids'];
433
+						$where[$table . '.form_id'] = $args['ids'];
434 434
 					}
435 435
 					break;
436 436
 				case 'styles':
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 					}
472 472
 			}
473 473
 
474
-			$records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select );
474
+			$records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select );
475 475
 			unset( $tb_type );
476 476
 		}
477 477
 
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 		$no_export_fields = FrmField::no_save_fields();
617 617
 		foreach ( $csv_fields as $k => $f ) {
618 618
 			if ( in_array( $f->type, $no_export_fields ) ) {
619
-				unset( $csv_fields[ $k ] );
619
+				unset( $csv_fields[$k] );
620 620
 			}
621 621
 		}
622 622
 
Please login to merge, or discard this patch.
classes/views/solutions/_import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 				$info['url'] = $xml;
7 7
 			}
8 8
 
9
-			$disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : '';
9
+			$disabled = isset( $imported[$info['form']] ) ? ' disabled' : '';
10 10
 			$url   = isset( $info['url'] ) ? $info['url'] : '';
11 11
 			$value = $importing === 'form' ? $info['form'] : $info['key'];
12 12
 			if ( ! isset( $info['img'] ) ) {
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 				continue;
17 17
 			}
18 18
 
19
-			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) );
19
+			$hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) );
20 20
 			?>
21 21
 			<div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>">
22 22
 				<?php if ( $importing === 'form' ) { ?>
23 23
 					<input type="hidden" name="xml[<?php echo esc_attr( $info['form'] ); ?>]" value="<?php echo esc_attr( $url ); ?>" <?php echo esc_attr( $disabled ); ?>/>
24 24
 				<?php } ?>
25 25
 				<label>
26
-					<input type="radio" name="<?php echo esc_attr( $importing .  ( $importing === 'view' ? '[' . $info['form'] . ']' : '' ) ); ?>" value="<?php echo esc_attr( $value ); ?>"
26
+					<input type="radio" name="<?php echo esc_attr( $importing . ( $importing === 'view' ? '[' . $info['form'] . ']' : '' ) ); ?>" value="<?php echo esc_attr( $value ); ?>"
27 27
 					<?php
28 28
 					echo esc_attr( $disabled );
29 29
 					if ( ! $selected && empty( $disabled ) ) {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 					<?php } ?>
37 37
 					/>
38 38
 					<div class="frm_image_option_container frm_label_with_image">
39
-						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) );  // WPCS: XSS ok. ?>
39
+						<?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // WPCS: XSS ok. ?>
40 40
 						<span class="frm_text_label_for_image">
41 41
 							<?php
42 42
 							if ( ! empty( $disabled ) ) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 							}
50 50
 
51 51
 							if ( $importing === 'form' && $disabled ) {
52
-								echo FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] );
52
+								echo FrmFormsHelper::edit_form_link( $imported[$info['form']] );
53 53
 							} else {
54 54
 								echo esc_html( $info['name'] );
55 55
 							}
Please login to merge, or discard this patch.