Completed
Push — master ( 67005e...6d6fde )
by
unknown
18s
created
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +26 added lines, -28 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 				'<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>',
120 120
 				'frm_view_forms',
121 121
 				'formidable-pro-upgrade',
122
-				function () {
122
+				function() {
123 123
 					// This function doesn't need to do anything.
124 124
 					// The redirect is handled earlier to avoid issues with the headers being sent.
125 125
 				}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			unset( $addons['error'] );
151 151
 		}
152 152
 
153
-		$pro    = array(
153
+		$pro = array(
154 154
 			'pro' => array(
155 155
 				'title'      => 'Formidable Forms Pro',
156 156
 				'slug'       => 'formidable-pro',
@@ -192,9 +192,9 @@  discard block
 block discarded – undo
192 192
 
193 193
 		// Extract the elements to move
194 194
 		foreach ( $plans as $plan ) {
195
-			if ( isset( self::$categories[ $plan ] ) ) {
196
-				$bottom_categories[ $plan ] = self::$categories[ $plan ];
197
-				unset( self::$categories[ $plan ] );
195
+			if ( isset( self::$categories[$plan] ) ) {
196
+				$bottom_categories[$plan] = self::$categories[$plan];
197
+				unset( self::$categories[$plan] );
198 198
 			}
199 199
 		}
200 200
 
@@ -250,14 +250,12 @@  discard block
 block discarded – undo
250 250
 			// Add the slug to the new array.
251 251
 			$addon['category-slugs'][] = $category_slug;
252 252
 
253
-			if ( ! isset( self::$categories[ $category_slug ] ) ) {
254
-				self::$categories[ $category_slug ] = array(
253
+			if ( ! isset( self::$categories[$category_slug] ) ) {
254
+				self::$categories[$category_slug] = array(
255 255
 					'name'  => $category,
256 256
 					'count' => 0,
257 257
 				);
258
-			}
259
-
260
-			++self::$categories[ $category_slug ]['count'];
258
+			} ++self::$categories[$category_slug]['count'];
261 259
 		}
262 260
 	}
263 261
 
@@ -290,7 +288,7 @@  discard block
 block discarded – undo
290 288
 		} else {
291 289
 			foreach ( $addons as $k => $addon ) {
292 290
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
293
-					unset( $addons[ $k ] );
291
+					unset( $addons[$k] );
294 292
 				}
295 293
 			}
296 294
 		}
@@ -405,7 +403,7 @@  discard block
 block discarded – undo
405 403
 
406 404
 		foreach ( $list as $k => $info ) {
407 405
 			$info['slug'] = $k;
408
-			$list[ $k ]   = array_merge( $defaults, $info );
406
+			$list[$k]   = array_merge( $defaults, $info );
409 407
 		}
410 408
 		return $list;
411 409
 	}
@@ -575,17 +573,17 @@  discard block
 block discarded – undo
575 573
 				continue;
576 574
 			}
577 575
 
578
-			$wp_plugin    = $wp_plugins[ $folder ] ?? array();
576
+			$wp_plugin    = $wp_plugins[$folder] ?? array();
579 577
 			$wp_version   = $wp_plugin['Version'] ?? '1.0';
580 578
 			$plugin->slug = explode( '/', $folder )[0];
581 579
 
582 580
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
583
-				$transient->response[ $folder ] = $plugin;
581
+				$transient->response[$folder] = $plugin;
584 582
 			} else {
585
-				$transient->no_update[ $folder ] = $plugin;
583
+				$transient->no_update[$folder] = $plugin;
586 584
 			}
587 585
 
588
-			$transient->checked[ $folder ] = $wp_version;
586
+			$transient->checked[$folder] = $wp_version;
589 587
 
590 588
 		}//end foreach
591 589
 
@@ -619,7 +617,7 @@  discard block
 block discarded – undo
619 617
 	 */
