@@ -412,7 +412,8 @@ discard block |
||
412 | 412 | |
413 | 413 | if ( $src === 'get' ) { |
414 | 414 | $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 |
415 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
415 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
416 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
416 | 417 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
417 | 418 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
418 | 419 | } |
@@ -500,7 +501,8 @@ discard block |
||
500 | 501 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
501 | 502 | } |
502 | 503 | } elseif ( $args['type'] == 'post' ) { |
503 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
504 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
505 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
504 | 506 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
505 | 507 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
506 | 508 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -508,7 +510,8 @@ discard block |
||
508 | 510 | } |
509 | 511 | } |
510 | 512 | } else { |
511 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
513 | + if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
514 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
512 | 515 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
513 | 516 | $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
514 | 517 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'fill' => '#4d4d4d', |
158 | 158 | 'orange' => '#f05a24', |
159 | 159 | ); |
160 | - $atts = array_merge( $defaults, $atts ); |
|
160 | + $atts = array_merge( $defaults, $atts ); |
|
161 | 161 | |
162 | 162 | 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'] ) . '"> |
163 | 163 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * @return string |
365 | 365 | */ |
366 | 366 | public static function get_server_value( $value ) { |
367 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
367 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | ); |
388 | 388 | $ip = ''; |
389 | 389 | foreach ( $ip_options as $key ) { |
390 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
390 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
391 | 391 | continue; |
392 | 392 | } |
393 | 393 | |
@@ -411,10 +411,10 @@ discard block |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | if ( $src === 'get' ) { |
414 | - $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 |
|
415 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
414 | + $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 |
|
415 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
416 | 416 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
417 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
417 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
418 | 418 | } |
419 | 419 | self::sanitize_value( $sanitize, $value ); |
420 | 420 | } else { |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | |
437 | 437 | $p = trim( $p, ']' ); |
438 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
438 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
439 | 439 | } |
440 | 440 | } |
441 | 441 | |
@@ -491,26 +491,26 @@ discard block |
||
491 | 491 | 'sanitize' => 'sanitize_text_field', |
492 | 492 | 'serialized' => false, |
493 | 493 | ); |
494 | - $args = wp_parse_args( $args, $defaults ); |
|
494 | + $args = wp_parse_args( $args, $defaults ); |
|
495 | 495 | |
496 | 496 | $value = $args['default']; |
497 | 497 | if ( $args['type'] == 'get' ) { |
498 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
498 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
499 | 499 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
500 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
500 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
501 | 501 | } |
502 | 502 | } elseif ( $args['type'] == 'post' ) { |
503 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
503 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
504 | 504 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
505 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
505 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
506 | 506 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
507 | 507 | self::unserialize_or_decode( $value ); |
508 | 508 | } |
509 | 509 | } |
510 | 510 | } else { |
511 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
511 | + if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
512 | 512 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
513 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
513 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
514 | 514 | } |
515 | 515 | } |
516 | 516 | |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | if ( is_array( $value ) ) { |
543 | 543 | $temp_values = $value; |
544 | 544 | foreach ( $temp_values as $k => $v ) { |
545 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
545 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
546 | 546 | } |
547 | 547 | } else { |
548 | 548 | $value = call_user_func( $sanitize, $value ); |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | public static function sanitize_request( $sanitize_method, &$values ) { |
554 | 554 | $temp_values = $values; |
555 | 555 | foreach ( $temp_values as $k => $val ) { |
556 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
557 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
556 | + if ( isset( $sanitize_method[$k] ) ) { |
|
557 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | if ( is_array( $value ) ) { |
578 | 578 | $temp_values = $value; |
579 | 579 | foreach ( $temp_values as $k => $v ) { |
580 | - self::decode_specialchars( $value[ $k ] ); |
|
580 | + self::decode_specialchars( $value[$k] ); |
|
581 | 581 | } |
582 | 582 | } else { |
583 | 583 | self::decode_amp( $value ); |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | * @return array |
698 | 698 | */ |
699 | 699 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
700 | - $allowed_html['input'] = array( |
|
700 | + $allowed_html['input'] = array( |
|
701 | 701 | 'type' => true, |
702 | 702 | 'value' => true, |
703 | 703 | 'formnovalidate' => true, |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | $allowed_html = $html; |
721 | 721 | } elseif ( ! empty( $allowed ) ) { |
722 | 722 | foreach ( (array) $allowed as $a ) { |
723 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
723 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
724 | 724 | } |
725 | 725 | } |
726 | 726 | |
@@ -899,8 +899,8 @@ discard block |
||
899 | 899 | } |
900 | 900 | |
901 | 901 | global $wp_query; |
902 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
903 | - $value = $wp_query->query_vars[ $param ]; |
|
902 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
903 | + $value = $wp_query->query_vars[$param]; |
|
904 | 904 | } |
905 | 905 | |
906 | 906 | return $value; |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | 'new_file_path' => self::plugin_path() . '/js', |
1180 | 1180 | ) |
1181 | 1181 | ); |
1182 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1182 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1183 | 1183 | |
1184 | 1184 | $files = array( |
1185 | 1185 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1607,8 +1607,8 @@ discard block |
||
1607 | 1607 | return $error; |
1608 | 1608 | } |
1609 | 1609 | |
1610 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1611 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1610 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1611 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1612 | 1612 | $frm_settings = self::get_settings(); |
1613 | 1613 | $error = $frm_settings->admin_permission; |
1614 | 1614 | } |
@@ -1643,7 +1643,7 @@ discard block |
||
1643 | 1643 | } else { |
1644 | 1644 | foreach ( $value as $k => $v ) { |
1645 | 1645 | if ( ! is_array( $v ) ) { |
1646 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1646 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1647 | 1647 | } |
1648 | 1648 | } |
1649 | 1649 | } |
@@ -1668,7 +1668,7 @@ discard block |
||
1668 | 1668 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1669 | 1669 | } else { |
1670 | 1670 | if ( $keys == 'keep' ) { |
1671 | - $return[ $key ] = $value; |
|
1671 | + $return[$key] = $value; |
|
1672 | 1672 | } else { |
1673 | 1673 | $return[] = $value; |
1674 | 1674 | } |
@@ -1721,11 +1721,11 @@ discard block |
||
1721 | 1721 | } |
1722 | 1722 | |
1723 | 1723 | $ver = $default; |
1724 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
1724 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
1725 | 1725 | return $ver; |
1726 | 1726 | } |
1727 | 1727 | |
1728 | - $query = $wp_scripts->registered[ $handle ]; |
|
1728 | + $query = $wp_scripts->registered[$handle]; |
|
1729 | 1729 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
1730 | 1730 | $ver = $query->ver; |
1731 | 1731 | } |
@@ -1831,7 +1831,7 @@ discard block |
||
1831 | 1831 | $suffix = 2; |
1832 | 1832 | do { |
1833 | 1833 | $key_check = $key . $separator . $suffix; |
1834 | - ++$suffix; |
|
1834 | + ++ $suffix; |
|
1835 | 1835 | } while ( in_array( $key_check, $similar_keys, true ) ); |
1836 | 1836 | |
1837 | 1837 | $key = $key_check; |
@@ -1932,7 +1932,7 @@ discard block |
||
1932 | 1932 | |
1933 | 1933 | foreach ( array( 'name', 'description' ) as $var ) { |
1934 | 1934 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
1935 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
1935 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
1936 | 1936 | unset( $var, $default_val ); |
1937 | 1937 | } |
1938 | 1938 | |
@@ -1990,9 +1990,9 @@ discard block |
||
1990 | 1990 | } |
1991 | 1991 | } |
1992 | 1992 | |
1993 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
1994 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
1995 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
1993 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
1994 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
1995 | + $new_value = $post_values['item_meta'][$field->id]; |
|
1996 | 1996 | self::unserialize_or_decode( $new_value ); |
1997 | 1997 | } else { |
1998 | 1998 | $new_value = $meta_value; |
@@ -2013,7 +2013,7 @@ discard block |
||
2013 | 2013 | |
2014 | 2014 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2015 | 2015 | |
2016 | - $values['fields'][ $field->id ] = $field_array; |
|
2016 | + $values['fields'][$field->id] = $field_array; |
|
2017 | 2017 | } |
2018 | 2018 | |
2019 | 2019 | /** |
@@ -2060,11 +2060,11 @@ discard block |
||
2060 | 2060 | } |
2061 | 2061 | |
2062 | 2062 | foreach ( $form->options as $opt => $value ) { |
2063 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2064 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2065 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2063 | + if ( isset( $post_values[$opt] ) ) { |
|
2064 | + $values[$opt] = $post_values[$opt]; |
|
2065 | + self::unserialize_or_decode( $values[$opt] ); |
|
2066 | 2066 | } else { |
2067 | - $values[ $opt ] = $value; |
|
2067 | + $values[$opt] = $value; |
|
2068 | 2068 | } |
2069 | 2069 | } |
2070 | 2070 | |
@@ -2078,8 +2078,8 @@ discard block |
||
2078 | 2078 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2079 | 2079 | |
2080 | 2080 | foreach ( $form_defaults as $opt => $default ) { |
2081 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2082 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
2081 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2082 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
2083 | 2083 | } |
2084 | 2084 | |
2085 | 2085 | unset( $opt, $default ); |
@@ -2090,8 +2090,8 @@ discard block |
||
2090 | 2090 | } |
2091 | 2091 | |
2092 | 2092 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2093 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2094 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2093 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2094 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2095 | 2095 | } |
2096 | 2096 | unset( $h ); |
2097 | 2097 | } |
@@ -2243,25 +2243,25 @@ discard block |
||
2243 | 2243 | if ( ! is_numeric( $levels ) ) { |
2244 | 2244 | // Show time in specified unit. |
2245 | 2245 | $levels = self::get_unit( $levels ); |
2246 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2246 | + if ( isset( $time_strings[$levels] ) ) { |
|
2247 | 2247 | $diff = array( |
2248 | 2248 | $levels => self::time_format( $levels, $diff ), |
2249 | 2249 | ); |
2250 | 2250 | $time_strings = array( |
2251 | - $levels => $time_strings[ $levels ], |
|
2251 | + $levels => $time_strings[$levels], |
|
2252 | 2252 | ); |
2253 | 2253 | } |
2254 | 2254 | $levels = 1; |
2255 | 2255 | } |
2256 | 2256 | |
2257 | 2257 | foreach ( $time_strings as $k => $v ) { |
2258 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2259 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2260 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2258 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2259 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2260 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2261 | 2261 | // Account for 0. |
2262 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2262 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2263 | 2263 | } else { |
2264 | - unset( $time_strings[ $k ] ); |
|
2264 | + unset( $time_strings[$k] ); |
|
2265 | 2265 | } |
2266 | 2266 | } |
2267 | 2267 | |
@@ -2280,8 +2280,8 @@ discard block |
||
2280 | 2280 | 'y' => 'y', |
2281 | 2281 | 'd' => 'days', |
2282 | 2282 | ); |
2283 | - if ( isset( $return[ $unit ] ) ) { |
|
2284 | - return $diff[ $return[ $unit ] ]; |
|
2283 | + if ( isset( $return[$unit] ) ) { |
|
2284 | + return $diff[$return[$unit]]; |
|
2285 | 2285 | } |
2286 | 2286 | |
2287 | 2287 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2289,11 +2289,11 @@ discard block |
||
2289 | 2289 | $times = array( 'h', 'i', 's' ); |
2290 | 2290 | |
2291 | 2291 | foreach ( $times as $time ) { |
2292 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2292 | + if ( ! isset( $diff[$time] ) ) { |
|
2293 | 2293 | continue; |
2294 | 2294 | } |
2295 | 2295 | |
2296 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2296 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2297 | 2297 | } |
2298 | 2298 | |
2299 | 2299 | return floor( $total ); |
@@ -2313,7 +2313,7 @@ discard block |
||
2313 | 2313 | 'y' => DAY_IN_SECONDS * 365.25, |
2314 | 2314 | ); |
2315 | 2315 | |
2316 | - return $convert[ $from ] / $convert[ $to ]; |
|
2316 | + return $convert[$from] / $convert[$to]; |
|
2317 | 2317 | } |
2318 | 2318 | |
2319 | 2319 | /** |
@@ -2321,7 +2321,7 @@ discard block |
||
2321 | 2321 | */ |
2322 | 2322 | private static function get_unit( $unit ) { |
2323 | 2323 | $units = self::get_time_strings(); |
2324 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2324 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2325 | 2325 | return $unit; |
2326 | 2326 | } |
2327 | 2327 | |
@@ -2432,17 +2432,17 @@ discard block |
||
2432 | 2432 | |
2433 | 2433 | case 1: |
2434 | 2434 | $l2 = $name; |
2435 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2435 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2436 | 2436 | break; |
2437 | 2437 | |
2438 | 2438 | case 2: |
2439 | 2439 | $l3 = $name; |
2440 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2440 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2441 | 2441 | break; |
2442 | 2442 | |
2443 | 2443 | case 3: |
2444 | 2444 | $l4 = $name; |
2445 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2445 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2446 | 2446 | } |
2447 | 2447 | |
2448 | 2448 | unset( $this_val, $n ); |
@@ -2461,8 +2461,8 @@ discard block |
||
2461 | 2461 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2462 | 2462 | if ( $name == '' ) { |
2463 | 2463 | $vars[] = $val; |
2464 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2465 | - $vars[ $l1 ] = $val; |
|
2464 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2465 | + $vars[$l1] = $val; |
|
2466 | 2466 | } |
2467 | 2467 | } |
2468 | 2468 | |
@@ -2478,7 +2478,7 @@ discard block |
||
2478 | 2478 | 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ), |
2479 | 2479 | ); |
2480 | 2480 | |
2481 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2481 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2482 | 2482 | return; |
2483 | 2483 | } |
2484 | 2484 | |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | echo ' class="frm_help"'; |
2489 | 2489 | } |
2490 | 2490 | |
2491 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2491 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2492 | 2492 | |
2493 | 2493 | if ( 'open' != $class ) { |
2494 | 2494 | echo '"'; |
@@ -2543,13 +2543,13 @@ discard block |
||
2543 | 2543 | } |
2544 | 2544 | |
2545 | 2545 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2546 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2546 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2547 | 2547 | return; |
2548 | 2548 | } |
2549 | 2549 | |
2550 | 2550 | if ( is_array( $val ) ) { |
2551 | 2551 | foreach ( $val as $k1 => $v1 ) { |
2552 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2552 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2553 | 2553 | unset( $k1, $v1 ); |
2554 | 2554 | } |
2555 | 2555 | } else { |
@@ -2557,7 +2557,7 @@ discard block |
||
2557 | 2557 | $val = stripslashes( $val ); |
2558 | 2558 | |
2559 | 2559 | // Add backslashes before double quotes and forward slashes only |
2560 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2560 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2561 | 2561 | } |
2562 | 2562 | } |
2563 | 2563 | |
@@ -2620,14 +2620,14 @@ discard block |
||
2620 | 2620 | continue; |
2621 | 2621 | } |
2622 | 2622 | $key = $input['name']; |
2623 | - if ( isset( $formatted[ $key ] ) ) { |
|
2624 | - if ( is_array( $formatted[ $key ] ) ) { |
|
2625 | - $formatted[ $key ][] = $input['value']; |
|
2623 | + if ( isset( $formatted[$key] ) ) { |
|
2624 | + if ( is_array( $formatted[$key] ) ) { |
|
2625 | + $formatted[$key][] = $input['value']; |
|
2626 | 2626 | } else { |
2627 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
2627 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
2628 | 2628 | } |
2629 | 2629 | } else { |
2630 | - $formatted[ $key ] = $input['value']; |
|
2630 | + $formatted[$key] = $input['value']; |
|
2631 | 2631 | } |
2632 | 2632 | } |
2633 | 2633 | |
@@ -3243,8 +3243,8 @@ discard block |
||
3243 | 3243 | } |
3244 | 3244 | |
3245 | 3245 | foreach ( $keys as $key ) { |
3246 | - if ( isset( $values[ $key ] ) ) { |
|
3247 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3246 | + if ( isset( $values[$key] ) ) { |
|
3247 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3248 | 3248 | } |
3249 | 3249 | } |
3250 | 3250 | |
@@ -3430,7 +3430,7 @@ discard block |
||
3430 | 3430 | return 0; |
3431 | 3431 | } |
3432 | 3432 | |
3433 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3433 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3434 | 3434 | } |
3435 | 3435 | |
3436 | 3436 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
46 | 46 | |
47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $_transient_data = new stdClass(); |
94 | 94 | } |
95 | 95 | |
96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
97 | 97 | return $_transient_data; |
98 | 98 | } |
99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
120 | 120 | $version_info->plugin = $this->name; |
121 | 121 | } |
122 | 122 | |
123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
123 | + $_transient_data->response[$this->name] = $version_info; |
|
124 | 124 | |
125 | 125 | } |
126 | 126 | |
127 | 127 | $_transient_data->last_checked = time(); |
128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
128 | + $_transient_data->checked[$this->name] = $this->version; |
|
129 | 129 | |
130 | 130 | } |
131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
190 | 190 | $new_sections = array(); |
191 | 191 | foreach ( $_data->sections as $key => $value ) { |
192 | - $new_sections[ $key ] = $value; |
|
192 | + $new_sections[$key] = $value; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
200 | 200 | $new_banners = array(); |
201 | 201 | foreach ( $_data->banners as $key => $value ) { |
202 | - $new_banners[ $key ] = $value; |
|
202 | + $new_banners[$key] = $value; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
319 | + $data = $frm_edd_plugin_data[$slug]; |
|
320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |
@@ -303,11 +303,13 @@ |
||
303 | 303 | |
304 | 304 | global $frm_edd_plugin_data; |
305 | 305 | |
306 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
306 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
307 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
307 | 308 | return; |
308 | 309 | } |
309 | 310 | |
310 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
311 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
312 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
311 | 313 | return; |
312 | 314 | } |
313 | 315 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $info['url'] = $xml; |
12 | 12 | } |
13 | 13 | |
14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
15 | 15 | $url = isset( $info['url'] ) ? $info['url'] : ''; |
16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | |
24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
25 | 25 | ?> |
26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <?php } ?> |
42 | 42 | /> |
43 | 43 | <div class="frm_image_option_container frm_label_with_image"> |
44 | - <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
44 | + <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
45 | 45 | <span class="frm_text_label_for_image"> |
46 | 46 | <?php |
47 | 47 | if ( ! empty( $disabled ) ) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ( $importing === 'form' && $disabled ) { |
57 | - echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
57 | + echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
58 | 58 | } else { |
59 | 59 | echo esc_html( $info['name'] ); |
60 | 60 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | '-' => 'down', |
195 | 195 | '+' => 'up', |
196 | 196 | ); |
197 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
197 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
198 | 198 | } else { |
199 | 199 | //frm_minus1_icon |
200 | 200 | $key = str_replace( 'p', '', $key ); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | '-' => 'minus', |
203 | 203 | '+' => 'plus', |
204 | 204 | ); |
205 | - $class = 'frm_' . $plus[ $icon ]; |
|
205 | + $class = 'frm_' . $plus[$icon]; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | if ( $key ) { |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | ?> |
223 | 223 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
224 | 224 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
225 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
226 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
225 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
226 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
227 | 227 | <b class="caret"></b> |
228 | 228 | </button> |
229 | 229 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
232 | 232 | <a href="javascript:void(0);"> |
233 | 233 | <label> |
234 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/> |
|
234 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/> |
|
235 | 235 | <span> |
236 | 236 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?> |
237 | 237 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?> |
@@ -313,15 +313,15 @@ discard block |
||
313 | 313 | $vars = array_diff( $vars, $remove ); |
314 | 314 | |
315 | 315 | foreach ( $vars as $var ) { |
316 | - if ( ! isset( $settings[ $var ] ) ) { |
|
316 | + if ( ! isset( $settings[$var] ) ) { |
|
317 | 317 | continue; |
318 | 318 | } |
319 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
320 | - $defaults[ $var ] = ''; |
|
319 | + if ( ! isset( $defaults[$var] ) ) { |
|
320 | + $defaults[$var] = ''; |
|
321 | 321 | } |
322 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
322 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
323 | 323 | if ( $show ) { |
324 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
324 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | } |
@@ -371,8 +371,8 @@ discard block |
||
371 | 371 | |
372 | 372 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
373 | 373 | foreach ( $checkbox_opts as $opt ) { |
374 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
375 | - $settings[ $opt ] = 0; |
|
374 | + if ( ! isset( $settings[$opt] ) ) { |
|
375 | + $settings[$opt] = 0; |
|
376 | 376 | } |
377 | 377 | } |
378 | 378 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $css = ''; |
401 | 401 | } |
402 | 402 | foreach ( $opts as $opt ) { |
403 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
403 | + self::get_color_output( $css, $settings[$opt] ); |
|
404 | 404 | } |
405 | 405 | } |
406 | 406 | } |
@@ -336,7 +336,8 @@ |
||
336 | 336 | if ( self::previewing_style() ) { |
337 | 337 | |
338 | 338 | $frm_style = new FrmStyle(); |
339 | - if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
339 | + if ( isset( $_POST['frm_style_setting'] ) ) { |
|
340 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
340 | 341 | |
341 | 342 | // Sanitizing is done later. |
342 | 343 | $posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->id = $new_instance['ID']; |
58 | 58 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
59 | 59 | if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
60 | - $all_instances[ $number ] = $new_instance; |
|
60 | + $all_instances[$number] = $new_instance; |
|
61 | 61 | |
62 | 62 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
63 | 63 | if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) { |
@@ -83,22 +83,22 @@ discard block |
||
83 | 83 | $default_settings = $this->get_defaults(); |
84 | 84 | |
85 | 85 | foreach ( $default_settings as $setting => $default ) { |
86 | - if ( ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
87 | - $new_instance['post_content'][ $setting ] = $default; |
|
86 | + if ( ! isset( $new_instance['post_content'][$setting] ) ) { |
|
87 | + $new_instance['post_content'][$setting] = $default; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if ( $this->is_color( $setting ) ) { |
91 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] ); |
|
91 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] ); |
|
92 | 92 | } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) |
93 | - && ! isset( $new_instance['post_content'][ $setting ] ) |
|
93 | + && ! isset( $new_instance['post_content'][$setting] ) |
|
94 | 94 | ) { |
95 | - $new_instance['post_content'][ $setting ] = 0; |
|
95 | + $new_instance['post_content'][$setting] = 0; |
|
96 | 96 | } elseif ( $setting == 'font' ) { |
97 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
97 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - $all_instances[ $number ] = $new_instance; |
|
101 | + $all_instances[$number] = $new_instance; |
|
102 | 102 | |
103 | 103 | $action_ids[] = $this->save( $new_instance ); |
104 | 104 | |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | $valid_keys = array_keys( $defaults ); |
136 | 136 | $sanitized_settings = array(); |
137 | 137 | foreach ( $valid_keys as $key ) { |
138 | - if ( isset( $settings[ $key ] ) ) { |
|
139 | - $sanitized_settings[ $key ] = sanitize_textarea_field( $settings[ $key ] ); |
|
138 | + if ( isset( $settings[$key] ) ) { |
|
139 | + $sanitized_settings[$key] = sanitize_textarea_field( $settings[$key] ); |
|
140 | 140 | } else { |
141 | - $sanitized_settings[ $key ] = $defaults[ $key ]; |
|
141 | + $sanitized_settings[$key] = $defaults[$key]; |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | return $sanitized_settings; |
@@ -305,13 +305,13 @@ discard block |
||
305 | 305 | $style->post_content = $this->override_defaults( $style->post_content ); |
306 | 306 | $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
307 | 307 | |
308 | - $styles[ $style->ID ] = $style; |
|
308 | + $styles[$style->ID] = $style; |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | if ( ! $default_style ) { |
312 | 312 | $default_style = reset( $styles ); |
313 | 313 | |
314 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
314 | + $styles[$default_style->ID]->menu_order = 1; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | return $styles; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'title' => esc_attr__( 'Toggle Options', 'formidable' ), |
17 | 17 | ) |
18 | 18 | ); |
19 | - $e_args = array( |
|
19 | + $e_args = array( |
|
20 | 20 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
21 | 21 | 'textarea_rows' => 8, |
22 | 22 | ); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | |
152 | 152 | if ( is_wp_error( $resp ) ) { |
153 | 153 | $error_string = $resp->get_error_message(); |
154 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
155 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
154 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
155 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
156 | 156 | return $errors; |
157 | 157 | } |
158 | 158 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if ( isset( $response['success'] ) && ! $response['success'] ) { |
175 | 175 | // What happens when the CAPTCHA was entered incorrectly |
176 | 176 | $invalid_message = FrmField::get_option( $this->field, 'invalid' ); |
177 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
177 | + $errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | return $errors; |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | $frm_vars['captcha_scores'] = array(); |
191 | 191 | } |
192 | 192 | $form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id']; |
193 | - if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) { |
|
194 | - $frm_vars['captcha_scores'][ $form_id ] = $score; |
|
193 | + if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) { |
|
194 | + $frm_vars['captcha_scores'][$form_id] = $score; |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
81 | 81 | $field_metas = array(); |
82 | 82 | foreach ( $metas as $meta ) { |
83 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
83 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | $reduced = array(); |
137 | 137 | foreach ( $filter_vals as $field_id => $value ) { |
138 | 138 | $field = FrmFieldFactory::get_field_object( $field_id ); |
139 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
141 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
142 | - unset( $reduced[ $field_id ] ); |
|
139 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
141 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
142 | + unset( $reduced[$field_id] ); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | return $reduced; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it |
333 | 333 | LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE "; |
334 | 334 | |
335 | - $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
335 | + $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
336 | 336 | $query_args = array( $id ); |
337 | 337 | $query = $wpdb->prepare( $query, $query_args ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
338 | 338 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | private static function prepare_entries( &$entries ) { |
378 | 378 | foreach ( $entries as $k => $entry ) { |
379 | 379 | self::prepare_entry( $entry ); |
380 | - $entries[ $k ] = $entry; |
|
380 | + $entries[$k] = $entry; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -402,20 +402,20 @@ discard block |
||
402 | 402 | foreach ( $metas as $meta_val ) { |
403 | 403 | if ( $meta_val->item_id == $entry->id ) { |
404 | 404 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
405 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
405 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
406 | 406 | if ( $include_key ) { |
407 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
407 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
408 | 408 | } |
409 | 409 | continue; |
410 | 410 | } |
411 | 411 | |
412 | 412 | // include sub entries in an array |
413 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
414 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
413 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
414 | + $entry->metas[$meta_val->field_id] = array(); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
418 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
418 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
419 | 419 | |
420 | 420 | unset( $meta_val ); |
421 | 421 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | if ( $inc_form ) { |
464 | 464 | $fields = 'it.*, fr.name as form_name,fr.form_key as form_key'; |
465 | - $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
465 | + $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) { |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | } |
507 | 507 | |
508 | 508 | foreach ( $metas as $m_key => $meta_val ) { |
509 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
509 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
510 | 510 | continue; |
511 | 511 | } |
512 | 512 | |
513 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
514 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
513 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
514 | + $entries[$meta_val->item_id]->metas = array(); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
518 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
518 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
519 | 519 | unset( $m_key, $meta_val ); |
520 | 520 | } |
521 | 521 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | } |
694 | 694 | |
695 | 695 | private static function get_entry_value( $values, $name, $default ) { |
696 | - return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
|
696 | + return isset( $values[$name] ) ? $values[$name] : $default; |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | private static function maybe_add_captcha_meta( $form_id, $entry_id ) { |
875 | 875 | global $frm_vars; |
876 | 876 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
877 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
877 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
878 | 878 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
879 | 879 | } |
880 | 880 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $data_keys = array_keys( $data ); |
7 | 7 | $params = array(); |
8 | 8 | foreach ( $data_keys as $key ) { |
9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
9 | + $params['data-' . $key] = $data[$key]; |
|
10 | 10 | } |
11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
12 | 12 | $params['href'] = '#'; |