Skip to content

Commit

Permalink
Merge pull request #175 from SimplyRETS/fix-php-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyReichert authored Jun 25, 2020
2 parents c2c433e + b377870 commit cf86991
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.9.1
* FIX: Update code to fix various PHP warnings and notices.

## 2.9.0
* FIX: Update `ivory-google-map` vendor library to fix issue loading Google Maps.

Expand Down
7 changes: 5 additions & 2 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Author: SimplyRETS
Contributors: SimplyRETS
Tags: rets, idx, idx plugin, mls, mls listings, real estate, simply rets, realtor, rets feed, idx feed
Requires at least: 3.0.1
Tested up to: 5.4
Stable tag: 2.9.0
Tested up to: 5.4.2
Stable tag: 2.9.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -236,6 +236,9 @@ listing sidebar widget.

== Changelog ==

= 2.9.1 =
* FIX: Update code to fix various PHP warnings and notices.

= 2.9.0 =
* FIX: Update `ivory-google-map` vendor library to fix issue loading Google Maps.

Expand Down
10 changes: 5 additions & 5 deletions src/simply-rets-api-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static function srApiOptionsRequest( $url ) {
$php_version = phpversion();
$site_url = get_site_url();

$ua_string = "SimplyRETSWP/2.9.0 Wordpress/{$wp_version} PHP/{$php_version}";
$ua_string = "SimplyRETSWP/2.9.1 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";

if( is_callable( 'curl_init' ) ) {
Expand Down Expand Up @@ -245,7 +245,7 @@ public static function srApiRequest( $url ) {
$wp_version = get_bloginfo('version');
$php_version = phpversion();

$ua_string = "SimplyRETSWP/2.9.0 Wordpress/{$wp_version} PHP/{$php_version}";
$ua_string = "SimplyRETSWP/2.9.1 Wordpress/{$wp_version} PHP/{$php_version}";
$accept_header = "Accept: application/json; q=0.2, application/vnd.simplyrets-v0.1+json";

if( is_callable( 'curl_init' ) ) {
Expand Down Expand Up @@ -568,7 +568,7 @@ public static function srResidentialDetailsGenerator( $listing ) {
// Boolean for fetching open houses
$has_openhouses = in_array(
"/openhouses",
get_option("sr_adv_search_meta_endpoints", array())
(array)get_option("sr_adv_search_meta_endpoints", array())
);

$last_update = $listing['lastUpdate'];
Expand All @@ -579,8 +579,8 @@ public static function srResidentialDetailsGenerator( $listing ) {
* The error code comes from the UrlBuilder function.
*/
if($listing == NULL
|| array_key_exists("error", $listing)
|| array_key_exists("errors", $listing)) {
|| property_exists($listing, "error")
|| property_exists($listing, "errors")) {
$err = SrMessages::noResultsMsg((array)$listing);
return $err;
}
Expand Down
16 changes: 1 addition & 15 deletions src/simply-rets-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,21 +428,7 @@ public static function sr_search_form_shortcode( $atts ) {
."<label><input name='sr_features[]' type='checkbox' value='$feature' $checked />$feature</label></li>";
}


// currently unused
// $adv_search_counties = get_option( 'sr_adv_search_meta_county' );
// foreach( $adv_search_counties as $key=>$county) {
// $county_options .= "<option value='$county' />$county</option>";
// }

// currently unused
// $adv_search_amenities = get_option( 'sr_adv_search_option_amenities' );
// foreach( $adv_search_amenities as $key=>$amenity) {
// $amenity_options .= "<li class='sr-adv-search-option'>"
// ."<label><input name='sr_features[]' type='checkbox' value='$amenity' />$amenity</label></li>";
// }

if( array_key_exists('advanced', $atts) && $atts['advanced'] == 'true' || $atts['advanced'] == 'True' ) {
if(array_key_exists('advanced', $atts) && ($atts['advanced'] == 'true' || $atts['advanced'] == 'True')) {
?>

<div class="sr-adv-search-wrap">
Expand Down
4 changes: 3 additions & 1 deletion src/simply-rets-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ class SrUtils {


public static function isSingleVendor() {
$vendors = get_option('sr_adv_search_meta_vendors', array());
$vendors = (array)get_option('sr_adv_search_meta_vendors', array());

if(count($vendors) > 1) {
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/simply-rets.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://simplyrets.com
Description: Show your Real Estate listings on your Wordpress site. SimplyRETS provides a very simple set up and full control over your listings.
Author: SimplyRETS
Version: 2.9.0
Version: 2.9.1
License: GNU General Public License v3 or later
Copyright (c) SimplyRETS 2014 - 2015
Expand Down

0 comments on commit cf86991

Please sign in to comment.