@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // Flag to cancel subscription at period end. |
280 | 280 | // In this case, we do not want to cancel immediately. |
281 | 281 | $hook = 'frm_stripe_cancel_subscription_at_period_end'; |
282 | - $filter = function () { |
|
282 | + $filter = function() { |
|
283 | 283 | return true; |
284 | 284 | }; |
285 | 285 | |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | 'charge.refunded' => 'refunded', |
535 | 535 | ); |
536 | 536 | |
537 | - if ( isset( $events[ $this->event->type ] ) ) { |
|
538 | - $this->status = $events[ $this->event->type ]; |
|
537 | + if ( isset( $events[$this->event->type] ) ) { |
|
538 | + $this->status = $events[$this->event->type]; |
|
539 | 539 | $this->set_payment_status(); |
540 | 540 | } elseif ( $this->event->type === 'customer.deleted' ) { |
541 | 541 | $this->reset_customer(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'payments' => $frm_payment->get_count(), |
118 | 118 | 'subscriptions' => $frm_sub->get_count(), |
119 | 119 | ); |
120 | - $type = FrmAppHelper::get_simple_request( |
|
120 | + $type = FrmAppHelper::get_simple_request( |
|
121 | 121 | array( |
122 | 122 | 'param' => 'trans_type', |
123 | 123 | 'type' => 'request', |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | $class = ''; |
133 | 133 | } |
134 | 134 | |
135 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
136 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
135 | + if ( $counts[$status] || 'published' === $status ) { |
|
136 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
137 | 137 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %3$s: Span close tag. |
138 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
138 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
139 | 139 | . '</a>'; |
140 | 140 | } |
141 | 141 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
213 | 213 | |
214 | 214 | $is_alternate = 0 === $alt % 2; |
215 | - ++$alt; |
|
215 | + ++ $alt; |
|
216 | 216 | |
217 | 217 | if ( $is_alternate ) { |
218 | 218 | echo 'class="alternate"'; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | $form_ids = array(); |
305 | 305 | foreach ( $forms as $form ) { |
306 | - $form_ids[ $form->id ] = $form; |
|
306 | + $form_ids[$form->id] = $form; |
|
307 | 307 | unset( $form ); |
308 | 308 | } |
309 | 309 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | 'href' => esc_url( $link ), |
355 | 355 | 'title' => __( 'View', 'formidable' ), |
356 | 356 | ); |
357 | - $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
357 | + $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
358 | 358 | . $item->{$field} |
359 | 359 | . '</a>'; |
360 | 360 | |
@@ -409,8 +409,8 @@ discard block |
||
409 | 409 | * @return mixed |
410 | 410 | */ |
411 | 411 | private function get_form_id_column( $item, $atts ) { |
412 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
413 | - $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
412 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
413 | + $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
414 | 414 | return $form_link; |
415 | 415 | } |
416 | 416 | |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | */ |
486 | 486 | private function get_processing_tooltip() { |
487 | 487 | return FrmAppHelper::clip( |
488 | - function () { |
|
488 | + function() { |
|
489 | 489 | $params = array( |
490 | 490 | 'class' => 'frm_help frm_icon_font frm_tooltip_icon', |
491 | 491 | 'title' => __( 'This payment method may take between 4-5 business days to process.', 'formidable' ), |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public static function show_status( $status ) { |
68 | 68 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
69 | - return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status; |
|
69 | + return isset( $statuses[$status] ) ? $statuses[$status] : $status; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public static function get_action_setting( $option, $atts ) { |
154 | 154 | $settings = self::get_action_settings( $atts ); |
155 | - $value = isset( $settings[ $option ] ) ? $settings[ $option ] : ''; |
|
155 | + $value = isset( $settings[$option] ) ? $settings[$option] : ''; |
|
156 | 156 | return $value; |
157 | 157 | } |
158 | 158 | |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public static function get_repeat_label_from_value( $value, $number ) { |
257 | 257 | $times = self::get_plural_repeat_times( $number ); |
258 | - if ( isset( $times[ $value ] ) ) { |
|
259 | - $value = $times[ $value ]; |
|
258 | + if ( isset( $times[$value] ) ) { |
|
259 | + $value = $times[$value]; |
|
260 | 260 | } |
261 | 261 | return $value; |
262 | 262 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $count = 0; |
505 | 505 | foreach ( $payments as $payment ) { |
506 | 506 | if ( $payment->status === 'complete' ) { |
507 | - $count++; |
|
507 | + $count ++; |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | ); |
315 | 315 | |
316 | 316 | $where_is = strtolower( $where_is ); |
317 | - if ( isset( $switch_to[ $where_is ] ) ) { |
|
318 | - return ' ' . $switch_to[ $where_is ]; |
|
317 | + if ( isset( $switch_to[$where_is] ) ) { |
|
318 | + return ' ' . $switch_to[$where_is]; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // > and < need a little more work since we don't want them switched to >= and <= |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | $temp_args = $args; |
381 | 381 | foreach ( $temp_args as $k => $v ) { |
382 | 382 | if ( $v == '' ) { |
383 | - unset( $args[ $k ] ); |
|
383 | + unset( $args[$k] ); |
|
384 | 384 | continue; |
385 | 385 | } |
386 | 386 | |
387 | 387 | $db_name = strtoupper( str_replace( '_', ' ', $k ) ); |
388 | 388 | if ( strpos( $v, $db_name ) === false ) { |
389 | - $args[ $k ] = $db_name . ' ' . $v; |
|
389 | + $args[$k] = $db_name . ' ' . $v; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | |
@@ -460,13 +460,13 @@ discard block |
||
460 | 460 | private static function esc_query_args( &$args ) { |
461 | 461 | foreach ( $args as $param => $value ) { |
462 | 462 | if ( $param === 'order_by' ) { |
463 | - $args[ $param ] = self::esc_order( $value ); |
|
463 | + $args[$param] = self::esc_order( $value ); |
|
464 | 464 | } elseif ( $param === 'limit' ) { |
465 | - $args[ $param ] = self::esc_limit( $value ); |
|
465 | + $args[$param] = self::esc_limit( $value ); |
|
466 | 466 | } |
467 | 467 | |
468 | - if ( $args[ $param ] == '' ) { |
|
469 | - unset( $args[ $param ] ); |
|
468 | + if ( $args[$param] == '' ) { |
|
469 | + unset( $args[$param] ); |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | $limit = explode( ',', trim( $limit ) ); |
549 | 549 | foreach ( $limit as $k => $l ) { |
550 | 550 | if ( is_numeric( $l ) ) { |
551 | - $limit[ $k ] = $l; |
|
551 | + $limit[$k] = $l; |
|
552 | 552 | } |
553 | 553 | } |
554 | 554 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public static function add_key_to_group_cache( $key, $group ) { |
703 | 703 | $cached = self::get_group_cached_keys( $group ); |
704 | - $cached[ $key ] = $key; |
|
704 | + $cached[$key] = $key; |
|
705 | 705 | wp_cache_set( 'cached_keys', $cached, $group, 300 ); |
706 | 706 | } |
707 | 707 |
@@ -300,8 +300,8 @@ discard block |
||
300 | 300 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
301 | 301 | } |
302 | 302 | $plugins = get_plugins(); |
303 | - if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) { |
|
304 | - return $plugins[ $plugin ]['Version']; |
|
303 | + if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) { |
|
304 | + return $plugins[$plugin]['Version']; |
|
305 | 305 | } |
306 | 306 | return false; |
307 | 307 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
375 | 375 | |
376 | 376 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
377 | - $new_values[ $col ] = $values[ $col ]; |
|
377 | + $new_values[$col] = $values[$col]; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | $new_values['options'] = self::maybe_filter_options( $values['options'] ); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
386 | 386 | |
387 | 387 | if ( isset( $values['id'] ) ) { |
388 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
388 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
389 | 389 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
390 | 390 | } |
391 | 391 | |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | foreach ( $new_values as $k => $v ) { |
395 | 395 | if ( is_array( $v ) ) { |
396 | 396 | if ( $k === 'default_value' ) { |
397 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
397 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
398 | 398 | } else { |
399 | - $new_values[ $k ] = serialize( $v ); |
|
399 | + $new_values[$k] = serialize( $v ); |
|
400 | 400 | } |
401 | 401 | } |
402 | 402 | unset( $k, $v ); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | if ( isset( $values['id'] ) ) { |
419 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
419 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | return $new_id; |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
477 | 477 | global $frm_duplicate_ids; |
478 | 478 | |
479 | - $where = array( |
|
479 | + $where = array( |
|
480 | 480 | array( |
481 | 481 | 'or' => 1, |
482 | 482 | 'fi.form_id' => $old_form_id, |
@@ -522,8 +522,8 @@ discard block |
||
522 | 522 | |
523 | 523 | $values = apply_filters( 'frm_duplicated_field', $values ); |
524 | 524 | $new_id = self::create( $values ); |
525 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
526 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
525 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
526 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
527 | 527 | unset( $field ); |
528 | 528 | }//end foreach |
529 | 529 | } |
@@ -572,11 +572,11 @@ discard block |
||
572 | 572 | |
573 | 573 | // serialize array values |
574 | 574 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
575 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
575 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
576 | 576 | if ( 'field_options' === $opt ) { |
577 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
577 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
578 | 578 | } |
579 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
579 | + $values[$opt] = serialize( $values[$opt] ); |
|
580 | 580 | } |
581 | 581 | } |
582 | 582 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | 'id' => $id, |
732 | 732 | 'field_key' => $id, |
733 | 733 | ); |
734 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
734 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | return $type; |
@@ -763,8 +763,8 @@ discard block |
||
763 | 763 | continue; |
764 | 764 | } |
765 | 765 | |
766 | - $fields[ $result->id ] = $result; |
|
767 | - ++$count; |
|
766 | + $fields[$result->id] = $result; |
|
767 | + ++ $count; |
|
768 | 768 | if ( $limit == 1 ) { |
769 | 769 | $fields = $result; |
770 | 770 | break; |
@@ -815,8 +815,8 @@ discard block |
||
815 | 815 | $fields = array(); |
816 | 816 | $count = 0; |
817 | 817 | foreach ( $results as $result ) { |
818 | - ++$count; |
|
819 | - $fields[ $result->id ] = $result; |
|
818 | + ++ $count; |
|
819 | + $fields[$result->id] = $result; |
|
820 | 820 | if ( ! empty( $limit ) && $count >= $limit ) { |
821 | 821 | break; |
822 | 822 | } |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
931 | 931 | |
932 | 932 | if ( is_array( $where ) ) { |
933 | - $args = array( |
|
933 | + $args = array( |
|
934 | 934 | 'order_by' => $order_by, |
935 | 935 | 'limit' => $limit, |
936 | 936 | ); |
@@ -961,9 +961,9 @@ discard block |
||
961 | 961 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
962 | 962 | |
963 | 963 | self::prepare_options( $result ); |
964 | - $results[ $r_key ]->field_options = $result->field_options; |
|
965 | - $results[ $r_key ]->options = $result->options; |
|
966 | - $results[ $r_key ]->default_value = $result->default_value; |
|
964 | + $results[$r_key]->field_options = $result->field_options; |
|
965 | + $results[$r_key]->options = $result->options; |
|
966 | + $results[$r_key]->default_value = $result->default_value; |
|
967 | 967 | |
968 | 968 | unset( $r_key, $result ); |
969 | 969 | } |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | |
1020 | 1020 | if ( count( $next_fields ) >= self::$transient_size ) { |
1021 | 1021 | // if this transient is full, check for another |
1022 | - ++$next; |
|
1022 | + ++ $next; |
|
1023 | 1023 | self::get_next_transient( $fields, $base_name, $next ); |
1024 | 1024 | } |
1025 | 1025 | } |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | return; |
1048 | 1048 | } |
1049 | 1049 | |
1050 | - ++$next; |
|
1050 | + ++ $next; |
|
1051 | 1051 | } |
1052 | 1052 | } |
1053 | 1053 | |
@@ -1195,7 +1195,7 @@ discard block |
||
1195 | 1195 | * @return bool |
1196 | 1196 | */ |
1197 | 1197 | public static function is_option_true_in_array( $field, $option ) { |
1198 | - return ! empty( $field[ $option ] ); |
|
1198 | + return ! empty( $field[$option] ); |
|
1199 | 1199 | } |
1200 | 1200 | |
1201 | 1201 | /** |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | * @return bool |
1205 | 1205 | */ |
1206 | 1206 | public static function is_option_true_in_object( $field, $option ) { |
1207 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1207 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1208 | 1208 | } |
1209 | 1209 | |
1210 | 1210 | /** |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | * @return bool |
1214 | 1214 | */ |
1215 | 1215 | public static function is_option_empty_in_array( $field, $option ) { |
1216 | - return empty( $field[ $option ] ); |
|
1216 | + return empty( $field[$option] ); |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | /** |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | * @return bool |
1223 | 1223 | */ |
1224 | 1224 | public static function is_option_empty_in_object( $field, $option ) { |
1225 | - return empty( $field->field_options[ $option ] ); |
|
1225 | + return empty( $field->field_options[$option] ); |
|
1226 | 1226 | } |
1227 | 1227 | |
1228 | 1228 | /** |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | * @return bool |
1232 | 1232 | */ |
1233 | 1233 | public static function is_option_value_in_object( $field, $option ) { |
1234 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1234 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | /** |
@@ -1257,10 +1257,10 @@ discard block |
||
1257 | 1257 | * @return mixed |
1258 | 1258 | */ |
1259 | 1259 | public static function get_option_in_array( $field, $option ) { |
1260 | - if ( isset( $field[ $option ] ) ) { |
|
1261 | - $this_option = $field[ $option ]; |
|
1262 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1263 | - $this_option = $field['field_options'][ $option ]; |
|
1260 | + if ( isset( $field[$option] ) ) { |
|
1261 | + $this_option = $field[$option]; |
|
1262 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1263 | + $this_option = $field['field_options'][$option]; |
|
1264 | 1264 | } else { |
1265 | 1265 | $this_option = ''; |
1266 | 1266 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | * @return mixed |
1275 | 1275 | */ |
1276 | 1276 | public static function get_option_in_object( $field, $option ) { |
1277 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1277 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1278 | 1278 | } |
1279 | 1279 | |
1280 | 1280 | /** |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | add_filter( |
7 | 7 | 'document_title', |
8 | - function ( $title ) use ( $form ) { |
|
8 | + function( $title ) use ( $form ) { |
|
9 | 9 | $form_name = '' === $form->name ? __( '(no title)', 'formidable' ) : $form->name; |
10 | 10 | return get_bloginfo( 'name', 'display' ) . ' | ' . wp_strip_all_tags( $form_name ); |
11 | 11 | } |