Code Duplication    Length = 5-16 lines in 3 locations

core/data_migration_scripts/EE_DMS_Core_4_1_0.dms.php 2 locations

@@ 1512-1516 (lines=5) @@
1509
        // if the file is located remotely, download it to our uploads DIR, because wp_genereate_attachmnet_metadata needs the file to be local
1510
        if (strpos($guid, $wp_upload_dir['url']) === false) {
1511
            // image is located remotely. download it and place it in the uploads directory
1512
            if (! is_readable($guid)) {
1513
                $migration_stage->add_error(sprintf(esc_html__(
1514
                    "Could not create image attachment from non-existent file: %s",
1515
                    "event_espresso"
1516
                ), $guid));
1517
                return 0;
1518
            }
1519
            $contents = file_get_contents($guid);
@@ 1520-1524 (lines=5) @@
1517
                return 0;
1518
            }
1519
            $contents = file_get_contents($guid);
1520
            if ($contents === false) {
1521
                $migration_stage->add_error(sprintf(esc_html__(
1522
                    "Could not read image at %s, and therefore couldnt create an attachment post for it.",
1523
                    "event_espresso"
1524
                ), $guid));
1525
                return false;
1526
            }
1527
            $local_filepath = $wp_upload_dir['path'] . '/' . basename($guid);

core/admin/EE_Admin_Page.core.php 1 location

@@ 1389-1404 (lines=16) @@
1386
                                                             . $tour
1387
                                                             . '.class.php' : $file_path;
1388
                    // if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error.
1389
                    if (! is_readable($file_path)) {
1390
                        EE_Error::add_error(
1391
                            sprintf(
1392
                                esc_html__(
1393
                                    'The file path given for the help tour (%s) is not a valid path.  Please check that the string you set for the help tour on this route (%s) is the correct spelling',
1394
                                    'event_espresso'
1395
                                ),
1396
                                $file_path,
1397
                                $tour
1398
                            ),
1399
                            __FILE__,
1400
                            __FUNCTION__,
1401
                            __LINE__
1402
                        );
1403
                        return;
1404
                    }
1405
                    require_once $file_path;
1406
                    if (! class_exists($tour)) {
1407
                        $error_msg[] = sprintf(