@@ -285,7 +285,7 @@ |
||
| 285 | 285 | 'type' => $field->type, |
| 286 | 286 | ); |
| 287 | 287 | |
| 288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | continue; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 329 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 330 | 330 | } |
| 331 | 331 | update_option( 'widget_frm_show_form', $widgets ); |
| 332 | 332 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 423 | 423 | continue; |
| 424 | 424 | } |
| 425 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 425 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 426 | 426 | } |
| 427 | 427 | update_option( 'widget_frm_show_form', $widgets ); |
| 428 | 428 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function set_upgrader( &$upgrader ) { |
| 23 | 23 | if ( is_object( $upgrader ) ) { |
| 24 | - $this->upgrader =& $upgrader; |
|
| 24 | + $this->upgrader = & $upgrader; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'sep' => ', ', |
| 40 | 40 | 'html' => false, |
| 41 | 41 | ); |
| 42 | - $atts = wp_parse_args( $atts, $defaults ); |
|
| 42 | + $atts = wp_parse_args( $atts, $defaults ); |
|
| 43 | 43 | |
| 44 | 44 | if ( $atts['html'] ) { |
| 45 | 45 | $atts['sep'] = ' '; |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // validate the url format |
| 63 | 63 | if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) { |
| 64 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 64 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | 65 | } elseif ( $this->field->required == '1' && empty( $value ) ) { |
| 66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $errors; |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | protected function init_saved_value( $entry ) { |
| 60 | 60 | if ( $this->field->type === 'html' ) { |
| 61 | 61 | $this->saved_value = $this->field->description; |
| 62 | - } elseif ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
| 63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
| 62 | + } elseif ( isset( $entry->metas[$this->field->id] ) ) { |
|
| 63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
| 64 | 64 | } else { |
| 65 | 65 | $this->saved_value = ''; |
| 66 | 66 | } |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | if ( is_array( $upsell ) ) { |
| 236 | 236 | foreach ( $upsell as $k => $plugin ) { |
| 237 | 237 | if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) { |
| 238 | - unset( $upsell[ $k ] ); |
|
| 238 | + unset( $upsell[$k] ); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -491,7 +491,8 @@ |
||
| 491 | 491 | |
| 492 | 492 | public static function process_entry( $errors = '', $ajax = false ) { |
| 493 | 493 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
| 494 | - if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 494 | + if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { |
|
| 495 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 495 | 496 | return; |
| 496 | 497 | } |
| 497 | 498 | |
@@ -152,20 +152,20 @@ discard block |
||
| 152 | 152 | global $frm_vars; |
| 153 | 153 | $form_id = FrmForm::get_current_form_id(); |
| 154 | 154 | |
| 155 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 156 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 155 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 156 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 157 | 157 | |
| 158 | 158 | if ( $form_id ) { |
| 159 | 159 | self::get_columns_for_form( $form_id, $columns ); |
| 160 | 160 | } else { |
| 161 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 162 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 163 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 161 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 162 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 163 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 167 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 168 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 166 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 167 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 168 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 169 | 169 | self::maybe_add_ip_col( $form_id, $columns ); |
| 170 | 170 | |
| 171 | 171 | $frm_vars['cols'] = $columns; |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 231 | 231 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 232 | - unset( $sub_form_cols[ $k ] ); |
|
| 232 | + unset( $sub_form_cols[$k] ); |
|
| 233 | 233 | continue; |
| 234 | 234 | } |
| 235 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 235 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 236 | 236 | unset( $sub_form_col ); |
| 237 | 237 | } |
| 238 | 238 | } |
@@ -256,10 +256,10 @@ discard block |
||
| 256 | 256 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status'; |
| 257 | 257 | $include_column_for_sep_val = $has_separate_value && ! $is_post_status; |
| 258 | 258 | if ( $include_column_for_sep_val ) { |
| 259 | - $columns[ $form_id . '_frmsep_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 259 | + $columns[$form_id . '_frmsep_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - $columns[ $form_id . '_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 262 | + $columns[$form_id . '_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 293 | 293 | if ( FrmAppHelper::ips_saved() ) { |
| 294 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 294 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | foreach ( $meta_value as $mk => $mv ) { |
| 347 | 347 | // Remove blank values. |
| 348 | 348 | if ( empty( $mv ) ) { |
| 349 | - unset( $meta_value[ $mk ] ); |
|
| 349 | + unset( $meta_value[$mk] ); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | |
@@ -423,14 +423,14 @@ discard block |
||
| 423 | 423 | ); |
| 424 | 424 | |
| 425 | 425 | if ( ! $form_id ) { |
| 426 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 427 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 428 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 426 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 427 | + $columns[$form_id . '_name'] = 'name'; |
|
| 428 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | foreach ( $fields as $field ) { |
| 432 | 432 | if ( self::field_supports_sorting( $field ) ) { |
| 433 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 433 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | $atts['form_id'] . '_item_key' => '', |
| 519 | 519 | $atts['form_id'] . '_id' => '', |
| 520 | 520 | ); |
| 521 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 521 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 522 | 522 | |
| 523 | 523 | $i = $atts['i']; |
| 524 | 524 | |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | |
| 530 | 530 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 531 | 531 | $result[] = $col_key; |
| 532 | - --$i; |
|
| 532 | + -- $i; |
|
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | unset( $col_key, $col ); |
@@ -677,9 +677,9 @@ discard block |
||
| 677 | 677 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 678 | 678 | $frm_vars['form_params'] = array(); |
| 679 | 679 | } |
| 680 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 680 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 681 | 681 | |
| 682 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 682 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 683 | 683 | return; |
| 684 | 684 | } |
| 685 | 685 | |
@@ -695,16 +695,16 @@ discard block |
||
| 695 | 695 | */ |
| 696 | 696 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 697 | 697 | |
| 698 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 698 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 699 | 699 | |
| 700 | 700 | if ( empty( $errors ) ) { |
| 701 | 701 | $_POST['frm_skip_cookie'] = 1; |
| 702 | 702 | $do_success = false; |
| 703 | 703 | if ( $params['action'] === 'create' ) { |
| 704 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 705 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 704 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 705 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 706 | 706 | |
| 707 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 707 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 708 | 708 | $do_success = true; |
| 709 | 709 | } |
| 710 | 710 | } |
@@ -42,7 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Only do this for single site installs. |
| 45 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 45 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
| 46 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function add_settings( $sections ) { |
| 185 | 185 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 186 | - $sections[ $this->plugin_slug ] = array( |
|
| 186 | + $sections[$this->plugin_slug] = array( |
|
| 187 | 187 | 'class' => $this, |
| 188 | 188 | 'function' => 'settings_page', |
| 189 | 189 | 'name' => $this->plugin_name(), |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | // Set the current step. |
| 350 | 350 | if ( ! isset( $step['current'] ) ) { |
| 351 | 351 | if ( $step['complete'] ) { |
| 352 | - $steps[ $k ]['current'] = false; |
|
| 352 | + $steps[$k]['current'] = false; |
|
| 353 | 353 | } else { |
| 354 | - $steps[ $k ]['current'] = ! $has_current; |
|
| 354 | + $steps[$k]['current'] = ! $has_current; |
|
| 355 | 355 | $has_current = true; |
| 356 | 356 | } |
| 357 | 357 | } elseif ( $step['current'] ) { |
@@ -361,10 +361,10 @@ discard block |
||
| 361 | 361 | // Set disabled buttons. |
| 362 | 362 | $class = $step['button_class'] ?? ''; |
| 363 | 363 | $class .= ' button-primary frm-button-primary'; |
| 364 | - if ( ! $steps[ $k ]['current'] ) { |
|
| 364 | + if ( ! $steps[$k]['current'] ) { |
|
| 365 | 365 | $class .= ' frm_grey disabled'; |
| 366 | 366 | } |
| 367 | - $steps[ $k ]['button_class'] = $class; |
|
| 367 | + $steps[$k]['button_class'] = $class; |
|
| 368 | 368 | }//end foreach |
| 369 | 369 | |
| 370 | 370 | return $steps; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $addons = $api->get_api_info(); |
| 520 | 520 | |
| 521 | 521 | $id = $this->download_id(); |
| 522 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 522 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 523 | 523 | |
| 524 | 524 | if ( ! $step['current'] ) { |
| 525 | 525 | ?> |
@@ -534,10 +534,10 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | if ( ! $has_file ) { |
| 536 | 536 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 537 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 537 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 538 | 538 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
| 539 | 539 | } else { |
| 540 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 540 | + $xml = $addons[$id]['beta']['package']; |
|
| 541 | 541 | if ( is_array( $xml ) ) { |
| 542 | 542 | $xml = reset( $xml ); |
| 543 | 543 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | foreach ( $options as $info ) { |
| 615 | 615 | // Count the number of options displayed for css. |
| 616 | 616 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 617 | - --$count; |
|
| 617 | + -- $count; |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | foreach ( $forms as $form ) { |
| 705 | 705 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 706 | 706 | if ( $was_imported ) { |
| 707 | - $imported[ $form['form'] ] = $was_imported; |
|
| 707 | + $imported[$form['form']] = $was_imported; |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
@@ -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'] = '#'; |