Completed
Pull Request — master (#2513)
by
unknown
47s
created
classes/models/FrmYoutubeFeedApi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
 	 */
41 41
 	public function get_video( $type = 'welcome' ) {
42 42
 		$videos = $this->get_api_info();
43
-		return $videos[ $type ] ?? array();
43
+		return $videos[$type] ?? array();
44 44
 	}
45 45
 }
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1334,11 +1334,11 @@  discard block
 block discarded – undo
1334 1334
 			wp_set_script_translations( 's11-floating-links-config', 's11-' );
1335 1335
 		}
1336 1336
 
1337
-		$upgrade_utm         = array(
1337
+		$upgrade_utm = array(
1338 1338
 			'campaign' => 'floating-links',
1339 1339
 			'content'  => 'floating-links-upgrade',
1340 1340
 		);
1341
-		$docs_utm            = array(
1341
+		$docs_utm = array(
1342 1342
 			'campaign' => 'floating-links',
1343 1343
 			'content'  => 'floating-links-docs',
1344 1344
 		);
@@ -1412,15 +1412,15 @@  discard block
 block discarded – undo
1412 1412
 		global $wp_filter;
1413 1413
 
1414 1414
 		foreach ( $actions as $action ) {
1415
-			if ( empty( $wp_filter[ $action ]->callbacks ) ) {
1415
+			if ( empty( $wp_filter[$action]->callbacks ) ) {
1416 1416
 				continue;
1417 1417
 			}
1418
-			foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) {
1418
+			foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) {
1419 1419
 				foreach ( $callbacks as $callback_name => $callback ) {
1420 1420
 					if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) {
1421 1421
 						continue;
1422 1422
 					}
1423
-					unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] );
1423
+					unset( $wp_filter[$action]->callbacks[$priority][$callback_name] );
1424 1424
 				}
1425 1425
 			}
1426 1426
 		}
@@ -1458,8 +1458,8 @@  discard block
 block discarded – undo
1458 1458
 		$current_sort  = $previous_meta;
1459 1459
 		$form_id       = $is_entry_list ? FrmAppHelper::simple_get( 'form', 'absint' ) : 0;
1460 1460
 
1461
-		if ( is_array( $current_sort ) && $form_id && is_int( $form_id ) && isset( $current_sort[ $form_id ] ) ) {
1462
-			$current_sort = $current_sort[ $form_id ];
1461
+		if ( is_array( $current_sort ) && $form_id && is_int( $form_id ) && isset( $current_sort[$form_id] ) ) {
1462
+			$current_sort = $current_sort[$form_id];
1463 1463
 		}
1464 1464
 
1465 1465
 		if ( $new_sort !== $current_sort ) {
@@ -1468,7 +1468,7 @@  discard block
 block discarded – undo
1468 1468
 			if ( $is_entry_list && $form_id && is_int( $form_id ) ) {
1469 1469
 				// Index meta by form ID.
1470 1470
 				$temp_meta             = is_array( $previous_meta ) ? $previous_meta : array();
1471
-				$temp_meta[ $form_id ] = $new_meta;
1471
+				$temp_meta[$form_id] = $new_meta;
1472 1472
 				$new_meta              = $temp_meta;
1473 1473
 				unset( $temp_meta );
1474 1474
 			}
@@ -1496,8 +1496,8 @@  discard block
 block discarded – undo
1496 1496
 		$preferred_list_sort = get_user_meta( $user_id, $meta_key, true );
1497 1497
 		$form_id             = FrmAppHelper::simple_get( 'form', 'absint' );
1498 1498
 
1499
-		if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[ $form_id ] ) ) {
1500
-			$preferred_list_sort = $preferred_list_sort[ $form_id ];
1499
+		if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[$form_id] ) ) {
1500
+			$preferred_list_sort = $preferred_list_sort[$form_id];
1501 1501
 		}
1502 1502
 
1503 1503
 		if ( is_array( $preferred_list_sort ) && ! empty( $preferred_list_sort['orderby'] ) ) {
Please login to merge, or discard this patch.
classes/views/addons/min-version-notice.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,10 @@
 block discarded – undo
14 14
 		);
15 15
 		?>
16 16
 		Please <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( $utm, 'account/downloads/' ) ); ?>">renew now</a> to get the latest version.
17
-	<?php else : ?>
18
-		Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ); ?>">update now</a>.
17
+	<?php else {
18
+	: ?>
19
+		Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) );
20
+}
21
+?>">update now</a>.
19 22
 	<?php endif; ?>
