Completed
Pull Request — master (#2216)
by
unknown
37s
created
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 isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false;
227
+			return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false;
228 228
 		}
229 229
 		return self::get_entry_meta_by_field( $entry->id, $field_id );
230 230
 	}
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 			$cached   = FrmDb::check_cache( $entry_id, 'frm_entry' );
242 242
 		}
243 243
 
244
-		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
245
-			$result = $cached->metas[ $field_id ];
244
+		if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) {
245
+			$result = $cached->metas[$field_id];
246 246
 
247 247
 			return wp_unslash( $result );
248 248
 		}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			'stripslashes' => true,
274 274
 			'is_draft'     => false,
275 275
 		);
276
-		$args     = wp_parse_args( $args, $defaults );
276
+		$args = wp_parse_args( $args, $defaults );
277 277
 
278 278
 		$query = array();
279 279
 		self::meta_field_query( $field_id, $order, $limit, $args, $query );
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
 		foreach ( $values as $k => $v ) {
290 290
 			FrmAppHelper::unserialize_or_decode( $v );
291
-			$values[ $k ] = $v;
291
+			$values[$k] = $v;
292 292
 			unset( $k, $v );
293 293
 		}
294 294
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 
356 356
 		foreach ( $results as $k => $result ) {
357 357
 			FrmAppHelper::unserialize_or_decode( $result->meta_value );
358
-			$results[ $k ]->meta_value = wp_unslash( $result->meta_value );
358
+			$results[$k]->meta_value = wp_unslash( $result->meta_value );
359 359
 			unset( $k, $result );
360 360
 		}
361 361
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 			'user_id'  => '',
369 369
 			'group_by' => '',
370 370
 		);
371
-		$args     = wp_parse_args( $args, $defaults );
371
+		$args = wp_parse_args( $args, $defaults );
372 372
 
373 373
 		$query = array();
374 374
 		self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query );
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 			} elseif ( false !== strpos( $args['is_draft'], ',' ) ) {
436 436
 				$is_draft = array_reduce(
437 437
 					explode( ',', $args['is_draft'] ),
438
-					function ( $total, $current ) {
438
+					function( $total, $current ) {
439 439
 						if ( is_numeric( $current ) ) {
440 440
 							$total[] = absint( $current );
441 441
 						}
Please login to merge, or discard this patch.
classes/views/styles/components/templates/slider.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,10 +137,13 @@  discard block
 block discarded – undo
137 137
 		</div>
138 138
 		<input type="hidden" <?php echo esc_attr( $field_name ); ?> value="<?php echo esc_attr( $field_value ); ?>" id="<?php echo esc_attr( $component['id'] ); ?>" />
139 139
 	</div>
140
-<?php else : ?>
140
+<?php else {
141
+	: ?>
141 142
 	<div>
142 143
 		<?php if ( empty( $component['independent_fields'] ) ) : ?>
143
-			<div class="frm-slider-component <?php echo esc_attr( $component_class ); ?>" <?php echo esc_attr( $component_attr ); ?> data-display-sliders="top,bottom" data-type="vertical" data-max-value="<?php echo (int) $component['max_value']; ?>">
144
+			<div class="frm-slider-component <?php echo esc_attr( $component_class );
145
+}
146
+?>" <?php echo esc_attr( $component_attr ); ?> data-display-sliders="top,bottom" data-type="vertical" data-max-value="<?php echo (int) $component['max_value']; ?>">
144 147
 				<div class="frm-flex-justify">
145 148
 					<div class="frm-slider-container">
146 149
 						<?php if ( ! empty( $component['icon'] ) ) : ?>
@@ -165,8 +168,11 @@  discard block
 block discarded – undo
165 168
 					</div>
166 169
 				</div>
167 170
 			</div>
168
-		<?php else : ?>
169
-			<div class="<?php echo esc_attr( $component_class ); ?>" <?php echo esc_attr( $component_attr ); ?> >
171
+		<?php else {
172
+	: ?>
173
+			<div class="<?php echo esc_attr( $component_class );
174
+}
175
+?>" <?php echo esc_attr( $component_attr ); ?> >
170 176
 				<div class="frm-slider-component frm-group-sliders frm-has-independent-fields" data-display-sliders="top,bottom" data-max-value="<?php echo (int) $component['max_value']; ?>">
171 177
 					<div class="frm-flex-justify">
172 178
 						<div class="frm-slider-container">
Please login to merge, or discard this patch.
stripe/models/FrmTransLiteAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
 				$has_field  = true;
182 182
 				$key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content );
183 183
 				?>
184
-				<option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>>
184
+				<option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>>
185 185
 					<?php
186 186
 					echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) );
187 187
 
Please login to merge, or discard this patch.
classes/controllers/FrmAppController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1340,15 +1340,15 @@
 block discarded – undo
1340 1340
 		global $wp_filter;
1341 1341
 
1342 1342
 		foreach ( $actions as $action ) {
1343
-			if ( empty( $wp_filter[ $action ]->callbacks ) ) {
1343
+			if ( empty( $wp_filter[$action]->callbacks ) ) {
1344 1344
 				continue;
1345 1345
 			}
1346
-			foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) {
1346
+			foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) {
1347 1347
 				foreach ( $callbacks as $callback_name => $callback ) {
1348 1348
 					if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) {
1349 1349
 						continue;
1350 1350
 					}
1351
-					unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] );
1351
+					unset( $wp_filter[$action]->callbacks[$priority][$callback_name] );
1352 1352
 				}
