@@ -28,8 +28,11 @@ |
||
| 28 | 28 | <div class="<?php echo esc_attr( $classes ); ?>"> |
| 29 | 29 | <?php if ( $is_active ) : ?> |
| 30 | 30 | <?php echo esc_html( $details['label'] ); ?> |
| 31 | - <?php else : ?> |
|
| 32 | - <a href="<?php echo esc_url( $details['url'] ); ?>"> |
|
| 31 | + <?php else { |
|
| 32 | + : ?> |
|
| 33 | + <a href="<?php echo esc_url( $details['url'] ); |
|
| 34 | +} |
|
| 35 | +?>"> |
|
| 33 | 36 | <?php echo esc_html( $details['label'] ); ?> |
| 34 | 37 | </a> |
| 35 | 38 | <?php endif; ?> |
@@ -123,7 +123,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * |
| 181 | 181 | * @return array |
| 182 | 182 | */ |
| 183 | - public function get_bulk_actions(){ |
|
| 183 | + public function get_bulk_actions() { |
|
| 184 | 184 | $actions = array(); |
| 185 | 185 | if ( $this->payments_addon_list_helper_exists() ) { |
| 186 | 186 | $actions['bulk_delete'] = __( 'Delete', 'formidable' ); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
| 233 | 233 | |
| 234 | 234 | $is_alternate = 0 === $alt % 2; |
| 235 | - ++$alt; |
|
| 235 | + ++ $alt; |
|
| 236 | 236 | |
| 237 | 237 | if ( $is_alternate ) { |
| 238 | 238 | echo 'class="alternate"'; |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | $form_ids = array(); |
| 340 | 340 | foreach ( $forms as $form ) { |
| 341 | - $form_ids[ $form->id ] = $form; |
|
| 341 | + $form_ids[$form->id] = $form; |
|
| 342 | 342 | unset( $form ); |
| 343 | 343 | } |
| 344 | 344 | |
@@ -491,8 +491,8 @@ discard block |
||
| 491 | 491 | * @return mixed |
| 492 | 492 | */ |
| 493 | 493 | private function get_form_id_column( $item, $atts ) { |
| 494 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
| 495 | - $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
| 494 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
| 495 | + $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
| 496 | 496 | return $form_link; |
| 497 | 497 | } |
| 498 | 498 | |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | private function get_processing_tooltip() { |
| 569 | 569 | return FrmAppHelper::clip( |
| 570 | - function () { |
|
| 570 | + function() { |
|
| 571 | 571 | FrmAppHelper::tooltip_icon( __( 'This payment method may take between 4-5 business days to process.', 'formidable' ) ); |
| 572 | 572 | } |
| 573 | 573 | ); |
@@ -180,7 +180,7 @@ |
||
| 180 | 180 | * |
| 181 | 181 | * @return array |
| 182 | 182 | */ |
| 183 | - public function get_bulk_actions(){ |
|
| 183 | + public function get_bulk_actions() { |
|
| 184 | 184 | $actions = array(); |
| 185 | 185 | if ( $this->payments_addon_list_helper_exists() ) { |
| 186 | 186 | $actions['bulk_delete'] = __( 'Delete', 'formidable' ); |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | /** |
| 9 | 9 | * @var bool |
| 10 | 10 | */ |
| 11 | - public static $use_cache = true; |
|
| 11 | + public static $use_cache = true; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * @var int |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | 'coupon' => '2026-01-01', |
| 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 | |
@@ -423,9 +423,9 @@ discard block |
||
| 423 | 423 | foreach ( $new_values as $k => $v ) { |
| 424 | 424 | if ( is_array( $v ) ) { |
| 425 | 425 | if ( $k === 'default_value' ) { |
| 426 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
| 426 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
| 427 | 427 | } else { |
| 428 | - $new_values[ $k ] = serialize( $v ); |
|
| 428 | + $new_values[$k] = serialize( $v ); |
|
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | unset( $k, $v ); |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | if ( isset( $values['id'] ) ) { |
| 448 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 448 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | return $new_id; |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | * |
| 500 | 500 | * @return string |
| 501 | 501 | */ |
| 502 | - function ( $match ) { |
|
| 502 | + function( $match ) { |
|
| 503 | 503 | $attr = shortcode_parse_atts( $match[3] ); |
| 504 | 504 | |
| 505 | 505 | if ( ! is_array( $attr ) ) { |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
| 527 | - $safe_atts[ $key ] = $value; |
|
| 527 | + $safe_atts[$key] = $value; |
|
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | 530 | |
@@ -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, |
@@ -641,8 +641,8 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 643 | 643 | $new_id = self::create( $values ); |
| 644 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 645 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 644 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 645 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 646 | 646 | unset( $field ); |
| 647 | 647 | }//end foreach |
| 648 | 648 | } |
@@ -692,11 +692,11 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | // serialize array values |
| 694 | 694 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
| 695 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 695 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 696 | 696 | if ( 'field_options' === $opt ) { |
| 697 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
| 697 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
| 698 | 698 | } |
| 699 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 699 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -905,8 +905,8 @@ discard block |
||
| 905 | 905 | continue; |
| 906 | 906 | } |
| 907 | 907 | |
| 908 | - $fields[ $result->id ] = $result; |
|
| 909 | - ++$count; |
|
| 908 | + $fields[$result->id] = $result; |
|
| 909 | + ++ $count; |
|
| 910 | 910 | if ( $limit == 1 ) { |
| 911 | 911 | $fields = $result; |
| 912 | 912 | break; |
@@ -958,8 +958,8 @@ discard block |
||
| 958 | 958 | $fields = array(); |
| 959 | 959 | $count = 0; |
| 960 | 960 | foreach ( $results as $result ) { |
| 961 | - ++$count; |
|
| 962 | - $fields[ $result->id ] = $result; |
|
| 961 | + ++ $count; |
|
| 962 | + $fields[$result->id] = $result; |
|
| 963 | 963 | if ( ! empty( $limit ) && $count >= $limit ) { |
| 964 | 964 | break; |
| 965 | 965 | } |
@@ -1086,7 +1086,7 @@ discard block |
||
| 1086 | 1086 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
| 1087 | 1087 | |
| 1088 | 1088 | if ( is_array( $where ) ) { |
| 1089 | - $args = array( |
|
| 1089 | + $args = array( |
|
| 1090 | 1090 | 'order_by' => $order_by, |
| 1091 | 1091 | 'limit' => $limit, |
| 1092 | 1092 | ); |
@@ -1123,9 +1123,9 @@ discard block |
||
| 1123 | 1123 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 1124 | 1124 | |
| 1125 | 1125 | self::prepare_options( $result ); |
| 1126 | - $results[ $r_key ]->field_options = $result->field_options; |
|
| 1127 | - $results[ $r_key ]->options = $result->options; |
|
| 1128 | - $results[ $r_key ]->default_value = $result->default_value; |
|
| 1126 | + $results[$r_key]->field_options = $result->field_options; |
|
| 1127 | + $results[$r_key]->options = $result->options; |
|
| 1128 | + $results[$r_key]->default_value = $result->default_value; |
|
| 1129 | 1129 | |
| 1130 | 1130 | unset( $r_key, $result ); |
| 1131 | 1131 | } |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | |
| 1221 | 1221 | if ( count( $next_fields ) >= self::$transient_size ) { |
| 1222 | 1222 | // if this transient is full, check for another |
| 1223 | - ++$next; |
|
| 1223 | + ++ $next; |
|
| 1224 | 1224 | self::get_next_transient( $fields, $base_name, $next ); |
| 1225 | 1225 | } |
| 1226 | 1226 | } |
@@ -1255,7 +1255,7 @@ discard block |
||
| 1255 | 1255 | return; |
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | - ++$next; |
|
| 1258 | + ++ $next; |
|
| 1259 | 1259 | } |
| 1260 | 1260 | } |
| 1261 | 1261 | |
@@ -1417,7 +1417,7 @@ discard block |
||
| 1417 | 1417 | * @return bool |
| 1418 | 1418 | */ |
| 1419 | 1419 | public static function is_option_true_in_array( $field, $option ) { |
| 1420 | - return ! empty( $field[ $option ] ); |
|
| 1420 | + return ! empty( $field[$option] ); |
|
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | 1423 | /** |
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | * @return bool |
| 1428 | 1428 | */ |
| 1429 | 1429 | public static function is_option_true_in_object( $field, $option ) { |
| 1430 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
| 1430 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | /** |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | * @return bool |
| 1438 | 1438 | */ |
| 1439 | 1439 | public static function is_option_empty_in_array( $field, $option ) { |
| 1440 | - return empty( $field[ $option ] ); |
|
| 1440 | + return empty( $field[$option] ); |
|
| 1441 | 1441 | } |
| 1442 | 1442 | |
| 1443 | 1443 | /** |
@@ -1447,7 +1447,7 @@ discard block |
||
| 1447 | 1447 | * @return bool |
| 1448 | 1448 | */ |
| 1449 | 1449 | public static function is_option_empty_in_object( $field, $option ) { |
| 1450 | - return empty( $field->field_options[ $option ] ); |
|
| 1450 | + return empty( $field->field_options[$option] ); |
|
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | /** |
@@ -1457,7 +1457,7 @@ discard block |
||
| 1457 | 1457 | * @return bool |
| 1458 | 1458 | */ |
| 1459 | 1459 | public static function is_option_value_in_object( $field, $option ) { |
| 1460 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
| 1460 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | |
| 1463 | 1463 | /** |
@@ -1485,10 +1485,10 @@ discard block |
||
| 1485 | 1485 | * @return mixed |
| 1486 | 1486 | */ |
| 1487 | 1487 | public static function get_option_in_array( $field, $option ) { |
| 1488 | - if ( isset( $field[ $option ] ) ) { |
|
| 1489 | - $this_option = $field[ $option ]; |
|
| 1490 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
| 1491 | - $this_option = $field['field_options'][ $option ]; |
|
| 1488 | + if ( isset( $field[$option] ) ) { |
|
| 1489 | + $this_option = $field[$option]; |
|
| 1490 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
| 1491 | + $this_option = $field['field_options'][$option]; |
|
| 1492 | 1492 | } else { |
| 1493 | 1493 | $this_option = ''; |
| 1494 | 1494 | } |
@@ -1503,7 +1503,7 @@ discard block |
||
| 1503 | 1503 | * @return mixed |
| 1504 | 1504 | */ |
| 1505 | 1505 | public static function get_option_in_object( $field, $option ) { |
| 1506 | - return $field->field_options[ $option ] ?? ''; |
|
| 1506 | + return $field->field_options[$option] ?? ''; |
|
| 1507 | 1507 | } |
| 1508 | 1508 | |
| 1509 | 1509 | /** |