20 23
 </div>
Please login to merge, or discard this patch.
classes/controllers/FrmWelcomeTourController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$active_step = 0;
119 119
 
120 120
 		foreach ( $step_keys as $index => $step_key ) {
121
-			$completed_step = isset( self::$checklist['completed_steps'][ $step_key ] );
121
+			$completed_step = isset( self::$checklist['completed_steps'][$step_key] );
122 122
 
123 123
 			if ( false === $completed_step ) {
124 124
 				switch ( $step_key ) {
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 			}
133 133
 
134 134
 			if ( $completed_step ) {
135
-				self::$checklist['completed_steps'][ $step_key ] = true;
135
+				self::$checklist['completed_steps'][$step_key] = true;
136 136
 			}
137 137
 
138 138
 			// Count completed steps from start until gap found.
139 139
 			if ( $completed_step && $index === $active_step ) {
140
-				$active_step++;
140
+				$active_step ++;
141 141
 			}
142 142
 
143
-			self::$steps['steps'][ $index ]['completed'] = $completed_step;
143
+			self::$steps['steps'][$index]['completed'] = $completed_step;
144 144
 		}//end foreach
145 145
 
146 146
 		self::$checklist['active_step'] = $active_step;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			self::$checklist['done']            = true;
150 150
 			self::$checklist['active_step_key'] = 'completed';
151 151
 		} else {
152
-			self::$checklist['active_step_key'] = $step_keys[ $active_step ];
152
+			self::$checklist['active_step_key'] = $step_keys[$active_step];
153 153
 		}
154 154
 
155 155
 		self::save_checklist();
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	private static function fill_step_completed_data( $steps, $steps_keys ) {
201 201
 		return array_map(
202
-			function ( $step, $step_key ) {
203
-				$step['completed'] = isset( self::$checklist['completed_steps'][ $step_key ] );
202
+			function( $step, $step_key ) {
203
+				$step['completed'] = isset( self::$checklist['completed_steps'][$step_key] );
204 204
 				return $step;
205 205
 			},
206 206
 			$steps,
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 					'target'        => '#frm_style_sidebar .frm-style-card > div',
235 235
 					'left-position' => 'end',
236 236
 					'offset'        => array(
237
-						'top'  => -22,
237
+						'top'  => - 22,
238 238
 						'left' => 16,
239 239
 					),
240 240
 				);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 				break;
251 251
 		}//end switch
252 252
 
253
-		return array_merge( self::$steps['steps'][ self::$checklist['active_step'] ], $spotlight_data );
253
+		return array_merge( self::$steps['steps'][self::$checklist['active_step']], $spotlight_data );
254 254
 	}
255 255
 
