Performance when registering multiple blocks

Explore practical solutions to optimize last database operations.
Post Reply
mdsojolh444
Posts: 90
Joined: Tue Jan 07, 2025 5:26 am

Performance when registering multiple blocks

Post by mdsojolh444 »

The new wp_register_block_metadata_collection() function optimizes performance when registering multiple blocks. Plugins can use it to bundle their block metadata in a single PHP manifest file instead of processing individual block.json files for each block. Integration into existing development workflows is extremely simple: The @wordpress/scripts package automatically generates the required manifest files using the new build-blocks-manifest command - a feature that only WordPress Core itself could use until now. Outlook: Support for themes is being discussed. There are plans to extend the concept to theme.json files, which would improve performance, especially with extensive theme configurations.

Plugin Template Registration API
With the new Plugin Template Registration API, developers can for the first time register their own block templates directly via their plugins and thus integrate them into the site editor. This important function was previously reserved for themes. The new API makes the process particularly easy with two central functions: register_block_template() can be used to create templates, while unregister_block_template() removes them again if necessary. Developers define the template name and can specify cashapp database other parameters such as title, description, standard content and supported post types. The templates then appear seamlessly alongside all other templates in the site editor. At the same time, theme templates continue to take precedence over plugin templates: themes can therefore overwrite plugin templates if necessary.

loading lazy-loaded images
Lazy-loaded images are now loaded more intelligently: The new sizes="auto" function allows the browser to choose the exact image size from the srcset list as soon as the image scrolls into the visible area. Since the layout is already known at this point, the browser can determine the actual display width of the image and load the optimal version accordingly. WordPress now automatically adds "auto" to the sizes attribute for lazy-loaded images.

Data Views component
The "Data Views" component is a building block for the upcoming redesign of the backend and is ultimately intended to replace the previous list views. It is being developed step by step and will undergo various changes and improvements with WordPress 6.7. You can now adjust the column order in table views and change the density of grid views. In addition, the list views for pages show the author's avatar next to the publication status. In addition, combined fields can be displayed, e.g. page thumbnails next to the title.

This is just a selection of the numerous changes and improvements. As always, a good starting point for more in-depth research is the current “Field Guide” for the new WordPress version.

Conclusion
WordPress 6.7 impressively shows that the platform not only remains confident, but is also constantly being prepared for the future. The new default theme, which focuses on blogs and news sites, is a welcome sign that WordPress has not forgotten its roots - something that I, as a long-time user, am particularly pleased about. Anyone who has known WordPress since its inception, like me, will perhaps appreciate this as much as I do. With exciting features such as the "Zoom Out" mode and many small improvements, WordPress 6.7 also shows that it is well prepared for the next generation of web design.


Over 5,000 subscribers are already participating!
Our newsletter provides you once a month with WordPress insights, business tips & more!
First name
e-mail address*
I would like to subscribe to the newsletter to be informed about new blog posts, e-books, features and news about WordPress. I can revoke my consent at any time. Please note our privacy policy .

Subscribe now
Did you like the article?
With your rating you help us to improve our content even further.

Yes

No
Post Reply