| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | 'email' => 'FrmEmailAction', |
| 49 | 49 | 'wppost' => 'FrmDefPostAction', |
| 50 | 50 | 'register' => 'FrmDefRegAction', |
| 51 | 51 | 'paypal' => 'FrmDefPayPalAction', |
| 52 | - 'payment' => 'FrmDefHrsAction', | |
| 52 | + 'payment' => 'FrmTransLiteAction', | |
| 53 | 53 | 'quiz' => 'FrmDefQuizAction', |
| 54 | 54 | 'quiz_outcome' => 'FrmDefQuizOutcomeAction', |
| 55 | 55 | 'mailchimp' => 'FrmDefMlcmpAction', |
| 56 | 56 | 'api' => 'FrmDefApiAction', |
| @@ -409,9 +409,22 @@ | ||
| 409 | 409 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| 410 | 410 | $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' ); |
| 411 | 411 | if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) { |
| 412 | 412 | $frm_settings = FrmAppHelper::get_settings(); |
| 413 | - wp_die( esc_html( $frm_settings->admin_permission ) ); | |
| 413 | + $error_args = array( | |
| 414 | + 'title' => __( 'Verification failed', 'formidable' ), | |
| 415 | + 'body' => $frm_settings->admin_permission, | |
| 416 | + 'cancel_url' => add_query_arg( | |
| 417 | + array( | |
| 418 | + 'page' => 'formidable', | |
| 419 | + 'frm_action' => 'settings', | |
| 420 | + 'id' => $form_id, | |
| 421 | + ), | |
| 422 | + admin_url( 'admin.php?' ) | |
| 423 | + ), | |
| 424 | + ); | |
| 425 | + FrmAppController::show_error_modal( $error_args ); | |
| 426 | + return; | |
| 414 | 427 | } |
| 415 | 428 | |
| 416 | 429 | global $wpdb; |
| 417 | 430 | |
| @@ -486,9 +499,9 @@ | ||
| 486 | 499 | |
| 487 | 500 | $stored_actions = array(); |
| 488 | 501 | $action_priority = array(); |
| 489 | 502 | |
| 490 | - if ( in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 503 | + if ( in_array( $event, array( 'create', 'update' ), true ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 491 | 504 | $this_event = 'import'; |
| 492 | 505 | } else { |
| 493 | 506 | $this_event = $event; |
| 494 | 507 | } |
| @@ -504,9 +517,9 @@ | ||
| 504 | 517 | if ( ! is_object( $entry ) ) { |
| 505 | 518 | $entry = FrmEntry::getOne( $entry, true ); |
| 506 | 519 | } |
| 507 | 520 | |
| 508 | - if ( empty( $entry ) || ( $entry->is_draft && $event != 'draft' ) ) { | |
| 521 | + if ( empty( $entry ) || ( FrmEntriesHelper::DRAFT_ENTRY_STATUS === (int) $entry->is_draft && 'draft' !== $event ) ) { | |
| 509 | 522 | continue; |
| 510 | 523 | } |
| 511 | 524 | |
| 512 | 525 | $child_entry = ( ( is_object( $form ) && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) ); |
| @@ -543,9 +556,9 @@ | ||
| 543 | 556 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 544 | 557 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 545 | 558 | |
| 546 | 559 | // If post is created, get updated $entry object. |
| 547 | - if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { | |
| 560 | + if ( $action->post_excerpt === 'wppost' && $event === 'create' ) { | |
| 548 | 561 | $entry = FrmEntry::getOne( $entry->id, true ); |
| 549 | 562 | } |
| 550 | 563 | } |
| 551 | 564 | } |
| @@ -551,9 +564,9 @@ | ||
| 551 | 564 | } |
| 552 | 565 | } |
| 553 | 566 | |
| 554 | 567 | public static function duplicate_form_actions( $form_id, $values, $args = array() ) { |
| 555 | - if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) { | |
| 568 | + if ( empty( $args['old_id'] ) ) { | |
| 556 | 569 | // Continue if we know which actions to copy. |
| 557 | 570 | return; |
| 558 | 571 | } |
| 559 | 572 | |