1353 1353
 			}
1354 1354
 		}
Please login to merge, or discard this patch.
classes/views/frm-settings/license_box.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
6
-$button_upgrade_link      = FrmAppHelper::admin_upgrade_link(
6
+$button_upgrade_link = FrmAppHelper::admin_upgrade_link(
7 7
 	array(
8 8
 		'medium'  => 'settings-license',
9 9
 		'content' => 'global-settings-license-box-get-formidable-button',
Please login to merge, or discard this patch.
stripe/helpers/FrmTransLiteListHelper.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			'payments'      => $frm_payment->get_count(),
124 124
 			'subscriptions' => $frm_sub->get_count(),
125 125
 		);
126
-		$type        = FrmAppHelper::get_simple_request(
126
+		$type = FrmAppHelper::get_simple_request(
127 127
 			array(
128 128
 				'param'   => 'trans_type',
129 129
 				'type'    => 'request',
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 				$class = '';
139 139
 			}
140 140
 
141
-			if ( $counts[ $status ] || 'published' === $status ) {
142
-				$links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>'
141
+			if ( $counts[$status] || 'published' === $status ) {
142
+				$links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>'
143 143
 					// translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %4$s: Span close tag.
144
-					. sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' )
144
+					. sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' )
145 145
 					. '</a>';
146 146
 			}
147 147
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 			echo '<tr id="payment-' . esc_attr( $item->id ) . '" ';
219 219
 
220 220
 			$is_alternate = 0 === $alt % 2;
221
-			++$alt;
221
+			++ $alt;
222 222
 
223 223
 			if ( $is_alternate ) {
224 224
 				echo 'class="alternate"';
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 		$form_ids = array();
311 311
 		foreach ( $forms as $form ) {
312
-			$form_ids[ $form->id ] = $form;
312
+			$form_ids[$form->id] = $form;
313 313
 			unset( $form );
314 314
 		}
315 315
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 			'href'  => esc_url( $link ),
361 361
 			'title' => __( 'View', 'formidable' ),
362 362
 		);
363
-		$link        = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>'
363
+		$link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>'
364 364
 			. $item->{$field}
365 365
 			. '</a>';
366 366
 
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	 * @return mixed
416 416
 	 */
417 417
 	private function get_form_id_column( $item, $atts ) {
418
-		if ( isset( $atts['form_ids'][ $item->item_id ] ) ) {
419
-			$form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id );
418
+		if ( isset( $atts['form_ids'][$item->item_id] ) ) {
419
+			$form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id );
420 420
 			return $form_link;
421 421
 		}
422 422
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 	 */
492 492
 	private function get_processing_tooltip() {
493 493
 		return FrmAppHelper::clip(
494
-			function () {
494
+			function() {
495 495
 				FrmAppHelper::tooltip_icon( __( 'This payment method may take between 4-5 business days to process.', 'formidable' ) );
496 496
 			}
497 497
 		);
Please login to merge, or discard this patch.
classes/controllers/FrmStylesController.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			/**
155 155
 			 * Update the form data on the "Manage Styles" tab after global settings are saved.
156 156
 			 */
157
-			function () {
157
+			function() {
158 158
 				self::manage_styles();
159 159
 			}
160 160
 		);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 		$style_id = self::get_style_id_for_styler();
327 327
 		if ( ! $style_id ) {
328
-			$error_args   = array(
328
+			$error_args = array(
329 329
 				'title'      => __( 'No styles', 'formidable' ),
330 330
 				'body'       => __( 'You must have a style to use the Visual Styler.', 'formidable' ),
331 331
 				'cancel_url' => admin_url( 'admin.php?page=formidable' ),
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 		$form = FrmForm::getOne( $form_id );
343 343
 
344 344
 		if ( ! is_object( $form ) ) {
345
-			$error_args   = array(
345
+			$error_args = array(
346 346
 				'title'      => __( 'No forms', 'formidable' ),
347 347
 				'body'       => __( 'You must have a form to use the Visual Styler.', 'formidable' ),
348 348
 				'cancel_url' => admin_url( 'admin.php?page=formidable' ),
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 		if ( ! $form_id ) {
416 416
 			// TODO: Show a message why a random form is being shown (because no form is assigned to the style).
417 417
 			// Fallback to any form.
418
-			$where   = array(
418
+			$where = array(
419 419
 				'status'         => 'published',
420 420
 				// Make sure it's not a repeater.
421 421
 				'parent_form_id' => array( null, 0 ),
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	private static function disable_admin_page_styling_on_submit_buttons() {
435 435
 		add_filter(
436 436
 			'frm_submit_button_class',
437
-			function ( $classes ) {
437
+			function( $classes ) {
438 438
 				$classes[] = 'frm_no_style_button';
439 439
 				return $classes;
440 440
 			}
@@ -643,13 +643,13 @@  discard block
 block discarded – undo
643 643
 	private static function force_form_style( $style ) {
644 644
 		add_filter(
645 645
 			'frm_add_form_style_class',
646
-			function ( $class ) use ( $style ) {
647
-				$split   = array_filter(
646
+			function( $class ) use ( $style ) {
647
+				$split = array_filter(
648 648
 					explode( ' ', $class ),
649 649
 					/**
650 650
 					 * @param string $class
651 651
 					 */
652
-					function ( $class ) {
652
+					function( $class ) {
653 653
 						return $class && 0 !== strpos( $class, 'frm_style_' );
654 654
 					}
655 655
 				);
@@ -765,11 +765,11 @@  discard block
 block discarded – undo
765 765
 
766 766
 		$forms = FrmForm::get_published_forms();
767 767
 		foreach ( $forms as $form ) {
768
-			if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
768
+			if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
769 769
 				continue;
770 770
 			}
771 771
 
772
-			$new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
772
+			$new_style = sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
773 773
 
774 774
 			$form->options['custom_style'] = $new_style;
775 775
 			$wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
@@ -1178,8 +1178,8 @@  discard block
 block discarded – undo
1178 1178
 	 */
1179 1179
 	public static function get_style_val( $val, $form = 'default' ) {
1180 1180
 		$style = self::get_form_style( $form );
1181
-		if ( $style && isset( $style->post_content[ $val ] ) ) {
1182
-			return $style->post_content[ $val ];
1181
+		if ( $style && isset( $style->post_content[$val] ) ) {
1182
+			return $style->post_content[$val];
1183 1183
 		}
1184 1184
 	}
1185 1185
 
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
 			} elseif ( 'alt_bg_color' == $name ) {
1199 1199
 				$setting = 'bg_color_active';
1200 1200
 			}
1201
-			$default_styles[ $name ] = $style->post_content[ $setting ];
1201
+			$default_styles[$name] = $style->post_content[$setting];
1202 1202
 			unset( $name, $val );
1203 1203
 		}
1204 1204
 
@@ -1244,16 +1244,16 @@  discard block
 block discarded – undo
1244 1244
 		$i          = 0;
1245 1245
 		$first_open = false;
1246 1246
 
1247
-		if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
1247
+		if ( isset( $wp_meta_boxes[$page][$context] ) ) {
1248 1248
 			foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
1249
-				if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
1250
-					foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1249
+				if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) {
1250
+					foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
1251 1251
 						if ( false === $box || ! $box['title'] ) {
1252 1252
 							continue;
1253 1253
 						}
1254 1254
 
1255
-						++$i;
1256
-						$icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id'];
1255
+						++ $i;
1256
+						$icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id'];
1257 1257
 
1258 1258
 						$open_class = '';
1259 1259
 						if ( ! $first_open ) {
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,7 +144,8 @@  discard block
 block discarded – undo
144 144
 	 * @return void
145 145
 	 */
146 146
 	private static function maybe_hook_into_global_settings_save() {
147
-		if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
147
+		if ( empty( $_POST ) || ! isset( $_POST['style'] ) ) {
148
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
148 149
 			// Avoid changing any style data if the style array is not sent in the request.
149 150
 			return;
150 151
 		}
@@ -765,7 +766,8 @@  discard block
 block discarded – undo
765 766
 
766 767
 		$forms = FrmForm::get_published_forms();
767 768
 		foreach ( $forms as $form ) {
768
-			if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
769
+			if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) {
770
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
769 771
 				continue;
770 772
 			}
771 773
 
Please login to merge, or discard this patch.
classes/models/FrmInstallPlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		// Get posted data.
83 83
 		$plugin_slug = FrmAppHelper::get_post_param( 'plugin', '', 'sanitize_text_field' );
84 84
 
85
-		if ( ! empty( get_plugins()[ $plugin_slug ] ) ) {
85
+		if ( ! empty( get_plugins()[$plugin_slug] ) ) {
86 86
 			$activate = activate_plugin( $plugin_slug );
87 87
 		} else {
88 88
 			// Include necessary files for plugin installation.
@@ -163,6 +163,6 @@  discard block
 block discarded – undo
163 163
 	 * @return bool
164 164
 	 */
165 165
 	private static function is_plugin_installed( $plugin_file ) {
166
-		return isset( get_plugins()[ $plugin_file ] );
166
+		return isset( get_plugins()[$plugin_file] );
167 167
 	}
168 168
 }
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
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 				'<span class="frm-upgrade-submenu">' . __( 'Upgrade', 'formidable' ) . '</span>',
112 112
 				'frm_view_forms',
113 113
 				'formidable-pro-upgrade',
114
-				function () {
114
+				function() {
115 115
 					// This function doesn't need to do anything.
116 116
 					// The redirect is handled earlier to avoid issues with the headers being sent.
117 117
 				}
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 			unset( $addons['error'] );
143 143
 		}
144 144
 
145
-		$pro    = array(
145
+		$pro = array(
146 146
 			'pro' => array(
147 147
 				'title'      => 'Formidable Forms Pro',
148 148
 				'slug'       => 'formidable-pro',
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 
185 185
 		// Extract the elements to move
186 186
 		foreach ( $plans as $plan ) {
187
-			if ( isset( self::$categories[ $plan ] ) ) {
188
-				$bottom_categories[ $plan ] = self::$categories[ $plan ];
189
-				unset( self::$categories[ $plan ] );
187
+			if ( isset( self::$categories[$plan] ) ) {
188
+				$bottom_categories[$plan] = self::$categories[$plan];
189
+				unset( self::$categories[$plan] );
190 190
 			}
191 191
 		}
192 192
 
@@ -240,14 +240,12 @@  discard block
 block discarded – undo
240 240
 			// Add the slug to the new array.
241 241
 			$addon['category-slugs'][] = $category_slug;
242 242
 
243
-			if ( ! isset( self::$categories[ $category_slug ] ) ) {
244
-				self::$categories[ $category_slug ] = array(
243
+			if ( ! isset( self::$categories[$category_slug] ) ) {
244
+				self::$categories[$category_slug] = array(
245 245
 					'name'  => $category,
246 246
 					'count' => 0,
247 247
 				);
248
-			}
249
-
250
-			++self::$categories[ $category_slug ]['count'];
248
+			} ++self::$categories[$category_slug]['count'];
251 249
 		}
252 250
 	}
253 251
 
@@ -279,7 +277,7 @@  discard block
 block discarded – undo
279 277
 		} else {
280 278
 			foreach ( $addons as $k => $addon ) {
281 279
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
282
-					unset( $addons[ $k ] );
280
+					unset( $addons[$k] );
283 281
 				}
284 282
 			}
285 283
 		}
@@ -393,7 +391,7 @@  discard block
 block discarded – undo
393 391
 
394 392
 		foreach ( $list as $k => $info ) {
395 393
 			$info['slug'] = $k;
396
-			$list[ $k ]   = array_merge( $defaults, $info );
394
+			$list[$k]   = array_merge( $defaults, $info );
397 395
 		}
398 396
 		return $list;
399 397
 	}
@@ -544,17 +542,17 @@  discard block
 block discarded – undo
544 542
 				continue;
545 543
 			}
546 544
 
547
-			$wp_plugin    = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
545
+			$wp_plugin    = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
548 546
 			$wp_version   = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
549 547
 			$plugin->slug = explode( '/', $folder )[0];
550 548
 
551 549
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
552
-				$transient->response[ $folder ] = $plugin;
550
+				$transient->response[$folder] = $plugin;
553 551
 			} else {
554
-				$transient->no_update[ $folder ] = $plugin;
552
+				$transient->no_update[$folder] = $plugin;
555 553
 			}
556 554
 
557
-			$transient->checked[ $folder ] = $wp_version;
555
+			$transient->checked[$folder] = $wp_version;
558 556
 
559 557
 		}//end foreach
560 558
 
@@ -587,7 +585,7 @@  discard block
 block discarded – undo
587 585
 	 */
588 586
 	protected static function is_installed( $plugin ) {
589 587
 		$all_plugins = self::get_plugins();
590
-		return isset( $all_plugins[ $plugin ] );
588
+		return isset( $all_plugins[$plugin] );
591 589
 	}
592 590
 
593 591
 	/**
@@ -626,13 +624,13 @@  discard block
 block discarded – undo
626 624
 			}
627 625
 
628 626
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
629
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
627
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
630 628
 				// if this addon is using its own license, get the update url
631 629
 				$addon_info = $api->get_api_info();
632 630
 
633
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
631
+				$version_info[$download_id] = $addon_info[$download_id];
634 632
 				if ( isset( $addon_info['error'] ) ) {
635
-					$version_info[ $download_id ]['error'] = array(
633
+					$version_info[$download_id]['error'] = array(
636 634
 						'message' => $addon_info['error']['message'],
637 635
 						'code'    => $addon_info['error']['code'],
638 636
 					);
@@ -731,8 +729,8 @@  discard block
 block discarded – undo
731 729
 					return $addon;
732 730
 				}
733 731
 			}
734
-		} elseif ( isset( $addons[ $download_id ] ) ) {
735
-			$plugin = $addons[ $download_id ];
732
+		} elseif ( isset( $addons[$download_id] ) ) {
733
+			$plugin = $addons[$download_id];
736 734
 		}
737 735
 
738 736
 		return $plugin;
@@ -798,7 +796,7 @@  discard block
 block discarded – undo
798 796
 			self::set_addon_status( $addon );
799 797
 			self::set_categories( $addon );
800 798
 
801
-			$addons[ $id ] = $addon;
799
+			$addons[$id] = $addon;
802 800
 		}//end foreach
803 801
 	}
804 802
 
@@ -839,7 +837,7 @@  discard block
 block discarded – undo
839 837
 			'utm_medium'   => 'addons',
840 838
 			'utm_campaign' => 'liteplugin',
841 839
 		);
842
-		$link       = add_query_arg( $query_args, $link );
840
+		$link = add_query_arg( $query_args, $link );
843 841
 	}
844 842
 
845 843
 	/**
@@ -1057,7 +1055,7 @@  discard block
 block discarded – undo
1057 1055
 	 */
1058 1056
 	public static function ajax_activate_addon() {
1059 1057
 		self::process_addon_action(
1060
-			function ( $plugin ) {
1058
+			function( $plugin ) {
1061 1059
 				return self::handle_addon_action( $plugin, 'activate' );
1062 1060
 			},
1063 1061
 			array( 'FrmAddonsController', 'get_addon_activation_response' )
@@ -1082,7 +1080,7 @@  discard block
 block discarded – undo
1082 1080
 	 */
1083 1081
 	public static function ajax_deactivate_addon() {
1084 1082
 		self::process_addon_action(
1085
-			function ( $plugin ) {
1083
+			function( $plugin ) {
1086 1084
 				return self::handle_addon_action( $plugin, 'deactivate' );
1087 1085
 			}
1088 1086
 		);
@@ -1097,7 +1095,7 @@  discard block
 block discarded – undo
1097 1095
 	 */
1098 1096
 	public static function ajax_uninstall_addon() {
1099 1097
 		self::process_addon_action(
1100
-			function ( $plugin ) {
1098
+			function( $plugin ) {
1101 1099
 				return self::handle_addon_action( $plugin, 'uninstall' );
1102 1100
 			}
1103 1101
 		);
@@ -1494,7 +1492,7 @@  discard block
 block discarded – undo
1494 1492
 		$addons = $api->get_api_info();
1495 1493
 
1496 1494
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1497
-			$dates    = $addons[ $addon_id ];
1495
+			$dates    = $addons[$addon_id];
1498 1496
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1499 1497
 		}
1500 1498
 
Please login to merge, or discard this patch.