wordpress-plugin
wordpress-plugin copied to clipboard
IMPB-1512 Mitigate OOM errors by maintaining a smaller array of properties to return from client_properties() when possible
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
- Link your IMPress plugin to an account with thousands of soldpending listings associated with it.
- Add shortcode that tries to use the soldpending property type to a page, like
[impress_property_carousel property_type="soldpending" max="100" order="high-low" autoplay="0" styles="1" new_window="1" ]
- Note that you encounter an OOM error.
- Apply the fixes in this PR, then try adding the shortcode again.
- The OOM error should now be resolved.
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.