Completed
Push — master ( c4defa...36e520 )
by
unknown
50s
created
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/models/FrmField.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
 			'ranking' => '2024-03-12',
268 268
 		);
269 269
 
270
-		if ( ! isset( $release_dates[ $type ] ) ) {
270
+		if ( ! isset( $release_dates[$type] ) ) {
271 271
 			return false;
272 272
 		}
273 273
 
274
-		$release_date = $release_dates[ $type ];
274
+		$release_date = $release_dates[$type];
275 275
 
276 276
 		$three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) );
277 277
 		return gmdate( 'Y-m-d' ) < $three_months_after_release;
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
 		$values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) );
305 305
 
306 306
 		foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) {
307
-			if ( isset( $values[ $col ] ) ) {
308
-				$new_values[ $col ] = $values[ $col ];
307
+			if ( isset( $values[$col] ) ) {
308
+				$new_values[$col] = $values[$col];
309 309
 			}
310 310
 		}
311 311
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		$new_values['created_at']    = current_time( 'mysql', 1 );
318 318
 
319 319
 		if ( isset( $values['id'] ) ) {
320
-			$frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key'];
320
+			$frm_duplicate_ids[$values['field_key']] = $new_values['field_key'];
321 321
 			$new_values                                = apply_filters( 'frm_duplicated_field', $new_values );
322 322
 		}
323 323
 
@@ -326,9 +326,9 @@  discard block
 block discarded – undo
326 326
 		foreach ( $new_values as $k => $v ) {
327 327
 			if ( is_array( $v ) ) {
328 328
 				if ( $k === 'default_value' ) {
329
-					$new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v );
329
+					$new_values[$k] = FrmAppHelper::maybe_json_encode( $v );
330 330
 				} else {
331
-					$new_values[ $k ] = serialize( $v );
331
+					$new_values[$k] = serialize( $v );
332 332
 				}
333 333
 			}
334 334
 			unset( $k, $v );
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 		}
349 349
 
350 350
 		if ( isset( $values['id'] ) ) {
351
-			$frm_duplicate_ids[ $values['id'] ] = $new_id;
351
+			$frm_duplicate_ids[$values['id']] = $new_id;
352 352
 		}
353 353
 
354 354
 		return $new_id;
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			 * @param array $match Shortcode data.
400 400
 			 * @return string
401 401
 			 */
402
-			function ( $match ) {
402
+			function( $match ) {
403 403
 				$attr = shortcode_parse_atts( $match[3] );
404 404
 
405 405
 				if ( ! is_array( $attr ) ) {
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 					}
425 425
 
426 426
 					if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) {
427
-						$safe_atts[ $key ] = $value;
427
+						$safe_atts[$key] = $value;
428 428
 					}
429 429
 				}
430 430
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) {
483 483
 		global $frm_duplicate_ids;
484 484
 
485
-		$where  = array(
485
+		$where = array(
486 486
 			array(
487 487
 				'or'                => 1,
488 488
 				'fi.form_id'        => $old_form_id,
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
 
529 529
 			$values                                 = apply_filters( 'frm_duplicated_field', $values );
530 530
 			$new_id                                 = self::create( $values );
531
-			$frm_duplicate_ids[ $field->id ]        = $new_id;
532
-			$frm_duplicate_ids[ $field->field_key ] = $new_id;
531
+			$frm_duplicate_ids[$field->id]        = $new_id;
532
+			$frm_duplicate_ids[$field->field_key] = $new_id;
533 533
 			unset( $field );
534 534
 		}//end foreach
535 535
 	}
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
 
579 579
 		// serialize array values
580 580
 		foreach ( array( 'field_options', 'options' ) as $opt ) {
581
-			if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) {
581
+			if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) {
582 582
 				if ( 'field_options' === $opt ) {
583
-					$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
583
+					$values[$opt] = self::maybe_filter_options( $values[$opt] );
584 584
 				}
585
-				$values[ $opt ] = serialize( $values[ $opt ] );
585
+				$values[$opt] = serialize( $values[$opt] );
586 586
 			}
587 587
 		}
588 588
 		if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) {
@@ -769,8 +769,8 @@  discard block
 block discarded – undo
769 769
 					continue;
770 770
 				}
771 771
 
