@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | public function __construct( $data ) { |
90 | 90 | $sections = array( 'counters', 'license', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
91 | 91 | foreach ( $sections as $section ) { |
92 | - if ( isset( $data[ $section ] ) ) { |
|
93 | - $this->view[ $section ] = $data[ $section ]; |
|
92 | + if ( isset( $data[$section] ) ) { |
|
93 | + $this->view[$section] = $data[$section]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | private static function load_entries_list_template( $template ) { |
338 | 338 | add_filter( |
339 | 339 | 'formidable_page_formidable_entries_per_page', |
340 | - function () { |
|
340 | + function() { |
|
341 | 341 | return 7; |
342 | 342 | } |
343 | 343 | ); |
@@ -524,7 +524,8 @@ discard block |
||
524 | 524 | |
525 | 525 | if ( $src === 'get' ) { |
526 | 526 | $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
527 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
527 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
528 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
528 | 529 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
529 | 530 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
530 | 531 | } |
@@ -612,7 +613,8 @@ discard block |
||
612 | 613 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
613 | 614 | } |
614 | 615 | } elseif ( $args['type'] === 'post' ) { |
615 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
616 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
617 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
616 | 618 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
617 | 619 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
618 | 620 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | 'fill' => '#4d4d4d', |
203 | 203 | 'orange' => '#f05a24', |
204 | 204 | ); |
205 | - $atts = array_merge( $defaults, $atts ); |
|
205 | + $atts = array_merge( $defaults, $atts ); |
|
206 | 206 | |
207 | 207 | return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '"> |
208 | 208 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | * @return string |
421 | 421 | */ |
422 | 422 | public static function get_server_value( $value ) { |
423 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
423 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | /** |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $ip = ''; |
455 | 455 | |
456 | 456 | foreach ( $ip_options as $key ) { |
457 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
457 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
458 | 458 | continue; |
459 | 459 | } |
460 | 460 | |
@@ -523,10 +523,10 @@ discard block |
||
523 | 523 | } |
524 | 524 | |
525 | 525 | if ( $src === 'get' ) { |
526 | - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
527 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
526 | + $value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
527 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
528 | 528 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
529 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
529 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
530 | 530 | } |
531 | 531 | self::sanitize_value( $sanitize, $value ); |
532 | 532 | } else { |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | $p = trim( $p, ']' ); |
550 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
550 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
551 | 551 | } |
552 | 552 | } |
553 | 553 | |
@@ -603,26 +603,26 @@ discard block |
||
603 | 603 | 'sanitize' => 'sanitize_text_field', |
604 | 604 | 'serialized' => false, |
605 | 605 | ); |
606 | - $args = wp_parse_args( $args, $defaults ); |
|
606 | + $args = wp_parse_args( $args, $defaults ); |
|
607 | 607 | |
608 | 608 | $value = $args['default']; |
609 | 609 | if ( $args['type'] === 'get' ) { |
610 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
610 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
611 | 611 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
612 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
612 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
613 | 613 | } |
614 | 614 | } elseif ( $args['type'] === 'post' ) { |
615 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
615 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
616 | 616 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
617 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
617 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
618 | 618 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
619 | 619 | self::unserialize_or_decode( $value ); |
620 | 620 | } |
621 | 621 | } |
622 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
622 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
623 | 623 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
624 | 624 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
625 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
625 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | if ( is_array( $value ) ) { |
670 | 670 | $temp_values = $value; |
671 | 671 | foreach ( $temp_values as $k => $v ) { |
672 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
672 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
673 | 673 | } |
674 | 674 | return; |
675 | 675 | } |
@@ -680,8 +680,8 @@ discard block |
||
680 | 680 | public static function sanitize_request( $sanitize_method, &$values ) { |
681 | 681 | $temp_values = $values; |
682 | 682 | foreach ( $temp_values as $k => $val ) { |
683 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
684 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
683 | + if ( isset( $sanitize_method[$k] ) ) { |
|
684 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
685 | 685 | } |
686 | 686 | } |
687 | 687 | } |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | if ( is_array( $value ) ) { |
742 | 742 | $temp_values = $value; |
743 | 743 | foreach ( $temp_values as $k => $v ) { |
744 | - self::decode_specialchars( $value[ $k ] ); |
|
744 | + self::decode_specialchars( $value[$k] ); |
|
745 | 745 | } |
746 | 746 | } else { |
747 | 747 | self::decode_amp( $value ); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | * @return array |
864 | 864 | */ |
865 | 865 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
866 | - $allowed_html['input'] = array( |
|
866 | + $allowed_html['input'] = array( |
|
867 | 867 | 'type' => true, |
868 | 868 | 'value' => true, |
869 | 869 | 'formnovalidate' => true, |
@@ -886,7 +886,7 @@ discard block |
||
886 | 886 | $allowed_html = $html; |
887 | 887 | } elseif ( ! empty( $allowed ) ) { |
888 | 888 | foreach ( (array) $allowed as $a ) { |
889 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
889 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
890 | 890 | } |
891 | 891 | } |
892 | 892 | |
@@ -1065,8 +1065,8 @@ discard block |
||
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | global $wp_query; |
1068 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
1069 | - $value = $wp_query->query_vars[ $param ]; |
|
1068 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
1069 | + $value = $wp_query->query_vars[$param]; |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | return $value; |
@@ -1097,9 +1097,9 @@ discard block |
||
1097 | 1097 | 'frm_keyalt_icon' => 'frm_key_icon', |
1098 | 1098 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
1099 | 1099 | ); |
1100 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1101 | - $icon = $deprecated[ $icon ]; |
|
1102 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1100 | + if ( isset( $deprecated[$icon] ) ) { |
|
1101 | + $icon = $deprecated[$icon]; |
|
1102 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | if ( $icon === $class ) { |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | * @return string|void |
1224 | 1224 | */ |
1225 | 1225 | public static function array_to_html_params( $atts, $echo = false ) { |
1226 | - $callback = function () use ( $atts ) { |
|
1226 | + $callback = function() use ( $atts ) { |
|
1227 | 1227 | if ( $atts ) { |
1228 | 1228 | foreach ( $atts as $key => $value ) { |
1229 | 1229 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | 'input_id' => '', |
1375 | 1375 | 'value' => false, |
1376 | 1376 | ); |
1377 | - $atts = array_merge( $defaults, $atts ); |
|
1377 | + $atts = array_merge( $defaults, $atts ); |
|
1378 | 1378 | |
1379 | 1379 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
1380 | 1380 | $atts['tosearch'] = 'frm-card'; |
@@ -1450,7 +1450,7 @@ discard block |
||
1450 | 1450 | 'new_file_path' => self::plugin_path() . '/js', |
1451 | 1451 | ) |
1452 | 1452 | ); |
1453 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1453 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1454 | 1454 | |
1455 | 1455 | $files = array( |
1456 | 1456 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1963,8 +1963,8 @@ discard block |
||
1963 | 1963 | return $error; |
1964 | 1964 | } |
1965 | 1965 | |
1966 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1967 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1966 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1967 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1968 | 1968 | $frm_settings = self::get_settings(); |
1969 | 1969 | $error = $frm_settings->admin_permission; |
1970 | 1970 | } |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | } else { |
2000 | 2000 | foreach ( $value as $k => $v ) { |
2001 | 2001 | if ( ! is_array( $v ) ) { |
2002 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
2002 | + $value[$k] = call_user_func( $original_function, $v ); |
|
2003 | 2003 | } |
2004 | 2004 | } |
2005 | 2005 | } |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | if ( is_array( $value ) ) { |
2041 | 2041 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
2042 | 2042 | } elseif ( $keys === 'keep' ) { |
2043 | - $return[ $key ] = $value; |
|
2043 | + $return[$key] = $value; |
|
2044 | 2044 | } else { |
2045 | 2045 | $return[] = $value; |
2046 | 2046 | } |
@@ -2101,11 +2101,11 @@ discard block |
||
2101 | 2101 | } |
2102 | 2102 | |
2103 | 2103 | $ver = $default; |
2104 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
2104 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
2105 | 2105 | return $ver; |
2106 | 2106 | } |
2107 | 2107 | |
2108 | - $query = $wp_scripts->registered[ $handle ]; |
|
2108 | + $query = $wp_scripts->registered[$handle]; |
|
2109 | 2109 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
2110 | 2110 | $ver = $query->ver; |
2111 | 2111 | } |
@@ -2121,7 +2121,7 @@ discard block |
||
2121 | 2121 | * @return string|null |
2122 | 2122 | */ |
2123 | 2123 | public static function js_redirect( $url, $echo = false ) { |
2124 | - $callback = function () use ( $url ) { |
|
2124 | + $callback = function() use ( $url ) { |
|
2125 | 2125 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
2126 | 2126 | }; |
2127 | 2127 | return self::clip( $callback, $echo ); |
@@ -2216,7 +2216,7 @@ discard block |
||
2216 | 2216 | $suffix = 2; |
2217 | 2217 | do { |
2218 | 2218 | $key_check = $key . $separator . $suffix; |
2219 | - ++$suffix; |
|
2219 | + ++ $suffix; |
|
2220 | 2220 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2221 | 2221 | |
2222 | 2222 | $key = $key_check; |
@@ -2324,7 +2324,7 @@ discard block |
||
2324 | 2324 | |
2325 | 2325 | foreach ( array( 'name', 'description' ) as $var ) { |
2326 | 2326 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2327 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2327 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2328 | 2328 | unset( $var, $default_val ); |
2329 | 2329 | } |
2330 | 2330 | |
@@ -2380,9 +2380,9 @@ discard block |
||
2380 | 2380 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
2381 | 2381 | }//end if |
2382 | 2382 | |
2383 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2384 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2385 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2383 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2384 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2385 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2386 | 2386 | self::unserialize_or_decode( $new_value ); |
2387 | 2387 | } else { |
2388 | 2388 | $new_value = $meta_value; |
@@ -2403,7 +2403,7 @@ discard block |
||
2403 | 2403 | |
2404 | 2404 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2405 | 2405 | |
2406 | - $values['fields'][ $field->id ] = $field_array; |
|
2406 | + $values['fields'][$field->id] = $field_array; |
|
2407 | 2407 | } |
2408 | 2408 | |
2409 | 2409 | /** |
@@ -2453,11 +2453,11 @@ discard block |
||
2453 | 2453 | } |
2454 | 2454 | |
2455 | 2455 | foreach ( $form->options as $opt => $value ) { |
2456 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2457 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2458 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2456 | + if ( isset( $post_values[$opt] ) ) { |
|
2457 | + $values[$opt] = $post_values[$opt]; |
|
2458 | + self::unserialize_or_decode( $values[$opt] ); |
|
2459 | 2459 | } else { |
2460 | - $values[ $opt ] = $value; |
|
2460 | + $values[$opt] = $value; |
|
2461 | 2461 | } |
2462 | 2462 | } |
2463 | 2463 | |
@@ -2471,8 +2471,8 @@ discard block |
||
2471 | 2471 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2472 | 2472 | |
2473 | 2473 | foreach ( $form_defaults as $opt => $default ) { |
2474 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2475 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
2474 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2475 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
2476 | 2476 | } |
2477 | 2477 | |
2478 | 2478 | unset( $opt, $default ); |
@@ -2483,8 +2483,8 @@ discard block |
||
2483 | 2483 | } |
2484 | 2484 | |
2485 | 2485 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2486 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2487 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2486 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2487 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2488 | 2488 | } |
2489 | 2489 | unset( $h ); |
2490 | 2490 | } |
@@ -2663,25 +2663,25 @@ discard block |
||
2663 | 2663 | if ( ! is_numeric( $levels ) ) { |
2664 | 2664 | // Show time in specified unit. |
2665 | 2665 | $levels = self::get_unit( $levels ); |
2666 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2666 | + if ( isset( $time_strings[$levels] ) ) { |
|
2667 | 2667 | $diff = array( |
2668 | 2668 | $levels => self::time_format( $levels, $diff ), |
2669 | 2669 | ); |
2670 | 2670 | $time_strings = array( |
2671 | - $levels => $time_strings[ $levels ], |
|
2671 | + $levels => $time_strings[$levels], |
|
2672 | 2672 | ); |
2673 | 2673 | } |
2674 | 2674 | $levels = 1; |
2675 | 2675 | } |
2676 | 2676 | |
2677 | 2677 | foreach ( $time_strings as $k => $v ) { |
2678 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2679 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2680 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2678 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2679 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2680 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2681 | 2681 | // Account for 0. |
2682 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2682 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2683 | 2683 | } else { |
2684 | - unset( $time_strings[ $k ] ); |
|
2684 | + unset( $time_strings[$k] ); |
|
2685 | 2685 | } |
2686 | 2686 | } |
2687 | 2687 | |
@@ -2700,8 +2700,8 @@ discard block |
||
2700 | 2700 | 'y' => 'y', |
2701 | 2701 | 'd' => 'days', |
2702 | 2702 | ); |
2703 | - if ( isset( $return[ $unit ] ) ) { |
|
2704 | - return $diff[ $return[ $unit ] ]; |
|
2703 | + if ( isset( $return[$unit] ) ) { |
|
2704 | + return $diff[$return[$unit]]; |
|
2705 | 2705 | } |
2706 | 2706 | |
2707 | 2707 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2709,11 +2709,11 @@ discard block |
||
2709 | 2709 | $times = array( 'h', 'i', 's' ); |
2710 | 2710 | |
2711 | 2711 | foreach ( $times as $time ) { |
2712 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2712 | + if ( ! isset( $diff[$time] ) ) { |
|
2713 | 2713 | continue; |
2714 | 2714 | } |
2715 | 2715 | |
2716 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2716 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2717 | 2717 | } |
2718 | 2718 | |
2719 | 2719 | return floor( $total ); |
@@ -2733,7 +2733,7 @@ discard block |
||
2733 | 2733 | 'y' => DAY_IN_SECONDS * 365.25, |
2734 | 2734 | ); |
2735 | 2735 | |
2736 | - return $convert[ $from ] / $convert[ $to ]; |
|
2736 | + return $convert[$from] / $convert[$to]; |
|
2737 | 2737 | } |
2738 | 2738 | |
2739 | 2739 | /** |
@@ -2741,7 +2741,7 @@ discard block |
||
2741 | 2741 | */ |
2742 | 2742 | private static function get_unit( $unit ) { |
2743 | 2743 | $units = self::get_time_strings(); |
2744 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2744 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2745 | 2745 | return $unit; |
2746 | 2746 | } |
2747 | 2747 | |
@@ -2857,17 +2857,17 @@ discard block |
||
2857 | 2857 | |
2858 | 2858 | case 1: |
2859 | 2859 | $l2 = $name; |
2860 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2860 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2861 | 2861 | break; |
2862 | 2862 | |
2863 | 2863 | case 2: |
2864 | 2864 | $l3 = $name; |
2865 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2865 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2866 | 2866 | break; |
2867 | 2867 | |
2868 | 2868 | case 3: |
2869 | 2869 | $l4 = $name; |
2870 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2870 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2871 | 2871 | } |
2872 | 2872 | |
2873 | 2873 | unset( $this_val, $n ); |
@@ -2886,8 +2886,8 @@ discard block |
||
2886 | 2886 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2887 | 2887 | if ( $name == '' ) { |
2888 | 2888 | $vars[] = $val; |
2889 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2890 | - $vars[ $l1 ] = $val; |
|
2889 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2890 | + $vars[$l1] = $val; |
|
2891 | 2891 | } |
2892 | 2892 | } |
2893 | 2893 | |
@@ -2904,7 +2904,7 @@ discard block |
||
2904 | 2904 | 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ), |
2905 | 2905 | ); |
2906 | 2906 | |
2907 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2907 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2908 | 2908 | return; |
2909 | 2909 | } |
2910 | 2910 | |
@@ -2914,7 +2914,7 @@ discard block |
||
2914 | 2914 | echo ' class="frm_help"'; |
2915 | 2915 | } |
2916 | 2916 | |
2917 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2917 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2918 | 2918 | |
2919 | 2919 | if ( 'open' != $class ) { |
2920 | 2920 | echo '"'; |
@@ -2973,13 +2973,13 @@ discard block |
||
2973 | 2973 | } |
2974 | 2974 | |
2975 | 2975 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2976 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2976 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2977 | 2977 | return; |
2978 | 2978 | } |
2979 | 2979 | |
2980 | 2980 | if ( is_array( $val ) ) { |
2981 | 2981 | foreach ( $val as $k1 => $v1 ) { |
2982 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2982 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2983 | 2983 | unset( $k1, $v1 ); |
2984 | 2984 | } |
2985 | 2985 | } else { |
@@ -2987,7 +2987,7 @@ discard block |
||
2987 | 2987 | $val = stripslashes( $val ); |
2988 | 2988 | |
2989 | 2989 | // Add backslashes before double quotes and forward slashes only |
2990 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2990 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2991 | 2991 | } |
2992 | 2992 | } |
2993 | 2993 | |
@@ -3108,14 +3108,14 @@ discard block |
||
3108 | 3108 | continue; |
3109 | 3109 | } |
3110 | 3110 | $key = $input['name']; |
3111 | - if ( isset( $formatted[ $key ] ) ) { |
|
3112 | - if ( is_array( $formatted[ $key ] ) ) { |
|
3113 | - $formatted[ $key ][] = $input['value']; |
|
3111 | + if ( isset( $formatted[$key] ) ) { |
|
3112 | + if ( is_array( $formatted[$key] ) ) { |
|
3113 | + $formatted[$key][] = $input['value']; |
|
3114 | 3114 | } else { |
3115 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
3115 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
3116 | 3116 | } |
3117 | 3117 | } else { |
3118 | - $formatted[ $key ] = $input['value']; |
|
3118 | + $formatted[$key] = $input['value']; |
|
3119 | 3119 | } |
3120 | 3120 | } |
3121 | 3121 | |
@@ -3822,8 +3822,8 @@ discard block |
||
3822 | 3822 | } |
3823 | 3823 | |
3824 | 3824 | foreach ( $keys as $key ) { |
3825 | - if ( isset( $values[ $key ] ) ) { |
|
3826 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3825 | + if ( isset( $values[$key] ) ) { |
|
3826 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3827 | 3827 | } |
3828 | 3828 | } |
3829 | 3829 | |
@@ -3982,7 +3982,7 @@ discard block |
||
3982 | 3982 | return 0; |
3983 | 3983 | } |
3984 | 3984 | |
3985 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3985 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3986 | 3986 | } |
3987 | 3987 | |
3988 | 3988 | /** |
@@ -4002,7 +4002,7 @@ discard block |
||
4002 | 4002 | |
4003 | 4003 | add_filter( |
4004 | 4004 | 'option_gmt_offset', |
4005 | - function ( $offset ) { |
|
4005 | + function( $offset ) { |
|
4006 | 4006 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
4007 | 4007 | // Leave a valid value alone. |
4008 | 4008 | return $offset; |
@@ -4156,7 +4156,7 @@ discard block |
||
4156 | 4156 | return; |
4157 | 4157 | } |
4158 | 4158 | |
4159 | - $ajax_callback = function () use ( $option ) { |
|
4159 | + $ajax_callback = function() use ( $option ) { |
|
4160 | 4160 | self::dismiss_warning_message( $option ); |
4161 | 4161 | }; |
4162 | 4162 | |
@@ -4166,7 +4166,7 @@ discard block |
||
4166 | 4166 | |
4167 | 4167 | add_filter( |
4168 | 4168 | 'frm_message_list', |
4169 | - function ( $show_messages ) use ( $message, $option ) { |
|
4169 | + function( $show_messages ) use ( $message, $option ) { |
|
4170 | 4170 | if ( get_option( $option, false ) ) { |
4171 | 4171 | return $show_messages; |
4172 | 4172 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | // This filter flags the Pro credit card field that Stripe is enabled. |
28 | 28 | add_filter( |
29 | 29 | 'frm_pro_show_card_callback', |
30 | - function () { |
|
30 | + function() { |
|
31 | 31 | return 'FrmStrpLiteActionsController::show_card'; |
32 | 32 | } |
33 | 33 | ); |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | // This filter hides gateway fields from the entries list. |
36 | 36 | add_filter( |
37 | 37 | 'frm_fields_in_entries_list_table', |
38 | - function ( $form_cols ) { |
|
38 | + function( $form_cols ) { |
|
39 | 39 | return array_filter( |
40 | 40 | $form_cols, |
41 | - function ( $form_col ) { |
|
41 | + function( $form_col ) { |
|
42 | 42 | return 'gateway' !== $form_col->type; |
43 | 43 | } |
44 | 44 | ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param object $frm_settings |
25 | 25 | * @return void |
26 | 26 | */ |
27 | - function ( $frm_settings ) { |
|
27 | + function( $frm_settings ) { |
|
28 | 28 | $stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings; |
29 | 29 | require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php'; |
30 | 30 | } |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | |
149 | 149 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
150 | 150 | if ( $is_setup_intent ) { |
151 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
151 | + $errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
152 | 152 | } else { |
153 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
153 | + $errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
154 | 154 | } |
155 | 155 | |
156 | - if ( ! $errors[ 'field' . $cc_field_id ] ) { |
|
157 | - $errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.'; |
|
156 | + if ( ! $errors['field' . $cc_field_id] ) { |
|
157 | + $errors['field' . $cc_field_id] = 'Payment was not successfully processed.'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | global $frm_vars; |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | $save_draft = ! empty( $form->options['save_draft'] ); |
183 | 183 | |
184 | 184 | global $frm_vars; |
185 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
185 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
186 | 186 | |
187 | 187 | // Set to true to get FrmProFieldsHelper::get_page_with_error() run. |
188 | - $_POST[ 'frm_page_order_' . $form_id ] = true; |
|
188 | + $_POST['frm_page_order_' . $form_id] = true; |
|
189 | 189 | |
190 | 190 | if ( ! $save_draft ) { |
191 | 191 | // If draft saving is not on, delete the entry. |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | // If draft saving is on, load the draft entry. |
197 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
197 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
198 | 198 | add_action( |
199 | 199 | 'frm_filter_final_form', |
200 | 200 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @param int $entry_id |
205 | 205 | * @return string |
206 | 206 | */ |
207 | - function ( $html ) use ( $entry_id ) { |
|
207 | + function( $html ) use ( $entry_id ) { |
|
208 | 208 | global $wpdb; |
209 | 209 | $wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) ); |
210 | 210 | return $html; |
@@ -393,8 +393,8 @@ discard block |
||
393 | 393 | return $values; |
394 | 394 | } |
395 | 395 | |
396 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
397 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
396 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
397 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | $frm_vars['trans_filled'] = true; |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | * @param Closure $destroy_callback |
430 | 430 | * @return void |
431 | 431 | */ |
432 | - function () use ( $entry_id, &$destroy_callback ) { |
|
432 | + function() use ( $entry_id, &$destroy_callback ) { |
|
433 | 433 | FrmEntry::destroy( $entry_id ); |
434 | 434 | // Only call this once. |
435 | 435 | remove_action( 'frm_entry_form', $destroy_callback ); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | |
149 | 149 | register_deactivation_hook( |
150 | 150 | __FILE__, |
151 | - function () { |
|
151 | + function() { |
|
152 | 152 | if ( ! class_exists( 'FrmCronController', false ) ) { |
153 | 153 | require_once __DIR__ . '/classes/controllers/FrmCronController.php'; |
154 | 154 | } |
@@ -149,7 +149,7 @@ |
||
149 | 149 | 'form' => $entry->form_id, |
150 | 150 | 'value' => $action->post_content['description'], |
151 | 151 | ); |
152 | - $new_values = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) ); |
|
152 | + $new_values = array( 'description' => FrmTransLiteAppHelper::process_shortcodes( $shortcode_atts ) ); |
|
153 | 153 | FrmStrpLiteAppHelper::call_stripe_helper_class( 'update_intent', $intent->id, $new_values ); |
154 | 154 | } |
155 | 155 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $intent_is_processing = 'processing' === $intent->status; |
58 | 58 | if ( $intent_is_processing ) { |
59 | 59 | // Append an additional processing message to the end of the success message. |
60 | - $filter = function ( $message ) { |
|
60 | + $filter = function( $message ) { |
|
61 | 61 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
62 | 62 | $message .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>'; |
63 | 63 | return $message; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
163 | 163 | $opt = 'success_action'; |
164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public static function get_payment_intents( $name ) { |
240 | 240 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
241 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
241 | + if ( ! isset( $_POST[$name] ) ) { |
|
242 | 242 | return array(); |
243 | 243 | } |
244 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
244 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
245 | 245 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
246 | 246 | return $intents; |
247 | 247 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | self::format_form_data( $form ); |
269 | 269 | |
270 | 270 | $form_id = absint( $form['form_id'] ); |
271 | - $intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
271 | + $intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array(); |
|
272 | 272 | |
273 | 273 | if ( empty( $intents ) ) { |
274 | 274 | wp_die(); |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | $intents = array( $intents ); |
279 | 279 | } else { |
280 | 280 | foreach ( $intents as $k => $intent ) { |
281 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
282 | - $intents[ $k ] = $intent[ $k ]; |
|
281 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
282 | + $intents[$k] = $intent[$k]; |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | if ( $saved->metadata->action != $action->ID ) { |
333 | 333 | continue; |
334 | 334 | } |
335 | - $intents[ $k ] = array( |
|
335 | + $intents[$k] = array( |
|
336 | 336 | 'id' => $intent, |
337 | 337 | 'action' => $action->ID, |
338 | 338 | ); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | if ( $k === 'item_meta' ) { |
376 | 376 | foreach ( $v as $f => $value ) { |
377 | 377 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
378 | - $entry->metas[ absint( $f ) ] = $value; |
|
378 | + $entry->metas[absint( $f )] = $value; |
|
379 | 379 | } |
380 | 380 | } else { |
381 | 381 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -399,14 +399,14 @@ discard block |
||
399 | 399 | |
400 | 400 | foreach ( $form as $input ) { |
401 | 401 | $key = $input['name']; |
402 | - if ( isset( $formatted[ $key ] ) ) { |
|
403 | - if ( is_array( $formatted[ $key ] ) ) { |
|
404 | - $formatted[ $key ][] = $input['value']; |
|
402 | + if ( isset( $formatted[$key] ) ) { |
|
403 | + if ( is_array( $formatted[$key] ) ) { |
|
404 | + $formatted[$key][] = $input['value']; |
|
405 | 405 | } else { |
406 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
406 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
407 | 407 | } |
408 | 408 | } else { |
409 | - $formatted[ $key ] = $input['value']; |
|
409 | + $formatted[$key] = $input['value']; |
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | |
550 | 550 | foreach ( $actions as $k => $action ) { |
551 | 551 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
552 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
552 | + $actions[$k]->post_content['amount'] = $amount; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 |