@@ -493,7 +493,8 @@ discard block |
||
493 | 493 | |
494 | 494 | if ( $src === 'get' ) { |
495 | 495 | $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 |
496 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
496 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
497 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
497 | 498 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
498 | 499 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
499 | 500 | } |
@@ -581,7 +582,8 @@ discard block |
||
581 | 582 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
582 | 583 | } |
583 | 584 | } elseif ( $args['type'] === 'post' ) { |
584 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
586 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | 587 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
586 | 588 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
587 | 589 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -589,7 +591,8 @@ discard block |
||
589 | 591 | } |
590 | 592 | } |
591 | 593 | } else { |
592 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
594 | + if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
595 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
593 | 596 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
594 | 597 | $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
595 | 598 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | 'fill' => '#4d4d4d', |
199 | 199 | 'orange' => '#f05a24', |
200 | 200 | ); |
201 | - $atts = array_merge( $defaults, $atts ); |
|
201 | + $atts = array_merge( $defaults, $atts ); |
|
202 | 202 | |
203 | 203 | 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'] ) . '"> |
204 | 204 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * @return string |
406 | 406 | */ |
407 | 407 | public static function get_server_value( $value ) { |
408 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
408 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $ip = ''; |
440 | 440 | |
441 | 441 | foreach ( $ip_options as $key ) { |
442 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
442 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
443 | 443 | continue; |
444 | 444 | } |
445 | 445 | |
@@ -508,10 +508,10 @@ discard block |
||
508 | 508 | } |
509 | 509 | |
510 | 510 | if ( $src === 'get' ) { |
511 | - $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 |
|
512 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
511 | + $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 |
|
512 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
513 | 513 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
514 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
514 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
515 | 515 | } |
516 | 516 | self::sanitize_value( $sanitize, $value ); |
517 | 517 | } else { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | } |
533 | 533 | |
534 | 534 | $p = trim( $p, ']' ); |
535 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
535 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
536 | 536 | } |
537 | 537 | } |
538 | 538 | |
@@ -588,26 +588,26 @@ discard block |
||
588 | 588 | 'sanitize' => 'sanitize_text_field', |
589 | 589 | 'serialized' => false, |
590 | 590 | ); |
591 | - $args = wp_parse_args( $args, $defaults ); |
|
591 | + $args = wp_parse_args( $args, $defaults ); |
|
592 | 592 | |
593 | 593 | $value = $args['default']; |
594 | 594 | if ( $args['type'] === 'get' ) { |
595 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
595 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
596 | 596 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
597 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
597 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
598 | 598 | } |
599 | 599 | } elseif ( $args['type'] === 'post' ) { |
600 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
600 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
601 | 601 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
602 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
602 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
603 | 603 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
604 | 604 | self::unserialize_or_decode( $value ); |
605 | 605 | } |
606 | 606 | } |
607 | 607 | } else { |
608 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
608 | + if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
609 | 609 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
610 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
610 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | if ( is_array( $value ) ) { |
640 | 640 | $temp_values = $value; |
641 | 641 | foreach ( $temp_values as $k => $v ) { |
642 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
642 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
643 | 643 | } |
644 | 644 | } else { |
645 | 645 | $value = call_user_func( $sanitize, $value ); |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | public static function sanitize_request( $sanitize_method, &$values ) { |
651 | 651 | $temp_values = $values; |
652 | 652 | foreach ( $temp_values as $k => $val ) { |
653 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
654 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
653 | + if ( isset( $sanitize_method[$k] ) ) { |
|
654 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
655 | 655 | } |
656 | 656 | } |
657 | 657 | } |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | if ( is_array( $value ) ) { |
709 | 709 | $temp_values = $value; |
710 | 710 | foreach ( $temp_values as $k => $v ) { |
711 | - self::decode_specialchars( $value[ $k ] ); |
|
711 | + self::decode_specialchars( $value[$k] ); |
|
712 | 712 | } |
713 | 713 | } else { |
714 | 714 | self::decode_amp( $value ); |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | * @return array |
831 | 831 | */ |
832 | 832 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
833 | - $allowed_html['input'] = array( |
|
833 | + $allowed_html['input'] = array( |
|
834 | 834 | 'type' => true, |
835 | 835 | 'value' => true, |
836 | 836 | 'formnovalidate' => true, |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | $allowed_html = $html; |
854 | 854 | } elseif ( ! empty( $allowed ) ) { |
855 | 855 | foreach ( (array) $allowed as $a ) { |
856 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
856 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
857 | 857 | } |
858 | 858 | } |
859 | 859 | |
@@ -1032,8 +1032,8 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | global $wp_query; |
1035 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
1036 | - $value = $wp_query->query_vars[ $param ]; |
|
1035 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
1036 | + $value = $wp_query->query_vars[$param]; |
|
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | return $value; |
@@ -1062,9 +1062,9 @@ discard block |
||
1062 | 1062 | 'frm_keyalt_icon' => 'frm_key_icon', |
1063 | 1063 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
1064 | 1064 | ); |
1065 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1066 | - $icon = $deprecated[ $icon ]; |
|
1067 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1065 | + if ( isset( $deprecated[$icon] ) ) { |
|
1066 | + $icon = $deprecated[$icon]; |
|
1067 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1068 | 1068 | } |
1069 | 1069 | |
1070 | 1070 | if ( $icon === $class ) { |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | 'new_file_path' => self::plugin_path() . '/js', |
1398 | 1398 | ) |
1399 | 1399 | ); |
1400 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1400 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1401 | 1401 | |
1402 | 1402 | $files = array( |
1403 | 1403 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | 'new_file_path' => self::plugin_path() . '/js', |
1417 | 1417 | ) |
1418 | 1418 | ); |
1419 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1419 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1420 | 1420 | $files = array( |
1421 | 1421 | FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js', |
1422 | 1422 | ); |
@@ -1907,8 +1907,8 @@ discard block |
||
1907 | 1907 | return $error; |
1908 | 1908 | } |
1909 | 1909 | |
1910 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1911 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1910 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1911 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1912 | 1912 | $frm_settings = self::get_settings(); |
1913 | 1913 | $error = $frm_settings->admin_permission; |
1914 | 1914 | } |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | } else { |
1944 | 1944 | foreach ( $value as $k => $v ) { |
1945 | 1945 | if ( ! is_array( $v ) ) { |
1946 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1946 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1947 | 1947 | } |
1948 | 1948 | } |
1949 | 1949 | } |
@@ -1968,7 +1968,7 @@ discard block |
||
1968 | 1968 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1969 | 1969 | } else { |
1970 | 1970 | if ( $keys === 'keep' ) { |
1971 | - $return[ $key ] = $value; |
|
1971 | + $return[$key] = $value; |
|
1972 | 1972 | } else { |
1973 | 1973 | $return[] = $value; |
1974 | 1974 | } |
@@ -2021,11 +2021,11 @@ discard block |
||
2021 | 2021 | } |
2022 | 2022 | |
2023 | 2023 | $ver = $default; |
2024 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
2024 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
2025 | 2025 | return $ver; |
2026 | 2026 | } |
2027 | 2027 | |
2028 | - $query = $wp_scripts->registered[ $handle ]; |
|
2028 | + $query = $wp_scripts->registered[$handle]; |
|
2029 | 2029 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
2030 | 2030 | $ver = $query->ver; |
2031 | 2031 | } |
@@ -2131,7 +2131,7 @@ discard block |
||
2131 | 2131 | $suffix = 2; |
2132 | 2132 | do { |
2133 | 2133 | $key_check = $key . $separator . $suffix; |
2134 | - ++$suffix; |
|
2134 | + ++ $suffix; |
|
2135 | 2135 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2136 | 2136 | |
2137 | 2137 | $key = $key_check; |
@@ -2239,7 +2239,7 @@ discard block |
||
2239 | 2239 | |
2240 | 2240 | foreach ( array( 'name', 'description' ) as $var ) { |
2241 | 2241 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2242 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2242 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2243 | 2243 | unset( $var, $default_val ); |
2244 | 2244 | } |
2245 | 2245 | |
@@ -2297,9 +2297,9 @@ discard block |
||
2297 | 2297 | } |
2298 | 2298 | }//end if |
2299 | 2299 | |
2300 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2301 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2302 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2300 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2301 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2302 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2303 | 2303 | self::unserialize_or_decode( $new_value ); |
2304 | 2304 | } else { |
2305 | 2305 | $new_value = $meta_value; |
@@ -2320,7 +2320,7 @@ discard block |
||
2320 | 2320 | |
2321 | 2321 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2322 | 2322 | |
2323 | - $values['fields'][ $field->id ] = $field_array; |
|
2323 | + $values['fields'][$field->id] = $field_array; |
|
2324 | 2324 | } |
2325 | 2325 | |
2326 | 2326 | /** |
@@ -2370,11 +2370,11 @@ discard block |
||
2370 | 2370 | } |
2371 | 2371 | |
2372 | 2372 | foreach ( $form->options as $opt => $value ) { |
2373 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2374 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2375 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2373 | + if ( isset( $post_values[$opt] ) ) { |
|
2374 | + $values[$opt] = $post_values[$opt]; |
|
2375 | + self::unserialize_or_decode( $values[$opt] ); |
|
2376 | 2376 | } else { |
2377 | - $values[ $opt ] = $value; |
|
2377 | + $values[$opt] = $value; |
|
2378 | 2378 | } |
2379 | 2379 | } |
2380 | 2380 | |
@@ -2388,8 +2388,8 @@ discard block |
||
2388 | 2388 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2389 | 2389 | |
2390 | 2390 | foreach ( $form_defaults as $opt => $default ) { |
2391 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2392 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
2391 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2392 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
2393 | 2393 | } |
2394 | 2394 | |
2395 | 2395 | unset( $opt, $default ); |
@@ -2400,8 +2400,8 @@ discard block |
||
2400 | 2400 | } |
2401 | 2401 | |
2402 | 2402 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2403 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2404 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2403 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2404 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2405 | 2405 | } |
2406 | 2406 | unset( $h ); |
2407 | 2407 | } |
@@ -2579,25 +2579,25 @@ discard block |
||
2579 | 2579 | if ( ! is_numeric( $levels ) ) { |
2580 | 2580 | // Show time in specified unit. |
2581 | 2581 | $levels = self::get_unit( $levels ); |
2582 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2582 | + if ( isset( $time_strings[$levels] ) ) { |
|
2583 | 2583 | $diff = array( |
2584 | 2584 | $levels => self::time_format( $levels, $diff ), |
2585 | 2585 | ); |
2586 | 2586 | $time_strings = array( |
2587 | - $levels => $time_strings[ $levels ], |
|
2587 | + $levels => $time_strings[$levels], |
|
2588 | 2588 | ); |
2589 | 2589 | } |
2590 | 2590 | $levels = 1; |
2591 | 2591 | } |
2592 | 2592 | |
2593 | 2593 | foreach ( $time_strings as $k => $v ) { |
2594 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2595 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2596 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2594 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2595 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2596 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2597 | 2597 | // Account for 0. |
2598 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2598 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2599 | 2599 | } else { |
2600 | - unset( $time_strings[ $k ] ); |
|
2600 | + unset( $time_strings[$k] ); |
|
2601 | 2601 | } |
2602 | 2602 | } |
2603 | 2603 | |
@@ -2616,8 +2616,8 @@ discard block |
||
2616 | 2616 | 'y' => 'y', |
2617 | 2617 | 'd' => 'days', |
2618 | 2618 | ); |
2619 | - if ( isset( $return[ $unit ] ) ) { |
|
2620 | - return $diff[ $return[ $unit ] ]; |
|
2619 | + if ( isset( $return[$unit] ) ) { |
|
2620 | + return $diff[$return[$unit]]; |
|
2621 | 2621 | } |
2622 | 2622 | |
2623 | 2623 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2625,11 +2625,11 @@ discard block |
||
2625 | 2625 | $times = array( 'h', 'i', 's' ); |
2626 | 2626 | |
2627 | 2627 | foreach ( $times as $time ) { |
2628 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2628 | + if ( ! isset( $diff[$time] ) ) { |
|
2629 | 2629 | continue; |
2630 | 2630 | } |
2631 | 2631 | |
2632 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2632 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2633 | 2633 | } |
2634 | 2634 | |
2635 | 2635 | return floor( $total ); |
@@ -2649,7 +2649,7 @@ discard block |
||
2649 | 2649 | 'y' => DAY_IN_SECONDS * 365.25, |
2650 | 2650 | ); |
2651 | 2651 | |
2652 | - return $convert[ $from ] / $convert[ $to ]; |
|
2652 | + return $convert[$from] / $convert[$to]; |
|
2653 | 2653 | } |
2654 | 2654 | |
2655 | 2655 | /** |
@@ -2657,7 +2657,7 @@ discard block |
||
2657 | 2657 | */ |
2658 | 2658 | private static function get_unit( $unit ) { |
2659 | 2659 | $units = self::get_time_strings(); |
2660 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2660 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2661 | 2661 | return $unit; |
2662 | 2662 | } |
2663 | 2663 | |
@@ -2774,17 +2774,17 @@ discard block |
||
2774 | 2774 | |
2775 | 2775 | case 1: |
2776 | 2776 | $l2 = $name; |
2777 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2777 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2778 | 2778 | break; |
2779 | 2779 | |
2780 | 2780 | case 2: |
2781 | 2781 | $l3 = $name; |
2782 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2782 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2783 | 2783 | break; |
2784 | 2784 | |
2785 | 2785 | case 3: |
2786 | 2786 | $l4 = $name; |
2787 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2787 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2788 | 2788 | } |
2789 | 2789 | |
2790 | 2790 | unset( $this_val, $n ); |
@@ -2803,8 +2803,8 @@ discard block |
||
2803 | 2803 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2804 | 2804 | if ( $name == '' ) { |
2805 | 2805 | $vars[] = $val; |
2806 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2807 | - $vars[ $l1 ] = $val; |
|
2806 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2807 | + $vars[$l1] = $val; |
|
2808 | 2808 | } |
2809 | 2809 | } |
2810 | 2810 | |
@@ -2821,7 +2821,7 @@ discard block |
||
2821 | 2821 | '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' ), |
2822 | 2822 | ); |
2823 | 2823 | |
2824 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2824 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2825 | 2825 | return; |
2826 | 2826 | } |
2827 | 2827 | |
@@ -2831,7 +2831,7 @@ discard block |
||
2831 | 2831 | echo ' class="frm_help"'; |
2832 | 2832 | } |
2833 | 2833 | |
2834 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2834 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2835 | 2835 | |
2836 | 2836 | if ( 'open' != $class ) { |
2837 | 2837 | echo '"'; |
@@ -2890,13 +2890,13 @@ discard block |
||
2890 | 2890 | } |
2891 | 2891 | |
2892 | 2892 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2893 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2893 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2894 | 2894 | return; |
2895 | 2895 | } |
2896 | 2896 | |
2897 | 2897 | if ( is_array( $val ) ) { |
2898 | 2898 | foreach ( $val as $k1 => $v1 ) { |
2899 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2899 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2900 | 2900 | unset( $k1, $v1 ); |
2901 | 2901 | } |
2902 | 2902 | } else { |
@@ -2904,7 +2904,7 @@ discard block |
||
2904 | 2904 | $val = stripslashes( $val ); |
2905 | 2905 | |
2906 | 2906 | // Add backslashes before double quotes and forward slashes only |
2907 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2907 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2908 | 2908 | } |
2909 | 2909 | } |
2910 | 2910 | |
@@ -3025,14 +3025,14 @@ discard block |
||
3025 | 3025 | continue; |
3026 | 3026 | } |
3027 | 3027 | $key = $input['name']; |
3028 | - if ( isset( $formatted[ $key ] ) ) { |
|
3029 | - if ( is_array( $formatted[ $key ] ) ) { |
|
3030 | - $formatted[ $key ][] = $input['value']; |
|
3028 | + if ( isset( $formatted[$key] ) ) { |
|
3029 | + if ( is_array( $formatted[$key] ) ) { |
|
3030 | + $formatted[$key][] = $input['value']; |
|
3031 | 3031 | } else { |
3032 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
3032 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
3033 | 3033 | } |
3034 | 3034 | } else { |
3035 | - $formatted[ $key ] = $input['value']; |
|
3035 | + $formatted[$key] = $input['value']; |
|
3036 | 3036 | } |
3037 | 3037 | } |
3038 | 3038 | |
@@ -3729,8 +3729,8 @@ discard block |
||
3729 | 3729 | } |
3730 | 3730 | |
3731 | 3731 | foreach ( $keys as $key ) { |
3732 | - if ( isset( $values[ $key ] ) ) { |
|
3733 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3732 | + if ( isset( $values[$key] ) ) { |
|
3733 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3734 | 3734 | } |
3735 | 3735 | } |
3736 | 3736 | |
@@ -3889,7 +3889,7 @@ discard block |
||
3889 | 3889 | return 0; |
3890 | 3890 | } |
3891 | 3891 | |
3892 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3892 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3893 | 3893 | } |
3894 | 3894 | |
3895 | 3895 | /** |
@@ -4122,7 +4122,7 @@ discard block |
||
4122 | 4122 | * @return string |
4123 | 4123 | */ |
4124 | 4124 | public static function copy_for_lite_license() { |
4125 | - $message = __( 'You\'re using Formidable Forms Lite - no license needed. Enjoy!', 'formidable' ) . ' |
@@ -464,8 +464,8 @@ |
||
464 | 464 | 'charge.refunded' => 'refunded', |
465 | 465 | ); |
466 | 466 | |
467 | - if ( isset( $events[ $this->event->type ] ) ) { |
|
468 | - $this->status = $events[ $this->event->type ]; |
|
467 | + if ( isset( $events[$this->event->type] ) ) { |
|
468 | + $this->status = $events[$this->event->type]; |
|
469 | 469 | $this->set_payment_status(); |
470 | 470 | } elseif ( $this->event->type === 'customer.deleted' ) { |
471 | 471 | $this->reset_customer(); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | 'sort' => '', |
101 | 101 | 'sdir' => '', |
102 | 102 | ) as $var => $default ) { |
103 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default ); |
|
103 | + $values[$var] = FrmAppHelper::get_param( $var, $default ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return $values; |
@@ -84,8 +84,8 @@ |
||
84 | 84 | $settings = $this->default_options(); |
85 | 85 | |
86 | 86 | foreach ( $settings as $setting => $default ) { |
87 | - if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) { |
|
88 | - $this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ); |
|
87 | + if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) { |
|
88 | + $this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) ); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $has_field = true; |
166 | 166 | $key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content ); |
167 | 167 | ?> |
168 | - <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>> |
|
168 | + <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>> |
|
169 | 169 | <?php echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) ); ?> |
170 | 170 | </option> |
171 | 171 | <?php |
@@ -34,10 +34,10 @@ |
||
34 | 34 | * @return string[] An empty array is treated as automatic. |
35 | 35 | */ |
36 | 36 | public static function get_payment_method_types( $action ) { |
37 | - if ( ! isset( self::$types_by_action_id[ $action->ID ] ) ) { |
|
38 | - self::$types_by_action_id[ $action->ID ] = self::get_filtered_payment_method_types( $action ); |
|
37 | + if ( ! isset( self::$types_by_action_id[$action->ID] ) ) { |
|
38 | + self::$types_by_action_id[$action->ID] = self::get_filtered_payment_method_types( $action ); |
|
39 | 39 | } |
40 | - return self::$types_by_action_id[ $action->ID ]; |
|
40 | + return self::$types_by_action_id[$action->ID]; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -261,14 +261,14 @@ |
||
261 | 261 | private function fill_values( $values, &$new_values ) { |
262 | 262 | $defaults = $this->get_defaults(); |
263 | 263 | foreach ( $defaults as $val => $default ) { |
264 | - if ( isset( $values[ $val ] ) ) { |
|
264 | + if ( isset( $values[$val] ) ) { |
|
265 | 265 | if ( $default['sanitize'] === 'float' ) { |
266 | - $new_values[ $val ] = (float) $values[ $val ]; |
|
266 | + $new_values[$val] = (float) $values[$val]; |
|
267 | 267 | } elseif ( ! empty( $default['sanitize'] ) ) { |
268 | - $new_values[ $val ] = call_user_func( $default['sanitize'], $values[ $val ] ); |
|
268 | + $new_values[$val] = call_user_func( $default['sanitize'], $values[$val] ); |
|
269 | 269 | } |
270 | 270 | } elseif ( $values['action'] === 'create' ) { |
271 | - $new_values[ $val ] = $default['default']; |
|
271 | + $new_values[$val] = $default['default']; |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public static function show_status( $status ) { |
36 | 36 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
37 | - return isset( $statuses[ $status ] ) ? $statuses[ $status ] : $status; |
|
37 | + return isset( $statuses[$status] ) ? $statuses[$status] : $status; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function get_action_setting( $option, $atts ) { |
121 | 121 | $settings = self::get_action_settings( $atts ); |
122 | - $value = isset( $settings[ $option ] ) ? $settings[ $option ] : ''; |
|
122 | + $value = isset( $settings[$option] ) ? $settings[$option] : ''; |
|
123 | 123 | return $value; |
124 | 124 | } |
125 | 125 | |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public static function get_repeat_label_from_value( $value, $number ) { |
224 | 224 | $times = self::get_plural_repeat_times( $number ); |
225 | - if ( isset( $times[ $value ] ) ) { |
|
226 | - $value = $times[ $value ]; |
|
225 | + if ( isset( $times[$value] ) ) { |
|
226 | + $value = $times[$value]; |
|
227 | 227 | } |
228 | 228 | return $value; |
229 | 229 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'payments' => $frm_payment->get_count(), |
113 | 113 | 'subscriptions' => $frm_sub->get_count(), |
114 | 114 | ); |
115 | - $type = FrmAppHelper::get_simple_request( |
|
115 | + $type = FrmAppHelper::get_simple_request( |
|
116 | 116 | array( |
117 | 117 | 'param' => 'trans_type', |
118 | 118 | 'type' => 'request', |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | $class = ''; |
128 | 128 | } |
129 | 129 | |
130 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
131 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
130 | + if ( $counts[$status] || 'published' === $status ) { |
|
131 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
132 | 132 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %3$s: Span close tag. |
133 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
133 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
134 | 134 | . '</a>'; |
135 | 135 | } |
136 | 136 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
207 | 207 | |
208 | 208 | $is_alternate = 0 === $alt % 2; |
209 | - $alt++; |
|
209 | + $alt ++; |
|
210 | 210 | |
211 | 211 | if ( $is_alternate ) { |
212 | 212 | echo 'class="alternate"'; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | $form_ids = array(); |
297 | 297 | foreach ( $forms as $form ) { |
298 | - $form_ids[ $form->id ] = $form; |
|
298 | + $form_ids[$form->id] = $form; |
|
299 | 299 | unset( $form ); |
300 | 300 | } |
301 | 301 | |
@@ -395,8 +395,8 @@ discard block |
||
395 | 395 | * @return mixed |
396 | 396 | */ |
397 | 397 | private function get_form_id_column( $item, $atts ) { |
398 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
399 | - $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
398 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
399 | + $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
400 | 400 | return $form_link; |
401 | 401 | } |
402 | 402 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | foreach ( $completed_payments as $completed_payment ) { |
454 | 454 | if ( $completed_payment->status === 'complete' ) { |
455 | - $count++; |
|
455 | + $count ++; |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 |