256 256
 	/**
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 		}
378 378
 
379 379
 		self::$checklist                                 = self::get_checklist();
380
-		self::$checklist['completed_steps'][ $step_key ] = true;
380
+		self::$checklist['completed_steps'][$step_key] = true;
381 381
 		self::save_checklist();
382 382
 
383 383
 		wp_send_json_success();
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 		$steps      = self::get_steps();
592 592
 
593 593
 		foreach ( $steps as $key => $step ) {
594
-			$usage_data[ 'completed_step_' . $key ] = empty( $option['completed_steps'][ $key ] ) ? 0 : 1;
594
+			$usage_data['completed_step_' . $key] = empty( $option['completed_steps'][$key] ) ? 0 : 1;
595 595
 		}
596 596
 
597 597
 		$usage_data['done'] = empty( $option['done'] ) ? 0 : 1;
Please login to merge, or discard this patch.
classes/views/frm-fields/front-end/combo-field/combo-field.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$sub_field_class   = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}";
42 42
 			$sub_field_desc    = FrmField::get_option( $field, $name . '_desc' );
43 43
 
44
-			if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) {
44
+			if ( isset( $errors['field' . $field_id . '-' . $name] ) ) {
45 45
 				$sub_field_class .= ' frm_blank_field';
46 46
 			}
47 47
 			?>
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
 				}
71 71
 
72 72
 				// Don't show individual field errors when there is a combo field error.
73
-				if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) {
73
+				if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) {
74 74
 					?>
75
-					<div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div>
75
+					<div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div>
76 76
 				<?php } ?>
77 77
 			</div>
78 78
 			<?php
Please login to merge, or discard this patch.
classes/models/FrmEntryMeta.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 		global $wpdb;
60 60
 
61
-		$values               = array(
61
+		$values = array(
62 62
 			'item_id'  => $entry_id,
63 63
 			'field_id' => $field_id,
64 64
 		);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				}
139 139
 			}
140 140
 
141
-			$values_indexed_by_field_id[ $field_id ] = $meta_value;
141
+			$values_indexed_by_field_id[$field_id] = $meta_value;
142 142
 
143 143
 			self::get_value_to_save( compact( 'field', 'field_id', 'entry_id' ), $meta_value );
144 144
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 				if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) {
148 148
 					// Remove blank fields.
149
-					unset( $values_indexed_by_field_id[ $field_id ] );
149
+					unset( $values_indexed_by_field_id[$field_id] );
150 150
 				} else {
151 151
 					// if value exists, then update it
152 152
 					self::update_entry_meta( $entry_id, $field_id, '', $meta_value );
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public static function get_meta_value( $entry, $field_id ) {
226 226
 		if ( isset( $entry->metas ) ) {
227
-			return $entry->metas[ $field_id ] ?? false;
227
+			return $entry->metas[$field_id] ?? false;
228 228
 		}
229 229
 		return self::get_entry_meta_by_field( $entry->id, $field_id );
230 230
 	}
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 			$cached   = FrmDb::check_cache( $entry_id, 'frm_entry' );
247 247
 		}
248 248
 
249
-		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
250
-			$result = $cached->metas[ $field_id ];
249
+		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) {
250
+			$result = $cached->metas[$field_id];
251 251
 
252 252
 			return wp_unslash( $result );
253 253
 		}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			'stripslashes' => true,
281 281
 			'is_draft'     => false,
282 282
 		);
283
-		$args     = wp_parse_args( $args, $defaults );
283
+		$args = wp_parse_args( $args, $defaults );
284 284
 
285 285
 		$query = array();
286 286
 		self::meta_field_query( $field_id, $order, $limit, $args, $query );
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 
296 296
 		foreach ( $values as $k => $v ) {
297 297
 			FrmAppHelper::unserialize_or_decode( $v );
298
-			$values[ $k ] = $v;
298
+			$values[$k] = $v;
299 299
 			unset( $k, $v );
300 300
 		}
301 301
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 
363 363
 		foreach ( $results as $k => $result ) {
364 364
 			FrmAppHelper::unserialize_or_decode( $result->meta_value );
365
-			$results[ $k ]->meta_value = wp_unslash( $result->meta_value );
365
+			$results[$k]->meta_value = wp_unslash( $result->meta_value );
366 366
 			unset( $k, $result );
367 367
 		}
368 368
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 			'user_id'  => '',
376 376
 			'group_by' => '',
377 377
 		);
378
-		$args     = wp_parse_args( $args, $defaults );
378
+		$args = wp_parse_args( $args, $defaults );
379 379
 
380 380
 		$query = array();
381 381
 		self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query );
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 			} elseif ( false !== strpos( $args['is_draft'], ',' ) ) {
479 479
 				$is_draft = array_reduce(
480 480
 					explode( ',', $args['is_draft'] ),
481
-					function ( $total, $current ) {
481
+					function( $total, $current ) {
482 482
 						if ( is_numeric( $current ) ) {
483 483
 							$total[] = absint( $current );
484 484
 						}
Please login to merge, or discard this patch.
classes/controllers/FrmFormActionsController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -133,19 +133,19 @@  discard block
 block discarded – undo
133 133
 		}
134 134
 
135 135
 		foreach ( $action_controls as $action ) {
136
-			if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) {
136
+			if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) {
137 137
 				continue;
138 138
 			}
139 139
 
140 140
 			$this_group = $action->action_options['group'];
141
-			if ( ! isset( $groups[ $this_group ] ) ) {
141
+			if ( ! isset( $groups[$this_group] ) ) {
142 142
 				$this_group = 'misc';
143 143
 			}
144 144
 
145
-			if ( ! isset( $groups[ $this_group ]['actions'] ) ) {
146
-				$groups[ $this_group ]['actions'] = array();
145
+			if ( ! isset( $groups[$this_group]['actions'] ) ) {
146
+				$groups[$this_group]['actions'] = array();
147 147
 			}
148
-			$groups[ $this_group ]['actions'][] = $action->id_base;
148
+			$groups[$this_group]['actions'][] = $action->id_base;
149 149
 
150 150
 			unset( $action );
151 151
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 				return $a;
320 320
 			}
321 321
 
322
-			$actions[ $a->id_base ] = $a;
322
+			$actions[$a->id_base] = $a;
323 323
 		}
324 324
 
325 325
 		return $actions;
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
 		$action_map = array();
359 359
 
360 360
 		foreach ( $action_controls as $key => $control ) {
361
-			$action_map[ $control->id_base ] = $key;
361
+			$action_map[$control->id_base] = $key;
362 362
 		}
363 363
 
364 364
 		self::maybe_show_limit_warning( $form->id, $form_actions );
365 365
 
366 366
 		foreach ( $form_actions as $action ) {
367
-			if ( ! isset( $action_map[ $action->post_excerpt ] ) ) {
367
+			if ( ! isset( $action_map[$action->post_excerpt] ) ) {
368 368
 				// don't try and show settings if action no longer exists
369 369
 				continue;
370 370
 			}
371 371
 
372
-			self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values );
372
+			self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values );
373 373
 		}
374 374
 	}
375 375
 
@@ -681,8 +681,8 @@  discard block
 block discarded – undo
681 681
 			}
682 682
 
683 683
 			// Store actions so they can be triggered with the correct priority.
684
-			$stored_actions[ $action->ID ]  = $action;
685
-			$action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
684
+			$stored_actions[$action->ID]  = $action;
685
+			$action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority'];
686 686
 
687 687
 			unset( $action );
688 688
 		}//end foreach
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 			new FrmNotification();
695 695
 
696 696
 			foreach ( $action_priority as $action_id => $priority ) {
697
-				$action = $stored_actions[ $action_id ];
697
+				$action = $stored_actions[$action_id];
698 698
 
699 699
 				/**
700 700
 				 * Allows custom form action trigger.
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 	 * @return void
792 792
 	 */
