0.0.8 EnqueueAccessory optimizations
This version includes the following performance optimizations:
Block Registry Performance Optimizations
- Request-level caching for WP_Block_Type_Registry singleton: Eliminates repeated get_instance() calls during block registration
- Cached custom properties array: Optimizes array_diff_key() operations by caching flipped property arrays
- Cached asset mappings: Prevents recreation of static asset mapping arrays for every block
- WordPress block function availability caching: Reduces repeated function_exists() calls during block presence detection
- Three new protected caching methods: _get_block_registry(), _get_our_properties_flipped(), and _get_asset_mappings()
Asset Management Performance Improvements
- Request-level site_url() caching: Optimizes URL resolution logic by caching WordPress site_url() calls
- Enhanced test isolation: Improved test structure to account for request-level caching behavior
- Comprehensive performance documentation: Added detailed explanations of caching rationale and behavior
Testing Infrastructure Updates
- Split environment-specific tests: Separated test methods for better isolation and clarity
- Caching behavior documentation: Added test comments explaining request-level caching impact
- Improved test reliability: Enhanced test structure to work correctly with new caching patterns
Summary
- Provides significant performance improvements for block registration and asset processing operations
- Eliminates expensive repeated operations including singleton lookups, array operations, and WordPress function calls
- Maintains complete backward compatibility while optimizing hot code paths
- Particularly beneficial for sites with many blocks or frequent asset processing
- Transparent performance improvements with comprehensive documentation and testing
- Ready for production use with enhanced performance characteristics and maintained functionality