772
-				$fields[ $result->id ] = $result;
773
-				++$count;
772
+				$fields[$result->id] = $result;
773
+				++ $count;
774 774
 				if ( $limit == 1 ) {
775 775
 					$fields = $result;
776 776
 					break;
@@ -821,8 +821,8 @@  discard block
 block discarded – undo
821 821
 			$fields = array();
822 822
 			$count  = 0;
823 823
 			foreach ( $results as $result ) {
824
-				++$count;
825
-				$fields[ $result->id ] = $result;
824
+				++ $count;
825
+				$fields[$result->id] = $result;
826 826
 				if ( ! empty( $limit ) && $count >= $limit ) {
827 827
 					break;
828 828
 				}
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 		$query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results';
937 937
 
938 938
 		if ( is_array( $where ) ) {
939
-			$args    = array(
939
+			$args = array(
940 940
 				'order_by' => $order_by,
941 941
 				'limit'    => $limit,
942 942
 			);
@@ -969,9 +969,9 @@  discard block
 block discarded – undo
969 969
 				FrmDb::set_cache( $result->field_key, $result, 'frm_field' );
970 970
 
971 971
 				self::prepare_options( $result );
972
-				$results[ $r_key ]->field_options = $result->field_options;
973
-				$results[ $r_key ]->options       = $result->options;
974
-				$results[ $r_key ]->default_value = $result->default_value;
972
+				$results[$r_key]->field_options = $result->field_options;
973
+				$results[$r_key]->options       = $result->options;
974
+				$results[$r_key]->default_value = $result->default_value;
975 975
 
976 976
 				unset( $r_key, $result );
977 977
 			}
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
 			if ( count( $next_fields ) >= self::$transient_size ) {
1052 1052
 				// if this transient is full, check for another
1053
-				++$next;
1053
+				++ $next;
1054 1054
 				self::get_next_transient( $fields, $base_name, $next );
1055 1055
 			}
1056 1056
 		}
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 				return;
1079 1079
 			}
1080 1080
 
1081
-			++$next;
1081
+			++ $next;
1082 1082
 		}
1083 1083
 	}
1084 1084
 
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
 	 * @return bool
1227 1227
 	 */
1228 1228
 	public static function is_option_true_in_array( $field, $option ) {
1229
-		return ! empty( $field[ $option ] );
1229
+		return ! empty( $field[$option] );
1230 1230
 	}
1231 1231
 
1232 1232
 	/**
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
 	 * @return bool
1236 1236
 	 */
1237 1237
 	public static function is_option_true_in_object( $field, $option ) {
1238
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
1238
+		return isset( $field->field_options[$option] ) && $field->field_options[$option];
1239 1239
 	}
1240 1240
 
1241 1241
 	/**
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
 	 * @return bool
1245 1245
 	 */
1246 1246
 	public static function is_option_empty_in_array( $field, $option ) {
1247
-		return empty( $field[ $option ] );
1247
+		return empty( $field[$option] );
1248 1248
 	}
1249 1249
 
1250 1250
 	/**
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 	 * @return bool
1254 1254
 	 */
1255 1255
 	public static function is_option_empty_in_object( $field, $option ) {
1256
-		return empty( $field->field_options[ $option ] );
1256
+		return empty( $field->field_options[$option] );
1257 1257
 	}
1258 1258
 
1259 1259
 	/**
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 	 * @return bool
1263 1263
 	 */
1264 1264
 	public static function is_option_value_in_object( $field, $option ) {
1265
-		return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != '';
1265
+		return isset( $field->field_options[$option] ) && $field->field_options[$option] != '';
1266 1266
 	}
1267 1267
 
1268 1268
 	/**
@@ -1288,10 +1288,10 @@  discard block
 block discarded – undo
1288 1288
 	 * @return mixed
1289 1289
 	 */
1290 1290
 	public static function get_option_in_array( $field, $option ) {
1291
-		if ( isset( $field[ $option ] ) ) {
1292
-			$this_option = $field[ $option ];
1293
-		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) {
1294
-			$this_option = $field['field_options'][ $option ];
1291
+		if ( isset( $field[$option] ) ) {
1292
+			$this_option = $field[$option];
1293
+		} elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) {
1294
+			$this_option = $field['field_options'][$option];
1295 1295
 		} else {
1296 1296
 			$this_option = '';
1297 1297
 		}
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 	 * @return mixed
1306 1306
 	 */
1307 1307
 	public static function get_option_in_object( $field, $option ) {
1308
-		return $field->field_options[ $option ] ?? '';
1308
+		return $field->field_options[$option] ?? '';
1309 1309
 	}
1310 1310
 
1311 1311
 	/**
Please login to merge, or discard this patch.