Improve the update asset parent paths functionality for better performance #1027
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.
Improving the update asset paths functionality to deliver better performance on the front-end and when performing WP Rest API requests.
Approach
QA notes
Enable additional asset syncing
setting is enabled and there are some plugins/themes activated. (screenshot attached below)Plugin: cloudinary_wordpress
andCaller: update_meta_cache()
. (screenshot attached below)update_meta_cache
queries that come fromCloudinary\Assets->update_asset_paths()
as shown in the screenshot below.update_meta_cache
fromCloudinary\Assets->update_asset_paths()
shouldn't appear.Utils::is_rest_api()
can happen by using a REST API request as this onewp-json/wp/v2/posts/?_envelope&_wpnonce=<nonce>
-- the nonce can be got fromwp-admin/admin-ajax.php?action=rest-nonce
-- more info here.Enabled asset syncing

Postmeta queries