793 793
 	public function register( $action_class ) {
794
-		$this->actions[ $action_class ] = new $action_class();
794
+		$this->actions[$action_class] = new $action_class();
795 795
 	}
796 796
 
797 797
 	/**
@@ -800,8 +800,8 @@  discard block
 block discarded – undo
800 800
 	 * @return void
801 801
 	 */
802 802
 	public function unregister( $action_class ) {
803
-		if ( isset( $this->actions[ $action_class ] ) ) {
804
-			unset( $this->actions[ $action_class ] );
803
+		if ( isset( $this->actions[$action_class] ) ) {
804
+			unset( $this->actions[$action_class] );
805 805
 		}
806 806
 	}
807 807
 
@@ -810,8 +810,8 @@  discard block
 block discarded – undo
810 810
 
811 811
 		foreach ( $keys as $key ) {
812 812
 			// don't register new action if old action with the same id is already registered
813
-			if ( ! isset( $this->actions[ $key ] ) ) {
814
-				$this->actions[ $key ]->_register();
813
+			if ( ! isset( $this->actions[$key] ) ) {
814
+				$this->actions[$key]->_register();
815 815
 			}
816 816
 		}
817 817
 	}
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -593,7 +593,8 @@
 block discarded – undo
593 593
 	 * @return void
594 594
 	 */
595 595
 	private function is_license_revoked() {
596
-		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
596
+		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) {
597
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
597 598
 			return;
598 599
 		}
599 600
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @return array
140 140
 	 */
141 141
 	public function insert_installed_addon( $plugins ) {
142
-		$plugins[ $this->plugin_slug ] = $this;
142
+		$plugins[$this->plugin_slug] = $this;
143 143
 
144 144
 		return $plugins;
145 145
 	}
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	public static function get_addon( $plugin_slug ) {
153 153
 		$plugins = apply_filters( 'frm_installed_addons', array() );
154 154
 
155
-		return $plugins[ $plugin_slug ] ?? false;
155
+		return $plugins[$plugin_slug] ?? false;
156 156
 	}
157 157
 
158 158
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		} else {
215 215
 			$api     = new FrmFormApi( $this->license );
216 216
 			$plugins = $api->get_api_info();
217
-			$_data   = $plugins[ $item_id ];
217
+			$_data   = $plugins[$item_id];
218 218
 		}
219 219
 
