wp-rest-blocks icon indicating copy to clipboard operation
wp-rest-blocks copied to clipboard

Fix: Don't create pQuery instance unless $attributes['source'] isset.

Open tkjaergaard opened this issue 1 year ago • 0 comments

Right now on each get_attribute call a new instance of pQuery is created, but we don't use it unless the $attributes['source'] isset.

Moving the instance creation into the if statement should give performance improvements.

Locally is saw a ~50% speed improvement on simple blocks.

tkjaergaard avatar Jun 25 '24 09:06 tkjaergaard