620 618
 	protected static function is_installed( $plugin ) {
621 619
 		$all_plugins = self::get_plugins();
622
-		return isset( $all_plugins[ $plugin ] );
620
+		return isset( $all_plugins[$plugin] );
623 621
 	}
624 622
 
625 623
 	/**
@@ -662,14 +660,14 @@  discard block
 block discarded – undo
662 660
 
663 661
 			$download_id = $plugin['id'] ?? 0;
664 662
 
665
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
663
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
666 664
 				// if this addon is using its own license, get the update url
667 665
 				$addon_info = $api->get_api_info();
668 666
 
669
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
667
+				$version_info[$download_id] = $addon_info[$download_id];
670 668
 
671 669
 				if ( isset( $addon_info['error'] ) ) {
672
-					$version_info[ $download_id ]['error'] = array(
670
+					$version_info[$download_id]['error'] = array(
673 671
 						'message' => $addon_info['error']['message'],
674 672
 						'code'    => $addon_info['error']['code'],
675 673
 					);
@@ -777,8 +775,8 @@  discard block
 block discarded – undo
777 775
 					return $addon;
778 776
 				}
779 777
 			}
780
-		} elseif ( isset( $addons[ $download_id ] ) ) {
781
-			$plugin = $addons[ $download_id ];
778
+		} elseif ( isset( $addons[$download_id] ) ) {
779
+			$plugin = $addons[$download_id];
782 780
 		}
783 781
 
784 782
 		return $plugin;
@@ -853,7 +851,7 @@  discard block
 block discarded – undo
853 851
 			self::set_addon_status( $addon );
854 852
 			self::set_categories( $addon );
855 853
 
856
-			$addons[ $id ] = $addon;
854
+			$addons[$id] = $addon;
857 855
 		}//end foreach
858 856
 	}
859 857
 
@@ -896,7 +894,7 @@  discard block
 block discarded – undo
896 894
 			$link = $site_url . $link;
897 895
 		}
898 896
 
899
-		$link       = FrmAppHelper::make_affiliate_url( $link );
897
+		$link = FrmAppHelper::make_affiliate_url( $link );
900 898
 
901 899
 		$utm  = array(
902 900
 			'campaign' => 'addons',
@@ -1128,7 +1126,7 @@  discard block
 block discarded – undo
1128 1126
 	 */
