Code Duplication    Length = 4-22 lines in 6 locations

admin_pages/messages/Messages_Admin_Page.core.php 1 location

@@ 2839-2852 (lines=14) @@
2836
                                // default setup for it.
2837
                                // @link https://events.codebasehq.com/projects/event-espresso/tickets/9465
2838
                                $updated = $MTP->insert($message_template_fields);
2839
                                if (! $updated || is_wp_error($updated)) {
2840
                                    EE_Error::add_error(
2841
                                        sprintf(
2842
                                            esc_html__('%s field could not be updated.', 'event_espresso'),
2843
                                            $template_field
2844
                                        ),
2845
                                        __FILE__,
2846
                                        __FUNCTION__,
2847
                                        __LINE__
2848
                                    );
2849
                                    $success = 0;
2850
                                } else {
2851
                                    $success = 1;
2852
                                }
2853
                            }
2854
                        }
2855
                        $action_desc = 'updated';

core/EE_Config.core.php 1 location

@@ 1095-1099 (lines=5) @@
1092
        // load the widget class file
1093
        require_once($widget_path . DS . $widget_class . $widget_ext);
1094
        // verify that class exists
1095
        if (! class_exists($widget_class)) {
1096
            $msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
1097
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1098
            return;
1099
        }
1100
        register_widget($widget_class);
1101
        // add to array of registered widgets
1102
        EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;

core/EE_Network_Config.core.php 1 location

@@ 185-188 (lines=4) @@
182
            }
183
            return true;
184
        } else {
185
            if ($add_error) {
186
                $msg = is_multisite() ? __(
187
                    'The Event Espresso Network Configuration Settings were not updated.',
188
                    'event_espresso'
189
                ) : __('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso');
190
                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
191
            }

core/helpers/EEH_Activation.helper.php 1 location

@@ 563-569 (lines=7) @@
560
            return $critical_page;
561
        }
562
        // get newly created post's details
563
        if (! $critical_page['post'] = get_post($post_id)) {
564
            $msg = sprintf(
565
                __('The Event Espresso critical page entitled "%s" could not be retrieved.', 'event_espresso'),
566
                $critical_page['name']
567
            );
568
            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
569
        }
570
571
        return $critical_page;
572
    }

core/libraries/messages/EE_Message_To_Generate.php 1 location

@@ 296-311 (lines=16) @@
293
    public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference)
294
    {
295
        $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data';
296
        if (! class_exists($class_name)) {
297
            EE_Error::add_error(
298
                sprintf(
299
                    __(
300
                        'The included data handler reference (%s) does not match any valid, accessible, "EE_Messages_incoming_data" classes.  Looking for %s.',
301
                        'event_espresso'
302
                    ),
303
                    $data_handler_reference,
304
                    $class_name
305
                ),
306
                __FILE__,
307
                __FUNCTION__,
308
                __LINE__
309
            );
310
            $class_name = ''; // clear out class_name so caller knows this isn't valid.
311
        }
312
        return $class_name;
313
    }
314
}

modules/single_page_checkout/reg_steps/attendee_information/EE_SPCO_Reg_Step_Attendee_Information.class.php 1 location

@@ 1025-1046 (lines=22) @@
1022
                                        $input_value = $primary_registrant[ $form_input ];
1023
                                    }
1024
                                    // now attempt to save the input data
1025
                                    if (! $this->_save_registration_form_input(
1026
                                        $registration,
1027
                                        $form_input,
1028
                                        $input_value
1029
                                    )
1030
                                    ) {
1031
                                        EE_Error::add_error(
1032
                                            sprintf(
1033
                                                esc_html_x(
1034
                                                    'Unable to save registration form data for the form input: "%1$s" with the submitted value: "%2$s"',
1035
                                                    'Unable to save registration form data for the form input: "form input name" with the submitted value: "form input value"',
1036
                                                    'event_espresso'
1037
                                                ),
1038
                                                $form_input,
1039
                                                $input_value
1040
                                            ),
1041
                                            __FILE__,
1042
                                            __FUNCTION__,
1043
                                            __LINE__
1044
                                        );
1045
                                        return false;
1046
                                    }
1047
                                }
1048
                            }
1049
                        }  // end of foreach ( $valid_data[ $reg_url_link ] as $form_section => $form_inputs )