Code Duplication    Length = 22-22 lines in 2 locations

classes/class-accommodation.php 1 location

@@ 71-92 (lines=22) @@
68
	/**
69
	 * Sets the variables used throughout the plugin.
70
	 */
71
	public function set_variables()
72
	{
73
	    parent::set_variables();
74
		// ** This request only works with API KEY **
75
		//if ( false !== $this->api_username && false !== $this->api_password ) {
76
		//	$this->url    = 'https://wetu.com/API/Pins/';
77
		//	$this->url_qs = 'username=' . $this->api_username . '&password=' . $this->api_password;
78
		//} elseif ( false !== $this->api_key ) {
79
			$this->url    = 'https://wetu.com/API/Pins/' . $this->api_key;
80
			$this->url_qs = '';
81
		//}
82
83
		$temp_options = get_option('_lsx-to_settings',false);
84
		if(false !== $temp_options && isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug])){
85
			$this->options = $temp_options[$this->plugin_slug];
86
		}
87
88
		$accommodation_options = get_option('wetu_importer_accommodation_settings',false);
89
		if(false !== $accommodation_options){
90
			$this->accommodation_options = $accommodation_options;
91
		}
92
	}
93
94
	/**
95
	 * Display the importer administration screen

classes/class-destination.php 1 location

@@ 73-94 (lines=22) @@
70
	/**
71
	 * Sets the variables used throughout the plugin.
72
	 */
73
	public function set_variables()
74
	{
75
		parent::set_variables();
76
		// ** This request only works with API KEY **
77
		//if ( false !== $this->api_username && false !== $this->api_password ) {
78
		//	$this->url    = 'https://wetu.com/API/Pins/';
79
		//	$this->url_qs = 'username=' . $this->api_username . '&password=' . $this->api_password;
80
		//} elseif ( false !== $this->api_key ) {
81
		$this->url = 'https://wetu.com/API/Pins/' . $this->api_key;
82
		$this->url_qs = '';
83
		//}
84
85
		$temp_options = get_option('_lsx-to_settings', false);
86
		if (false !== $temp_options && isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug])) {
87
			$this->options = $temp_options[$this->plugin_slug];
88
		}
89
90
		$destination_options = get_option('wetu_importer_destination_settings', false);
91
		if (false !== $destination_options) {
92
			$this->destination_options = $destination_options;
93
		}
94
	}
95
96
	/**
97
	 * Display the importer administration screen