Plugin Directory

Changeset 2875154


Ignore:
Timestamp:
03/06/2023 07:33:28 AM (3 years ago)
Author:
BoltonStudios
Message:

Adding version 1.5.3

Location:
easy-zillow-reviews/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easy-zillow-reviews/trunk/README.txt

    r2875132 r2875154  
    66Tested up to: 6.1.1
    77Requires PHP: 5.4
    8 Stable tag: 1.5.2
     8Stable tag: 1.5.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     77= 1.5.3 =
     78* Date Updated: 2023-03-06
     79* Bug Fix: Fixed bug that caused reviews to appear out of sequence (should be newest first).
     80
    7781= 1.5.2 =
    7882* Date Updated: 2023-03-05
    79 * Bug Fix: Fixed bug that caused reviews to appear out of sequence (should be newest first).
    80 * Updated @wordpress/scripts Gutenberg dependency package to v25.5.0 and recompiled blocks code.
     83* Implemented new method to count reviews.
     84* Updated @wordpress/scripts Gutenberg dependency package to v25.5.0.
    8185
    8286= 1.5.1 =
     
    8892* Zillow transitioned to Bridge Interative API access. Create a Bridge API access token to get reviews.
    8993* New Feature: Added support for Bridge Interative API access tokens.
    90 * Updated @wordpress/scripts Gutenberg dependency package to v24.6.0 and recompiled blocks code.
     94* Updated @wordpress/scripts Gutenberg dependency package to v24.6.0.
    9195* Cleaned up Settings page by rewriting labels and hiding deprecated fields.
    9296
  • easy-zillow-reviews/trunk/easy-zillow-reviews.php

    r2875132 r2875154  
    2121 * Plugin URI:        https://wordpress.org/plugins/easy-zillow-reviews/
    2222 * Description:       Display reviews from Zillow on your site.
    23  * Version:           1.5.2
     23 * Version:           1.5.3
    2424 * Author:            Aaron Bolton
    2525 * Author URI:        https://www.boltonstudios.com
     
    4646         * Rename this for your plugin and update it as you release new versions.
    4747         */
    48         define( 'EASY_ZILLOW_REVIEWS_VERSION', '1.5.2' );
     48        define( 'EASY_ZILLOW_REVIEWS_VERSION', '1.5.3' );
    4949        define( 'EASY_ZILLOW_REVIEWS_BASENAME', plugin_basename( __FILE__ ) );
    5050        /**
  • easy-zillow-reviews/trunk/includes/class-easy-zillow-reviews-professional.php

    r2875132 r2875154  
    252252                            // Count the reviews available in the API response.
    253253                            $reviews_available_count = count( $zillow_reviews_data );
    254 
    255                             // Check if the user specified the $count parameter.
    256                             // If not, set the $count parameter equal to the number of reviews available.
    257                             $count = isset( $count ) ? $count : $reviews_available_count;
    258 
    259                             // The $count parameter should provide a subset of the reviews available.
    260                             // Check if the user-specified $count parameter is less than the reviews available.
    261                             // If not, set the $count parameter equal to the number of reviews available.
    262                             $count = $count < $reviews_available_count ? $count : $reviews_available_count;
    263254                           
    264255                            // Iterate over the elements in $zillow_reviews_data.
    265                             for( $i = 0; $i < $count; $i++ ){
     256                            for( $i = 0; $i < $reviews_available_count; $i++ ){
    266257                               
    267258                                $review_data = $zillow_reviews_data[ $i ];
     
    284275                                );
    285276                            }
     277                           
     278                            /**
     279                             * Sort reviews by date.
     280                             *
     281                             * Citation
     282                             * Title: "Heres a nicer way using ..."
     283                             * Author: Scott Quinlan
     284                             * Date: 04/15/2012
     285                             * Availability: https://stackoverflow.com/questions/4282413/sort-array-of-objects-by-one-property
     286                             */
     287                            usort( $reviews, function( $a, $b ){
     288                                return strtotime( $b->get_date() ) - strtotime( $a->get_date() );
     289                            });
     290
     291                            // Check if the user specified the $count parameter.
     292                            // If not, set the $count parameter equal to the number of reviews available.
     293                            $count = isset( $count ) ? $count : $reviews_available_count;
     294
     295                            // The $count parameter should provide a subset of the reviews available.
     296                            // Check if the user-specified $count parameter is less than the reviews available.
     297                            // If not, set the $count parameter equal to the number of reviews available.
     298                            $count = $count < $reviews_available_count ? $count : $reviews_available_count;
     299
     300                            // If the $count is different than $reviews_available_count...
     301                            if( $count != $reviews_available_count ){
     302
     303                                // Create a temporary reviews array.
     304                                $temp_reviews = array();
     305
     306                                // Iterate over the elements in $reviews.
     307                                for( $i = 0; $i < $count; $i++ ){
     308
     309                                    // Populate the temporary array with a subset of reviews.
     310                                    $temp_reviews[ $i ] = $reviews[ $i ];
     311               
     312                                }
     313
     314                                // Update the $reviews array.
     315                                $reviews = $temp_reviews;
     316                            }
    286317                        }
    287318                    }
Note: See TracChangeset for help on using the changeset viewer.