220 220
 		$_data['sections'] = array(
@@ -515,19 +515,19 @@  discard block
 block discarded – undo
515 515
 
516 516
 		if ( $this->is_current_version( $transient ) ) {
517 517
 			// Make sure it doesn't show there is an update if plugin is up-to-date.
518
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
519
-				unset( $transient->response[ $this->plugin_folder ] );
518
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
519
+				unset( $transient->response[$this->plugin_folder] );
520 520
 			}
521
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
522
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
521
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
522
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
523 523
 
524 524
 			// if the transient has expired, clear the update and trigger it again
525
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
525
+			if ( $transient->response[$this->plugin_folder] === false ) {
526 526
 				if ( ! $this->has_been_cleared() ) {
527 527
 					$this->cleared_plugins();
528 528
 					$this->manually_queue_update();
529 529
 				}
530
-				unset( $transient->response[ $this->plugin_folder ] );
530
+				unset( $transient->response[$this->plugin_folder] );
531 531
 			}
532 532
 		}
533 533
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 * @return bool
641 641
 	 */
642 642
 	private function is_current_version( $transient ) {
643
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
643
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
644 644
 			return false;
645 645
 		}
646 646
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 			return true;
651 651
 		}
652 652
 
653
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
653
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
654 654
 	}
655 655
 
656 656
 	/**
@@ -818,8 +818,8 @@  discard block
 block discarded – undo
818 818
 		} else {
819 819
 			$messages = $this->get_messages();
820 820
 
821
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
822
-				$response['message'] = $messages[ $response['status'] ];
821
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
822
+				$response['message'] = $messages[$response['status']];
823 823
 			} else {
824 824
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
825 825
 			}
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 			'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
1003 1003
 		);
1004 1004
 
1005
-		$resp              = wp_remote_post(
1005
+		$resp = wp_remote_post(
1006 1006
 			$this->store_url . '?l=' . urlencode( base64_encode( $this->license ) ),
1007 1007
 			$arg_array
1008 1008
 		);
Please login to merge, or discard this patch.
classes/helpers/FrmFieldsHelper.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -231,7 +231,8 @@  discard block
 block discarded – undo
231 231
 				return false;
232 232
 			}
233 233
 
234
-			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
234
+			if ( ! $_POST || ! isset( $_POST['field_options'] ) ) {
235
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
235 236
 				return false;
236 237
 			}
237 238
 
@@ -338,7 +339,8 @@  discard block
 block discarded – undo
338 339
 	 * @return void
339 340
 	 */
340 341
 	private static function get_posted_field_setting( $setting, &$value ) {
341
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
342
+		if ( ! isset( $_POST['field_options'][ $setting ] ) ) {
343
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
342 344
 			return;
343 345
 		}
344 346
 
@@ -1531,7 +1533,8 @@  discard block
 block discarded – undo
1531 1533
 
1532 1534
 		// Check posted vals before checking saved values
1533 1535
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1534
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1536
+		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) {
1537
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1535 1538
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1536 1539
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1537 1540
 				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
@@ -1542,7 +1545,8 @@  discard block
 block discarded – undo
1542 1545
 			return $other_val;
1543 1546
 		}
1544 1547
 
1545
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1548
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) {
1549
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
1546 1550
 			// For normal fields
1547 1551
 
1548 1552
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			if ( in_array( $type, array( 'data', 'lookup' ), true ) ) {
45 45
 				$values['field_options']['data_type'] = $setting;
46 46
 			} else {
47
-				$values['field_options'][ $setting ] = 1;
47
+				$values['field_options'][$setting] = 1;
48 48
 			}
49 49
 		}
50 50
 
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 		}
210 210
 
211 211
 		foreach ( $defaults as $opt => $default ) {
212
-			$values[ $opt ] = $field->field_options[ $opt ] ?? $default;
212
+			$values[$opt] = $field->field_options[$opt] ?? $default;
213 213
 
214 214
 			if ( $check_post ) {
215
-				self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] );
215
+				self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] );
216 216
 			}
217 217
 		}
218 218
 	}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			return self::$context_is_safe_to_load_field_options_from_request_data;
230 230
 		}
231 231
 
232
-		$function = function () {
232
+		$function = function() {
233 233
 			if ( ! FrmAppHelper::is_admin_page() ) {
234 234
 				return false;
235 235
 			}
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
 	 * @return void
342 342
 	 */
343 343
 	private static function get_posted_field_setting( $setting, &$value ) {
344
-		if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
344
+		if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
345 345
 			return;
346 346
 		}
347 347
 
348 348
 		if ( strpos( $setting, 'html' ) !== false ) {
349
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
349
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
350 350
 
351 351
 			// Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML.
352 352
 			if ( ! FrmAppHelper::allow_unfiltered_html() ) {
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
 			}
355 355
 		} elseif ( strpos( $setting, 'format_' ) === 0 ) {
356 356
 			// TODO: Remove stripslashes on output, and use on input only.
357
-			$value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
357
+			$value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
358 358
 		} else {
359
-			$value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
359
+			$value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
360 360
 			FrmAppHelper::sanitize_value( 'wp_kses_post', $value );
361 361
 		}
362 362
 	}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value );
