Completed
Push — master ( 5c7440...6c429e )
by
unknown
18s
created
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.