IMPB-1512 Mitigate OOM errors by maintaining a smaller array of properties to return from client_properties() when possible #499
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Requests
Please explain the intent of your Pull Request.
🐛 Are you fixing a bug? Y
💻 Are you changing functionality? Y
Template
Description of the Change
A client was encountering OOM errors when trying to use the 'soldpending' property type option with the IMPress shortcodes. Investigating the situation, it was determined that this is happening because of the current behavior of the plugin where it loads all possible sold/pending listings even when only a part of them are necessary. The large number of listings associated with the account was thereby causing the issue.
The changes in this PR add optional arguments to /idx/idx-api.php client_properties() that, when used, allow for the plugin to maintain a smaller rolling list of properties that match what is needed to output the correct listings for the given request.
Note that the functionality when the "default" sort order is set is left unchanged in case there are clients that are intentionally retrieving all the listings at once for these widgets. This means a high-low, low-high or 'none' sort order will have to be set to see the changes in effect.
Verification Process
[impress_property_carousel property_type="soldpending" max="100" order="high-low" autoplay="0" styles="1" new_window="1" ]
Release Notes
Fix: mitigated possibility of out of memory errors occurring when handling thousands of listings with the Showcase and Carousel widgets
Review
Pull Requests must have the sign-off of two other developers and at least one of these must be an IDX Broker team member.