440 440
 
441 441
 		foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) {
442
-			$values[ $col ] = $field->{$col};
442
+			$values[$col] = $field->{$col};
443 443
 		}
444 444
 	}
445 445
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 		$defaults = apply_filters( 'frm_default_field_validation_messages', $defaults, $field );
486 486
 
487 487
 		$msg = FrmField::get_option( $field, $error );
488
-		$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
488
+		$msg = empty( $msg ) ? $defaults[$error]['part'] : $msg;
489 489
 		$msg = do_shortcode( $msg );
490 490
 
491 491
 		return self::maybe_replace_substrings_with_field_name( $msg, $error, $field );
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 			'inside_class' => 'inside',
813 813
 			'dismiss-icon' => true,
814 814
 		);
815
-		$args     = array_merge( $defaults, $args );
815
+		$args = array_merge( $defaults, $args );
816 816
 
817 817
 		include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php';
818 818
 	}
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 				continue;
1097 1097
 			}
1098 1098
 
1099
-			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] );
1099
+			$atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] );
1100 1100
 			$tag  = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key );
1101 1101
 
1102 1102
 			$atts['entry'] = $entry;
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 			if ( $replace_with !== null ) {
1107 1107
 				$replace_with = self::trigger_shortcode_atts( $replace_with, $atts );
1108 1108
 				self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with );
1109
-				$content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content );
1109
+				$content = str_replace( $shortcodes[0][$short_key], $replace_with, $content );
1110 1110
 			}
1111 1111
 
1112 1112
 			unset( $atts, $replace_with );
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 		$included_atts  = array_intersect( $supported_atts, array_keys( $atts ) );
1127 1127
 
1128 1128
 		foreach ( $included_atts as $included_att ) {
1129
-			if ( '0' === $atts[ $included_att ] ) {
1129
+			if ( '0' === $atts[$included_att] ) {
1130 1130
 				// Skip any option that uses 0 so sanitize_url=0 does not encode.
1131 1131
 				continue;
1132 1132
 			}
@@ -1209,8 +1209,8 @@  discard block
 block discarded – undo
1209 1209
 
1210 1210
 		$dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' );
1211 1211
 
1212
-		if ( isset( $shortcode_values[ $atts['tag'] ] ) ) {
1213
-			$replace_with = $shortcode_values[ $atts['tag'] ];
1212
+		if ( isset( $shortcode_values[$atts['tag']] ) ) {
1213
+			$replace_with = $shortcode_values[$atts['tag']];
1214 1214
 		} elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) {
1215 1215
 			$replace_with = self::dynamic_default_values( $atts['tag'], $atts );
1216 1216
 		} elseif ( $clean_tag === 'user_agent' ) {
@@ -1459,8 +1459,8 @@  discard block
 block discarded – undo
1459 1459
 			self::field_types_for_input( $single_input, $field_selection, $field_types );
1460 1460
 		} elseif ( in_array( $type, $multiple_input, true ) ) {
1461 1461
 			self::field_types_for_input( $multiple_input, $field_selection, $field_types );
1462
-		} elseif ( isset( $field_selection[ $type ] ) ) {
1463
-			$field_types[ $type ] = $field_selection[ $type ];
1462
+		} elseif ( isset( $field_selection[$type] ) ) {
1463
+			$field_types[$type] = $field_selection[$type];
1464 1464
 		}
1465 1465
 
1466 1466
 		return apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
 		foreach ( $inputs as $input ) {
1504 1504
 			// This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters.
1505 1505
 			if ( array_key_exists( $input, $fields ) ) {
1506
-				$field_types[ $input ] = $fields[ $input ];
1506
+				$field_types[$input] = $fields[$input];
1507 1507
 			}
1508 1508
 			unset( $input );
1509 1509
 		}
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 			'parent'  => false,
1539 1539
 			'pointer' => false,
1540 1540
 		);
1541
-		$args     = wp_parse_args( $args, $defaults );
1541
+		$args = wp_parse_args( $args, $defaults );
1542 1542
 
1543 1543
 		$opt_key   = $args['opt_key'];
1544 1544
 		$field     = $args['field'];
@@ -1554,25 +1554,25 @@  discard block
 block discarded – undo
1554 1554
 
1555 1555
 		// Check posted vals before checking saved values
1556 1556
 		// For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero
1557
-		if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1557
+		if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1558 1558
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1559 1559
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1560
-				$other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1560
+				$other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : '';
1561 1561
 			} else {
1562
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1562
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1563 1563
 			}
