Code Duplication    Length = 8-11 lines in 3 locations

classes/class-lsx-wetu-importer-accommodation.php 1 location

@@ 479-487 (lines=9) @@
476
477
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
478
479
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {
480
				$adata = json_decode( $jdata['body'], true );
481
				$return = $this->import_row( $adata, $wetu_id, $post_id, $team_members, $content, $safari_brands );
482
				$this->format_completed_row( $return );
483
				$this->remove_from_queue( $return );
484
				$this->cleanup_posts();
485
			} else {
486
				$this->format_error( esc_html__( 'There was a problem importing your accommodation, please try refreshing the page.', 'lsx-wetu-importer' ) );
487
			}
488
		}
489
	}
490

classes/class-lsx-wetu-importer-destination.php 1 location

@@ 516-523 (lines=8) @@
513
514
			$jdata = wp_remote_get( $this->url . '/Get?' . $this->url_qs . '&ids=' . $wetu_id );
515
516
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {
517
				$adata = json_decode( $jdata, true );
518
				$return = $this->import_row( $adata, $wetu_id, $post_id, $team_members, $content, $safari_brands );
519
				$this->remove_from_queue( $return );
520
				$this->format_completed_row( $return );
521
			} else {
522
				$this->format_error( esc_html__( 'There was a problem importing your destination, please try refreshing the page.', 'lsx-wetu-importer' ) );
523
			}
524
		}
525
	}
526

classes/class-lsx-wetu-importer-tours.php 1 location

@@ 469-479 (lines=11) @@
466
			}
467
			$jdata = wp_remote_get( 'https://wetu.com/API/Itinerary/V8/Get?id=' . $wetu_id );
468
469
			if ( ! empty( $jdata ) && isset( $jdata['response'] ) && isset( $jdata['response']['code'] ) && 200 === $jdata['response']['code'] ) {
470
				$jdata = json_decode( $jdata['body'], true );
471
				$return = $this->import_row( $jdata, $wetu_id, $post_id, $content );
472
				$this->format_completed_row( $return );
473
				$this->save_queue();
474
				$this->cleanup_posts();
475
				$this->attach_destination_images( $content );
476
				$this->clean_attached_destinations( $return );
477
			} else {
478
				$this->format_error( esc_html__( 'There was a problem importing your tour, please contact support.', 'lsx-wetu-importer' ) );
479
			}
480
		}
481
	}
482