@@ -28,7 +28,7 @@ |
||
| 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 |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | unset( $filename ); |
| 157 | 157 | |
| 158 | - $comment_count = FrmDb::get_count( |
|
| 158 | + $comment_count = FrmDb::get_count( |
|
| 159 | 159 | 'frm_item_metas', |
| 160 | 160 | array( |
| 161 | 161 | 'item_id' => $atts['entry_ids'], |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | private static function prepare_csv_headings() { |
| 321 | 321 | $headings = array(); |
| 322 | 322 | self::csv_headings( $headings ); |
| 323 | - $headings = apply_filters( |
|
| 323 | + $headings = apply_filters( |
|
| 324 | 324 | 'frm_csv_columns', |
| 325 | 325 | $headings, |
| 326 | 326 | self::$form_id, |
@@ -351,13 +351,13 @@ discard block |
||
| 351 | 351 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 352 | 352 | |
| 353 | 353 | if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) { |
| 354 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 354 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - if ( ! empty( $field_headings[ $col->id . '_label' ] ) ) { |
|
| 358 | - $field_headings[ $col->id ] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 357 | + if ( ! empty( $field_headings[$col->id . '_label'] ) ) { |
|
| 358 | + $field_headings[$col->id] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 359 | 359 | } else { |
| 360 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 360 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | return apply_filters( |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 384 | 384 | $repeater_id = $col->field_options['in_section']; |
| 385 | 385 | // Set a placeholder to maintain order for repeater fields. |
| 386 | - $headings[ 'repeater' . $repeater_id ] = array(); |
|
| 386 | + $headings['repeater' . $repeater_id] = array(); |
|
| 387 | 387 | |
| 388 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 389 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
| 388 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
| 389 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
| 390 | 390 | $repeater_ids[] = $repeater_id; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
| 393 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
| 394 | 394 | |
| 395 | 395 | continue; |
| 396 | 396 | } |
@@ -409,8 +409,8 @@ discard block |
||
| 409 | 409 | $end = strpos( $row->meta_value, ':{' ); |
| 410 | 410 | $length = substr( $row->meta_value, $start, $end - $start ); |
| 411 | 411 | |
| 412 | - if ( $length > $max[ $row->field_id ] ) { |
|
| 413 | - $max[ $row->field_id ] = $length; |
|
| 412 | + if ( $length > $max[$row->field_id] ) { |
|
| 413 | + $max[$row->field_id] = $length; |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | $repeater_headings = array(); |
| 425 | 425 | |
| 426 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
| 426 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
| 427 | 427 | $repeater_headings += self::field_headings( $col ); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i++ ) { |
|
| 430 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
| 431 | 431 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
| 432 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
| 432 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | } else { |
| 436 | - $flat[ $key ] = $heading; |
|
| 436 | + $flat[$key] = $heading; |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
@@ -446,10 +446,10 @@ discard block |
||
| 446 | 446 | }//end if |
| 447 | 447 | |
| 448 | 448 | if ( self::$comment_count ) { |
| 449 | - for ( $i = 0; $i < self::$comment_count; $i++ ) { |
|
| 450 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 451 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 452 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 449 | + for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
|
| 450 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 451 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 452 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 453 | 453 | } |
| 454 | 454 | unset( $i ); |
| 455 | 455 | } |
@@ -569,32 +569,32 @@ discard block |
||
| 569 | 569 | continue; |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) { |
|
| 573 | - $entries[ self::$entry->parent_item_id ] = new stdClass(); |
|
| 574 | - $entries[ self::$entry->parent_item_id ]->metas = array(); |
|
| 572 | + if ( ! isset( $entries[self::$entry->parent_item_id] ) ) { |
|
| 573 | + $entries[self::$entry->parent_item_id] = new stdClass(); |
|
| 574 | + $entries[self::$entry->parent_item_id]->metas = array(); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 578 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 579 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 577 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 578 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 579 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 580 | 580 | // if the data is here, it should be an array but if this field has collected data |
| 581 | 581 | // both while inside and outside of the repeating section, it's possible this is a string. |
| 582 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 582 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | // Add the repeated values. |
| 586 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 586 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 587 | 587 | }//end foreach |
| 588 | 588 | |
| 589 | 589 | self::$entry->metas = self::fill_missing_repeater_metas( self::$entry->metas, $entries ); |
| 590 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 590 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 591 | 591 | }//end if |
| 592 | 592 | |
| 593 | 593 | // add the embedded form id |
| 594 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 595 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 594 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 595 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 596 | 596 | } |
| 597 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 597 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /** |
@@ -617,19 +617,19 @@ discard block |
||
| 617 | 617 | |
| 618 | 618 | $repeater_id = $field->field_options['in_section']; |
| 619 | 619 | |
| 620 | - if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 620 | + if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) { |
|
| 621 | 621 | return $metas; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) { |
|
| 625 | - if ( ! isset( $metas[ $repeater_child->id ] ) ) { |
|
| 626 | - $metas[ $repeater_child->id ] = ''; |
|
| 624 | + foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) { |
|
| 625 | + if ( ! isset( $metas[$repeater_child->id] ) ) { |
|
| 626 | + $metas[$repeater_child->id] = ''; |
|
| 627 | 627 | |
| 628 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { |
|
| 629 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array(); |
|
| 628 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) { |
|
| 629 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array(); |
|
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = ''; |
|
| 632 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = ''; |
|
| 633 | 633 | } |
| 634 | 634 | } |
| 635 | 635 | |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | */ |
| 660 | 660 | private static function add_field_values_to_csv( &$row ) { |
| 661 | 661 | foreach ( self::$fields as $col ) { |
| 662 | - $field_value = self::$entry->metas[ $col->id ] ?? false; |
|
| 662 | + $field_value = self::$entry->metas[$col->id] ?? false; |
|
| 663 | 663 | |
| 664 | 664 | FrmFieldsHelper::prepare_field_value( $field_value, $col->type ); |
| 665 | 665 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -679,20 +679,20 @@ discard block |
||
| 679 | 679 | $label_key = $col->id . '_label'; |
| 680 | 680 | |
| 681 | 681 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 682 | - $row[ $label_key ] = array(); |
|
| 682 | + $row[$label_key] = array(); |
|
| 683 | 683 | |
| 684 | 684 | if ( is_array( $field_value ) ) { |
| 685 | 685 | foreach ( $field_value as $value ) { |
| 686 | - $row[ $label_key ][] = self::get_separate_value_label( $value, $col ); |
|
| 686 | + $row[$label_key][] = self::get_separate_value_label( $value, $col ); |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | } else { |
| 690 | - $row[ $label_key ] = self::get_separate_value_label( $field_value, $col ); |
|
| 690 | + $row[$label_key] = self::get_separate_value_label( $field_value, $col ); |
|
| 691 | 691 | } |
| 692 | 692 | unset( $label_key ); |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - $row[ $col->id ] = $field_value; |
|
| 695 | + $row[$col->id] = $field_value; |
|
| 696 | 696 | |
| 697 | 697 | unset( $col, $field_value ); |
| 698 | 698 | }//end foreach |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | 'show_icon' => false, |
| 717 | 717 | 'entry_id' => self::$entry->id, |
| 718 | 718 | 'sep' => self::$separator, |
| 719 | - 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, |
|
| 719 | + 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0, |
|
| 720 | 720 | ) |
| 721 | 721 | ); |
| 722 | 722 | } |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | foreach ( $sub_value as $sub_key => $sub_sub_value ) { |
| 738 | 738 | $column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']'; |
| 739 | 739 | |
| 740 | - if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 741 | - $row[ $column_key ] = $sub_sub_value; |
|
| 740 | + if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) { |
|
| 741 | + $row[$column_key] = $sub_sub_value; |
|
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | |
@@ -747,8 +747,8 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | $column_key = $atts['col']->id . '_' . $key; |
| 749 | 749 | |
| 750 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 751 | - $row[ $column_key ] = $sub_value; |
|
| 750 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 751 | + $row[$column_key] = $sub_value; |
|
| 752 | 752 | } |
| 753 | 753 | } |
| 754 | 754 | }//end if |
@@ -784,19 +784,19 @@ discard block |
||
| 784 | 784 | $echo = 'echo' === self::$mode; |
| 785 | 785 | |
| 786 | 786 | foreach ( self::$headings as $k => $heading ) { |
| 787 | - if ( isset( $rows[ $k ] ) ) { |
|
| 788 | - $row = $rows[ $k ]; |
|
| 787 | + if ( isset( $rows[$k] ) ) { |
|
| 788 | + $row = $rows[$k]; |
|
| 789 | 789 | } else { |
| 790 | 790 | $row = ''; |
| 791 | 791 | |
| 792 | 792 | // array indexed data is not at $rows[ $k ] |
| 793 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
| 793 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
| 794 | 794 | $start = strrpos( $k, '[' ); |
| 795 | - $key = substr( $k, 0, $start++ ); |
|
| 795 | + $key = substr( $k, 0, $start ++ ); |
|
| 796 | 796 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
| 797 | 797 | |
| 798 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
| 799 | - $row = $rows[ $key ][ $index ]; |
|
| 798 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
| 799 | + $row = $rows[$key][$index]; |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | unset( $start, $key, $index ); |
@@ -504,8 +504,8 @@ discard block |
||
| 504 | 504 | return $values; |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
| 508 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
| 507 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
| 508 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | $frm_vars['trans_filled'] = true; |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | * |
| 543 | 543 | * @return void |
| 544 | 544 | */ |
| 545 | - function () use ( $entry_id, &$destroy_callback ) { |
|
| 545 | + function() use ( $entry_id, &$destroy_callback ) { |
|
| 546 | 546 | FrmEntry::destroy( $entry_id ); |
| 547 | 547 | // Only call this once. |
| 548 | 548 | remove_action( 'frm_entry_form', $destroy_callback ); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $is_stripe = $gateway === 'stripe' || ( is_array( $gateway ) && in_array( 'stripe', $gateway, true ) ); |
| 79 | 79 | |
| 80 | 80 | if ( ! $is_stripe || empty( $payment_action->post_content['amount'] ) ) { |
| 81 | - unset( $payment_actions[ $k ] ); |
|
| 81 | + unset( $payment_actions[$k] ); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | return $payment_actions; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'run_triggers' => false, |
| 118 | 118 | 'show_errors' => true, |
| 119 | 119 | ); |
| 120 | - $atts = compact( 'action', 'entry', 'form' ); |
|
| 120 | + $atts = compact( 'action', 'entry', 'form' ); |
|
| 121 | 121 | |
| 122 | 122 | $amount = self::prepare_amount( $action->post_content['amount'], $atts ); |
| 123 | 123 | |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | |
| 522 | 522 | foreach ( $settings as $k => $s ) { |
| 523 | 523 | if ( is_string( $s ) ) { |
| 524 | - $settings[ $k ] = str_replace( $disallowed, '', $s ); |
|
| 524 | + $settings[$k] = str_replace( $disallowed, '', $s ); |
|
| 525 | 525 | } |
| 526 | 526 | } |
| 527 | 527 | |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * @return array |
| 651 | 651 | */ |
| 652 | 652 | public static function remove_cc_validation( $errors, $field, $values ) { |
| 653 | - $has_processed = isset( $_POST[ 'frmintent' . $field->form_id ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 653 | + $has_processed = isset( $_POST['frmintent' . $field->form_id] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 654 | 654 | |
| 655 | 655 | if ( ! $has_processed ) { |
| 656 | 656 | return $errors; |
@@ -658,12 +658,12 @@ discard block |
||
| 658 | 658 | |
| 659 | 659 | $field_id = $field->temp_id ?? $field->id; |
| 660 | 660 | |
| 661 | - if ( isset( $errors[ 'field' . $field_id . '-cc' ] ) ) { |
|
| 662 | - unset( $errors[ 'field' . $field_id . '-cc' ] ); |
|
| 661 | + if ( isset( $errors['field' . $field_id . '-cc'] ) ) { |
|
| 662 | + unset( $errors['field' . $field_id . '-cc'] ); |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | - if ( isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 666 | - unset( $errors[ 'field' . $field_id ] ); |
|
| 665 | + if ( isset( $errors['field' . $field_id] ) ) { |
|
| 666 | + unset( $errors['field' . $field_id] ); |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | return $errors; |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | 'coupon' => '2026-01-13', |
| 364 | 364 | ); |
| 365 | 365 | |
| 366 | - if ( ! isset( $release_dates[ $type ] ) ) { |
|
| 366 | + if ( ! isset( $release_dates[$type] ) ) { |
|
| 367 | 367 | return false; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $release_date = $release_dates[ $type ]; |
|
| 370 | + $release_date = $release_dates[$type]; |
|
| 371 | 371 | |
| 372 | 372 | $three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) ); |
| 373 | 373 | return gmdate( 'Y-m-d' ) < $three_months_after_release; |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
| 402 | 402 | |
| 403 | 403 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
| 404 | - if ( isset( $values[ $col ] ) ) { |
|
| 405 | - $new_values[ $col ] = $values[ $col ]; |
|
| 404 | + if ( isset( $values[$col] ) ) { |
|
| 405 | + $new_values[$col] = $values[$col]; |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
| 415 | 415 | |
| 416 | 416 | if ( isset( $values['id'] ) ) { |
| 417 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
| 417 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
| 418 | 418 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
| 419 | 419 | } |
| 420 | 420 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | foreach ( $new_values as $k => $v ) { |
| 424 | 424 | if ( is_array( $v ) ) { |
| 425 | - $new_values[ $k ] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 425 | + $new_values[$k] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 426 | 426 | } |
| 427 | 427 | unset( $k, $v ); |
| 428 | 428 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | if ( isset( $values['id'] ) ) { |
| 444 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 444 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | return $new_id; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | * |
| 496 | 496 | * @return string |
| 497 | 497 | */ |
| 498 | - function ( $match ) { |
|
| 498 | + function( $match ) { |
|
| 499 | 499 | $attr = shortcode_parse_atts( $match[3] ); |
| 500 | 500 | |
| 501 | 501 | if ( ! is_array( $attr ) ) { |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
| 526 | - $safe_atts[ $key ] = $value; |
|
| 526 | + $safe_atts[$key] = $value; |
|
| 527 | 527 | } |
| 528 | 528 | }//end foreach |
| 529 | 529 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
| 596 | 596 | global $frm_duplicate_ids; |
| 597 | 597 | |
| 598 | - $where = array( |
|
| 598 | + $where = array( |
|
| 599 | 599 | array( |
| 600 | 600 | 'or' => 1, |
| 601 | 601 | 'fi.form_id' => $old_form_id, |
@@ -642,8 +642,8 @@ discard block |
||
| 642 | 642 | |
| 643 | 643 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 644 | 644 | $new_id = self::create( $values ); |
| 645 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 646 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 645 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 646 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 647 | 647 | unset( $field ); |
| 648 | 648 | }//end foreach |
| 649 | 649 | } |
@@ -693,11 +693,11 @@ discard block |
||
| 693 | 693 | |
| 694 | 694 | // serialize array values |
| 695 | 695 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
| 696 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 696 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 697 | 697 | if ( 'field_options' === $opt ) { |
| 698 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
| 698 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
| 699 | 699 | } |
| 700 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 700 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | continue; |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | - $fields[ $result->id ] = $result; |
|
| 914 | - ++$count; |
|
| 913 | + $fields[$result->id] = $result; |
|
| 914 | + ++ $count; |
|
| 915 | 915 | |
| 916 | 916 | if ( $limit == 1 ) { |
| 917 | 917 | $fields = $result; |
@@ -966,8 +966,8 @@ discard block |
||
| 966 | 966 | $count = 0; |
| 967 | 967 | |
| 968 | 968 | foreach ( $results as $result ) { |
| 969 | - ++$count; |
|
| 970 | - $fields[ $result->id ] = $result; |
|
| 969 | + ++ $count; |
|
| 970 | + $fields[$result->id] = $result; |
|
| 971 | 971 | |
| 972 | 972 | if ( ! empty( $limit ) && $count >= $limit ) { |
| 973 | 973 | break; |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
| 1101 | 1101 | |
| 1102 | 1102 | if ( is_array( $where ) ) { |
| 1103 | - $args = array( |
|
| 1103 | + $args = array( |
|
| 1104 | 1104 | 'order_by' => $order_by, |
| 1105 | 1105 | 'limit' => $limit, |
| 1106 | 1106 | ); |
@@ -1137,9 +1137,9 @@ discard block |
||
| 1137 | 1137 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 1138 | 1138 | |
| 1139 | 1139 | self::prepare_options( $result ); |
| 1140 | - $results[ $r_key ]->field_options = $result->field_options; |
|
| 1141 | - $results[ $r_key ]->options = $result->options; |
|
| 1142 | - $results[ $r_key ]->default_value = $result->default_value; |
|
| 1140 | + $results[$r_key]->field_options = $result->field_options; |
|
| 1141 | + $results[$r_key]->options = $result->options; |
|
| 1142 | + $results[$r_key]->default_value = $result->default_value; |
|
| 1143 | 1143 | |
| 1144 | 1144 | unset( $r_key, $result ); |
| 1145 | 1145 | } |
@@ -1235,7 +1235,7 @@ discard block |
||
| 1235 | 1235 | |
| 1236 | 1236 | if ( count( $next_fields ) >= self::$transient_size ) { |
| 1237 | 1237 | // if this transient is full, check for another |
| 1238 | - ++$next; |
|
| 1238 | + ++ $next; |
|
| 1239 | 1239 | self::get_next_transient( $fields, $base_name, $next ); |
| 1240 | 1240 | } |
| 1241 | 1241 | } |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | return; |
| 1272 | 1272 | } |
| 1273 | 1273 | |
| 1274 | - ++$next; |
|
| 1274 | + ++ $next; |
|
| 1275 | 1275 | } |
| 1276 | 1276 | } |
| 1277 | 1277 | |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | * @return bool |
| 1430 | 1430 | */ |
| 1431 | 1431 | public static function is_option_true_in_array( $field, $option ) { |
| 1432 | - return ! empty( $field[ $option ] ); |
|
| 1432 | + return ! empty( $field[$option] ); |
|
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | /** |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | * @return bool |
| 1440 | 1440 | */ |
| 1441 | 1441 | public static function is_option_true_in_object( $field, $option ) { |
| 1442 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
| 1442 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
| 1443 | 1443 | } |
| 1444 | 1444 | |
| 1445 | 1445 | /** |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | * @return bool |
| 1450 | 1450 | */ |
| 1451 | 1451 | public static function is_option_empty_in_array( $field, $option ) { |
| 1452 | - return empty( $field[ $option ] ); |
|
| 1452 | + return empty( $field[$option] ); |
|
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | /** |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | * @return bool |
| 1460 | 1460 | */ |
| 1461 | 1461 | public static function is_option_empty_in_object( $field, $option ) { |
| 1462 | - return empty( $field->field_options[ $option ] ); |
|
| 1462 | + return empty( $field->field_options[$option] ); |
|
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 | /** |
@@ -1469,7 +1469,7 @@ discard block |
||
| 1469 | 1469 | * @return bool |
| 1470 | 1470 | */ |
| 1471 | 1471 | public static function is_option_value_in_object( $field, $option ) { |
| 1472 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
| 1472 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | /** |
@@ -1491,10 +1491,10 @@ discard block |
||
| 1491 | 1491 | * @return mixed |
| 1492 | 1492 | */ |
| 1493 | 1493 | public static function get_option_in_array( $field, $option ) { |
| 1494 | - if ( isset( $field[ $option ] ) ) { |
|
| 1495 | - $this_option = $field[ $option ]; |
|
| 1496 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
| 1497 | - $this_option = $field['field_options'][ $option ]; |
|
| 1494 | + if ( isset( $field[$option] ) ) { |
|
| 1495 | + $this_option = $field[$option]; |
|
| 1496 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
| 1497 | + $this_option = $field['field_options'][$option]; |
|
| 1498 | 1498 | } else { |
| 1499 | 1499 | $this_option = ''; |
| 1500 | 1500 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | * @return mixed |
| 1510 | 1510 | */ |
| 1511 | 1511 | public static function get_option_in_object( $field, $option ) { |
| 1512 | - return $field->field_options[ $option ] ?? ''; |
|
| 1512 | + return $field->field_options[$option] ?? ''; |
|
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'payments' => $frm_payment->get_count(), |
| 129 | 129 | 'subscriptions' => $frm_sub->get_count(), |
| 130 | 130 | ); |
| 131 | - $type = FrmAppHelper::get_simple_request( |
|
| 131 | + $type = FrmAppHelper::get_simple_request( |
|
| 132 | 132 | array( |
| 133 | 133 | 'param' => 'trans_type', |
| 134 | 134 | 'type' => 'request', |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | foreach ( $statuses as $status => $name ) { |
| 140 | 140 | $class = $status === $type ? ' class="current"' : ''; |
| 141 | 141 | |
| 142 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
| 143 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 142 | + if ( $counts[$status] || 'published' === $status ) { |
|
| 143 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 144 | 144 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %4$s: Span close tag. |
| 145 | - . 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 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
| 146 | 146 | . '</a>'; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
| 239 | 239 | |
| 240 | 240 | $is_alternate = 0 === $alt % 2; |
| 241 | - ++$alt; |
|
| 241 | + ++ $alt; |
|
| 242 | 242 | |
| 243 | 243 | if ( $is_alternate ) { |
| 244 | 244 | echo 'class="alternate"'; |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $form_ids = array(); |
| 349 | 349 | |
| 350 | 350 | foreach ( $forms as $form ) { |
| 351 | - $form_ids[ $form->id ] = $form; |
|
| 351 | + $form_ids[$form->id] = $form; |
|
| 352 | 352 | unset( $form ); |
| 353 | 353 | } |
| 354 | 354 | |
@@ -501,8 +501,8 @@ discard block |
||
| 501 | 501 | * @return mixed |
| 502 | 502 | */ |
| 503 | 503 | private function get_form_id_column( $item, $atts ) { |
| 504 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
| 505 | - return FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
| 504 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
| 505 | + return FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | return ''; |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | */ |
| 584 | 584 | private function get_processing_tooltip() { |
| 585 | 585 | return FrmAppHelper::clip( |
| 586 | - function () { |
|
| 586 | + function() { |
|
| 587 | 587 | FrmAppHelper::tooltip_icon( __( 'This payment method may take between 4-5 business days to process.', 'formidable' ) ); |
| 588 | 588 | } |
| 589 | 589 | ); |
@@ -616,8 +616,8 @@ discard block |
||
| 616 | 616 | * @return string |
| 617 | 617 | */ |
| 618 | 618 | private function get_paysys_column( $item, $atts ) { |
| 619 | - if ( isset( $atts['gateways'][ $item->paysys ] ) ) { |
|
| 620 | - return $atts['gateways'][ $item->paysys ]['label']; |
|
| 619 | + if ( isset( $atts['gateways'][$item->paysys] ) ) { |
|
| 620 | + return $atts['gateways'][$item->paysys]['label']; |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | if ( 'paypal' === $item->paysys ) { |