1564 1564
 
1565 1565
 			return $other_val;
1566 1566
 		}
1567 1567
 
1568
-		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1568
+		if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
1569 1569
 			// For normal fields
1570 1570
 
1571 1571
 			if ( FrmField::is_field_with_multiple_values( $field ) ) {
1572 1572
 				// phpcs:ignore WordPress.Security.NonceVerification.Missing
1573
-				$other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : '';
1573
+				$other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : '';
1574 1574
 			} else {
1575
-				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1575
+				$other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
1576 1576
 			}
1577 1577
 
1578 1578
 			return $other_val;
@@ -1582,8 +1582,8 @@  discard block
 block discarded – undo
1582 1582
 		if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) {
1583 1583
 			// Check if there is an "other" val in saved value and make sure the
1584 1584
 			// "other" val is not equal to the Other checkbox option
1585
-			if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) {
1586
-				$other_val = $field['value'][ $opt_key ];
1585
+			if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) {
1586
+				$other_val = $field['value'][$opt_key];
1587 1587
 			}
1588 1588
 		} else {
1589 1589
 			/**
@@ -1597,8 +1597,8 @@  discard block
 block discarded – undo
1597 1597
 				if ( is_array( $field['value'] ) ) {
1598 1598
 					$o_key = array_search( $temp_val, $field['value'] );
1599 1599
 
1600
-					if ( isset( $field['value'][ $o_key ] ) ) {
1601
-						unset( $field['value'][ $o_key ], $o_key );
1600
+					if ( isset( $field['value'][$o_key] ) ) {
1601
+						unset( $field['value'][$o_key], $o_key );
1602 1602
 					}
1603 1603
 				} elseif ( $temp_val == $field['value'] ) {
1604 1604
 					// For radio and regular dropdowns
@@ -1826,11 +1826,11 @@  discard block
 block discarded – undo
1826 1826
 			foreach ( $val as $k => $v ) {
1827 1827
 				if ( is_string( $v ) ) {
1828 1828
 					if ( 'custom_html' === $k ) {
1829
-						$val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1829
+						$val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v );
1830 1830
 						unset( $k, $v );
1831 1831
 						continue;
1832 1832
 					}
1833
-					$val[ $k ] = str_replace( $replace, $replace_with, $v );
1833
+					$val[$k] = str_replace( $replace, $replace_with, $v );
1834 1834
 					unset( $k, $v );
1835 1835
 				}
1836 1836
 			}
@@ -1860,8 +1860,8 @@  discard block
 block discarded – undo
1860 1860
 			if ( false === $index ) {
1861 1861
 				continue;
1862 1862
 			}
1863
-			unset( $replace[ $index ] );
1864
-			unset( $replace_with[ $index ] );
1863
+			unset( $replace[$index] );
1864
+			unset( $replace_with[$index] );
1865 1865
 		}
1866 1866
 		return str_replace( $replace, $replace_with, $value );
1867 1867
 	}
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 			$countries['class'] = 'frm-countries-opts';
2220 2220
 		}
2221 2221
 
2222
-		$prepop[ __( 'Countries', 'formidable' ) ] = $countries;
2222
+		$prepop[__( 'Countries', 'formidable' )] = $countries;
2223 2223
 
2224 2224
 		// State abv.
2225 2225
 		$states    = self::get_us_states();
@@ -2230,7 +2230,7 @@  discard block
 block discarded – undo
2230 2230
 			$state_abv['class'] = 'frm-state-abv-opts';
2231 2231
 		}
2232 2232
 
2233
-		$prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv;
2233
+		$prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv;
2234 2234
 
2235 2235
 		// States.
2236 2236
 		$states = array_values( $states );
@@ -2240,7 +2240,7 @@  discard block
 block discarded – undo
2240 2240
 			$states['class'] = 'frm-states-opts';
2241 2241
 		}
2242 2242
 
2243
-		$prepop[ __( 'U.S. States', 'formidable' ) ] = $states;
2243
+		$prepop[__( 'U.S. States', 'formidable' )] = $states;
2244 2244
 		unset( $state_abv, $states );
2245 2245
 
2246 2246
 		// Age.
@@ -2259,7 +2259,7 @@  discard block
 block discarded – undo
2259 2259
 			$ages['class'] = 'frm-age-opts';
2260 2260
 		}
2261 2261
 
2262
-		$prepop[ __( 'Age', 'formidable' ) ] = $ages;
2262
+		$prepop[__( 'Age', 'formidable' )] = $ages;
2263 2263
 
2264 2264
 		// Satisfaction.
2265 2265
 		$satisfaction = array(
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
 			$satisfaction['class'] = 'frm-satisfaction-opts';
2276 2276
 		}
2277 2277
 
2278
-		$prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction;
2278
+		$prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction;
2279 2279
 
2280 2280
 		// Importance.
2281 2281
 		$importance = array(
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
 			$importance['class'] = 'frm-importance-opts';
2292 2292
 		}
2293 2293
 
2294
-		$prepop[ __( 'Importance', 'formidable' ) ] = $importance;
2294
+		$prepop[__( 'Importance', 'formidable' )] = $importance;
2295 2295
 
2296 2296
 		// Agreement.
2297 2297
 		$agreement = array(
@@ -2307,7 +2307,7 @@  discard block
 block discarded – undo
2307 2307
 			$agreement['class'] = 'frm-agreement-opts';
2308 2308
 		}
2309 2309
 
2310
-		$prepop[ __( 'Agreement', 'formidable' ) ] = $agreement;
2310
+		$prepop[__( 'Agreement', 'formidable' )] = $agreement;
2311 2311
 
2312 2312
 		// Likely.
2313 2313
 		$likely = array(
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
 			$likely['class'] = 'frm-likely-opts';
2324 2324
 		}
2325 2325
 
2326
-		$prepop[ __( 'Likely', 'formidable' ) ] = $likely;
2326
+		$prepop[__( 'Likely', 'formidable' )] = $likely;
2327 2327
 
2328 2328
 		$prepop = apply_filters( 'frm_bulk_field_choices', $prepop );
2329 2329
 	}
@@ -2573,17 +2573,17 @@  discard block
 block discarded – undo
2573 2573
 	 */
2574 2574
 	private static function fill_image_setting_options( $options, &$args ) {
2575 2575
 		foreach ( $options as $key => $option ) {
2576
-			$args['options'][ $key ] = $option;
2576
+			$args['options'][$key] = $option;
2577 2577
 
2578 2578
 			if ( ! empty( $option['addon'] ) ) {
2579
-				$args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2579
+				$args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option );
2580 2580
 			}
2581 2581
 
2582
-			unset( $args['options'][ $key ]['addon'] );
2582
+			unset( $args['options'][$key]['addon'] );
2583 2583
 			$fill = array( 'upgrade', 'message', 'content' );
2584 2584
 
2585 2585
 			foreach ( $fill as $f ) {
2586
-				unset( $args['options'][ $key ][ $f ], $f );
2586
+				unset( $args['options'][$key][$f], $f );
2587 2587
 			}
2588 2588
 		}
2589 2589
 	}
