Code Duplication    Length = 14-15 lines in 2 locations

geodirectory-admin/admin_functions.php 2 locations

@@ 4938-4951 (lines=14) @@
4935
                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4936
                                    }
4937
                                }
4938
                            } elseif ( $import_choice == 'skip' ) {
4939
                                if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4940
                                    $skipped++;
4941
                                } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4942
                                    $skipped++;
4943
                                } else {
4944
                                    if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4945
                                        $created++;
4946
                                    } else {
4947
                                        $invalid++;
4948
                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4949
                                    }
4950
                                }
4951
                            } else {
4952
                                $invalid++;
4953
                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4954
                            }
@@ 5050-5064 (lines=15) @@
5047
                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5048
                                    }
5049
                                }
5050
                            } elseif ( $import_choice == 'skip' ) {
5051
                                if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5052
                                    $skipped++;
5053
                                } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5054
                                    $skipped++;
5055
                                } else {
5056
                                    
5057
                                    if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5058
                                        $created++;
5059
                                    } else {
5060
                                        $invalid++;
5061
                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5062
                                    }
5063
                                }
5064
                            } else {
5065
                                $invalid++;
5066
                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5067
                            }