Code Duplication    Length = 4-16 lines in 5 locations

core/EE_Network_Config.core.php 1 location

@@ 174-177 (lines=4) @@
171
			}
172
			return true;
173
		} else {
174
			if ( $add_error ) {
175
				$msg = is_multisite() ? __( 'The Event Espresso Network Configuration Settings were not updated.', 'event_espresso' ) : __( 'Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso' );
176
				EE_Error::add_error( $msg , __FILE__, __FUNCTION__, __LINE__ );
177
			}
178
			return false;
179
		}
180
	}

core/helpers/EEH_Activation.helper.php 1 location

@@ 579-585 (lines=7) @@
576
            return $critical_page;
577
        }
578
        // get newly created post's details
579
        if (! $critical_page['post'] = get_post($post_id)) {
580
            $msg = sprintf(
581
                __('The Event Espresso critical page entitled "%s" could not be retrieved.', 'event_espresso'),
582
                $critical_page['name']
583
            );
584
            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
585
        }
586
587
        return $critical_page;
588

core/libraries/messages/EE_Message_To_Generate.php 1 location

@@ 284-299 (lines=16) @@
281
	 */
282
	public static function verify_and_retrieve_class_name_for_data_handler_reference( $data_handler_reference ) {
283
		$class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data';
284
		if ( ! class_exists( $class_name ) ) {
285
			EE_Error::add_error(
286
				sprintf(
287
					__(
288
						'The included data handler reference (%s) does not match any valid, accessible, "EE_Messages_incoming_data" classes.  Looking for %s.',
289
						'event_espresso'
290
					),
291
					$data_handler_reference,
292
					$class_name
293
				),
294
				__FILE__,
295
				__FUNCTION__,
296
				__LINE__
297
			);
298
			$class_name = ''; //clear out class_name so caller knows this isn't valid.
299
		}
300
		return $class_name;
301
	}
302

admin_pages/messages/Messages_Admin_Page.core.php 1 location

@@ 2790-2803 (lines=14) @@
2787
                                //default setup for it.
2788
                                //@link https://events.codebasehq.com/projects/event-espresso/tickets/9465
2789
                                $updated = $MTP->insert($message_template_fields);
2790
                                if (! $updated || is_wp_error($updated)) {
2791
                                    EE_Error::add_error(
2792
                                        sprintf(
2793
                                            esc_html__('%s field could not be updated.', 'event_espresso'),
2794
                                            $template_field
2795
                                        ),
2796
                                        __FILE__,
2797
                                        __FUNCTION__,
2798
                                        __LINE__
2799
                                    );
2800
                                    $success = 0;
2801
                                } else {
2802
                                    $success = 1;
2803
                                }
2804
                            }
2805
                        }
2806
                        $action_desc = 'updated';

core/EE_Config.core.php 1 location

@@ 1120-1124 (lines=5) @@
1117
        // load the widget class file
1118
        require_once($widget_path . DS . $widget_class . $widget_ext);
1119
        // verify that class exists
1120
        if (! class_exists($widget_class)) {
1121
            $msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
1122
            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1123
            return;
1124
        }
1125
        register_widget($widget_class);
1126
        // add to array of registered widgets
1127
        EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;