Code Duplication    Length = 5-20 lines in 4 locations

caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php 1 location

@@ 930-934 (lines=5) @@
927
            );
928
            $this->_redirect_after_action(false, '', '', $query_args, true);
929
        }
930
        if ($errors > 0) {
931
            EE_Error::add_error(
932
                sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
933
                __FILE__,
934
                __FUNCTION__,
935
                __LINE__
936
            );
937
        } else {

modules/messages/EED_Messages.module.php 2 locations

@@ 954-973 (lines=20) @@
951
        } else {
952
            //can count how many sent by using the messages in the queue
953
            $sent_count = $sent_queue->count_STS_in_queue(EEM_Message::instance()->stati_indicating_sent());
954
            if ($sent_count > 0) {
955
                EE_Error::add_success(
956
                    sprintf(
957
                        _n(
958
                            'There was %d message successfully sent.',
959
                            'There were %d messages successfully sent.',
960
                            $sent_count,
961
                            'event_espresso'
962
                        ),
963
                        $sent_count
964
                    )
965
                );
966
            } else {
967
                EE_Error::overwrite_errors();
968
                EE_Error::add_error(
969
                    __('No message was sent because of problems with sending. Either all the messages you selected were not a sendable message, they were ALREADY sent on a different scheduled task, or there was an error.
970
					If there was an error, you can look at the messages in the message activity list table for any error messages.',
971
                        'event_espresso'),
972
                    __FILE__, __FUNCTION__, __LINE__
973
                );
974
            }
975
        }
976
        return $sent_queue;
@@ 1019-1036 (lines=18) @@
1016
            || EE_Registry::instance()->NET_CFG->core->do_messages_on_same_request
1017
        ) {
1018
            $queue_count = self::$_MSG_PROCESSOR->get_queue()->count_STS_in_queue(EEM_Message::status_sent);
1019
            if ($queue_count > 0) {
1020
                EE_Error::add_success(
1021
                    sprintf(
1022
                        _n(
1023
                            '%d message successfully sent.',
1024
                            '%d messages successfully sent.',
1025
                            $queue_count,
1026
                            'event_espresso'
1027
                        ),
1028
                        $queue_count
1029
                    )
1030
                );
1031
            } else {
1032
                EE_Error::add_error(
1033
                    __('No messages were queued for resending. This usually only happens when all the messages flagged for resending are not a status that can be resent.',
1034
                        'event_espresso'),
1035
                    __FILE__, __FUNCTION__, __LINE__
1036
                );
1037
            }
1038
        } else {
1039
            EE_Error::add_error(

admin_pages/transactions/Transactions_Admin_Page.core.php 1 location

@@ 1481-1488 (lines=8) @@
1478
        /** @type EE_Transaction_Payments $transaction_payments */
1479
        $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1480
        //update the transaction with this payment
1481
        if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1482
            EE_Error::add_success(esc_html__('The payment has been processed successfully.', 'event_espresso'),
1483
                __FILE__, __FUNCTION__, __LINE__);
1484
        } else {
1485
            EE_Error::add_error(
1486
                esc_html__('The payment was processed successfully but the amount paid for the transaction was not updated.',
1487
                    'event_espresso')
1488
                , __FILE__, __FUNCTION__, __LINE__
1489
            );
1490
        }
1491
    }