1129 1127
 	public static function ajax_activate_addon() {
1130 1128
 		self::process_addon_action(
1131
-			function ( $plugin ) {
1129
+			function( $plugin ) {
1132 1130
 				return self::handle_addon_action( $plugin, 'activate' );
1133 1131
 			},
1134 1132
 			array( 'FrmAddonsController', 'get_addon_activation_response' )
@@ -1153,7 +1151,7 @@  discard block
 block discarded – undo
1153 1151
 	 */
1154 1152
 	public static function ajax_deactivate_addon() {
1155 1153
 		self::process_addon_action(
1156
-			function ( $plugin ) {
1154
+			function( $plugin ) {
1157 1155
 				return self::handle_addon_action( $plugin, 'deactivate' );
1158 1156
 			}
1159 1157
 		);
@@ -1168,7 +1166,7 @@  discard block
 block discarded – undo
1168 1166
 	 */
1169 1167
 	public static function ajax_uninstall_addon() {
1170 1168
 		self::process_addon_action(
1171
-			function ( $plugin ) {
1169
+			function( $plugin ) {
1172 1170
 				return self::handle_addon_action( $plugin, 'uninstall' );
1173 1171
 			}
1174 1172
 		);
@@ -1582,7 +1580,7 @@  discard block
 block discarded – undo
1582 1580
 		$addons = $api->get_api_info();
1583 1581
 
1584 1582
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1585
-			$dates    = $addons[ $addon_id ];
1583
+			$dates    = $addons[$addon_id];
1586 1584
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1587 1585
 		}
1588 1586
 
Please login to merge, or discard this patch.
classes/controllers/FrmEmailStylesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		$styles = self::get_email_styles();
97 97
 		$style  = $frm_settings->email_style;
98 98
 
99
-		if ( isset( $styles[ $style ] ) && ! empty( $styles[ $style ]['selectable'] ) ) {
99
+		if ( isset( $styles[$style] ) && ! empty( $styles[$style]['selectable'] ) ) {
100 100
 			return $style;
101 101
 		}
102 102
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
 		$styles = self::get_email_styles();
280 280
 
281
-		if ( ! isset( $styles[ $style_key ] ) ) {
281
+		if ( ! isset( $styles[$style_key] ) ) {
282 282
 			die( esc_html( $not_exist_msg ) );
283 283
 		}
284 284
 
Please login to merge, or discard this patch.
classes/views/shared/errors.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) {
23 23
 	// Define a callback function to add 'data-action' attribute to allowed HTML tags
24
-	$add_data_action_callback = function ( $allowed_html ) {
24
+	$add_data_action_callback = function( $allowed_html ) {
25 25
 		$allowed_html['span']['data-action'] = true;
26 26
 		return $allowed_html;
27 27
 	};
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 
54 54
 	foreach ( $action_control->action_options['event'] as $event ) {
55 55
 		?>
56
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option>
56
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option>
57 57
 <?php } ?>
58 58
 		</select>
59 59
 	</p>
Please login to merge, or discard this patch.
classes/views/frm-forms/form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 			$values['count'] = 0;
54 54
 
55 55
 			foreach ( $values['fields'] as $field ) {
56
-				++$values['count'];
56
+				++ $values['count'];
57 57
 				$grid_helper->set_field( $field );
58 58
 				$grid_helper->maybe_begin_field_wrapper();
59 59
 				FrmFieldsController::load_single_field( $field, $values );
Please login to merge, or discard this patch.
classes/views/frm-forms/landing-page-preview-option.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $params    = array();
9 9
 
10 10
 foreach ( $data_keys as $key ) {
11
-	$params[ 'data-' . $key ] = $data[ $key ];
11
+	$params['data-' . $key] = $data[$key];
12 12
 }
13 13
 $params['class'] = 'frm_show_upgrade frm_noallow';
14 14
 $params['href']  = '#';
Please login to merge, or discard this patch.
classes/views/styles/manage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 					 *
55 55
 					 * @return void
56 56
 					 */
57
-					function ( $form ) use ( $styles, $default_style, $row_view_file_path ) {
57
+					function( $form ) use ( $styles, $default_style, $row_view_file_path ) {
58 58
 						$active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1;
59 59
 
60 60
 						if ( 1 === $active_style_id ) {
Please login to merge, or discard this patch.
classes/views/styles/_style-card.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 				'text-color'      => $style->post_content['text_color'],
47 47
 				'submit-bg-color' => $style->post_content['submit_bg_color'],
48 48
 			);
49
-			$index  = 0;
49
+			$index = 0;
50 50
 
51 51
 			foreach ( $colors as $css_var_name => $color ) {
52 52
 				if ( 0 !== strpos( $color, 'rgb' ) ) {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 					'style' => 'background-color: var(--' . $css_var_name . ')',
59 59
 				);
60 60
 
61
-				++$index;
61
+				++ $index;
62 62
 				?>
63 63
 				<div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div>
64 64
 				<?php
Please login to merge, or discard this patch.
classes/views/xml/posts_xml.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,8 +119,8 @@
 block discarded – undo
119 119
 	$label         = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term';
120 120
 	?>
121 121
 	<term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
122
-	if ( ! empty( $parent_slugs[ $term->parent ] ) ) {
123
-		echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>';
122
+	if ( ! empty( $parent_slugs[$term->parent] ) ) {
123
+		echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>';
124 124
 	}
125 125
 
126 126
 	if ( ! empty( $term->name ) ) {
Please login to merge, or discard this patch.