Code Duplication    Length = 5-20 lines in 8 locations

modules/messages/EED_Messages.module.php 2 locations

@@ 1158-1177 (lines=20) @@
1155
        } else {
1156
            // can count how many sent by using the messages in the queue
1157
            $sent_count = $sent_queue->count_STS_in_queue(EEM_Message::instance()->stati_indicating_sent());
1158
            if ($sent_count > 0) {
1159
                EE_Error::add_success(
1160
                    sprintf(
1161
                        _n(
1162
                            'There was %d message successfully sent.',
1163
                            'There were %d messages successfully sent.',
1164
                            $sent_count,
1165
                            'event_espresso'
1166
                        ),
1167
                        $sent_count
1168
                    )
1169
                );
1170
            } else {
1171
                EE_Error::overwrite_errors();
1172
                EE_Error::add_error(
1173
                    __(
1174
                        '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.
1175
					If there was an error, you can look at the messages in the message activity list table for any error messages.',
1176
                        'event_espresso'
1177
                    ),
1178
                    __FILE__,
1179
                    __FUNCTION__,
1180
                    __LINE__
@@ 1266-1283 (lines=18) @@
1263
            || EE_Registry::instance()->NET_CFG->core->do_messages_on_same_request
1264
        ) {
1265
            $queue_count = self::$_MSG_PROCESSOR->get_queue()->count_STS_in_queue(EEM_Message::status_sent);
1266
            if ($queue_count > 0) {
1267
                EE_Error::add_success(
1268
                    sprintf(
1269
                        _n(
1270
                            '%d message successfully sent.',
1271
                            '%d messages successfully sent.',
1272
                            $queue_count,
1273
                            'event_espresso'
1274
                        ),
1275
                        $queue_count
1276
                    )
1277
                );
1278
            } else {
1279
                EE_Error::add_error(
1280
                    __(
1281
                        '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.',
1282
                        'event_espresso'
1283
                    ),
1284
                    __FILE__,
1285
                    __FUNCTION__,
1286
                    __LINE__

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

@@ 1033-1037 (lines=5) @@
1030
            );
1031
            $this->_redirect_after_action(false, '', '', $query_args, true);
1032
        }
1033
        if ($errors > 0) {
1034
            EE_Error::add_error(
1035
                sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors),
1036
                __FILE__,
1037
                __FUNCTION__,
1038
                __LINE__
1039
            );
1040
        } else {

admin_pages/transactions/Transactions_Admin_Page.core.php 1 location

@@ 1918-1925 (lines=8) @@
1915
        /** @type EE_Transaction_Payments $transaction_payments */
1916
        $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments');
1917
        // update the transaction with this payment
1918
        if ($transaction_payments->calculate_total_payments_and_update_status($transaction)) {
1919
            EE_Error::add_success(
1920
                esc_html__(
1921
                    'The payment has been processed successfully.',
1922
                    'event_espresso'
1923
                ),
1924
                __FILE__,
1925
                __FUNCTION__,
1926
                __LINE__
1927
            );
1928
        } else {

caffeinated/modules/event_single_caff/EED_Event_Single_Caff.module.php 1 location

@@ 227-231 (lines=5) @@
224
            }
225
            $config_saved = EE_Registry::instance()->CFG->update_espresso_config(false, false);
226
        }
227
        if ($config_saved) {
228
            EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso'));
229
        } else {
230
            EE_Error::add_error(
231
                __('Display Order was not updated.', 'event_espresso'),
232
                __FILE__,
233
                __FUNCTION__,
234
                __LINE__

caffeinated/modules/events_archive_caff/EED_Events_Archive_Caff.module.php 1 location

@@ 259-263 (lines=5) @@
256
            }
257
            $config_saved = $config->update_espresso_config(false, false);
258
        }
259
        if ($config_saved) {
260
            EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso'));
261
        } else {
262
            EE_Error::add_error(
263
                __('Display Order was not updated.', 'event_espresso'),
264
                __FILE__,
265
                __FUNCTION__,
266
                __LINE__

admin_pages/messages/Messages_Admin_Page.core.php 2 locations

@@ 3038-3047 (lines=10) @@
3035
        )) {
3036
            if (EEM_Event::instance()->count() > 0) {
3037
                $success = $this->_preview_message(true);
3038
                if ($success) {
3039
                    EE_Error::add_success(__('Test message sent', 'event_espresso'));
3040
                } else {
3041
                    EE_Error::add_error(
3042
                        esc_html__('The test message was not sent', 'event_espresso'),
3043
                        __FILE__,
3044
                        __FUNCTION__,
3045
                        __LINE__
3046
                    );
3047
                }
3048
            } else {
3049
                $this->noEventsErrorMessage(true);
3050
            }
@@ 4413-4425 (lines=13) @@
4410
        // okay we should have the data all setup.  Now we just update!
4411
        $success = $this->_message_resource_manager->update_active_messengers_option();
4412
4413
        if ($success) {
4414
            EE_Error::add_success(__('Settings updated', 'event_espresso'));
4415
        } else {
4416
            EE_Error::add_error(
4417
                esc_html__(
4418
                    'Settings did not get updated',
4419
                    'event_espresso'
4420
                ),
4421
                __FILE__,
4422
                __FUNCTION__,
4423
                __LINE__
4424
            );
4425
        }
4426
4427
        $this->_template_args['success'] = $success;
4428
        $this->_return_json();