@@ -2607,8 +2607,8 @@  discard block
 block discarded – undo
2607 2607
 		$fill = array( 'upgrade', 'message', 'content' );
2608 2608
 
2609 2609
 		foreach ( $fill as $f ) {
2610
-			if ( isset( $option[ $f ] ) ) {
2611
-				$custom_attrs[ 'data-' . $f ] = $option[ $f ];
2610
+			if ( isset( $option[$f] ) ) {
2611
+				$custom_attrs['data-' . $f] = $option[$f];
2612 2612
 			}
2613 2613
 		}
2614 2614
 
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
 
2674 2674
 		return array_filter(
2675 2675
 			$rows,
2676
-			function ( $row ) {
2676
+			function( $row ) {
2677 2677
 				FrmAppHelper::unserialize_or_decode( $row->field_options );
2678 2678
 				return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] );
2679 2679
 			}
@@ -2743,7 +2743,7 @@  discard block
 block discarded – undo
2743 2743
 			unset( $data['plugin-status'] );
2744 2744
 
2745 2745
 			foreach ( $data as $key => $value ) {
2746
-				$attributes[ 'data-' . $key ] = $value;
2746
+				$attributes['data-' . $key] = $value;
2747 2747
 			}
2748 2748
 		}
2749 2749
 
Please login to merge, or discard this patch.