| @@ -22,7 +22,7 @@ discard block | ||
| 22 | 22 | * | 
| 23 | 23 | * @access public | 
| 24 | 24 | * @param mixed $address | 
| 25 | - * @return void | |
| 25 | + * @return string | |
| 26 | 26 | */ | 
| 27 | 27 |  		public function extract_zipcode( $address ) { | 
| 28 | 28 |  			$zipcode = preg_match("/\b[A-Z]{2}\s+\d{5}(-\d{4})?\b/", $address, $matches); | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | * | 
| 61 | 61 | * @access public | 
| 62 | 62 | * @param mixed $zip_code | 
| 63 | - * @return void | |
| 63 | + * @return boolean | |
| 64 | 64 | */ | 
| 65 | 65 |  		public function validate_usa_zipcode( $zip_code ) { | 
| 66 | 66 |  			if ( preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code) ) | 
| @@ -75,7 +75,7 @@ discard block | ||
| 75 | 75 | * | 
| 76 | 76 | * @access public | 
| 77 | 77 | * @param mixed $latitude | 
| 78 | - * @return void | |
| 78 | + * @return boolean | |
| 79 | 79 | */ | 
| 80 | 80 |  		public function is_valid_latitude($latitude) { | 
| 81 | 81 |  			if ( preg_match("/^-?([1-8]?[1-9]|[1-9]0)\.{1}\d{1,6}$/", $latitude) ) { | 
| @@ -91,7 +91,7 @@ discard block | ||
| 91 | 91 | * | 
| 92 | 92 | * @access public | 
| 93 | 93 | * @param mixed $longitude | 
| 94 | - * @return void | |
| 94 | + * @return boolean | |
| 95 | 95 | */ | 
| 96 | 96 |  		public function is_valid_longitude($longitude) { | 
| 97 | 97 |  			if (preg_match("/^-?([1]?[1-7][1-9]|[1]?[1-8][0]|[1-9]?[0-9])\.{1}\d{1,6}$/", | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 | * @return void | 
| 38 | 38 | */ | 
| 39 | 39 |  		public function extract_bed_count( $text ) { | 
| 40 | -    		$beds = preg_match("/\d (beds|Beds|Bedrooms)/", $text, $matches); | |
| 40 | +			$beds = preg_match("/\d (beds|Beds|Bedrooms)/", $text, $matches); | |
| 41 | 41 | $beds_text = $matches[0]; | 
| 42 | 42 | return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT); | 
| 43 | 43 | } | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 | * @return void | 
| 51 | 51 | */ | 
| 52 | 52 |  		public function extract_bath_count( $text ) { | 
| 53 | -    		$baths = preg_match("/\d (bath|Baths|Bathrooms)/", $text, $matches); | |
| 53 | +			$baths = preg_match("/\d (bath|Baths|Bathrooms)/", $text, $matches); | |
| 54 | 54 | $baths_text = $matches[0]; | 
| 55 | 55 | return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT); | 
| 56 | 56 | } | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -if ( ! class_exists( 'RealEstateTools' ) ) { | |
| 3 | +if ( ! class_exists('RealEstateTools')) { | |
| 4 | 4 | |
| 5 | 5 | /** | 
| 6 | 6 | * RealEstateTools class. | 
| @@ -24,7 +24,7 @@ discard block | ||
| 24 | 24 | * @param mixed $address | 
| 25 | 25 | * @return void | 
| 26 | 26 | */ | 
| 27 | -		public function extract_zipcode( $address ) { | |
| 27 | +		public function extract_zipcode($address) { | |
| 28 | 28 |  			$zipcode = preg_match("/\b[A-Z]{2}\s+\d{5}(-\d{4})?\b/", $address, $matches); | 
| 29 | 29 | return $matches[0]; | 
| 30 | 30 | } | 
| @@ -36,7 +36,7 @@ discard block | ||
| 36 | 36 | * @param mixed $text | 
| 37 | 37 | * @return void | 
| 38 | 38 | */ | 
| 39 | -		public function extract_bed_count( $text ) { | |
| 39 | +		public function extract_bed_count($text) { | |
| 40 | 40 |      		$beds = preg_match("/\d (beds|Beds|Bedrooms)/", $text, $matches); | 
| 41 | 41 | $beds_text = $matches[0]; | 
| 42 | 42 | return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT); | 
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | * @param mixed $text | 
| 50 | 50 | * @return void | 
| 51 | 51 | */ | 
| 52 | -		public function extract_bath_count( $text ) { | |
| 52 | +		public function extract_bath_count($text) { | |
| 53 | 53 |      		$baths = preg_match("/\d (bath|Baths|Bathrooms)/", $text, $matches); | 
| 54 | 54 | $baths_text = $matches[0]; | 
| 55 | 55 | return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT); | 
| @@ -62,8 +62,8 @@ discard block | ||
| 62 | 62 | * @param mixed $zip_code | 
| 63 | 63 | * @return void | 
| 64 | 64 | */ | 
| 65 | -		public function validate_usa_zipcode( $zip_code ) { | |
| 66 | -			if ( preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code) ) | |
| 65 | +		public function validate_usa_zipcode($zip_code) { | |
| 66 | +			if (preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code)) | |
| 67 | 67 | return true; | 
| 68 | 68 | else | 
| 69 | 69 | return false; | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | * @return void | 
| 79 | 79 | */ | 
| 80 | 80 |  		public function is_valid_latitude($latitude) { | 
| 81 | -			if ( preg_match("/^-?([1-8]?[1-9]|[1-9]0)\.{1}\d{1,6}$/", $latitude) ) { | |
| 81 | +			if (preg_match("/^-?([1-8]?[1-9]|[1-9]0)\.{1}\d{1,6}$/", $latitude)) { | |
| 82 | 82 | return true; | 
| 83 | 83 |  			} else { | 
| 84 | 84 | return false; | 
| @@ -63,10 +63,11 @@ | ||
| 63 | 63 | * @return void | 
| 64 | 64 | */ | 
| 65 | 65 |  		public function validate_usa_zipcode( $zip_code ) { | 
| 66 | -			if ( preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code) ) | |
| 67 | - return true; | |
| 68 | - else | |
| 69 | - return false; | |
| 66 | +			if ( preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code) ) { | |
| 67 | + return true; | |
| 68 | +			} else { | |
| 69 | + return false; | |
| 70 | + } | |
| 70 | 71 | } | 
| 71 | 72 | |
| 72 | 73 | |
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | * Fetch the request from the API. | 
| 41 | 41 | * | 
| 42 | 42 | * @access private | 
| 43 | - * @param mixed $request Request URL. | |
| 43 | + * @param string $request Request URL. | |
| 44 | 44 | * @return $body Body. | 
| 45 | 45 | */ | 
| 46 | 46 |  		private function fetch( $request ) { | 
| @@ -23,10 +23,10 @@ discard block | ||
| 23 | 23 | */ | 
| 24 | 24 |  	class EnerscoreAPI { | 
| 25 | 25 | /** | 
| 26 | - * URL to the API. | |
| 27 | - * | |
| 28 | - * @var string | |
| 29 | - */ | |
| 26 | + * URL to the API. | |
| 27 | + * | |
| 28 | + * @var string | |
| 29 | + */ | |
| 30 | 30 | private $base_uri = 'http://api-alpha.enerscore.com/api/address/neighbors/'; | 
| 31 | 31 | /** | 
| 32 | 32 | * __construct function. | 
| @@ -37,12 +37,12 @@ discard block | ||
| 37 | 37 |  		public function __construct() { | 
| 38 | 38 | } | 
| 39 | 39 | /** | 
| 40 | - * Fetch the request from the API. | |
| 41 | - * | |
| 42 | - * @access private | |
| 43 | - * @param mixed $request Request URL. | |
| 44 | - * @return $body Body. | |
| 45 | - */ | |
| 40 | + * Fetch the request from the API. | |
| 41 | + * | |
| 42 | + * @access private | |
| 43 | + * @param mixed $request Request URL. | |
| 44 | + * @return $body Body. | |
| 45 | + */ | |
| 46 | 46 |  		private function fetch( $request ) { | 
| 47 | 47 | $response = wp_remote_get( $request ); | 
| 48 | 48 | $code = wp_remote_retrieve_response_code( $response ); | 
| @@ -15,9 +15,9 @@ discard block | ||
| 15 | 15 | GitHub Branch: master | 
| 16 | 16 | */ | 
| 17 | 17 | /* Exit if accessed directly */ | 
| 18 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 18 | +if ( ! defined('ABSPATH')) { exit; } | |
| 19 | 19 | /* Check if class exists. */ | 
| 20 | -if ( ! class_exists( 'EnerscoreAPI' ) ) { | |
| 20 | +if ( ! class_exists('EnerscoreAPI')) { | |
| 21 | 21 | /** | 
| 22 | 22 | * EnerscoreAPI class. | 
| 23 | 23 | */ | 
| @@ -43,14 +43,14 @@ discard block | ||
| 43 | 43 | * @param mixed $request Request URL. | 
| 44 | 44 | * @return $body Body. | 
| 45 | 45 | */ | 
| 46 | -		private function fetch( $request ) { | |
| 47 | - $response = wp_remote_get( $request ); | |
| 48 | - $code = wp_remote_retrieve_response_code( $response ); | |
| 49 | -			if ( 200 !== $code ) { | |
| 50 | - return new WP_Error( 'response-error', sprintf( __( 'Server response code: %d', 'text-domain' ), $code ) ); | |
| 46 | +		private function fetch($request) { | |
| 47 | + $response = wp_remote_get($request); | |
| 48 | + $code = wp_remote_retrieve_response_code($response); | |
| 49 | +			if (200 !== $code) { | |
| 50 | +				return new WP_Error('response-error', sprintf(__('Server response code: %d', 'text-domain'), $code)); | |
| 51 | 51 | } | 
| 52 | - $body = wp_remote_retrieve_body( $response ); | |
| 53 | - return json_decode( $body ); | |
| 52 | + $body = wp_remote_retrieve_body($response); | |
| 53 | + return json_decode($body); | |
| 54 | 54 | } | 
| 55 | 55 | /** | 
| 56 | 56 | * Get Energy Score for Address. | 
| @@ -59,12 +59,12 @@ discard block | ||
| 59 | 59 | * @param mixed $address Address. | 
| 60 | 60 | * @return void | 
| 61 | 61 | */ | 
| 62 | -		public function get_enerscore( $address ) { | |
| 63 | -			if ( empty( $address ) ) { | |
| 64 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 'text-domain' ) ); | |
| 62 | +		public function get_enerscore($address) { | |
| 63 | +			if (empty($address)) { | |
| 64 | +				return new WP_Error('required-fields', __('Required fields are empty.', 'text-domain')); | |
| 65 | 65 | } | 
| 66 | 66 | $request = $this->base_uri . $address; | 
| 67 | - return $this->fetch( $request ); | |
| 67 | + return $this->fetch($request); | |
| 68 | 68 | } | 
| 69 | 69 | } | 
| 70 | 70 | } | 
| @@ -44,7 +44,7 @@ | ||
| 44 | 44 | * __construct function. | 
| 45 | 45 | * | 
| 46 | 46 | * @access public | 
| 47 | - * @param mixed $api_key API Key | |
| 47 | + * @param string $api_key API Key | |
| 48 | 48 | * @param string $output (default: 'json') Output. | 
| 49 | 49 | * @return void | 
| 50 | 50 | */ | 
| @@ -15,8 +15,8 @@ discard block | ||
| 15 | 15 | * GitHub Branch: master | 
| 16 | 16 | */ | 
| 17 | 17 | /* Exit if accessed directly */ | 
| 18 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 19 | -if ( ! class_exists( 'GreatSchoolsAPI' ) ) { | |
| 18 | +if ( ! defined('ABSPATH')) { exit; } | |
| 19 | +if ( ! class_exists('GreatSchoolsAPI')) { | |
| 20 | 20 | /** | 
| 21 | 21 | * GreatSchools API Class. | 
| 22 | 22 | */ | 
| @@ -48,7 +48,7 @@ discard block | ||
| 48 | 48 | * @param string $output (default: 'json') Output. | 
| 49 | 49 | * @return void | 
| 50 | 50 | */ | 
| 51 | -		public function __construct( $api_key, $output = 'json' ) { | |
| 51 | +		public function __construct($api_key, $output = 'json') { | |
| 52 | 52 | static::$api_key = $api_key; | 
| 53 | 53 | static::$output = $output; | 
| 54 | 54 | } | 
| @@ -59,13 +59,13 @@ discard block | ||
| 59 | 59 | * @param mixed $request Request URL. | 
| 60 | 60 | * @return $body Body. | 
| 61 | 61 | */ | 
| 62 | -		private function fetch( $request ) { | |
| 63 | - $response = wp_remote_get( $request ); | |
| 64 | - $code = wp_remote_retrieve_response_code( $response ); | |
| 65 | -			if ( 200 !== $code ) { | |
| 66 | - return new WP_Error( 'response-error', sprintf( __( 'Server response code: %d', 'text-domain' ), $code ) ); | |
| 62 | +		private function fetch($request) { | |
| 63 | + $response = wp_remote_get($request); | |
| 64 | + $code = wp_remote_retrieve_response_code($response); | |
| 65 | +			if (200 !== $code) { | |
| 66 | +				return new WP_Error('response-error', sprintf(__('Server response code: %d', 'text-domain'), $code)); | |
| 67 | 67 | } | 
| 68 | - $body = wp_remote_retrieve_body( $response ); | |
| 68 | + $body = wp_remote_retrieve_body($response); | |
| 69 | 69 | return $body; | 
| 70 | 70 | } | 
| 71 | 71 | /** | 
| @@ -76,11 +76,11 @@ discard block | ||
| 76 | 76 | * @param mixed $city City. | 
| 77 | 77 | * @return void | 
| 78 | 78 | */ | 
| 79 | -		public function get_schools( $state, $city ) { | |
| 79 | +		public function get_schools($state, $city) { | |
| 80 | 80 | $request = $this->base_uri . $state . '/' . $city . '?key=' . static::$api_key; | 
| 81 | - $xml = simplexml_load_file( $request ); | |
| 82 | - $json = wp_json_encode( $xml ); | |
| 83 | - $results = json_decode( $json, true ); | |
| 81 | + $xml = simplexml_load_file($request); | |
| 82 | + $json = wp_json_encode($xml); | |
| 83 | + $results = json_decode($json, true); | |
| 84 | 84 | return $results; | 
| 85 | 85 | } | 
| 86 | 86 | /** | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 | * @param mixed $limit Limit. | 
| 100 | 100 | * @return void | 
| 101 | 101 | */ | 
| 102 | -		public function get_nearby_schools( $state, $zip, $city, $address, $latitude, $longitude, $school_type, $level_code, $radius, $limit ) { | |
| 102 | +		public function get_nearby_schools($state, $zip, $city, $address, $latitude, $longitude, $school_type, $level_code, $radius, $limit) { | |
| 103 | 103 | } | 
| 104 | 104 | /** | 
| 105 | 105 | * Returns a profile data for a specific school. | 
| @@ -109,11 +109,11 @@ discard block | ||
| 109 | 109 | * @param mixed $school_id School ID. | 
| 110 | 110 | * @return void | 
| 111 | 111 | */ | 
| 112 | -		public function get_school( $state, $school_id ) { | |
| 113 | - $request = $this->base_uri . $state . '/'. $school_id .'?key=' . static::$api_key; | |
| 114 | - $xml = simplexml_load_file( $request ); | |
| 115 | - $json = wp_json_encode( $xml ); | |
| 116 | - $results = json_decode( $json, true ); | |
| 112 | +		public function get_school($state, $school_id) { | |
| 113 | + $request = $this->base_uri . $state . '/' . $school_id . '?key=' . static::$api_key; | |
| 114 | + $xml = simplexml_load_file($request); | |
| 115 | + $json = wp_json_encode($xml); | |
| 116 | + $results = json_decode($json, true); | |
| 117 | 117 | return $results; | 
| 118 | 118 | } | 
| 119 | 119 | /** | 
| @@ -124,11 +124,11 @@ discard block | ||
| 124 | 124 | * @param mixed $query_string Query String. | 
| 125 | 125 | * @return void | 
| 126 | 126 | */ | 
| 127 | -		public function search_for_schools( $state, $query_string, $level_code, $sort, $limit ) { | |
| 128 | - $request = $this->base_uri . '/search/schools?key=' . static::$api_key . '&state=' . $state . '&q='. $query_string .'&levelCode='. $level_code .'&sort='. $sort .'&limit=' . $limit; | |
| 129 | - $xml = simplexml_load_file( $request ); | |
| 130 | - $json = wp_json_encode( $xml ); | |
| 131 | - $results = json_decode( $json, true ); | |
| 127 | +		public function search_for_schools($state, $query_string, $level_code, $sort, $limit) { | |
| 128 | + $request = $this->base_uri . '/search/schools?key=' . static::$api_key . '&state=' . $state . '&q=' . $query_string . '&levelCode=' . $level_code . '&sort=' . $sort . '&limit=' . $limit; | |
| 129 | + $xml = simplexml_load_file($request); | |
| 130 | + $json = wp_json_encode($xml); | |
| 131 | + $results = json_decode($json, true); | |
| 132 | 132 | return $results; | 
| 133 | 133 | } | 
| 134 | 134 | /** | 
| @@ -143,11 +143,11 @@ discard block | ||
| 143 | 143 | * @param mixed $topic_id Topic ID. | 
| 144 | 144 | * @return void | 
| 145 | 145 | */ | 
| 146 | -		public function get_school_reviews( $state, $city, $school_id, $cutoffage, $limit, $topic_id ) { | |
| 147 | - $request = $this->base_uri . '/reviews/school/' . $state . '/'. $school_id .'?key=' . static::$api_key . '&limit='. $limit .'&cutoffAge='. $cutoffage .'&topicId=' . $topic_id; | |
| 148 | - $xml = simplexml_load_file( $request ); | |
| 149 | - $json = wp_json_encode( $xml ); | |
| 150 | - $results = json_decode( $json, true ); | |
| 146 | +		public function get_school_reviews($state, $city, $school_id, $cutoffage, $limit, $topic_id) { | |
| 147 | + $request = $this->base_uri . '/reviews/school/' . $state . '/' . $school_id . '?key=' . static::$api_key . '&limit=' . $limit . '&cutoffAge=' . $cutoffage . '&topicId=' . $topic_id; | |
| 148 | + $xml = simplexml_load_file($request); | |
| 149 | + $json = wp_json_encode($xml); | |
| 150 | + $results = json_decode($json, true); | |
| 151 | 151 | return $results; | 
| 152 | 152 | } | 
| 153 | 153 | /** | 
| @@ -158,9 +158,9 @@ discard block | ||
| 158 | 158 | */ | 
| 159 | 159 |  		public function get_review_topics() { | 
| 160 | 160 | $request = $this->base_uri . '/reviews/reviewTopics?key=' . static::$api_key; | 
| 161 | - $xml = simplexml_load_file( $request ); | |
| 162 | - $json = wp_json_encode( $xml ); | |
| 163 | - $results = json_decode( $json, true ); | |
| 161 | + $xml = simplexml_load_file($request); | |
| 162 | + $json = wp_json_encode($xml); | |
| 163 | + $results = json_decode($json, true); | |
| 164 | 164 | return $results; | 
| 165 | 165 | } | 
| 166 | 166 | /** | 
| @@ -171,11 +171,11 @@ discard block | ||
| 171 | 171 | * @param mixed $school_id School ID. | 
| 172 | 172 | * @return void | 
| 173 | 173 | */ | 
| 174 | -		public function get_school_test_scores( $state, $school_id ) { | |
| 175 | - $request = $this->base_uri . '/school/tests/' . $state . '/'. $school_id .'?key=' . static::$api_key; | |
| 176 | - $xml = simplexml_load_file( $request ); | |
| 177 | - $json = wp_json_encode( $xml ); | |
| 178 | - $results = json_decode( $json, true ); | |
| 174 | +		public function get_school_test_scores($state, $school_id) { | |
| 175 | + $request = $this->base_uri . '/school/tests/' . $state . '/' . $school_id . '?key=' . static::$api_key; | |
| 176 | + $xml = simplexml_load_file($request); | |
| 177 | + $json = wp_json_encode($xml); | |
| 178 | + $results = json_decode($json, true); | |
| 179 | 179 | return $results; | 
| 180 | 180 | } | 
| 181 | 181 | /** | 
| @@ -186,11 +186,11 @@ discard block | ||
| 186 | 186 | * @param mixed $school_id School ID. | 
| 187 | 187 | * @return void | 
| 188 | 188 | */ | 
| 189 | -		public function get_school_census_data( $state, $school_id ) { | |
| 190 | - $request = $this->base_uri . '/school/census/' . $state . '/'. $school_id .'?key=' . static::$api_key; | |
| 191 | - $xml = simplexml_load_file( $request ); | |
| 192 | - $json = wp_json_encode( $xml ); | |
| 193 | - $results = json_decode( $json, true ); | |
| 189 | +		public function get_school_census_data($state, $school_id) { | |
| 190 | + $request = $this->base_uri . '/school/census/' . $state . '/' . $school_id . '?key=' . static::$api_key; | |
| 191 | + $xml = simplexml_load_file($request); | |
| 192 | + $json = wp_json_encode($xml); | |
| 193 | + $results = json_decode($json, true); | |
| 194 | 194 | return $results; | 
| 195 | 195 | } | 
| 196 | 196 | /** | 
| @@ -201,11 +201,11 @@ discard block | ||
| 201 | 201 | * @param mixed $city City. | 
| 202 | 202 | * @return void | 
| 203 | 203 | */ | 
| 204 | -		public function get_city_schools( $state, $city ) { | |
| 205 | - $request = $this->base_uri . '/cities/' . $state . '/'. $city .'?key=' . static::$api_key; | |
| 206 | - $xml = simplexml_load_file( $request ); | |
| 207 | - $json = wp_json_encode( $xml ); | |
| 208 | - $results = json_decode( $json, true ); | |
| 204 | +		public function get_city_schools($state, $city) { | |
| 205 | + $request = $this->base_uri . '/cities/' . $state . '/' . $city . '?key=' . static::$api_key; | |
| 206 | + $xml = simplexml_load_file($request); | |
| 207 | + $json = wp_json_encode($xml); | |
| 208 | + $results = json_decode($json, true); | |
| 209 | 209 | return $results; | 
| 210 | 210 | } | 
| 211 | 211 | /** | 
| @@ -218,11 +218,11 @@ discard block | ||
| 218 | 218 | * @param mixed $sort Sort. | 
| 219 | 219 | * @return void | 
| 220 | 220 | */ | 
| 221 | -		public function get_nearby_cities( $state, $city, $radius, $sort = 'rating' ) { | |
| 222 | - $request = $this->base_uri . '/cities/nearby/' . $state . '/'. $city .'?key=' . static::$api_key . '&radius='. $radius .'&sort=' . $sort; | |
| 223 | - $xml = simplexml_load_file( $request ); | |
| 224 | - $json = wp_json_encode( $xml ); | |
| 225 | - $results = json_decode( $json, true ); | |
| 221 | +		public function get_nearby_cities($state, $city, $radius, $sort = 'rating') { | |
| 222 | + $request = $this->base_uri . '/cities/nearby/' . $state . '/' . $city . '?key=' . static::$api_key . '&radius=' . $radius . '&sort=' . $sort; | |
| 223 | + $xml = simplexml_load_file($request); | |
| 224 | + $json = wp_json_encode($xml); | |
| 225 | + $results = json_decode($json, true); | |
| 226 | 226 | return $results; | 
| 227 | 227 | } | 
| 228 | 228 | /** | 
| @@ -233,11 +233,11 @@ discard block | ||
| 233 | 233 | * @param mixed $city City. | 
| 234 | 234 | * @return void | 
| 235 | 235 | */ | 
| 236 | -		public function get_districts( $state, $city ) { | |
| 237 | - $request = $this->base_uri . '/districts/' . $state . '/'. $city .'?key=' . static::$api_key; | |
| 238 | - $xml = simplexml_load_file( $request ); | |
| 239 | - $json = wp_json_encode( $xml ); | |
| 240 | - $results = json_decode( $json, true ); | |
| 236 | +		public function get_districts($state, $city) { | |
| 237 | + $request = $this->base_uri . '/districts/' . $state . '/' . $city . '?key=' . static::$api_key; | |
| 238 | + $xml = simplexml_load_file($request); | |
| 239 | + $json = wp_json_encode($xml); | |
| 240 | + $results = json_decode($json, true); | |
| 241 | 241 | return $results; | 
| 242 | 242 | } | 
| 243 | 243 | } | 
| @@ -25,7 +25,7 @@ discard block | ||
| 25 | 25 | * | 
| 26 | 26 | * @access public | 
| 27 | 27 | * @param string $iframe_id (default: '') | 
| 28 | - * @return void | |
| 28 | + * @return string|null | |
| 29 | 29 | */ | 
| 30 | 30 |  		public function nar_iframe_id( $iframe_id = '' ) { | 
| 31 | 31 | |
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | * | 
| 41 | 41 | * @access public | 
| 42 | 42 | * @param string $widget_name (default: '') | 
| 43 | - * @return void | |
| 43 | + * @return string | |
| 44 | 44 | */ | 
| 45 | 45 |  		public function nar_iframe_class( $widget_name = '' ) { | 
| 46 | 46 | |
| @@ -1,9 +1,9 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | 3 | /* Exit if accessed directly. */ | 
| 4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 4 | +if ( ! defined('ABSPATH')) { exit; } | |
| 5 | 5 | |
| 6 | -if ( ! class_exists( 'NarWidgets' ) ) { | |
| 6 | +if ( ! class_exists('NarWidgets')) { | |
| 7 | 7 | |
| 8 | 8 | /** | 
| 9 | 9 | * NarWidgets class. | 
| @@ -27,10 +27,10 @@ discard block | ||
| 27 | 27 | * @param string $iframe_id (default: '') | 
| 28 | 28 | * @return void | 
| 29 | 29 | */ | 
| 30 | -		public function nar_iframe_id( $iframe_id = '' ) { | |
| 30 | +		public function nar_iframe_id($iframe_id = '') { | |
| 31 | 31 | |
| 32 | -			if ( '' !== $iframe_id  ) { | |
| 33 | - return sanitize_html_class( $iframe_id ) . '-iframe'; | |
| 32 | +			if ('' !== $iframe_id) { | |
| 33 | + return sanitize_html_class($iframe_id) . '-iframe'; | |
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | 36 | } | 
| @@ -42,10 +42,10 @@ discard block | ||
| 42 | 42 | * @param string $widget_name (default: '') | 
| 43 | 43 | * @return void | 
| 44 | 44 | */ | 
| 45 | -		public function nar_iframe_class( $widget_name = '' ) { | |
| 45 | +		public function nar_iframe_class($widget_name = '') { | |
| 46 | 46 | |
| 47 | -			if ( '' !== $widget_name ) { | |
| 48 | - return 'nar nar-iframe nar-' . sanitize_html_class( $widget_name ) . '-iframe'; | |
| 47 | +			if ('' !== $widget_name) { | |
| 48 | + return 'nar nar-iframe nar-' . sanitize_html_class($widget_name) . '-iframe'; | |
| 49 | 49 |  			} else { | 
| 50 | 50 | return 'nar nar-iframe'; | 
| 51 | 51 | } | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | */ | 
| 61 | 61 |  		public function get_mvp_program_widget() { | 
| 62 | 62 | |
| 63 | -			echo '<iframe frameborder="0" id="'. nar_iframe_id() .'" class="'. $this->zillow_iframe_class( 'mvp-program' ) .'" title="'. __('NAR MVP Program.', 're-pro') .'" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300"  height="250"></iframe>'; | |
| 63 | +			echo '<iframe frameborder="0" id="' . nar_iframe_id() . '" class="' . $this->zillow_iframe_class('mvp-program') . '" title="' . __('NAR MVP Program.', 're-pro') . '" src="https://static.realtor.org/ro/widget/mvpwidget.html" scrolling="no" width="300"  height="250"></iframe>'; | |
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | 66 | /** | 
| @@ -73,7 +73,7 @@ discard block | ||
| 73 | 73 | |
| 74 | 74 | // wp_enqueue_script( 'nar-message', 'http://www.realtor.org/sites/all/themes/rotheme/js/narmessage.js', 'jquery', null, true); | 
| 75 | 75 | |
| 76 | -			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'home-ownership-matters' ) .'"  title="'. __('NAR Home Hownership Matters.', 're-pro') .'"  src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>'; | |
| 76 | +			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('home-ownership-matters') . '"  title="' . __('NAR Home Hownership Matters.', 're-pro') . '"  src="https://www.realtor.org/sites/all/themes/rotheme/html/narmessage.html" frameborder="0" width="180" height="250" scrolling="no"></iframe></noscript>'; | |
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | 79 | /** | 
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | * @return void | 
| 84 | 84 | */ | 
| 85 | 85 |  		public function get_code_of_ethics_widget() { | 
| 86 | -			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'code-of-ethics' ) .'" title="'. __('NAR Code of Ethics.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>'; | |
| 86 | +			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('code-of-ethics') . '" title="' . __('NAR Code of Ethics.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/7504/embed" scrolling="no"></iframe>'; | |
| 87 | 87 | } | 
| 88 | 88 | |
| 89 | 89 | /** | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | * @return void | 
| 94 | 94 | */ | 
| 95 | 95 |  		public function get_nar_conf_expo_widget() { | 
| 96 | -			echo '<iframe id="'. nar_iframe_id() .' class="'. $this->zillow_iframe_class( 'conference-expo' ) .'" title="'. __('NAR Conferences and Expos.', 're-pro') .'" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>'; | |
| 96 | +			echo '<iframe id="' . nar_iframe_id() . ' class="' . $this->zillow_iframe_class('conference-expo') . '" title="' . __('NAR Conferences and Expos.', 're-pro') . '" frameborder="0" width="300" height="250" src="https://www.realtor.org/node/10695/embed" scrolling="no"></iframe>'; | |
| 97 | 97 | } | 
| 98 | 98 | |
| 99 | 99 | } | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | * __construct function. | 
| 40 | 40 | * | 
| 41 | 41 | * @access public | 
| 42 | - * @param mixed $api_key API Key. | |
| 42 | + * @param string $api_key API Key. | |
| 43 | 43 | * @return void | 
| 44 | 44 | */ | 
| 45 | 45 |  		public function __construct( $api_key ) { | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | * Fetch the request from the API. | 
| 54 | 54 | * | 
| 55 | 55 | * @access private | 
| 56 | - * @param mixed $request Request URL. | |
| 56 | + * @param string $request Request URL. | |
| 57 | 57 | * @return $body Body. | 
| 58 | 58 | */ | 
| 59 | 59 |  		private function fetch( $request ) { | 
| @@ -16,9 +16,9 @@ discard block | ||
| 16 | 16 | * GitHub Branch: master | 
| 17 | 17 | */ | 
| 18 | 18 | /* Exit if accessed directly */ | 
| 19 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 19 | +if ( ! defined('ABSPATH')) { exit; } | |
| 20 | 20 | /* Check if Class Exists. */ | 
| 21 | -if ( ! class_exists( 'StreetAdvisorAPI' ) ) { | |
| 21 | +if ( ! class_exists('StreetAdvisorAPI')) { | |
| 22 | 22 | /** | 
| 23 | 23 | * StreetAdvisor API Class. | 
| 24 | 24 | */ | 
| @@ -42,7 +42,7 @@ discard block | ||
| 42 | 42 | * @param mixed $api_key API Key. | 
| 43 | 43 | * @return void | 
| 44 | 44 | */ | 
| 45 | -		public function __construct( $api_key ) { | |
| 45 | +		public function __construct($api_key) { | |
| 46 | 46 | static::$api_key = $api_key; | 
| 47 | 47 | $this->args['headers'] = array( | 
| 48 | 48 | 'Content-Type' => 'application/json', | 
| @@ -56,14 +56,14 @@ discard block | ||
| 56 | 56 | * @param mixed $request Request URL. | 
| 57 | 57 | * @return $body Body. | 
| 58 | 58 | */ | 
| 59 | -		private function fetch( $request ) { | |
| 60 | - $response = wp_remote_get( $request, $this->args ); | |
| 61 | - $code = wp_remote_retrieve_response_code( $response ); | |
| 62 | -			if ( 200 !== $code ) { | |
| 63 | - return new WP_Error( 'response-error', sprintf( __( 'Server response code: %d', 'text-domain' ), $code ) ); | |
| 59 | +		private function fetch($request) { | |
| 60 | + $response = wp_remote_get($request, $this->args); | |
| 61 | + $code = wp_remote_retrieve_response_code($response); | |
| 62 | +			if (200 !== $code) { | |
| 63 | +				return new WP_Error('response-error', sprintf(__('Server response code: %d', 'text-domain'), $code)); | |
| 64 | 64 | } | 
| 65 | - $body = wp_remote_retrieve_body( $response ); | |
| 66 | - return json_decode( $body, true ); | |
| 65 | + $body = wp_remote_retrieve_body($response); | |
| 66 | + return json_decode($body, true); | |
| 67 | 67 | } | 
| 68 | 68 | /** | 
| 69 | 69 | * Get Location Data. | 
| @@ -74,9 +74,9 @@ discard block | ||
| 74 | 74 | * @param mixed $level Level. | 
| 75 | 75 | * @return void | 
| 76 | 76 | */ | 
| 77 | -		public function get_location_data( $latitude, $longitude, $level ) { | |
| 78 | - $request = $this->base_uri . '/locations/overview/'.$latitude.'/'.$longitude.'/'.$level; | |
| 79 | - return $this->fetch( $request ); | |
| 77 | +		public function get_location_data($latitude, $longitude, $level) { | |
| 78 | + $request = $this->base_uri . '/locations/overview/' . $latitude . '/' . $longitude . '/' . $level; | |
| 79 | + return $this->fetch($request); | |
| 80 | 80 | } | 
| 81 | 81 | /** | 
| 82 | 82 | * Get Location Reviews. | 
| @@ -88,9 +88,9 @@ discard block | ||
| 88 | 88 | * @param int $review_count (default: 5) Total # of Reviews to display. | 
| 89 | 89 | * @return void | 
| 90 | 90 | */ | 
| 91 | -		public function get_location_reviews( $latitude, $longitude, $level, $review_count = '5' ) { | |
| 92 | - $request = $this->base_uri . '/reviews/'.$latitude.'/'.$longitude.'/'.$level . '?take='. $review_count; | |
| 93 | - return $this->fetch( $request ); | |
| 91 | +		public function get_location_reviews($latitude, $longitude, $level, $review_count = '5') { | |
| 92 | + $request = $this->base_uri . '/reviews/' . $latitude . '/' . $longitude . '/' . $level . '?take=' . $review_count; | |
| 93 | + return $this->fetch($request); | |
| 94 | 94 | } | 
| 95 | 95 | } | 
| 96 | 96 | } | 
| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | * | 
| 6 | 6 | * @access public | 
| 7 | 7 | * @param string $type (default: 'for_sale') | 
| 8 | - * @param mixed $city | |
| 9 | - * @param mixed $state | |
| 8 | + * @param string $city | |
| 9 | + * @param string $state | |
| 10 | 10 | * @param string $min_price (default: '') | 
| 11 | 11 | * @param string $max_price (default: '') | 
| 12 | 12 | * @param string $property_type (default: '') | 
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | * @param string $max_sqft (default: '') | 
| 17 | 17 | * @return void | 
| 18 | 18 | */ | 
| 19 | -function get_trulia_rss_listing_feed( $type = 'for_sale', $city, $state, $min_price = '', $max_price = '', $property_type = '', $min_bath = '', $max_bath = '', $min_sqft = '', $max_sqft = '' ) { | |
| 19 | +function get_trulia_rss_listing_feed($type = 'for_sale', $city, $state, $min_price = '', $max_price = '', $property_type = '', $min_bath = '', $max_bath = '', $min_sqft = '', $max_sqft = '') { | |
| 20 | 20 | |
| 21 | - $url = esc_url( 'https://www.trulia.com/rss2/'. urlencode($type ).'/'. urlencode( $city ).','. urlencode( $state ).'/' ); | |
| 21 | +	$url = esc_url('https://www.trulia.com/rss2/' . urlencode($type) . '/' . urlencode($city) . ',' . urlencode($state) . '/'); | |
| 22 | 22 | |
| 23 | 23 | return $url; | 
| 24 | 24 | |
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | * | 
| 47 | 47 | * @access public | 
| 48 | 48 | * @param string $iframe_id (default: '') | 
| 49 | - * @return void | |
| 49 | + * @return string|null | |
| 50 | 50 | */ | 
| 51 | 51 |  		public function trulia_iframe_id( $iframe_id = '' ) { | 
| 52 | 52 | |
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | * | 
| 62 | 62 | * @access public | 
| 63 | 63 | * @param string $widget_name (default: '') | 
| 64 | - * @return void | |
| 64 | + * @return string | |
| 65 | 65 | */ | 
| 66 | 66 |  		public function trulia_iframe_class( $widget_name = '' ) { | 
| 67 | 67 | |
| @@ -1,9 +1,9 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | 3 | /* Exit if accessed directly. */ | 
| 4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 4 | +if ( ! defined('ABSPATH')) { exit; } | |
| 5 | 5 | |
| 6 | -if ( ! class_exists( 'TruliaWidgets' ) ) { | |
| 6 | +if ( ! class_exists('TruliaWidgets')) { | |
| 7 | 7 | |
| 8 | 8 | /** | 
| 9 | 9 | * TruliaWidgets class. | 
| @@ -48,10 +48,10 @@ discard block | ||
| 48 | 48 | * @param string $iframe_id (default: '') | 
| 49 | 49 | * @return void | 
| 50 | 50 | */ | 
| 51 | -		public function trulia_iframe_id( $iframe_id = '' ) { | |
| 51 | +		public function trulia_iframe_id($iframe_id = '') { | |
| 52 | 52 | |
| 53 | -			if( '' !== $iframe_id  ) { | |
| 54 | - return sanitize_html_class( $iframe_id ) . '-iframe'; | |
| 53 | +			if ('' !== $iframe_id) { | |
| 54 | + return sanitize_html_class($iframe_id) . '-iframe'; | |
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | } | 
| @@ -63,10 +63,10 @@ discard block | ||
| 63 | 63 | * @param string $widget_name (default: '') | 
| 64 | 64 | * @return void | 
| 65 | 65 | */ | 
| 66 | -		public function trulia_iframe_class( $widget_name = '' ) { | |
| 66 | +		public function trulia_iframe_class($widget_name = '') { | |
| 67 | 67 | |
| 68 | -			if( '' !== $widget_name ) { | |
| 69 | - return 'trulia trulia-iframe trulia-' . sanitize_html_class( $widget_name ) . '-iframe'; | |
| 68 | +			if ('' !== $widget_name) { | |
| 69 | + return 'trulia trulia-iframe trulia-' . sanitize_html_class($widget_name) . '-iframe'; | |
| 70 | 70 |  			} else { | 
| 71 | 71 | return 'trulia-iframe'; | 
| 72 | 72 | } | 
| @@ -83,8 +83,8 @@ discard block | ||
| 83 | 83 | * @param string $email (default: '') | 
| 84 | 84 | * @return void | 
| 85 | 85 | */ | 
| 86 | -		public function get_community_advice_widget( $iframe_id = '', $display_answers, $title, $email = '' ) { | |
| 87 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'community-advice' ) .'" src="https://synd.trulia.com/tools/expert-community-advice/embedded?params%5Bwhose_answer%5D=¶ms%5Bdisplay_answers%5D=true¶ms%5Btitle%5D=Expert+Community+Advice¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58237a792f772"></iframe>'; | |
| 86 | +		public function get_community_advice_widget($iframe_id = '', $display_answers, $title, $email = '') { | |
| 87 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('community-advice') . '" src="https://synd.trulia.com/tools/expert-community-advice/embedded?params%5Bwhose_answer%5D=¶ms%5Bdisplay_answers%5D=true¶ms%5Btitle%5D=Expert+Community+Advice¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58237a792f772"></iframe>'; | |
| 88 | 88 | } | 
| 89 | 89 | |
| 90 | 90 | /** | 
| @@ -98,8 +98,8 @@ discard block | ||
| 98 | 98 | * @param string $email (default: '') | 
| 99 | 99 | * @return void | 
| 100 | 100 | */ | 
| 101 | -		public function get_rent_buy_calc_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 102 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'rent-buy-calc' ) .'" src="https://synd.trulia.com/tools/rent-vs-buy-calculator/embedded?params%5Btool_metro_area%5D=31084¶ms%5Btitle%5D=Rent+vs.+Buy+Calculator¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582379f9264e8"></iframe>'; | |
| 101 | +		public function get_rent_buy_calc_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 102 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('rent-buy-calc') . '" src="https://synd.trulia.com/tools/rent-vs-buy-calculator/embedded?params%5Btool_metro_area%5D=31084¶ms%5Btitle%5D=Rent+vs.+Buy+Calculator¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582379f9264e8"></iframe>'; | |
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | 105 | /** | 
| @@ -113,9 +113,9 @@ discard block | ||
| 113 | 113 | * @param string $email (default: '') | 
| 114 | 114 | * @return void | 
| 115 | 115 | */ | 
| 116 | -		public function get_rental_market_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 116 | +		public function get_rental_market_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 117 | 117 | |
| 118 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'rental-market' ) .'" src="https://synd.trulia.com/tools/rental-market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Rental+Market+Monitor¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=582379637cf2e"></iframe>'; | |
| 118 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('rental-market') . '" src="https://synd.trulia.com/tools/rental-market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Rental+Market+Monitor¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=582379637cf2e"></iframe>'; | |
| 119 | 119 | |
| 120 | 120 | } | 
| 121 | 121 | |
| @@ -131,8 +131,8 @@ discard block | ||
| 131 | 131 | * @param string $email (default: '') | 
| 132 | 132 | * @return void | 
| 133 | 133 | */ | 
| 134 | -		public function get_map_search_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 135 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'map-search' ) .'" src="https://synd.trulia.com/tools/map-search/embedded?params%5Blocation%5D=West+Hills%2C+CA¶ms%5BlocationId%5D=39307¶ms%5Bagent_id%5D=¶ms%5Bproperty_status%5D=for+sale¶ms%5Btitle%5D=Map+Search¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582378f4c0432"></iframe>'; | |
| 134 | +		public function get_map_search_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 135 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('map-search') . '" src="https://synd.trulia.com/tools/map-search/embedded?params%5Blocation%5D=West+Hills%2C+CA¶ms%5BlocationId%5D=39307¶ms%5Bagent_id%5D=¶ms%5Bproperty_status%5D=for+sale¶ms%5Btitle%5D=Map+Search¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582378f4c0432"></iframe>'; | |
| 136 | 136 | } | 
| 137 | 137 | |
| 138 | 138 | /** | 
| @@ -146,8 +146,8 @@ discard block | ||
| 146 | 146 | * @param string $email (default: '') | 
| 147 | 147 | * @return void | 
| 148 | 148 | */ | 
| 149 | -		public function get_home_gallery_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 150 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'home-gallery' ) .'" src="https://synd.trulia.com/tools/home-gallery/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=Home+Gallery¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582371b703b0d¶ms%5Bslides_per_page%5D=3&city=Los Angeles&state_code=CA"></iframe>'; | |
| 149 | +		public function get_home_gallery_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 150 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('home-gallery') . '" src="https://synd.trulia.com/tools/home-gallery/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=Home+Gallery¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=300¶ms%5Bguid%5D=582371b703b0d¶ms%5Bslides_per_page%5D=3&city=Los Angeles&state_code=CA"></iframe>'; | |
| 151 | 151 | } | 
| 152 | 152 | |
| 153 | 153 | /** | 
| @@ -161,8 +161,8 @@ discard block | ||
| 161 | 161 | * @param string $email (default: '') | 
| 162 | 162 | * @return void | 
| 163 | 163 | */ | 
| 164 | -		public function get_home_showcase_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 165 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'home-showcase' ) .'" src="https://synd.trulia.com/tools/home-showcase/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=My+Listings¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=582370ce64073"></iframe>'; | |
| 164 | +		public function get_home_showcase_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 165 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('home-showcase') . '" src="https://synd.trulia.com/tools/home-showcase/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Bmin_price%5D=¶ms%5Bmax_price%5D=¶ms%5Bnum_beds%5D=¶ms%5Bnum_baths%5D=¶ms%5Bagent_id%5D=¶ms%5Bspeed%5D=5000¶ms%5Btitle%5D=My+Listings¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=582370ce64073"></iframe>'; | |
| 166 | 166 | } | 
| 167 | 167 | |
| 168 | 168 | /** | 
| @@ -176,8 +176,8 @@ discard block | ||
| 176 | 176 | * @param string $email (default: '') | 
| 177 | 177 | * @return void | 
| 178 | 178 | */ | 
| 179 | -		public function get_homefinder_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 180 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'homefinder' ) .'" src="https://synd.trulia.com/tools/home-finder/embedded?params%5Blocation%5D=¶ms%5BlocationId%5D=¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Home+Finder¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58236f71d7732"></iframe>'; | |
| 179 | +		public function get_homefinder_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 180 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('homefinder') . '"  src="https://synd.trulia.com/tools/home-finder/embedded?params%5Blocation%5D=¶ms%5BlocationId%5D=¶ms%5Bcolor%5D=green¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Home+Finder¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=350¶ms%5Bguid%5D=58236f71d7732"></iframe>'; | |
| 181 | 181 | } | 
| 182 | 182 | |
| 183 | 183 | /** | 
| @@ -191,9 +191,9 @@ discard block | ||
| 191 | 191 | * @param string $email (default: '') | 
| 192 | 192 | * @return void | 
| 193 | 193 | */ | 
| 194 | -		public function get_market_monitor_widget( $iframe_id = '', $location, $width, $height, $email = '' ) { | |
| 194 | +		public function get_market_monitor_widget($iframe_id = '', $location, $width, $height, $email = '') { | |
| 195 | 195 | |
| 196 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'market-monitor' ) .'" src="https://synd.trulia.com/tools/market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Blisting_price_type%5D=average¶ms%5Bshow_inventory%5D=1¶ms%5Btitle%5D=Market+Monitor¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=58236e004595a"></iframe>'; | |
| 196 | +			echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('market-monitor') . '" src="https://synd.trulia.com/tools/market-monitor/embedded?params%5Blocation%5D=Los+Angeles%2C+CA¶ms%5BlocationId%5D=22637¶ms%5Blisting_price_type%5D=average¶ms%5Bshow_inventory%5D=1¶ms%5Btitle%5D=Market+Monitor¶ms%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Bwidth%5D=300¶ms%5Bheight%5D=250¶ms%5Bguid%5D=58236e004595a"></iframe>'; | |
| 197 | 197 | } | 
| 198 | 198 | |
| 199 | 199 | /** | 
| @@ -207,9 +207,9 @@ discard block | ||
| 207 | 207 | * @param mixed $height | 
| 208 | 208 | * @return void | 
| 209 | 209 | */ | 
| 210 | -		public function get_affordability_calc_widget( $iframe_id = '', $color, $title, $width, $height, $email = '' ) { | |
| 210 | +		public function get_affordability_calc_widget($iframe_id = '', $color, $title, $width, $height, $email = '') { | |
| 211 | 211 | |
| 212 | - echo '<iframe id="'. $this->trulia_iframe_id( $iframe_id ) .'" class="'. $this->trulia_iframe_class( 'affordability-calc' ) .'" src="https://synd.trulia.com/tools/affordability-calculator/embedded?params%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Affordability+Calculator¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=58236d0b501ae"></iframe>'; | |
| 212 | +		echo '<iframe id="' . $this->trulia_iframe_id($iframe_id) . '" class="' . $this->trulia_iframe_class('affordability-calc') . '" src="https://synd.trulia.com/tools/affordability-calculator/embedded?params%5Bcolor%5D=grey¶ms%5Bemail%5D=¶ms%5Buser_url%5D=¶ms%5Btitle%5D=Affordability+Calculator¶ms%5Bwidth%5D=600¶ms%5Bheight%5D=300¶ms%5Bguid%5D=58236d0b501ae"></iframe>'; | |
| 213 | 213 | |
| 214 | 214 | } | 
| 215 | 215 | |
| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | * Fetch the request from the API. | 
| 56 | 56 | * | 
| 57 | 57 | * @access private | 
| 58 | - * @param mixed $request Request URL. | |
| 58 | + * @param string $request Request URL. | |
| 59 | 59 | * @return $body Body. | 
| 60 | 60 | */ | 
| 61 | 61 |  		private function fetch( $request ) { | 
| @@ -71,11 +71,9 @@ discard block | ||
| 71 | 71 | * Get Walkscore (https://www.walkscore.com/professional/api.php) | 
| 72 | 72 | * | 
| 73 | 73 | * @access public | 
| 74 | - * @param mixed $wsapikey Your Walk Score API Key. Contact us to get one. Required. | |
| 75 | 74 | * @param mixed $latitude The latitude of the requested location. Required. | 
| 76 | 75 | * @param mixed $longitude The longitude of the requested location. Required. | 
| 77 | 76 | * @param mixed $address The URL encoded address. Required. | 
| 78 | - * @param mixed $format Return results in XML or JSON (defaults to XML). | |
| 79 | 77 | * @return void | 
| 80 | 78 | */ | 
| 81 | 79 |  		function get_walkscore( $latitude, $longitude, $address ) { | 
| @@ -15,9 +15,9 @@ discard block | ||
| 15 | 15 | * GitHub Branch: master | 
| 16 | 16 | */ | 
| 17 | 17 | /* Exit if accessed directly. */ | 
| 18 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 18 | +if ( ! defined('ABSPATH')) { exit; } | |
| 19 | 19 | /* Check if class exists. */ | 
| 20 | -if ( ! class_exists( 'WalkscoreAPI' ) ) { | |
| 20 | +if ( ! class_exists('WalkscoreAPI')) { | |
| 21 | 21 | /** | 
| 22 | 22 | * Walkscore API Class. | 
| 23 | 23 | */ | 
| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | * @param mixed $wsapikey API Key. | 
| 48 | 48 | * @return void | 
| 49 | 49 | */ | 
| 50 | -		public function __construct( $wsapikey, $output = 'json' ) { | |
| 50 | +		public function __construct($wsapikey, $output = 'json') { | |
| 51 | 51 | static::$wsapikey = $wsapikey; | 
| 52 | 52 | static::$output = $output; | 
| 53 | 53 | } | 
| @@ -58,14 +58,14 @@ discard block | ||
| 58 | 58 | * @param mixed $request Request URL. | 
| 59 | 59 | * @return $body Body. | 
| 60 | 60 | */ | 
| 61 | -		private function fetch( $request ) { | |
| 62 | - $response = wp_remote_get( $request ); | |
| 63 | - $code = wp_remote_retrieve_response_code( $response ); | |
| 64 | -			if ( 200 !== $code ) { | |
| 65 | - return new WP_Error( 'response-error', sprintf( __( 'Server response code: %d', 'text-domain' ), $code ) ); | |
| 61 | +		private function fetch($request) { | |
| 62 | + $response = wp_remote_get($request); | |
| 63 | + $code = wp_remote_retrieve_response_code($response); | |
| 64 | +			if (200 !== $code) { | |
| 65 | +				return new WP_Error('response-error', sprintf(__('Server response code: %d', 'text-domain'), $code)); | |
| 66 | 66 | } | 
| 67 | - $body = wp_remote_retrieve_body( $response ); | |
| 68 | - return json_decode( $body ); | |
| 67 | + $body = wp_remote_retrieve_body($response); | |
| 68 | + return json_decode($body); | |
| 69 | 69 | } | 
| 70 | 70 | /** | 
| 71 | 71 | * Get Walkscore (https://www.walkscore.com/professional/api.php) | 
| @@ -78,12 +78,12 @@ discard block | ||
| 78 | 78 | * @param mixed $format Return results in XML or JSON (defaults to XML). | 
| 79 | 79 | * @return void | 
| 80 | 80 | */ | 
| 81 | -		function get_walkscore( $latitude, $longitude, $address ) { | |
| 82 | -			if ( empty( $latitude ) || empty( $longitude ) || empty( $address ) ) { | |
| 83 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 'text-domain' ) ); | |
| 81 | +		function get_walkscore($latitude, $longitude, $address) { | |
| 82 | +			if (empty($latitude) || empty($longitude) || empty($address)) { | |
| 83 | +				return new WP_Error('required-fields', __('Required fields are empty.', 'text-domain')); | |
| 84 | 84 | } | 
| 85 | 85 | $request = $this->base_uri . '/score?format=' . static::$output . '&wsapikey=' . static::$wsapikey . '&lat=' . $latitude . '&lon=' . $longitude . '&address=' . $address; | 
| 86 | - return $this->fetch( $request ); | |
| 86 | + return $this->fetch($request); | |
| 87 | 87 | } | 
| 88 | 88 | /** | 
| 89 | 89 | * get_transit_score function. | 
| @@ -97,12 +97,12 @@ discard block | ||
| 97 | 97 | * @param mixed $research | 
| 98 | 98 | * @return void | 
| 99 | 99 | */ | 
| 100 | -		function get_transit_score( $latitude, $longitude, $city, $state, $country, $research ) { | |
| 101 | -			if ( empty( $latitude ) || empty( $longitude ) || empty( $city ) || empty( $state ) ) { | |
| 102 | - return new WP_Error( 'required-fields', __( 'Required fields are empty.', 'text-domain' ) ); | |
| 100 | +		function get_transit_score($latitude, $longitude, $city, $state, $country, $research) { | |
| 101 | +			if (empty($latitude) || empty($longitude) || empty($city) || empty($state)) { | |
| 102 | +				return new WP_Error('required-fields', __('Required fields are empty.', 'text-domain')); | |
| 103 | 103 | } | 
| 104 | 104 | $request = $this->base_uri . '/transit/score/?wsapikey=' . static::$wsapikey . '&lat=' . $latitude . '&lon=' . $longitude . '&city=' . $city . '&state=' . $state . '&format=' . $output; | 
| 105 | - return $this->fetch( $request ); | |
| 105 | + return $this->fetch($request); | |
| 106 | 106 | } | 
| 107 | 107 |  		function get_transit_stop_search() { | 
| 108 | 108 | } | 
| @@ -120,31 +120,31 @@ discard block | ||
| 120 | 120 | * @param [String] $code : Response code to get message from. | 
| 121 | 121 | * @return [String] : Message corresponding to response code sent in. | 
| 122 | 122 | */ | 
| 123 | -		public function response_code_msg( $code = '' ) { | |
| 124 | -			switch ( $code ) { | |
| 123 | +		public function response_code_msg($code = '') { | |
| 124 | +			switch ($code) { | |
| 125 | 125 | case 1: | 
| 126 | - $msg = __( 'Walk Score successfully returned.', 'text-domain' ); | |
| 126 | +				$msg = __('Walk Score successfully returned.', 'text-domain'); | |
| 127 | 127 | break; | 
| 128 | 128 | case 2: | 
| 129 | - $msg = __( 'Score is being calculated and is not currently available.', 'text-domain' ); | |
| 129 | +				$msg = __('Score is being calculated and is not currently available.', 'text-domain'); | |
| 130 | 130 | break; | 
| 131 | 131 | case 30: | 
| 132 | - $msg = __( 'Invalid latitude/longitude.', 'text-domain' ); | |
| 132 | +				$msg = __('Invalid latitude/longitude.', 'text-domain'); | |
| 133 | 133 | break; | 
| 134 | 134 | case 31: | 
| 135 | - $msg = __( 'Walk Score API internal error.', 'text-domain' ); | |
| 135 | +				$msg = __('Walk Score API internal error.', 'text-domain'); | |
| 136 | 136 | break; | 
| 137 | 137 | case 40: | 
| 138 | - $msg = __( 'Your WSAPIKEY is invalid.', 'text-domain' ); | |
| 138 | +				$msg = __('Your WSAPIKEY is invalid.', 'text-domain'); | |
| 139 | 139 | break; | 
| 140 | 140 | case 41: | 
| 141 | - $msg = __( 'Your daily API quota has been exceeded.', 'text-domain' ); | |
| 141 | +				$msg = __('Your daily API quota has been exceeded.', 'text-domain'); | |
| 142 | 142 | break; | 
| 143 | 143 | case 42: | 
| 144 | - $msg = __( 'Your IP address has been blocked.', 'text-domain' ); | |
| 144 | +				$msg = __('Your IP address has been blocked.', 'text-domain'); | |
| 145 | 145 | break; | 
| 146 | 146 | default: | 
| 147 | - $msg = __( 'Sorry, response code is unknown.', 'text-domain' ); | |
| 147 | +				$msg = __('Sorry, response code is unknown.', 'text-domain'); | |
| 148 | 148 | break; | 
| 149 | 149 | } | 
| 150 | 150 | return $msg; | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | * | 
| 47 | 47 | * @access public | 
| 48 | 48 | * @param string $iframe_id (default: '') | 
| 49 | - * @return void | |
| 49 | + * @return string|null | |
| 50 | 50 | */ | 
| 51 | 51 |  		public function zillow_iframe_id( $iframe_id = '' ) { | 
| 52 | 52 | |
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | * | 
| 62 | 62 | * @access public | 
| 63 | 63 | * @param string $widget_name (default: '') | 
| 64 | - * @return void | |
| 64 | + * @return string | |
| 65 | 65 | */ | 
| 66 | 66 |  		public function zillow_iframe_class( $widget_name = '' ) { | 
| 67 | 67 | |
| @@ -413,7 +413,6 @@ discard block | ||
| 413 | 413 | * get_lg_zillow_search_widget function. | 
| 414 | 414 | * | 
| 415 | 415 | * @access public | 
| 416 | - * @param string $widget_type (default: 'iframe') | |
| 417 | 416 | * @param string $iframe_id (default: '') | 
| 418 | 417 | * @param mixed $zillow_screenname | 
| 419 | 418 | * @param string $type (default: 'iframe') | 
| @@ -1,9 +1,9 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | 3 | /* Exit if accessed directly. */ | 
| 4 | -if ( ! defined( 'ABSPATH' ) ) { exit; } | |
| 4 | +if ( ! defined('ABSPATH')) { exit; } | |
| 5 | 5 | |
| 6 | -if ( ! class_exists( 'ZillowWidgets' ) ) { | |
| 6 | +if ( ! class_exists('ZillowWidgets')) { | |
| 7 | 7 | |
| 8 | 8 | /** | 
| 9 | 9 | * ZillowWidgets class. | 
| @@ -48,10 +48,10 @@ discard block | ||
| 48 | 48 | * @param string $iframe_id (default: '') | 
| 49 | 49 | * @return void | 
| 50 | 50 | */ | 
| 51 | -		public function zillow_iframe_id( $iframe_id = '' ) { | |
| 51 | +		public function zillow_iframe_id($iframe_id = '') { | |
| 52 | 52 | |
| 53 | -			if( '' !== $iframe_id  ) { | |
| 54 | - return sanitize_html_class( $iframe_id ) . '-iframe'; | |
| 53 | +			if ('' !== $iframe_id) { | |
| 54 | + return sanitize_html_class($iframe_id) . '-iframe'; | |
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | } | 
| @@ -63,10 +63,10 @@ discard block | ||
| 63 | 63 | * @param string $widget_name (default: '') | 
| 64 | 64 | * @return void | 
| 65 | 65 | */ | 
| 66 | -		public function zillow_iframe_class( $widget_name = '' ) { | |
| 66 | +		public function zillow_iframe_class($widget_name = '') { | |
| 67 | 67 | |
| 68 | -			if( '' !== $widget_name ) { | |
| 69 | - return 'zillow zillow-iframe zillow-' . sanitize_html_class( $widget_name ) . '-iframe'; | |
| 68 | +			if ('' !== $widget_name) { | |
| 69 | + return 'zillow zillow-iframe zillow-' . sanitize_html_class($widget_name) . '-iframe'; | |
| 70 | 70 |  			} else { | 
| 71 | 71 | return 'zillow zillow-iframe'; | 
| 72 | 72 | } | 
| @@ -84,9 +84,9 @@ discard block | ||
| 84 | 84 | * @param string $format (default: 'normalWidget') | 
| 85 | 85 | * @return void | 
| 86 | 86 | */ | 
| 87 | -		public function get_listings_widget( $iframe_id = '', $zuid, $format = 'normalWidget' ) { | |
| 87 | +		public function get_listings_widget($iframe_id = '', $zuid, $format = 'normalWidget') { | |
| 88 | 88 | |
| 89 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'listings' ) .'" scrolling="no" title="'. __( 'My Listings on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/profile/NewListingsWidget.htm?aid='. $zuid .'&newVersion=true&widgetFormat='. $format .'" width="500" height="300" frameborder="0" style="width:100%;"></iframe>'; | |
| 89 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('listings') . '" scrolling="no" title="' . __('My Listings on Zillow', 're-rpo') . '" src="https://www.zillow.com/widgets/profile/NewListingsWidget.htm?aid=' . $zuid . '&newVersion=true&widgetFormat=' . $format . '" width="500" height="300" frameborder="0" style="width:100%;"></iframe>'; | |
| 90 | 90 | |
| 91 | 91 | } | 
| 92 | 92 | |
| @@ -103,9 +103,9 @@ discard block | ||
| 103 | 103 | * @param mixed $height | 
| 104 | 104 | * @return void | 
| 105 | 105 | */ | 
| 106 | -		public function get_review_widget( $iframe_id = '', $zuid, $screenname, $size = 'wide', $zmod = 'true', $width = '300', $height = '100' ) { | |
| 106 | +		public function get_review_widget($iframe_id = '', $zuid, $screenname, $size = 'wide', $zmod = 'true', $width = '300', $height = '100') { | |
| 107 | 107 | |
| 108 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'reviews' ) .'" scrolling="yes" title="'. __( 'My Reviews on Zillow', 're-pro' ) .'" src="https://www.zillow.com/widgets/reputation/Rating.htm?did=rw-widget-container&ezuid=' . $zuid .'&scrnname=' . $screenname . '&size=' .$size . '&type=iframe&zmod='. $zmod .'" width="'. $width . '" height="'. $height .'" frameborder="0"></iframe>'; | |
| 108 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('reviews') . '" scrolling="yes" title="' . __('My Reviews on Zillow', 're-pro') . '" src="https://www.zillow.com/widgets/reputation/Rating.htm?did=rw-widget-container&ezuid=' . $zuid . '&scrnname=' . $screenname . '&size=' . $size . '&type=iframe&zmod=' . $zmod . '" width="' . $width . '" height="' . $height . '" frameborder="0"></iframe>'; | |
| 109 | 109 | |
| 110 | 110 | } | 
| 111 | 111 | |
| @@ -118,9 +118,9 @@ discard block | ||
| 118 | 118 | * @param string $format (default: 'normalWidget') | 
| 119 | 119 | * @return void | 
| 120 | 120 | */ | 
| 121 | -		public function get_past_listings_widget( $iframe_id = '', $zuid, $format = 'normalWidget' ) { | |
| 121 | +		public function get_past_listings_widget($iframe_id = '', $zuid, $format = 'normalWidget') { | |
| 122 | 122 | |
| 123 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'past-listings' ) .'" scrolling="no" title="'. __( 'My Sales on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/profile/PastSalesListingWidget.htm?aid='. $zuid .'&newVersion=true&widgetFormat='. $format .'" width="500" height="250" frameborder="0" style="width:100%;"></iframe>'; | |
| 123 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('past-listings') . '" scrolling="no" title="' . __('My Sales on Zillow', 're-rpo') . '" src="https://www.zillow.com/widgets/profile/PastSalesListingWidget.htm?aid=' . $zuid . '&newVersion=true&widgetFormat=' . $format . '" width="500" height="250" frameborder="0" style="width:100%;"></iframe>'; | |
| 124 | 124 | |
| 125 | 125 | } | 
| 126 | 126 | |
| @@ -132,9 +132,9 @@ discard block | ||
| 132 | 132 | * @param mixed $email | 
| 133 | 133 | * @return void | 
| 134 | 134 | */ | 
| 135 | -		public function get_contact_widget( $iframe_id = '', $email ) { | |
| 135 | +		public function get_contact_widget($iframe_id = '', $email) { | |
| 136 | 136 | |
| 137 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'contact' ) .'" scrolling="no" title="'. __( 'Contact me on Zillow', 're-rpo' ) .'" src="https://www.zillow.com/widgets/contact/ContactFormWidget.htm?email='. antispambot( sanitize_email( $email ) ) .'&size=wide" width="350" height="250" frameborder="0" style="width:100%;"></iframe>'; | |
| 137 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('contact') . '" scrolling="no" title="' . __('Contact me on Zillow', 're-rpo') . '" src="https://www.zillow.com/widgets/contact/ContactFormWidget.htm?email=' . antispambot(sanitize_email($email)) . '&size=wide" width="350" height="250" frameborder="0" style="width:100%;"></iframe>'; | |
| 138 | 138 | |
| 139 | 139 | } | 
| 140 | 140 | |
| @@ -147,9 +147,9 @@ discard block | ||
| 147 | 147 | * @param string $iframe_id (default: '') | 
| 148 | 148 | * @return void | 
| 149 | 149 | */ | 
| 150 | -		public function get_affordability_calc_widget( $iframe_id = '' ) { | |
| 150 | +		public function get_affordability_calc_widget($iframe_id = '') { | |
| 151 | 151 | |
| 152 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'affordability-calc' ) .'" scrolling="no" title="'. __( 'Zillow Affordability Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/widgets/AffordabilityCalculatorWidget.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; | |
| 152 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('affordability-calc') . '" scrolling="no" title="' . __('Zillow Affordability Calculator', 're-rpo') . '" src="https://www.zillow.com/mortgage/widgets/AffordabilityCalculatorWidget.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; | |
| 153 | 153 | |
| 154 | 154 | } | 
| 155 | 155 | |
| @@ -160,9 +160,9 @@ discard block | ||
| 160 | 160 | * @param string $iframe_id (default: '') | 
| 161 | 161 | * @return void | 
| 162 | 162 | */ | 
| 163 | -		public function get_monthlypay_calc_widget( $iframe_id = '' ) { | |
| 163 | +		public function get_monthlypay_calc_widget($iframe_id = '') { | |
| 164 | 164 | |
| 165 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'listings' ) .'" scrolling="no" title="'. __( 'Monthly Payment Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/MortgageCalculatorWidgetLarge.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; | |
| 165 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('listings') . '" scrolling="no" title="' . __('Monthly Payment Calculator', 're-rpo') . '" src="https://www.zillow.com/mortgage/MortgageCalculatorWidgetLarge.htm" width="688" height="700" frameborder="0" style="width:100%;min-height:700px;"></iframe>'; | |
| 166 | 166 | |
| 167 | 167 | } | 
| 168 | 168 | |
| @@ -174,9 +174,9 @@ discard block | ||
| 174 | 174 | * @param string $orientation (default: 'verticalWidget') | 
| 175 | 175 | * @return void | 
| 176 | 176 | */ | 
| 177 | -		public function get_mortgage_calc_widget( $iframe_id = '', $orientation = 'verticalWidget' ) { | |
| 177 | +		public function get_mortgage_calc_widget($iframe_id = '', $orientation = 'verticalWidget') { | |
| 178 | 178 | |
| 179 | -			if ( 'verticalWidget' === $orientation ) { | |
| 179 | +			if ('verticalWidget' === $orientation) { | |
| 180 | 180 | $height = '470'; | 
| 181 | 181 | $width = '200'; | 
| 182 | 182 |  			} else { | 
| @@ -184,7 +184,7 @@ discard block | ||
| 184 | 184 | $width = '352'; | 
| 185 | 185 | } | 
| 186 | 186 | |
| 187 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-calc' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Calculator', 're-rpo' ) .'" src="https://www.zillow.com/mortgage/SmallMortgageLoanCalculatorWidget.htm?widgetOrientationType='. $orientation .'" width="'. $width .'" height="'. $height .'" frameborder="0" style="width:100%;"></iframe>'; | |
| 187 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-calc') . '" scrolling="no" title="' . __('Zillow Mortgage Calculator', 're-rpo') . '" src="https://www.zillow.com/mortgage/SmallMortgageLoanCalculatorWidget.htm?widgetOrientationType=' . $orientation . '" width="' . $width . '" height="' . $height . '" frameborder="0" style="width:100%;"></iframe>'; | |
| 188 | 188 | |
| 189 | 189 | } | 
| 190 | 190 | |
| @@ -198,16 +198,16 @@ discard block | ||
| 198 | 198 | * @param mixed $region | 
| 199 | 199 | * @return void | 
| 200 | 200 | */ | 
| 201 | -		public function get_mortgage_rate_table_widget( $iframe_id = '', $textcolor, $screenname, $region ) { | |
| 201 | +		public function get_mortgage_rate_table_widget($iframe_id = '', $textcolor, $screenname, $region) { | |
| 202 | 202 | |
| 203 | 203 | ?> | 
| 204 | 204 | <div id="" class="zillow-mortage-rate-table"> | 
| 205 | 205 | <div class="header-labels"> | 
| 206 | 206 | <span class="current-label" style="color:#<?php echo $textcolor ?>"> | 
| 207 | - <?php _e( 'Current', 're-pro' ); ?> | |
| 207 | +				<?php _e('Current', 're-pro'); ?> | |
| 208 | 208 | </span> | 
| 209 | 209 | <span class="lastweek-label" style="color:#<?php echo $textcolor ?>"> | 
| 210 | - <?php _e( 'Last Week', 're-pro' ); ?> | |
| 210 | +				<?php _e('Last Week', 're-pro'); ?> | |
| 211 | 211 | </span> | 
| 212 | 212 | </div> | 
| 213 | 213 | |
| @@ -215,26 +215,26 @@ discard block | ||
| 215 | 215 | <div class="rate-labels-wrapper"> | 
| 216 | 216 | <div id="30-year-label-row" class="rate-label-row"> | 
| 217 | 217 | <div id="30-year-label" class="rate-label"> | 
| 218 | - <?php _e( '30 Year Fixed', 're-pro' ); ?> | |
| 218 | +						<?php _e('30 Year Fixed', 're-pro'); ?> | |
| 219 | 219 | </div> | 
| 220 | 220 | </div> | 
| 221 | 221 | |
| 222 | 222 | <div id="15-year-label-row" class="rate-label-row"> | 
| 223 | 223 | <div id="15-year-label" class="rate-label"> | 
| 224 | - <?php _e( '15 Year Fixed', 're-pro' ); ?> | |
| 224 | +						<?php _e('15 Year Fixed', 're-pro'); ?> | |
| 225 | 225 | </div> | 
| 226 | 226 | </div> | 
| 227 | 227 | |
| 228 | 228 | <div id="5-1-adjustable-label-row" class="rate-label-row"> | 
| 229 | 229 | <div id="5-1-adjustable-label" class="rate-label"> | 
| 230 | - <?php _e( '5/1 Adjustable', 're-pro' ); ?> | |
| 230 | +						<?php _e('5/1 Adjustable', 're-pro'); ?> | |
| 231 | 231 | </div> | 
| 232 | 232 | </div> | 
| 233 | 233 | </div> | 
| 234 | 234 | |
| 235 | 235 | <?php | 
| 236 | 236 | |
| 237 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates-table' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Rate Table', 're-pro' ) .'" src="https://www.zillow.com/mortgage/MortgageRateTable.htm?wide=1&textcolor='. $textcolor .'&scrnname='. $screenname .'®ion='. $region .'&cobrand='. $screenname .'" width="130" height="100" frameborder="0" style="width:50%;"></iframe>'; | |
| 237 | +		echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-rates-table') . '" scrolling="no" title="' . __('Zillow Mortgage Rate Table', 're-pro') . '" src="https://www.zillow.com/mortgage/MortgageRateTable.htm?wide=1&textcolor=' . $textcolor . '&scrnname=' . $screenname . '®ion=' . $region . '&cobrand=' . $screenname . '" width="130" height="100" frameborder="0" style="width:50%;"></iframe>'; | |
| 238 | 238 | |
| 239 | 239 | } | 
| 240 | 240 | |
| @@ -245,9 +245,9 @@ discard block | ||
| 245 | 245 | * @param string $iframe_id (default: '') | 
| 246 | 246 | * @return void | 
| 247 | 247 | */ | 
| 248 | -		public function get_rate_table_graph_widget( $iframe_id = '' ) { | |
| 248 | +		public function get_rate_table_graph_widget($iframe_id = '') { | |
| 249 | 249 | |
| 250 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates-graph' ) .'" title="'. __( 'Zillow Mortgage Rates Graph', 're-pro' ) .'" src="https://www.zillow.com/webtools/widgets/RateTableAndGraphDistributionWidget.htm" width="306" height="315" frameborder="0" scrolling="no" ></iframe>'; | |
| 250 | +			echo '<iframe  id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-rates-graph') . '" title="' . __('Zillow Mortgage Rates Graph', 're-pro') . '" src="https://www.zillow.com/webtools/widgets/RateTableAndGraphDistributionWidget.htm" width="306" height="315" frameborder="0" scrolling="no" ></iframe>'; | |
| 251 | 251 | |
| 252 | 252 | } | 
| 253 | 253 | |
| @@ -257,9 +257,9 @@ discard block | ||
| 257 | 257 | * @access public | 
| 258 | 258 | * @return void | 
| 259 | 259 | */ | 
| 260 | -		public function get_mortage_rate_widget( $iframe_id = '' ) { | |
| 260 | +		public function get_mortage_rate_widget($iframe_id = '') { | |
| 261 | 261 | |
| 262 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-rates' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Rate Table', 're-pro' ) .'" src="https://www.zillow.com/webtools/widgets/RateTableDistributionWidget.htm" width="306" height="215" frameborder="0" style="width:100%;min-height:215px;"></iframe>'; | |
| 262 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-rates') . '" scrolling="no" title="' . __('Zillow Mortgage Rate Table', 're-pro') . '" src="https://www.zillow.com/webtools/widgets/RateTableDistributionWidget.htm" width="306" height="215" frameborder="0" style="width:100%;min-height:215px;"></iframe>'; | |
| 263 | 263 | |
| 264 | 264 | } | 
| 265 | 265 | |
| @@ -273,9 +273,9 @@ discard block | ||
| 273 | 273 | * @param string $textcolor (default: '000000') | 
| 274 | 274 | * @return void | 
| 275 | 275 | */ | 
| 276 | -		public function get_paymentbreakout_calc_widget( $iframe_id = '', $price, $region_id, $textcolor = '000000' ) { | |
| 276 | +		public function get_paymentbreakout_calc_widget($iframe_id = '', $price, $region_id, $textcolor = '000000') { | |
| 277 | 277 | |
| 278 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-payment-breakout' ) .'" scrolling="no" title="'. __( 'Zillow Mortgage Payment Breakout Calculator', 're-pro' ) .'"src="https://www.zillow.com/mortgage/MortgageLoanCalculatorWidget.htm?skin=custom&price='. $price .'&rid='. $region_id .'&textcolor='. $textcolor .'" frameborder="0" title="'. __( 'Zillow Mortgage Calculator', 're-pro' ) .'" width="176" height="298px"></iframe>'; | |
| 278 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-payment-breakout') . '" scrolling="no" title="' . __('Zillow Mortgage Payment Breakout Calculator', 're-pro') . '"src="https://www.zillow.com/mortgage/MortgageLoanCalculatorWidget.htm?skin=custom&price=' . $price . '&rid=' . $region_id . '&textcolor=' . $textcolor . '" frameborder="0" title="' . __('Zillow Mortgage Calculator', 're-pro') . '" width="176" height="298px"></iframe>'; | |
| 279 | 279 | |
| 280 | 280 | } | 
| 281 | 281 | |
| @@ -295,9 +295,9 @@ discard block | ||
| 295 | 295 | * @param string $bgcolor (default: 'FFFFFF') | 
| 296 | 296 | * @return void | 
| 297 | 297 | */ | 
| 298 | -		public function get_home_value_estimate_widget( $iframe_id = '', $type = 'iframe', $address, $searchbox = 'yes', $region, $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF' ) { | |
| 298 | +		public function get_home_value_estimate_widget($iframe_id = '', $type = 'iframe', $address, $searchbox = 'yes', $region, $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF') { | |
| 299 | 299 | |
| 300 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'home-value-estimate' ) .'" scrolling="no" title="'. __( 'Zillow Home Value Estimate', 're-pro' ) .'" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type='.$type.'&address='.$address.'&searchbox='. $searchbox .'®ion='.$region.'&skinnyWidget='.$skinny_widget.'&tc='. $textcolor .'&bgc='. $bgcolor .'" width="296" frameborder="0" height="360"></iframe>'; | |
| 300 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('home-value-estimate') . '" scrolling="no" title="' . __('Zillow Home Value Estimate', 're-pro') . '" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type=' . $type . '&address=' . $address . '&searchbox=' . $searchbox . '®ion=' . $region . '&skinnyWidget=' . $skinny_widget . '&tc=' . $textcolor . '&bgc=' . $bgcolor . '" width="296" frameborder="0" height="360"></iframe>'; | |
| 301 | 301 | } | 
| 302 | 302 | |
| 303 | 303 | /** | 
| @@ -318,9 +318,9 @@ discard block | ||
| 318 | 318 | * @param string $bgcolor (default: 'FFFFFF') | 
| 319 | 319 | * @return void | 
| 320 | 320 | */ | 
| 321 | -		public function get_realestate_stats_widget( $iframe_id = '', $cs, $did = 'rsw-wide', $dys, $mt, $region_id, $sid, $type = 'iframe', $wtype = 'rhv', $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF' ) { | |
| 321 | +		public function get_realestate_stats_widget($iframe_id = '', $cs, $did = 'rsw-wide', $dys, $mt, $region_id, $sid, $type = 'iframe', $wtype = 'rhv', $skinny_widget = 'true', $textcolor = '000000', $bgcolor = 'FFFFFF') { | |
| 322 | 322 | |
| 323 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'realestate-stats' ) .'" title="'. __( 'Zillow Real Estate Stats', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/geo/RegionalStatsWidget.htm?cs='. $cs .'&did='. $did .'&dys='.$dys.'&mt='.$mt.'&rid='.$region_id.'&sid='.$sid.'&type='.$type.'&wtype='. $type .'&skinnyWidget='.$skinny_widget.'&textcolor='.$textcolor.'&backgroundColor='. $bgcolor .'" width="286" frameborder="0" height="280"></iframe>'; | |
| 323 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('realestate-stats') . '" title="' . __('Zillow Real Estate Stats', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/geo/RegionalStatsWidget.htm?cs=' . $cs . '&did=' . $did . '&dys=' . $dys . '&mt=' . $mt . '&rid=' . $region_id . '&sid=' . $sid . '&type=' . $type . '&wtype=' . $type . '&skinnyWidget=' . $skinny_widget . '&textcolor=' . $textcolor . '&backgroundColor=' . $bgcolor . '" width="286" frameborder="0" height="280"></iframe>'; | |
| 324 | 324 | } | 
| 325 | 325 | |
| 326 | 326 | /** | 
| @@ -338,9 +338,9 @@ discard block | ||
| 338 | 338 | * @param string $bgcolor (default: 'FFFFF') | 
| 339 | 339 | * @return void | 
| 340 | 340 | */ | 
| 341 | -		public function get_rent_validation_widget($iframe_id = '', $type = 'iframe', $skinny_widget = 'true', $searchbox = 'yes', $for_rent = 'true', $address, $region, $textcolor = '000000', $bgcolor = 'FFFFF' ) { | |
| 341 | +		public function get_rent_validation_widget($iframe_id = '', $type = 'iframe', $skinny_widget = 'true', $searchbox = 'yes', $for_rent = 'true', $address, $region, $textcolor = '000000', $bgcolor = 'FFFFF') { | |
| 342 | 342 | |
| 343 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'rent-validation' ) .'" title="'. __( 'Zillow Rent Validation', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type='.$type.'&forRent='.$for_rent.'&tc='.$textcolor.'&bgc='.$bgcolor.'&address='. $address .'&searchbox='.$searchbox.'®ion='.$region.'&skinnyWidget='.$skinny_widget.'" frameborder="0" width="296" height="360"></iframe>'; | |
| 343 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('rent-validation') . '" title="' . __('Zillow Rent Validation', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/zestimate/ZestimateLargeWidget.htm?did=zillow-shv-large-iframe-widget&type=' . $type . '&forRent=' . $for_rent . '&tc=' . $textcolor . '&bgc=' . $bgcolor . '&address=' . $address . '&searchbox=' . $searchbox . '®ion=' . $region . '&skinnyWidget=' . $skinny_widget . '" frameborder="0" width="296" height="360"></iframe>'; | |
| 344 | 344 | } | 
| 345 | 345 | |
| 346 | 346 | /* LISTINGS. */ | 
| @@ -355,7 +355,7 @@ discard block | ||
| 355 | 355 | * @param string $size (default: ' wide') | 
| 356 | 356 | * @return void | 
| 357 | 357 | */ | 
| 358 | -		public function get_expensive_homes_widget( $iframe_id = '', $location, $type = 'iframe', $size = ' wide' ) { | |
| 358 | +		public function get_expensive_homes_widget($iframe_id = '', $location, $type = 'iframe', $size = ' wide') { | |
| 359 | 359 | |
| 360 | 360 | // TODO - Check for HTTPS, as this widget does not support it. | 
| 361 | 361 | // TODO - Support JS Version. | 
| @@ -363,7 +363,7 @@ discard block | ||
| 363 | 363 | echo '<div class="zillow-listings-widget-container zillow-meh-widget-container">'; | 
| 364 | 364 | echo '<h5>Most Expensive Homes in ' . $location . '</h5>'; | 
| 365 | 365 | echo '<div class="zillow-meh-outer">'; | 
| 366 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'expensive-homes' ) .'" title="'. __( 'Zillow Most Expensive Homes', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=meh-large-iframe-widget-container&type='. $type .'&size='.$size.'&rn='. $location .'&widgettype=meh" width="" height="121" frameborder="0" style="width:100%;"></iframe>'; | |
| 366 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('expensive-homes') . '" title="' . __('Zillow Most Expensive Homes', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=meh-large-iframe-widget-container&type=' . $type . '&size=' . $size . '&rn=' . $location . '&widgettype=meh" width="" height="121" frameborder="0" style="width:100%;"></iframe>'; | |
| 367 | 367 | echo '</div>'; | 
| 368 | 368 | echo '<img alt="Zillow Real Estate" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; | 
| 369 | 369 | echo '</div>'; | 
| @@ -379,14 +379,14 @@ discard block | ||
| 379 | 379 | * @param string $size (default: ' wide') | 
| 380 | 380 | * @return void | 
| 381 | 381 | */ | 
| 382 | -		public function get_newest_forsale_homes_widget( $iframe_id = '', $location, $type = 'iframe', $size = ' wide' ) { | |
| 382 | +		public function get_newest_forsale_homes_widget($iframe_id = '', $location, $type = 'iframe', $size = ' wide') { | |
| 383 | 383 | |
| 384 | 384 | // TODO - Check for HTTPS, as this widget does not support it. | 
| 385 | 385 | // TODO - Support JS Version. | 
| 386 | 386 | |
| 387 | 387 | echo '<div class="zillow-listings-widget-container zillow-nfs-widget-container">'; | 
| 388 | 388 | echo '<h5>Newest For Sale Homes in ' . $location . '</h5>'; | 
| 389 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'newest-homes' ) .'" title="'. __( 'Zillow Newest For Sale Homes', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=nfs-large-iframe-widget-container&type='. $type .'&size='.$size.'&rn='. $location .'&widgettype=nfs" width="286" height="123" frameborder="0"></iframe>'; | |
| 389 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('newest-homes') . '" title="' . __('Zillow Newest For Sale Homes', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/fmr/FMRWidget.htm?did=nfs-large-iframe-widget-container&type=' . $type . '&size=' . $size . '&rn=' . $location . '&widgettype=nfs" width="286" height="123" frameborder="0"></iframe>'; | |
| 390 | 390 | echo '<img alt="Zillow Real Estate" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; | 
| 391 | 391 | echo '</div>'; | 
| 392 | 392 | } | 
| @@ -403,9 +403,9 @@ discard block | ||
| 403 | 403 | * @param mixed $region_id | 
| 404 | 404 | * @return void | 
| 405 | 405 | */ | 
| 406 | -		public function get_zillow_search_widget( $iframe_id = '', $use_user_location = 'false', $is_public = 'true', $bucket = 'map', $zillow_screenname, $region_id ) { | |
| 406 | +		public function get_zillow_search_widget($iframe_id = '', $use_user_location = 'false', $is_public = 'true', $bucket = 'map', $zillow_screenname, $region_id) { | |
| 407 | 407 | |
| 408 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'search' ) .'" title="'. __( 'Zillow Search', 're-pro' ) .'" src="https://www.zillow.com/widgets/search/PartnerAdWidget.htm?ulbm='.$use_user_location.'&isPublic='.$is_public.'&bucket='.$bucket.'&pn='.$zillow_screenname.'&rid='.$region_id.'&style=default" scrolling="no" frameborder="0" width="298" height="272"></iframe>'; | |
| 408 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('search') . '" title="' . __('Zillow Search', 're-pro') . '" src="https://www.zillow.com/widgets/search/PartnerAdWidget.htm?ulbm=' . $use_user_location . '&isPublic=' . $is_public . '&bucket=' . $bucket . '&pn=' . $zillow_screenname . '&rid=' . $region_id . '&style=default" scrolling="no" frameborder="0" width="298" height="272"></iframe>'; | |
| 409 | 409 | |
| 410 | 410 | } | 
| 411 | 411 | |
| @@ -421,14 +421,14 @@ discard block | ||
| 421 | 421 | * @param string $include_home_val_info (default: 'yes') | 
| 422 | 422 | * @return void | 
| 423 | 423 | */ | 
| 424 | -		public function get_lg_zillow_search_widget( $iframe_id = '', $zillow_screenname, $type = 'iframe', $region_name, $include_home_val_info = 'yes' ) { | |
| 424 | +		public function get_lg_zillow_search_widget($iframe_id = '', $zillow_screenname, $type = 'iframe', $region_name, $include_home_val_info = 'yes') { | |
| 425 | 425 | |
| 426 | 426 | echo '<div class="zillow-large-search-box-widget-container">'; | 
| 427 | 427 | echo ' <h2>Find Homes</h2>'; | 
| 428 | 428 | echo ' <div style="float:right;">'; | 
| 429 | 429 | echo ' <img alt="Zillow Real Estate Information" style="border:0;" src="http://www.zillow.com/widgets/GetVersionedResource.htm?path=%2Fstatic%2Fimages%2Fpowered-by-zillow.gif" />'; | 
| 430 | 430 | echo ' </div>'; | 
| 431 | - echo ' <iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'lg-search' ) .'" scrolling="no" title="'. __( 'Zillow Search', 're-pro' ) .'" src="https://www.zillow.com/widgets/search/LargeSearchBoxWidget.htm?did=zillow-large-search-box-iframe-widget&scrnname='.$zillow_screenname.'&type='.$type.'&rgname='.$region_name.'&shvi='.$include_home_val_info.'" width="430" frameborder="0" height="400"></iframe>'; | |
| 431 | +			echo '	<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('lg-search') . '" scrolling="no" title="' . __('Zillow Search', 're-pro') . '" src="https://www.zillow.com/widgets/search/LargeSearchBoxWidget.htm?did=zillow-large-search-box-iframe-widget&scrnname=' . $zillow_screenname . '&type=' . $type . '&rgname=' . $region_name . '&shvi=' . $include_home_val_info . '" width="430" frameborder="0" height="400"></iframe>'; | |
| 432 | 432 | echo '</div>'; | 
| 433 | 433 | } | 
| 434 | 434 | |
| @@ -445,9 +445,9 @@ discard block | ||
| 445 | 445 | * @param mixed $zillow_screenname | 
| 446 | 446 | * @return void | 
| 447 | 447 | */ | 
| 448 | -		public function get_refinance_quiz_widget( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'refq', $zillow_screenname ) { | |
| 448 | +		public function get_refinance_quiz_widget($widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'refq', $zillow_screenname) { | |
| 449 | 449 | |
| 450 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'refinance-quiz' ) .'" title="'. __( 'Zillow Refinance Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=refinance-quiz-iframe-container&type=iframe&widgetcode=refq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; | |
| 450 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('refinance-quiz') . '" title="' . __('Zillow Refinance Quiz', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=refinance-quiz-iframe-container&type=iframe&widgetcode=refq&scrnname=' . $zillow_screenname . '" width="158" frameborder="0" height="317"></iframe>'; | |
| 451 | 451 | |
| 452 | 452 | } | 
| 453 | 453 | |
| @@ -462,9 +462,9 @@ discard block | ||
| 462 | 462 | * @param mixed $zillow_screenname | 
| 463 | 463 | * @return void | 
| 464 | 464 | */ | 
| 465 | -		public function get_kindofneighbor_quiz_widget( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'konq', $zillow_screenname ) { | |
| 465 | +		public function get_kindofneighbor_quiz_widget($widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'konq', $zillow_screenname) { | |
| 466 | 466 | |
| 467 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'kindofneighbor-quiz' ) .'" title="'. __( 'Zillow Kind of Neighbor Quiz', 're-pro' ) .'" scrolling="no" src="httsp://www.zillow.com/widgets/quiz/QuizWidget.htm?did=neighbor-quiz-iframe-container&type=iframe&widgetcode=konq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; | |
| 467 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('kindofneighbor-quiz') . '" title="' . __('Zillow Kind of Neighbor Quiz', 're-pro') . '" scrolling="no" src="httsp://www.zillow.com/widgets/quiz/QuizWidget.htm?did=neighbor-quiz-iframe-container&type=iframe&widgetcode=konq&scrnname=' . $zillow_screenname . '" width="158" frameborder="0" height="317"></iframe>'; | |
| 468 | 468 | |
| 469 | 469 | } | 
| 470 | 470 | |
| @@ -479,9 +479,9 @@ discard block | ||
| 479 | 479 | * @param mixed $zillow_screenname | 
| 480 | 480 | * @return void | 
| 481 | 481 | */ | 
| 482 | -		public function get_mortgage_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'mq', $zillow_screenname ) { | |
| 482 | +		public function get_mortgage_quiz($widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'mq', $zillow_screenname) { | |
| 483 | 483 | |
| 484 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-quiz' ) .'" title="'. __( 'Zillow Mortgage Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=mq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; | |
| 484 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-quiz') . '" title="' . __('Zillow Mortgage Quiz', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=mq&scrnname=' . $zillow_screenname . '" width="158" frameborder="0" height="317"></iframe>'; | |
| 485 | 485 | |
| 486 | 486 | } | 
| 487 | 487 | |
| @@ -496,9 +496,9 @@ discard block | ||
| 496 | 496 | * @param mixed $zillow_screenname | 
| 497 | 497 | * @return void | 
| 498 | 498 | */ | 
| 499 | -		public function get_mortgage_harp_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'hec', $zillow_screenname ) { | |
| 499 | +		public function get_mortgage_harp_quiz($widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'hec', $zillow_screenname) { | |
| 500 | 500 | |
| 501 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'mortgage-harp-quiz' ) .'" title="'. __( 'Zillow Mortgage HARP Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=hec&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; | |
| 501 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('mortgage-harp-quiz') . '" title="' . __('Zillow Mortgage HARP Quiz', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=mortgage-iframe-container&type=iframe&widgetcode=hec&scrnname=' . $zillow_screenname . '" width="158" frameborder="0" height="317"></iframe>'; | |
| 502 | 502 | |
| 503 | 503 | } | 
| 504 | 504 | |
| @@ -513,9 +513,9 @@ discard block | ||
| 513 | 513 | * @param mixed $zillow_screenname | 
| 514 | 514 | * @return void | 
| 515 | 515 | */ | 
| 516 | -		public function get_buyeriq_quiz( $widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'biq', $zillow_screenname ) { | |
| 516 | +		public function get_buyeriq_quiz($widget_type = 'iframe', $iframe_id = '', $type = 'iframe', $widgetcode = 'biq', $zillow_screenname) { | |
| 517 | 517 | |
| 518 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'buyeriq-quiz' ) .'" title="'. __( 'Zillow Buyer IQ Quiz', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=buyer-iframe-container&type=iframe&widgetcode=biq&scrnname='.$zillow_screenname.'" width="158" frameborder="0" height="317"></iframe>'; | |
| 518 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('buyeriq-quiz') . '" title="' . __('Zillow Buyer IQ Quiz', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/quiz/QuizWidget.htm?did=buyer-iframe-container&type=iframe&widgetcode=biq&scrnname=' . $zillow_screenname . '" width="158" frameborder="0" height="317"></iframe>'; | |
| 519 | 519 | |
| 520 | 520 | } | 
| 521 | 521 | |
| @@ -532,9 +532,9 @@ discard block | ||
| 532 | 532 | * @param mixed $button_link | 
| 533 | 533 | * @return void | 
| 534 | 534 | */ | 
| 535 | -		public function get_moving_boxes_widget( $widget_type = 'iframe', $iframe_id = '', $zillow_city_id, $button_text, $custom_text, $button_link ) { | |
| 535 | +		public function get_moving_boxes_widget($widget_type = 'iframe', $iframe_id = '', $zillow_city_id, $button_text, $custom_text, $button_link) { | |
| 536 | 536 | |
| 537 | - echo '<iframe id="'. $this->zillow_iframe_id( $iframe_id ) .'" class="'. $this->zillow_iframe_class( 'moving-boxes' ) .'" title="'. __( 'Zillow Moving Box Calculator', 're-pro' ) .'" scrolling="no" src="https://www.zillow.com/widgets/misc/MovingBoxEstimatorWidget.htm?bc='.$zillow_city_id.'&bt='.$button_text.'&cap='.$custom_text.'&bl='.$button_link.'" width="168" frameborder="0" height="315"></iframe>'; | |
| 537 | +			echo '<iframe id="' . $this->zillow_iframe_id($iframe_id) . '" class="' . $this->zillow_iframe_class('moving-boxes') . '" title="' . __('Zillow Moving Box Calculator', 're-pro') . '" scrolling="no" src="https://www.zillow.com/widgets/misc/MovingBoxEstimatorWidget.htm?bc=' . $zillow_city_id . '&bt=' . $button_text . '&cap=' . $custom_text . '&bl=' . $button_link . '" width="168" frameborder="0" height="315"></iframe>'; | |
| 538 | 538 | |
| 539 | 539 | } | 
| 540 | 540 | |