PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.0.07
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.0.07
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmEntriesController.php +55 -68 6.55.0.07 View file →
@@ -23,9 +23,9 @@
23 23 /**
24 24 * @since 2.05.07
25 25 */
26 26 private static function load_manage_entries_hooks() {
27 - if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show', 'new', 'duplicate' ), true ) ) {
27 + if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show', 'new' ) ) ) {
28 28 $menu_name = FrmAppHelper::get_menu_name();
29 29 $base = self::base_column_key( $menu_name );
30 30
31 31 add_filter( 'manage_' . $base . '_columns', 'FrmEntriesController::manage_columns' );
@@ -80,14 +80,13 @@
80 80
81 81 if ( $form_id ) {
82 82 self::get_columns_for_form( $form_id, $columns );
83 83 } else {
84 - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' );
85 - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' );
86 - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' );
84 + $columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
85 + $columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' );
86 + $columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
87 87 }
88 88
89 - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' );
90 89 $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
91 90 $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
92 91 self::maybe_add_ip_col( $form_id, $columns );
93 92
@@ -97,9 +96,9 @@
97 96 if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
98 97 add_screen_option(
99 98 'per_page',
100 99 array(
101 - 'label' => esc_html__( 'Entries', 'formidable' ),
100 + 'label' => __( 'Entries', 'formidable' ),
102 101 'default' => 20,
103 102 'option' => 'formidable_page_formidable_entries_per_page',
104 103 )
105 104 );
@@ -306,20 +305,9 @@
306 305 $is_sortable = 'checkbox' !== $field->type && empty( $field->field_options['post_field'] );
307 306 return apply_filters( 'frm_field_column_is_sortable', $is_sortable, $field );
308 307 }
309 308
310 - /**
311 - * @param mixed $result Option value from database for hidden columns in entries table.
312 - * @return array
313 - */
314 309 public static function hidden_columns( $result ) {
315 - if ( ! is_array( $result ) ) {
316 - // Force an unexpected value to be an array.
317 - // Since $result is a filtered option and gets saved to the database, it's possible it could be a string.
318 - // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error.
319 - $result = array();
320 - }
321 -
322 310 $form_id = FrmForm::get_current_form_id();
323 311
324 312 $hidden = self::user_hidden_columns_for_form( $form_id, $result );
325 313
@@ -417,9 +405,9 @@
417 405 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
418 406 if ( $pagenum > $total_pages && $total_pages > 0 ) {
419 407 $url = add_query_arg( 'paged', $total_pages );
420 408 if ( headers_sent() ) {
421 - FrmAppHelper::js_redirect( $url, true );
409 + echo FrmAppHelper::js_redirect( $url ); // WPCS: XSS ok.
422 410 } else {
423 411 wp_redirect( esc_url_raw( $url ) );
424 412 }
425 413 die();
@@ -428,9 +416,9 @@
428 416 if ( empty( $message ) && isset( $_GET['import-message'] ) ) {
429 417 $message = __( 'Your import is complete', 'formidable' );
430 418 }
431 419
432 - require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php';
420 + require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php' );
433 421 }
434 422
435 423 private static function get_delete_form_time( $form, &$errors ) {
436 424 if ( 'trash' == $form->status ) {
@@ -473,19 +461,10 @@
473 461
474 462 include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/show.php' );
475 463 }
476 464
477 - /**
478 - * Destroy an entry from the admin page.
479 - * This is triggered from the entries list from the "Delete" row action, and also from the "Delete Entry" trigger in the view/edit entry sidebar.
480 - *
481 - * @return void
482 - */
483 465 public static function destroy() {
484 - $permission_error = FrmAppHelper::permission_nonce_error( 'frm_delete_entries', '_wpnonce', -1 );
485 - if ( false !== $permission_error ) {
486 - wp_die( esc_html( $permission_error ) );
487 - }
466 + FrmAppHelper::permission_check( 'frm_delete_entries' );
488 467
489 468 $params = FrmForm::get_admin_params();
490 469
491 470 if ( isset( $params['keep_post'] ) && $params['keep_post'] ) {
@@ -493,9 +472,9 @@
493 472 }
494 473
495 474 $message = '';
496 475 if ( FrmEntry::destroy( $params['id'] ) ) {
497 - $message = __( 'Entry was successfully deleted', 'formidable' );
476 + $message = __( 'Entry was Successfully Deleted', 'formidable' );
498 477 }
499 478
500 479 self::display_list( $message );
501 480 }
@@ -511,9 +490,9 @@
511 490 }
512 491
513 492 public static function process_entry( $errors = '', $ajax = false ) {
514 493 $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
515 - 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'] ) ) {
516 495 return;
517 496 }
518 497
519 498 global $frm_vars;
@@ -534,9 +513,9 @@
534 513 return;
535 514 }
536 515
537 516 if ( $errors == '' && ! $ajax ) {
538 - $errors = FrmEntryValidate::validate( wp_unslash( $_POST ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
517 + $errors = FrmEntryValidate::validate( wp_unslash( $_POST ) );
539 518 }
540 519
541 520 /**
542 521 * Use this filter to add trigger actions and add errors after
@@ -550,11 +529,11 @@
550 529
551 530 if ( empty( $errors ) ) {
552 531 $_POST['frm_skip_cookie'] = 1;
553 532 $do_success = false;
554 - if ( $params['action'] === 'create' ) {
533 + if ( $params['action'] == 'create' ) {
555 534 if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
556 - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
535 + $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
557 536
558 537 $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
559 538 $do_success = true;
560 539 }
@@ -563,9 +542,9 @@
563 542 do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
564 543 if ( $do_success ) {
565 544 FrmFormsController::maybe_trigger_redirect( $form, $params, array( 'ajax' => $ajax ) );
566 545 }
567 - unset( $_POST['frm_skip_cookie'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
546 + unset( $_POST['frm_skip_cookie'] );
568 547 }
569 548 }
570 549
571 550 /**
@@ -623,34 +602,33 @@
623 602 * @return array|string
624 603 */
625 604 public static function show_entry_shortcode( $atts ) {
626 605 $defaults = array(
627 - 'id' => false,
628 - 'entry' => false,
629 - 'fields' => false,
630 - 'plain_text' => false,
631 - 'user_info' => false,
632 - 'include_blank' => false,
633 - 'default_email' => false,
634 - 'form_id' => false,
635 - 'format' => 'text',
636 - 'array_key' => 'key',
637 - 'direction' => 'ltr',
638 - 'font_size' => '',
639 - 'text_color' => '',
640 - 'border_width' => '',
641 - 'border_color' => '',
642 - 'bg_color' => '',
643 - 'alt_bg_color' => '',
644 - 'class' => '',
645 - 'clickable' => false,
646 - 'exclude_fields' => '',
647 - 'include_fields' => '',
648 - 'include_extras' => '',
649 - 'inline_style' => 1,
650 - 'child_array' => false, // return embedded fields as nested array
651 - 'line_breaks' => true,
652 - 'array_separator' => ', ',
606 + 'id' => false,
607 + 'entry' => false,
608 + 'fields' => false,
609 + 'plain_text' => false,
610 + 'user_info' => false,
611 + 'include_blank' => false,
612 + 'default_email' => false,
613 + 'form_id' => false,
614 + 'format' => 'text',
615 + 'array_key' => 'key',
616 + 'direction' => 'ltr',
617 + 'font_size' => '',
618 + 'text_color' => '',
619 + 'border_width' => '',
620 + 'border_color' => '',
621 + 'bg_color' => '',
622 + 'alt_bg_color' => '',
623 + 'class' => '',
624 + 'clickable' => false,
625 + 'exclude_fields' => '',
626 + 'include_fields' => '',
627 + 'include_extras' => '',
628 + 'inline_style' => 1,
629 + 'child_array' => false, // return embedded fields as nested array
630 + 'line_breaks' => true,
653 631 );
654 632 $defaults = apply_filters( 'frm_show_entry_defaults', $defaults );
655 633
656 634 $atts = shortcode_atts( $defaults, $atts );
@@ -686,15 +664,8 @@
686 664 $data = $entry->description;
687 665 if ( isset( $data['browser'] ) ) {
688 666 $browser = FrmEntriesHelper::get_browser( $data['browser'] );
689 667 }
690 - /**
691 - * Add or remove information in the entry sidebar.
692 - *
693 - * @since 5.5.2
694 - * @param array $data
695 - */
696 - $data = apply_filters( 'frm_sidebar_data', $data, compact( 'entry' ) );
697 668 }
698 669
699 670 include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-shared.php' );
700 671 }
@@ -704,6 +675,22 @@
704 675 */
705 676 public static function contextual_help( $help, $screen_id, $screen ) {
706 677 _deprecated_function( __METHOD__, '4.0' );
707 678 return $help;
679 + }
680 +
681 + /**
682 + * @deprecated 1.07.05
683 + * @codeCoverageIgnore
684 + */
685 + public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
686 + return FrmDeprecated::show_form( $id, $key, $title, $description );
687 + }
688 +
689 + /**
690 + * @deprecated 1.07.05
691 + * @codeCoverageIgnore
692 + */
693 + public static function get_form( $filename, $form, $title, $description ) {
694 + return FrmDeprecated::get_form( $filename, $form, $title, $description );
708 695 }
709 696 }