Completed
Pull Request — master (#2579)
by
unknown
41s
created
classes/helpers/FrmHtmlHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		wp_enqueue_script( 'formidable_settings' );
29 29
 		return FrmAppHelper::clip(
30 30
 			// @phpstan-ignore-next-line
31
-			function () use ( $id, $name, $args ) {
31
+			function() use ( $id, $name, $args ) {
32 32
 				require FrmAppHelper::plugin_path() . '/classes/views/shared/toggle.php';
33 33
 			},
34 34
 			$args['echo'] ?? false
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			}
98 98
 		}
99 99
 
100
-		$input_number_attrs          = array_merge(
100
+		$input_number_attrs = array_merge(
101 101
 			$args['input_number_attrs'],
102 102
 			array(
103 103
 				'type'  => ! empty( $selected_unit ) ? 'number' : 'text',
Please login to merge, or discard this patch.
classes/helpers/FrmOnSubmitHelper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -219,17 +219,17 @@  discard block
 block discarded – undo
219 219
 	public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) {
220 220
 		$opt = 'update' === $event ? 'edit_' : 'success_';
221 221
 		if ( ! $action || ! is_object( $action ) ) {
222
-			$form_options[ $opt . 'action' ] = self::get_default_action_type();
223
-			$form_options[ $opt . 'msg' ]    = self::get_default_msg();
222
+			$form_options[$opt . 'action'] = self::get_default_action_type();
223
+			$form_options[$opt . 'msg']    = self::get_default_msg();
224 224
 
225 225
 			return;
226 226
 		}
227 227
 
228
-		$form_options[ $opt . 'action' ] = $action->post_content['success_action'] ?? 'message';
228
+		$form_options[$opt . 'action'] = $action->post_content['success_action'] ?? 'message';
229 229
 
230
-		switch ( $form_options[ $opt . 'action' ] ) {
230
+		switch ( $form_options[$opt . 'action'] ) {
231 231
 			case 'redirect':
232
-				$form_options[ $opt . 'url' ]        = $action->post_content['success_url'] ?? '';
232
+				$form_options[$opt . 'url']        = $action->post_content['success_url'] ?? '';
233 233
 				$form_options['open_in_new_tab']     = ! empty( $action->post_content['open_in_new_tab'] );
234 234
 				$form_options['redirect_delay']      = ! empty( $action->post_content['redirect_delay'] );
235 235
 				$form_options['redirect_delay_time'] = $action->post_content['redirect_delay_time'];
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 				break;
238 238
 
239 239
 			case 'page':
240
-				$form_options[ $opt . 'page_id' ] = $action->post_content['success_page_id'] ?? '';
240
+				$form_options[$opt . 'page_id'] = $action->post_content['success_page_id'] ?? '';
241 241
 				break;
242 242
 
243 243
 			default:
244
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
244
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
245 245
 				$form_options['show_form']    = ! empty( $action->post_content['show_form'] );
246 246
 		}
247 247
 	}
@@ -330,20 +330,20 @@  discard block
 block discarded – undo
330 330
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
331 331
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
332 332
 		$data = array(
333
-			'success_action' => $form_options[ $opt . 'action' ] ?? self::get_default_action_type(),
333
+			'success_action' => $form_options[$opt . 'action'] ?? self::get_default_action_type(),
334 334
 		);
335 335
 
336 336
 		switch ( $data['success_action'] ) {
337 337
 			case 'redirect':
338
-				$data['success_url'] = $form_options[ $opt . 'url' ] ?? '';
338
+				$data['success_url'] = $form_options[$opt . 'url'] ?? '';
339 339
 				break;
340 340
 
341 341
 			case 'page':
342
-				$data['success_page_id'] = $form_options[ $opt . 'page_id' ] ?? '';
342
+				$data['success_page_id'] = $form_options[$opt . 'page_id'] ?? '';
343 343
 				break;
344 344
 
345 345
 			default:
346
-				$data['success_msg'] = $form_options[ $opt . 'msg' ] ?? self::get_default_msg();
346
+				$data['success_msg'] = $form_options[$opt . 'msg'] ?? self::get_default_msg();
347 347
 				$data['show_form']   = ! empty( $form_options['show_form'] );
348 348
 		}
349 349
 
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 			'class'        => '',
38 38
 			'inc_children' => 'exclude',
39 39
 		);
40
-		$args     = wp_parse_args( $args, $defaults );
40
+		$args = wp_parse_args( $args, $defaults );
41 41
 
42 42
 		if ( ! $args['field_id'] ) {
43 43
 			$args['field_id'] = $field_name;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public static function add_html_attr( $class, $param, &$add_html ) {
80 80
 		if ( ! empty( $class ) ) {
81
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
81
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
82 82
 		}
83 83
 	}
84 84
 
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
 			'description' => '',
323 323
 		);
324 324
 		foreach ( $defaults as $var => $default ) {
325
-			if ( ! isset( $values[ $var ] ) ) {
326
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
325
+			if ( ! isset( $values[$var] ) ) {
326
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
327 327
 			}
328 328
 		}
329 329
 
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 			'parent_form_id' => 0,
339 339
 		);
340 340
 		foreach ( $defaults as $var => $default ) {
341
-			if ( ! isset( $values[ $var ] ) ) {
342
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
341
+			if ( ! isset( $values[$var] ) ) {
342
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
343 343
 			}
344 344
 		}
345 345
 		unset( $defaults );
@@ -376,16 +376,16 @@  discard block
 block discarded – undo
376 376
 		$defaults = self::get_default_opts();
377 377
 		foreach ( $defaults as $var => $default ) {
378 378
 			if ( is_array( $default ) ) {
379
-				if ( ! isset( $values[ $var ] ) ) {
380
-					$values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array();
379
+				if ( ! isset( $values[$var] ) ) {
380
+					$values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array();
381 381
 				}
382 382
 
383 383
 				foreach ( $default as $k => $v ) {
384
-					$values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v );
384
+					$values[$var][$k] = $post_values && isset( $post_values[$var][$k] ) ? $post_values[$var][$k] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ? $record->options[$var][$k] : $v );
385 385
 
386 386
 					if ( is_array( $v ) ) {
387 387
 						foreach ( $v as $k1 => $v1 ) {
388
-							$values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
388
+							$values[$var][$k][$k1] = $post_values && isset( $post_values[$var][$k][$k1] ) ? $post_values[$var][$k][$k1] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ? $record->options[$var][$k][$k1] : $v1 );
389 389
 							unset( $k1, $v1 );
390 390
 						}
391 391
 					}
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 					unset( $k, $v );
394 394
 				}
395 395
 			} else {
396
-				$values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default );
396
+				$values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default );
397 397
 			}
398 398
 
399 399
 			unset( $var, $default );
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 	public static function fill_form_options( &$options, $values ) {
439 439
 		$defaults = self::get_default_opts();
440 440
 		foreach ( $defaults as $var => $default ) {
441
-			$options[ $var ] = $values['options'][ $var ] ?? $default;
441
+			$options[$var] = $values['options'][$var] ?? $default;
442 442
 			unset( $var, $default );
443 443
 		}
444 444
 	}
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 	public static function insert_opt_html( $args ) {
616 616
 		$class  = $args['class'] ?? '';
617 617
 		$fields = self::get_field_type_data_for_insert_opt_html();
618
-		$field  = $fields[ $args['type'] ] ?? array();
618
+		$field  = $fields[$args['type']] ?? array();
619 619
 
620 620
 		self::prepare_field_type( $field );
621 621
 
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 		$last_field         = false;
748 748
 		foreach ( $fields as $field ) {
749 749
 			if ( $prev_order === $field->field_order ) {
750
-				++$add_order;
750
+				++ $add_order;
751 751
 			}
752 752
 
753 753
 			if ( $add_order ) {
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1222 1222
 			}
1223 1223
 
1224
-			$label = ( $link_details[ $length ] ?? $link_details['label'] );
1225
-			if ( $length === 'icon' && isset( $link_details[ $length ] ) ) {
1224
+			$label = ( $link_details[$length] ?? $link_details['label'] );
1225
+			if ( $length === 'icon' && isset( $link_details[$length] ) ) {
1226 1226
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1227 1227
 				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1228 1228
 			}
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 			$status = 'publish';
1370 1370
 		}
1371 1371
 
1372
-		$name = $nice_names[ $status ];
1372
+		$name = $nice_names[$status];
1373 1373
 
1374 1374
 		return $name;
1375 1375
 	}
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
 		$icon = $icons[''];
1434 1434
 		if ( count( $categories ) === 1 ) {
1435 1435
 			$category = reset( $categories );
1436
-			$icon     = $icons[ $category ] ?? $icon;
1436
+			$icon     = $icons[$category] ?? $icon;
1437 1437
 		} elseif ( ! empty( $categories ) ) {
1438 1438
 			$icons = array_intersect_key( $icons, array_flip( $categories ) );
1439 1439
 			$icon  = reset( $icons );
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 
1556 1556
 		foreach ( $item['categories'] as $k => $category ) {
1557 1557
 			if ( in_array( $category, $plans, true ) ) {
1558
-				unset( $item['categories'][ $k ] );
1558
+				unset( $item['categories'][$k] );
1559 1559
 
1560 1560
 				$category = self::convert_legacy_package_names( $category );
1561 1561
 
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
 			'include_all' => true,
1595 1595
 			'case_lower'  => false,
1596 1596
 		);
1597
-		$args     = wp_parse_args( $args, $defaults );
1597
+		$args = wp_parse_args( $args, $defaults );
1598 1598
 
1599 1599
 		$license_types = array( 'Basic', 'Plus', 'Business', 'Elite' );
1600 1600
 
@@ -1797,9 +1797,9 @@  discard block
 block discarded – undo
1797 1797
 		}
1798 1798
 
1799 1799
 		foreach ( $shortcodes[0] as $key => $shortcode ) {
1800
-			$options = trim( $shortcodes[3][ $key ] );
1800
+			$options = trim( $shortcodes[3][$key] );
1801 1801
 
1802
-			if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1802
+			if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) {
1803 1803
 				// Skip if shortcodes.
1804 1804
 				continue;
1805 1805
 			}
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 				continue;
1810 1810
 			}
1811 1811
 
1812
-			$new_shortcode = '[' . $shortcodes[2][ $key ];
1812
+			$new_shortcode = '[' . $shortcodes[2][$key];
1813 1813
 			if ( $options ) {
1814 1814
 				$new_shortcode .= ' ' . $options;
1815 1815
 			}
Please login to merge, or discard this patch.
classes/helpers/FrmSubmitHelper.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
 	public static function get_current_action_from_global_var( $form_id ) {
86 86
 		global $frm_vars;
87 87
 
88
-		return $frm_vars['form_params'][ $form_id ]['action'] ?? 'create';
88
+		return $frm_vars['form_params'][$form_id]['action'] ?? 'create';
89 89
 	}
90 90
 
91 91
 	/**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	public static function remove_submit_field_from_list( &$fields ) {
178 178
 		foreach ( $fields as $key => $field ) {
179 179
 			if ( self::FIELD_TYPE === FrmField::get_field_type( $field ) ) {
180
-				unset( $fields[ $key ] );
180
+				unset( $fields[$key] );
181 181
 				return;
182 182
 			}
183 183
 		}
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 				array( 'field_order' => $new_order )
225 225
 			);
226 226
 			if ( false !== $updated ) {
227
-				self::$last_row_fields_order[ $last_row_field_id ] = $new_order;
227
+				self::$last_row_fields_order[$last_row_field_id] = $new_order;
228 228
 			}
229 229
 		}
230 230
 	}
Please login to merge, or discard this patch.
classes/models/FrmSalesApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 		$cross_sell_links = $data['cross_sell_link'];
113 113
 		$index            = self::determine_cross_sell_index( $cross_sell_text );
114 114
 
115
-		self::$cross_sell_text = sanitize_text_field( $cross_sell_text[ $index ] );
116
-		self::$cross_sell_link = esc_url_raw( $cross_sell_links[ $index ] );
115
+		self::$cross_sell_text = sanitize_text_field( $cross_sell_text[$index] );
116
+		self::$cross_sell_link = esc_url_raw( $cross_sell_links[$index] );
117 117
 	}
118 118
 
119 119
 	/**
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 
160 160
 		foreach ( $cross_sell_text as $index => $current_text ) {
161
-			if ( ! isset( $cross_sell_settings[ $current_text ] ) ) {
162
-				$cross_sell_settings[ $current_text ] = time();
161
+			if ( ! isset( $cross_sell_settings[$current_text] ) ) {
162
+				$cross_sell_settings[$current_text] = time();
163 163
 				update_option( $option_name, $cross_sell_settings );
164 164
 				return $index;
165 165
 			}
166 166
 
167
-			$time_elapsed = time() - $cross_sell_settings[ $current_text ];
167
+			$time_elapsed = time() - $cross_sell_settings[$current_text];
168 168
 			if ( $time_elapsed < DAY_IN_SECONDS * 30 ) {
169 169
 				return $index;
170 170
 			}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 			return;
198 198
 		}
199 199
 
200
-		self::$sales[ $sale['key'] ] = $this->fill_sale( $sale );
200
+		self::$sales[$sale['key']] = $this->fill_sale( $sale );
201 201
 	}
202 202
 
203 203
 	/**
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 		$sale = self::$instance->get_best_sale();
306 306
 
307
-		return is_array( $sale ) && ! empty( $sale[ $key ] ) ? $sale[ $key ] : false;
307
+		return is_array( $sale ) && ! empty( $sale[$key] ) ? $sale[$key] : false;
308 308
 	}
309 309
 
310 310
 	/**
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
 			esc_html( self::$cross_sell_text ),
502 502
 			'activate_plugins',
503 503
 			'frm-sales-api-cross-sell',
504
-			function () {
504
+			function() {
505 505
 				// There is no page. The redirect logic is handled below, before this callback is triggered.
506 506
 			}
507 507
 		);
508 508
 
509 509
 		add_action(
510 510
 			'admin_init',
511
-			function () {
511
+			function() {
512 512
 				if ( ! current_user_can( 'activate_plugins' ) ) {
513 513
 					return;
514 514
 				}
Please login to merge, or discard this patch.
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +26 added lines, -28 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 				'<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>',
117 117
 				'frm_view_forms',
118 118
 				'formidable-pro-upgrade',
119
-				function () {
119
+				function() {
120 120
 					// This function doesn't need to do anything.
121 121
 					// The redirect is handled earlier to avoid issues with the headers being sent.
122 122
 				}
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			unset( $addons['error'] );
148 148
 		}
149 149
 
150
-		$pro    = array(
150
+		$pro = array(
151 151
 			'pro' => array(
152 152
 				'title'      => 'Formidable Forms Pro',
153 153
 				'slug'       => 'formidable-pro',
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 
190 190
 		// Extract the elements to move
191 191
 		foreach ( $plans as $plan ) {
192
-			if ( isset( self::$categories[ $plan ] ) ) {
193
-				$bottom_categories[ $plan ] = self::$categories[ $plan ];
194
-				unset( self::$categories[ $plan ] );
192
+			if ( isset( self::$categories[$plan] ) ) {
193
+				$bottom_categories[$plan] = self::$categories[$plan];
194
+				unset( self::$categories[$plan] );
195 195
 			}
196 196
 		}
197 197
 
@@ -245,14 +245,12 @@  discard block
 block discarded – undo
245 245
 			// Add the slug to the new array.
246 246
 			$addon['category-slugs'][] = $category_slug;
247 247
 
248
-			if ( ! isset( self::$categories[ $category_slug ] ) ) {
249
-				self::$categories[ $category_slug ] = array(
248
+			if ( ! isset( self::$categories[$category_slug] ) ) {
249
+				self::$categories[$category_slug] = array(
250 250
 					'name'  => $category,
251 251
 					'count' => 0,
252 252
 				);
253
-			}
254
-
255
-			++self::$categories[ $category_slug ]['count'];
253
+			} ++self::$categories[$category_slug]['count'];
256 254
 		}
257 255
 	}
258 256
 
@@ -284,7 +282,7 @@  discard block
 block discarded – undo
284 282
 		} else {
285 283
 			foreach ( $addons as $k => $addon ) {
286 284
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
287
-					unset( $addons[ $k ] );
285
+					unset( $addons[$k] );
288 286
 				}
289 287
 			}
290 288
 		}
@@ -398,7 +396,7 @@  discard block
 block discarded – undo
398 396
 
399 397
 		foreach ( $list as $k => $info ) {
400 398
 			$info['slug'] = $k;
401
-			$list[ $k ]   = array_merge( $defaults, $info );
399
+			$list[$k]   = array_merge( $defaults, $info );
402 400
 		}
403 401
 		return $list;
404 402
 	}
@@ -549,17 +547,17 @@  discard block
 block discarded – undo
549 547
 				continue;
550 548
 			}
551 549
 
552
-			$wp_plugin    = $wp_plugins[ $folder ] ?? array();
550
+			$wp_plugin    = $wp_plugins[$folder] ?? array();
553 551
 			$wp_version   = $wp_plugin['Version'] ?? '1.0';
554 552
 			$plugin->slug = explode( '/', $folder )[0];
555 553
 
556 554
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
557
-				$transient->response[ $folder ] = $plugin;
555
+				$transient->response[$folder] = $plugin;
558 556
 			} else {
559
-				$transient->no_update[ $folder ] = $plugin;
557
+				$transient->no_update[$folder] = $plugin;
560 558
 			}
561 559
 
562
-			$transient->checked[ $folder ] = $wp_version;
560
+			$transient->checked[$folder] = $wp_version;
563 561
 
564 562
 		}//end foreach
565 563
 
@@ -592,7 +590,7 @@  discard block
 block discarded – undo
592 590
 	 */
593 591
 	protected static function is_installed( $plugin ) {
594 592
 		$all_plugins = self::get_plugins();
595
-		return isset( $all_plugins[ $plugin ] );
593
+		return isset( $all_plugins[$plugin] );
596 594
 	}
597 595
 
598 596
 	/**
@@ -631,13 +629,13 @@  discard block
 block discarded – undo
631 629
 			}
632 630
 
633 631
 			$download_id = $plugin['id'] ?? 0;
634
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
632
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
635 633
 				// if this addon is using its own license, get the update url
636 634
 				$addon_info = $api->get_api_info();
637 635
 
638
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
636
+				$version_info[$download_id] = $addon_info[$download_id];
639 637
 				if ( isset( $addon_info['error'] ) ) {
640
-					$version_info[ $download_id ]['error'] = array(
638
+					$version_info[$download_id]['error'] = array(
641 639
 						'message' => $addon_info['error']['message'],
642 640
 						'code'    => $addon_info['error']['code'],
643 641
 					);
@@ -736,8 +734,8 @@  discard block
 block discarded – undo
736 734
 					return $addon;
737 735
 				}
738 736
 			}
739
-		} elseif ( isset( $addons[ $download_id ] ) ) {
740
-			$plugin = $addons[ $download_id ];
737
+		} elseif ( isset( $addons[$download_id] ) ) {
738
+			$plugin = $addons[$download_id];
741 739
 		}
742 740
 
743 741
 		return $plugin;
@@ -803,7 +801,7 @@  discard block
 block discarded – undo
803 801
 			self::set_addon_status( $addon );
804 802
 			self::set_categories( $addon );
805 803
 
806
-			$addons[ $id ] = $addon;
804
+			$addons[$id] = $addon;
807 805
 		}//end foreach
808 806
 	}
809 807
 
@@ -838,7 +836,7 @@  discard block
 block discarded – undo
838 836
 		if ( strpos( $link, 'http' ) !== 0 ) {
839 837
 			$link = $site_url . $link;
840 838
 		}
841
-		$link       = FrmAppHelper::make_affiliate_url( $link );
839
+		$link = FrmAppHelper::make_affiliate_url( $link );
842 840
 
843 841
 		$utm  = array(
844 842
 			'campaign' => 'addons',
@@ -1061,7 +1059,7 @@  discard block
 block discarded – undo
1061 1059
 	 */
1062 1060
 	public static function ajax_activate_addon() {
1063 1061
 		self::process_addon_action(
1064
-			function ( $plugin ) {
1062
+			function( $plugin ) {
1065 1063
 				return self::handle_addon_action( $plugin, 'activate' );
1066 1064
 			},
1067 1065
 			array( 'FrmAddonsController', 'get_addon_activation_response' )
@@ -1086,7 +1084,7 @@  discard block
 block discarded – undo
1086 1084
 	 */
1087 1085
 	public static function ajax_deactivate_addon() {
1088 1086
 		self::process_addon_action(
1089
-			function ( $plugin ) {
1087
+			function( $plugin ) {
1090 1088
 				return self::handle_addon_action( $plugin, 'deactivate' );
1091 1089
 			}
1092 1090
 		);
@@ -1101,7 +1099,7 @@  discard block
 block discarded – undo
1101 1099
 	 */
1102 1100
 	public static function ajax_uninstall_addon() {
1103 1101
 		self::process_addon_action(
1104
-			function ( $plugin ) {
1102
+			function( $plugin ) {
1105 1103
 				return self::handle_addon_action( $plugin, 'uninstall' );
1106 1104
 			}
1107 1105
 		);
@@ -1499,7 +1497,7 @@  discard block
 block discarded – undo
1499 1497
 		$addons = $api->get_api_info();
1500 1498
 
1501 1499
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1502
-			$dates    = $addons[ $addon_id ];
1500
+			$dates    = $addons[$addon_id];
1503 1501
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1504 1502
 		}
1505 1503
 
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.