@@ -138,7 +138,8 @@ |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // Only do this for single site installs. |
| 141 | - if ( is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 141 | + if ( is_network_admin() ) { |
|
| 142 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 142 | 143 | self::mark_onboarding_as_skipped(); |
| 143 | 144 | return; |
| 144 | 145 | } |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | ); |
| 369 | 369 | |
| 370 | 370 | foreach ( $fields_to_update as $field => $sanitize_callback ) { |
| 371 | - if ( isset( $_POST[ $field ] ) ) { |
|
| 372 | - $usage_data[ $field ] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback ); |
|
| 371 | + if ( isset( $_POST[$field] ) ) { |
|
| 372 | + $usage_data[$field] = FrmAppHelper::get_post_param( $field, '', $sanitize_callback ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | 'is-disabled' => true, |
| 589 | 589 | 'help-text' => esc_html__( 'Customize form appearance with an intuitive styling interface.', 'formidable' ), |
| 590 | 590 | ); |
| 591 | - self::$available_addons['save-entries'] = array( |
|
| 591 | + self::$available_addons['save-entries'] = array( |
|
| 592 | 592 | 'title' => esc_html__( 'Save Entries', 'formidable' ), |
| 593 | 593 | 'is-checked' => true, |
| 594 | 594 | 'is-disabled' => true, |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) { |
| 658 | 658 | $is_installed = array_key_exists( $plugin_file, $plugins ); |
| 659 | 659 | |
| 660 | - self::$available_addons[ $key ] = array( |
|
| 660 | + self::$available_addons[$key] = array( |
|
| 661 | 661 | 'title' => $data['title'], |
| 662 | 662 | 'rel' => $is_installed ? $plugin_file : $addon['url'], |
| 663 | 663 | 'is-checked' => false, |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | foreach ( $errors as $field => $error ) { |
| 89 | 89 | $field_id = str_replace( 'field', '', $field ); |
| 90 | 90 | $error = self::maybe_modify_ajax_error( $error, $field_id, $form, $errors ); |
| 91 | - $obj[ $field_id ] = $error; |
|
| 91 | + $obj[$field_id] = $error; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $response['errors'] = $obj; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | private static function fix_woocommerce_conflict() { |
| 120 | 120 | add_action( |
| 121 | 121 | 'wp_print_footer_scripts', |
| 122 | - function () { |
|
| 122 | + function() { |
|
| 123 | 123 | if ( ! function_exists( 'get_current_screen' ) ) { |
| 124 | 124 | require_once ABSPATH . 'wp-admin/includes/screen.php'; |
| 125 | 125 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | if ( is_admin() ) { |
| 19 | 19 | add_action( |
| 20 | 20 | 'elementor/editor/after_enqueue_styles', |
| 21 | - function () { |
|
| 21 | + function() { |
|
| 22 | 22 | wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() ); |
| 23 | 23 | } |
| 24 | 24 | ); |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | private static function sort_templates( $applications ) { |
| 155 | 155 | usort( |
| 156 | 156 | $applications, |
| 157 | - function ( $a, $b ) { |
|
| 157 | + function( $a, $b ) { |
|
| 158 | 158 | return strcmp( $a['name'], $b['name'] ); |
| 159 | 159 | } |
| 160 | 160 | ); |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @param string $row_view_file_path |
| 35 | 35 | * @return void |
| 36 | 36 | */ |
| 37 | - function ( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 37 | + function( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 38 | 38 | $active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 39 | 39 | if ( 1 === $active_style_id ) { |
| 40 | 40 | // use the default style |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $show_messages = apply_filters( 'frm_message_list', $show_messages ); |
| 20 | 20 | if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) { |
| 21 | 21 | // Define a callback function to add 'data-action' attribute to allowed HTML tags |
| 22 | - $add_data_action_callback = function ( $allowed_html ) { |
|
| 22 | + $add_data_action_callback = function( $allowed_html ) { |
|
| 23 | 23 | $allowed_html['span']['data-action'] = true; |
| 24 | 24 | return $allowed_html; |
| 25 | 25 | }; |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | foreach ( $type as $tb_type ) { |
| 20 | 20 | |
| 21 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 21 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
| 22 | 22 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 23 | 23 | continue; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 26 | + if ( ! isset( $records[$tb_type] ) ) { |
|
| 27 | 27 | // No records. |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $item_ids = $records[ $tb_type ]; |
|
| 31 | + $item_ids = $records[$tb_type]; |
|
| 32 | 32 | |
| 33 | 33 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
| 34 | 34 | include __DIR__ . '/posts_xml.php'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
| 41 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
| 42 | 42 | }//end foreach |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -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 ) ) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | 'fill' => '#4d4d4d', |
| 249 | 249 | 'orange' => '#f05a24', |
| 250 | 250 | ); |
| 251 | - $atts = array_merge( $defaults, $atts ); |
|
| 251 | + $atts = array_merge( $defaults, $atts ); |
|
| 252 | 252 | |
| 253 | 253 | 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'] ) . '"> |
| 254 | 254 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | * @return string |
| 537 | 537 | */ |
| 538 | 538 | public static function get_server_value( $value ) { |
| 539 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
| 539 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | /** |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $ip = ''; |
| 571 | 571 | |
| 572 | 572 | foreach ( $ip_options as $key ) { |
| 573 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
| 573 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
| 574 | 574 | continue; |
| 575 | 575 | } |
| 576 | 576 | |
@@ -639,10 +639,10 @@ discard block |
||
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | if ( $src === 'get' ) { |
| 642 | - $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 |
|
| 643 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 642 | + $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 |
|
| 643 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 644 | 644 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 645 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
| 645 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
| 646 | 646 | } |
| 647 | 647 | self::sanitize_value( $sanitize, $value ); |
| 648 | 648 | } else { |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | $p = trim( $p, ']' ); |
| 666 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
| 666 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
| 667 | 667 | } |
| 668 | 668 | } |
| 669 | 669 | |
@@ -728,26 +728,26 @@ discard block |
||
| 728 | 728 | 'sanitize' => 'sanitize_text_field', |
| 729 | 729 | 'serialized' => false, |
| 730 | 730 | ); |
| 731 | - $args = wp_parse_args( $args, $defaults ); |
|
| 731 | + $args = wp_parse_args( $args, $defaults ); |
|
| 732 | 732 | |
| 733 | 733 | $value = $args['default']; |
| 734 | 734 | if ( $args['type'] === 'get' ) { |
| 735 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
| 735 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
| 736 | 736 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 737 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
| 737 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
| 738 | 738 | } |
| 739 | 739 | } elseif ( $args['type'] === 'post' ) { |
| 740 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 740 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 741 | 741 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 742 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
| 742 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
| 743 | 743 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
| 744 | 744 | self::unserialize_or_decode( $value ); |
| 745 | 745 | } |
| 746 | 746 | } |
| 747 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
| 747 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
| 748 | 748 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 749 | 749 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 750 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
| 750 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
| 751 | 751 | } |
| 752 | 752 | |
| 753 | 753 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | if ( is_array( $value ) ) { |
| 795 | 795 | $temp_values = $value; |
| 796 | 796 | foreach ( $temp_values as $k => $v ) { |
| 797 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
| 797 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
| 798 | 798 | } |
| 799 | 799 | return; |
| 800 | 800 | } |
@@ -805,8 +805,8 @@ discard block |
||
| 805 | 805 | public static function sanitize_request( $sanitize_method, &$values ) { |
| 806 | 806 | $temp_values = $values; |
| 807 | 807 | foreach ( $temp_values as $k => $val ) { |
| 808 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
| 809 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
| 808 | + if ( isset( $sanitize_method[$k] ) ) { |
|
| 809 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
| 810 | 810 | } |
| 811 | 811 | } |
| 812 | 812 | } |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | if ( is_array( $value ) ) { |
| 867 | 867 | $temp_values = $value; |
| 868 | 868 | foreach ( $temp_values as $k => $v ) { |
| 869 | - self::decode_specialchars( $value[ $k ] ); |
|
| 869 | + self::decode_specialchars( $value[$k] ); |
|
| 870 | 870 | } |
| 871 | 871 | } else { |
| 872 | 872 | self::decode_amp( $value ); |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | * @return array |
| 1002 | 1002 | */ |
| 1003 | 1003 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
| 1004 | - $allowed_html['input'] = array( |
|
| 1004 | + $allowed_html['input'] = array( |
|
| 1005 | 1005 | 'type' => true, |
| 1006 | 1006 | 'value' => true, |
| 1007 | 1007 | 'formnovalidate' => true, |
@@ -1024,7 +1024,7 @@ discard block |
||
| 1024 | 1024 | $allowed_html = $html; |
| 1025 | 1025 | } elseif ( ! empty( $allowed ) ) { |
| 1026 | 1026 | foreach ( (array) $allowed as $a ) { |
| 1027 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
| 1027 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
@@ -1208,8 +1208,8 @@ discard block |
||
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | 1210 | global $wp_query; |
| 1211 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
| 1212 | - $value = $wp_query->query_vars[ $param ]; |
|
| 1211 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
| 1212 | + $value = $wp_query->query_vars[$param]; |
|
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | return $value; |
@@ -1240,9 +1240,9 @@ discard block |
||
| 1240 | 1240 | 'frm_keyalt_icon' => 'frm_key_icon', |
| 1241 | 1241 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
| 1242 | 1242 | ); |
| 1243 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
| 1244 | - $icon = $deprecated[ $icon ]; |
|
| 1245 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
| 1243 | + if ( isset( $deprecated[$icon] ) ) { |
|
| 1244 | + $icon = $deprecated[$icon]; |
|
| 1245 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | 1248 | if ( $icon === $class ) { |
@@ -1364,7 +1364,7 @@ discard block |
||
| 1364 | 1364 | * @return string|void |
| 1365 | 1365 | */ |
| 1366 | 1366 | public static function array_to_html_params( $atts, $echo = false ) { |
| 1367 | - $callback = function () use ( $atts ) { |
|
| 1367 | + $callback = function() use ( $atts ) { |
|
| 1368 | 1368 | if ( $atts ) { |
| 1369 | 1369 | foreach ( $atts as $key => $value ) { |
| 1370 | 1370 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | 'value' => false, |
| 1543 | 1543 | 'class' => '', |
| 1544 | 1544 | ); |
| 1545 | - $atts = array_merge( $defaults, $atts ); |
|
| 1545 | + $atts = array_merge( $defaults, $atts ); |
|
| 1546 | 1546 | |
| 1547 | 1547 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
| 1548 | 1548 | $atts['tosearch'] = 'frm-card'; |
@@ -1618,7 +1618,7 @@ discard block |
||
| 1618 | 1618 | 'new_file_path' => self::plugin_path() . '/js', |
| 1619 | 1619 | ) |
| 1620 | 1620 | ); |
| 1621 | - $new_file = new FrmCreateFile( $file_atts ); |
|
| 1621 | + $new_file = new FrmCreateFile( $file_atts ); |
|
| 1622 | 1622 | |
| 1623 | 1623 | $files = array( |
| 1624 | 1624 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1832,8 +1832,8 @@ discard block |
||
| 1832 | 1832 | */ |
| 1833 | 1833 | private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) { |
| 1834 | 1834 | if ( is_array( $option ) ) { |
| 1835 | - $value = isset( $option[ $args['value_key'] ] ) ? $option[ $args['value_key'] ] : ''; |
|
| 1836 | - $label = isset( $option[ $args['label_key'] ] ) ? $option[ $args['label_key'] ] : ''; |
|
| 1835 | + $value = isset( $option[$args['value_key']] ) ? $option[$args['value_key']] : ''; |
|
| 1836 | + $label = isset( $option[$args['label_key']] ) ? $option[$args['label_key']] : ''; |
|
| 1837 | 1837 | } else { |
| 1838 | 1838 | $value = $key; |
| 1839 | 1839 | $label = $option; |
@@ -2216,8 +2216,8 @@ discard block |
||
| 2216 | 2216 | return $error; |
| 2217 | 2217 | } |
| 2218 | 2218 | |
| 2219 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
| 2220 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2219 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
| 2220 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2221 | 2221 | $frm_settings = self::get_settings(); |
| 2222 | 2222 | $error = $frm_settings->admin_permission; |
| 2223 | 2223 | } |
@@ -2253,7 +2253,7 @@ discard block |
||
| 2253 | 2253 | } else { |
| 2254 | 2254 | foreach ( $value as $k => $v ) { |
| 2255 | 2255 | if ( ! is_array( $v ) ) { |
| 2256 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
| 2256 | + $value[$k] = call_user_func( $original_function, $v ); |
|
| 2257 | 2257 | } |
| 2258 | 2258 | } |
| 2259 | 2259 | } |
@@ -2294,7 +2294,7 @@ discard block |
||
| 2294 | 2294 | if ( is_array( $value ) ) { |
| 2295 | 2295 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
| 2296 | 2296 | } elseif ( $keys === 'keep' ) { |
| 2297 | - $return[ $key ] = $value; |
|
| 2297 | + $return[$key] = $value; |
|
| 2298 | 2298 | } else { |
| 2299 | 2299 | $return[] = $value; |
| 2300 | 2300 | } |
@@ -2369,11 +2369,11 @@ discard block |
||
| 2369 | 2369 | } |
| 2370 | 2370 | |
| 2371 | 2371 | $ver = $default; |
| 2372 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
| 2372 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
| 2373 | 2373 | return $ver; |
| 2374 | 2374 | } |
| 2375 | 2375 | |
| 2376 | - $query = $wp_scripts->registered[ $handle ]; |
|
| 2376 | + $query = $wp_scripts->registered[$handle]; |
|
| 2377 | 2377 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
| 2378 | 2378 | $ver = $query->ver; |
| 2379 | 2379 | } |
@@ -2389,7 +2389,7 @@ discard block |
||
| 2389 | 2389 | * @return string|null |
| 2390 | 2390 | */ |
| 2391 | 2391 | public static function js_redirect( $url, $echo = false ) { |
| 2392 | - $callback = function () use ( $url ) { |
|
| 2392 | + $callback = function() use ( $url ) { |
|
| 2393 | 2393 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
| 2394 | 2394 | }; |
| 2395 | 2395 | return self::clip( $callback, $echo ); |
@@ -2484,7 +2484,7 @@ discard block |
||
| 2484 | 2484 | $suffix = 2; |
| 2485 | 2485 | do { |
| 2486 | 2486 | $key_check = $key . $separator . $suffix; |
| 2487 | - ++$suffix; |
|
| 2487 | + ++ $suffix; |
|
| 2488 | 2488 | } while ( in_array( $key_check, $similar_keys, true ) ); |
| 2489 | 2489 | |
| 2490 | 2490 | $key = $key_check; |
@@ -2594,7 +2594,7 @@ discard block |
||
| 2594 | 2594 | |
| 2595 | 2595 | foreach ( array( 'name', 'description' ) as $var ) { |
| 2596 | 2596 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
| 2597 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2597 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2598 | 2598 | unset( $var, $default_val ); |
| 2599 | 2599 | } |
| 2600 | 2600 | |
@@ -2650,9 +2650,9 @@ discard block |
||
| 2650 | 2650 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
| 2651 | 2651 | }//end if |
| 2652 | 2652 | |
| 2653 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
| 2654 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
| 2655 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
| 2653 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
| 2654 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
| 2655 | + $new_value = $post_values['item_meta'][$field->id]; |
|
| 2656 | 2656 | self::unserialize_or_decode( $new_value ); |
| 2657 | 2657 | } else { |
| 2658 | 2658 | $new_value = $meta_value; |
@@ -2673,7 +2673,7 @@ discard block |
||
| 2673 | 2673 | |
| 2674 | 2674 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
| 2675 | 2675 | |
| 2676 | - $values['fields'][ $field->id ] = $field_array; |
|
| 2676 | + $values['fields'][$field->id] = $field_array; |
|
| 2677 | 2677 | } |
| 2678 | 2678 | |
| 2679 | 2679 | /** |
@@ -2723,11 +2723,11 @@ discard block |
||
| 2723 | 2723 | } |
| 2724 | 2724 | |
| 2725 | 2725 | foreach ( $form->options as $opt => $value ) { |
| 2726 | - if ( isset( $post_values[ $opt ] ) ) { |
|
| 2727 | - $values[ $opt ] = $post_values[ $opt ]; |
|
| 2728 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
| 2726 | + if ( isset( $post_values[$opt] ) ) { |
|
| 2727 | + $values[$opt] = $post_values[$opt]; |
|
| 2728 | + self::unserialize_or_decode( $values[$opt] ); |
|
| 2729 | 2729 | } else { |
| 2730 | - $values[ $opt ] = $value; |
|
| 2730 | + $values[$opt] = $value; |
|
| 2731 | 2731 | } |
| 2732 | 2732 | } |
| 2733 | 2733 | |
@@ -2741,8 +2741,8 @@ discard block |
||
| 2741 | 2741 | $form_defaults = FrmFormsHelper::get_default_opts(); |
| 2742 | 2742 | |
| 2743 | 2743 | foreach ( $form_defaults as $opt => $default ) { |
| 2744 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
| 2745 | - $values[ $opt ] = $post_values && isset( $post_values['options'][ $opt ] ) ? $post_values['options'][ $opt ] : $default; |
|
| 2744 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
| 2745 | + $values[$opt] = $post_values && isset( $post_values['options'][$opt] ) ? $post_values['options'][$opt] : $default; |
|
| 2746 | 2746 | } |
| 2747 | 2747 | |
| 2748 | 2748 | unset( $opt, $default ); |
@@ -2753,8 +2753,8 @@ discard block |
||
| 2753 | 2753 | } |
| 2754 | 2754 | |
| 2755 | 2755 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
| 2756 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
| 2757 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
| 2756 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
| 2757 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
| 2758 | 2758 | } |
| 2759 | 2759 | unset( $h ); |
| 2760 | 2760 | } |
@@ -2949,25 +2949,25 @@ discard block |
||
| 2949 | 2949 | if ( ! is_numeric( $levels ) ) { |
| 2950 | 2950 | // Show time in specified unit. |
| 2951 | 2951 | $levels = self::get_unit( $levels ); |
| 2952 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
| 2952 | + if ( isset( $time_strings[$levels] ) ) { |
|
| 2953 | 2953 | $diff = array( |
| 2954 | 2954 | $levels => self::time_format( $levels, $diff ), |
| 2955 | 2955 | ); |
| 2956 | 2956 | $time_strings = array( |
| 2957 | - $levels => $time_strings[ $levels ], |
|
| 2957 | + $levels => $time_strings[$levels], |
|
| 2958 | 2958 | ); |
| 2959 | 2959 | } |
| 2960 | 2960 | $levels = 1; |
| 2961 | 2961 | } |
| 2962 | 2962 | |
| 2963 | 2963 | foreach ( $time_strings as $k => $v ) { |
| 2964 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
| 2965 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
| 2966 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
| 2964 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
| 2965 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
| 2966 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
| 2967 | 2967 | // Account for 0. |
| 2968 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
| 2968 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
| 2969 | 2969 | } else { |
| 2970 | - unset( $time_strings[ $k ] ); |
|
| 2970 | + unset( $time_strings[$k] ); |
|
| 2971 | 2971 | } |
| 2972 | 2972 | } |
| 2973 | 2973 | |
@@ -2986,8 +2986,8 @@ discard block |
||
| 2986 | 2986 | 'y' => 'y', |
| 2987 | 2987 | 'd' => 'days', |
| 2988 | 2988 | ); |
| 2989 | - if ( isset( $return[ $unit ] ) ) { |
|
| 2990 | - return $diff[ $return[ $unit ] ]; |
|
| 2989 | + if ( isset( $return[$unit] ) ) { |
|
| 2990 | + return $diff[$return[$unit]]; |
|
| 2991 | 2991 | } |
| 2992 | 2992 | |
| 2993 | 2993 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2995,11 +2995,11 @@ discard block |
||
| 2995 | 2995 | $times = array( 'h', 'i', 's' ); |
| 2996 | 2996 | |
| 2997 | 2997 | foreach ( $times as $time ) { |
| 2998 | - if ( ! isset( $diff[ $time ] ) ) { |
|
| 2998 | + if ( ! isset( $diff[$time] ) ) { |
|
| 2999 | 2999 | continue; |
| 3000 | 3000 | } |
| 3001 | 3001 | |
| 3002 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
| 3002 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
| 3003 | 3003 | } |
| 3004 | 3004 | |
| 3005 | 3005 | return floor( $total ); |
@@ -3019,7 +3019,7 @@ discard block |
||
| 3019 | 3019 | 'y' => DAY_IN_SECONDS * 365.25, |
| 3020 | 3020 | ); |
| 3021 | 3021 | |
| 3022 | - return $convert[ $from ] / $convert[ $to ]; |
|
| 3022 | + return $convert[$from] / $convert[$to]; |
|
| 3023 | 3023 | } |
| 3024 | 3024 | |
| 3025 | 3025 | /** |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | */ |
| 3028 | 3028 | private static function get_unit( $unit ) { |
| 3029 | 3029 | $units = self::get_time_strings(); |
| 3030 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
| 3030 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
| 3031 | 3031 | return $unit; |
| 3032 | 3032 | } |
| 3033 | 3033 | |
@@ -3143,17 +3143,17 @@ discard block |
||
| 3143 | 3143 | |
| 3144 | 3144 | case 1: |
| 3145 | 3145 | $l2 = $name; |
| 3146 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
| 3146 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
| 3147 | 3147 | break; |
| 3148 | 3148 | |
| 3149 | 3149 | case 2: |
| 3150 | 3150 | $l3 = $name; |
| 3151 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
| 3151 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
| 3152 | 3152 | break; |
| 3153 | 3153 | |
| 3154 | 3154 | case 3: |
| 3155 | 3155 | $l4 = $name; |
| 3156 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
| 3156 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
| 3157 | 3157 | } |
| 3158 | 3158 | |
| 3159 | 3159 | unset( $this_val, $n ); |
@@ -3172,8 +3172,8 @@ discard block |
||
| 3172 | 3172 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
| 3173 | 3173 | if ( $name == '' ) { |
| 3174 | 3174 | $vars[] = $val; |
| 3175 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
| 3176 | - $vars[ $l1 ] = $val; |
|
| 3175 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
| 3176 | + $vars[$l1] = $val; |
|
| 3177 | 3177 | } |
| 3178 | 3178 | } |
| 3179 | 3179 | |
@@ -3190,7 +3190,7 @@ discard block |
||
| 3190 | 3190 | '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' ), |
| 3191 | 3191 | ); |
| 3192 | 3192 | |
| 3193 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
| 3193 | + if ( ! isset( $tooltips[$name] ) ) { |
|
| 3194 | 3194 | return; |
| 3195 | 3195 | } |
| 3196 | 3196 | |
@@ -3200,7 +3200,7 @@ discard block |
||
| 3200 | 3200 | echo ' class="frm_help"'; |
| 3201 | 3201 | } |
| 3202 | 3202 | |
| 3203 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
| 3203 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
| 3204 | 3204 | |
| 3205 | 3205 | if ( 'open' != $class ) { |
| 3206 | 3206 | echo '"'; |
@@ -3259,13 +3259,13 @@ discard block |
||
| 3259 | 3259 | } |
| 3260 | 3260 | |
| 3261 | 3261 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
| 3262 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
| 3262 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
| 3263 | 3263 | return; |
| 3264 | 3264 | } |
| 3265 | 3265 | |
| 3266 | 3266 | if ( is_array( $val ) ) { |
| 3267 | 3267 | foreach ( $val as $k1 => $v1 ) { |
| 3268 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
| 3268 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
| 3269 | 3269 | unset( $k1, $v1 ); |
| 3270 | 3270 | } |
| 3271 | 3271 | } else { |
@@ -3273,7 +3273,7 @@ discard block |
||
| 3273 | 3273 | $val = stripslashes( $val ); |
| 3274 | 3274 | |
| 3275 | 3275 | // Add backslashes before double quotes and forward slashes only |
| 3276 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
| 3276 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
| 3277 | 3277 | } |
| 3278 | 3278 | } |
| 3279 | 3279 | |
@@ -3394,14 +3394,14 @@ discard block |
||
| 3394 | 3394 | continue; |
| 3395 | 3395 | } |
| 3396 | 3396 | $key = $input['name']; |
| 3397 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 3398 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 3399 | - $formatted[ $key ][] = $input['value']; |
|
| 3397 | + if ( isset( $formatted[$key] ) ) { |
|
| 3398 | + if ( is_array( $formatted[$key] ) ) { |
|
| 3399 | + $formatted[$key][] = $input['value']; |
|
| 3400 | 3400 | } else { |
| 3401 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 3401 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 3402 | 3402 | } |
| 3403 | 3403 | } else { |
| 3404 | - $formatted[ $key ] = $input['value']; |
|
| 3404 | + $formatted[$key] = $input['value']; |
|
| 3405 | 3405 | } |
| 3406 | 3406 | } |
| 3407 | 3407 | |
@@ -4103,8 +4103,8 @@ discard block |
||
| 4103 | 4103 | } |
| 4104 | 4104 | |
| 4105 | 4105 | foreach ( $keys as $key ) { |
| 4106 | - if ( isset( $values[ $key ] ) ) { |
|
| 4107 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
| 4106 | + if ( isset( $values[$key] ) ) { |
|
| 4107 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
| 4108 | 4108 | } |
| 4109 | 4109 | } |
| 4110 | 4110 | |
@@ -4169,7 +4169,7 @@ discard block |
||
| 4169 | 4169 | 'role', |
| 4170 | 4170 | 'style', |
| 4171 | 4171 | ); |
| 4172 | - $safe = in_array( $key, $safe_keys, true ); |
|
| 4172 | + $safe = in_array( $key, $safe_keys, true ); |
|
| 4173 | 4173 | }//end if |
| 4174 | 4174 | |
| 4175 | 4175 | /** |
@@ -4308,7 +4308,7 @@ discard block |
||
| 4308 | 4308 | return 0; |
| 4309 | 4309 | } |
| 4310 | 4310 | |
| 4311 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
| 4311 | + return strlen( $parts[count( $parts ) - 1] ); |
|
| 4312 | 4312 | } |
| 4313 | 4313 | |
| 4314 | 4314 | /** |
@@ -4328,7 +4328,7 @@ discard block |
||
| 4328 | 4328 | |
| 4329 | 4329 | add_filter( |
| 4330 | 4330 | 'option_gmt_offset', |
| 4331 | - function ( $offset ) { |
|
| 4331 | + function( $offset ) { |
|
| 4332 | 4332 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
| 4333 | 4333 | // Leave a valid value alone. |
| 4334 | 4334 | return $offset; |
@@ -4425,7 +4425,7 @@ discard block |
||
| 4425 | 4425 | return; |
| 4426 | 4426 | } |
| 4427 | 4427 | |
| 4428 | - $ajax_callback = function () use ( $option ) { |
|
| 4428 | + $ajax_callback = function() use ( $option ) { |
|
| 4429 | 4429 | self::dismiss_warning_message( $option ); |
| 4430 | 4430 | }; |
| 4431 | 4431 | |
@@ -4435,7 +4435,7 @@ discard block |
||
| 4435 | 4435 | |
| 4436 | 4436 | add_filter( |
| 4437 | 4437 | 'frm_message_list', |
| 4438 | - function ( $show_messages ) use ( $message, $option ) { |
|
| 4438 | + function( $show_messages ) use ( $message, $option ) { |
|
| 4439 | 4439 | if ( get_option( $option, false ) ) { |
| 4440 | 4440 | return $show_messages; |
| 4441 | 4441 | } |