Search the site:

Copyright 2010 - 2024 @ DevriX - All rights reserved.

WordPress 5.7 “Esperanza”: Major Updates for 40% of the Web

WordPress 5.7 "Esperanza": Major Updates for 40% of the Web

The official WordPress 5.7 “Esperanza” release is here and brings major updates for 40% of the world web. Named after the inspiring jazz bassists Esperanza Spalding, it comes with important editor updates and long-awaited enhancements to the core.

The release squad, led by WordPress co-founder Matt Mullenweg, has been working hard to ensure both users and developers would benefit from the new features and fixed issues.

“Esperanza” is the first of four major core releases scheduled to take place this year and sets the tone for what we could expect from our favorite open-source software in 2021. This year, WP plans to allow website owners to make a full site editing available via Gutenberg, so we will see further improvements in this direction.

What else? Well, the additional 66 enhancements and feature requests and over 130 bug fixes to the core in the 5.7 version will surely make developers happy.

One of them is the continuous cleanup after the jQuery 3.5.1 update as the next step to the complete removal of jQuery Migrate. “Esperanza” also comes with streamlined URL migration to HTTPS and new Robots API.

Let’s see in detail what’s new about the “Esperanza” release:

Refined Gutenberg Editor UI and Functionalities

The highlight of the “Esperanza” version are the massive developments in the block editor. WordPress users would now enjoy a refined interface of the Gutenberg version 9.9, as well as many bug fixes and improvements. It combines the work of seven patches (versions from 9.3 to 9.9) into one and also update from versions 10.0 и 10.1.

Blocks and patterns can now be easily dragged straight from the inserter and added into posts and pages. The editor also provides more block variations and options for customization and switching between them.

block-variations

Source: WordPress

Justification settings have also been introduced for inner button blocks that can be implemented using display:flex instead of previously used display:block. Following the launch of these various alignment options, WP recommends that theme developers check that everything is correctly displayed for users.

Many other improvements can be seen in the new 5.7 version, including full height alignment for blocks, enhancements to the usability and stability of reusable blocks as well as options to change font size in many more places.

reusable blocks

Source: WordPress

Introducing Lazy-Loading iframes

Following the introduction of lazy-loading images in the 5.5 “Eckstine” release from August 2020, in the “Esperanza” update WP brings even more performance improvements with setting lazy-loading as default to iframe tags.

This means that embedded media via iframes won’t be loaded until the user approaches the viewport thus ensuring a better website performance and smoother user experience.

To avoid negative effects on the layout shifting, the setting loading="lazy" will apply to iframe tags with both height and width dimensions set. WordPress will add by default the attribute to iframes within post content, excerpts and widgets using the wp_filter_content_tags() function, also presented in the 5.5 update.

The introduction of this functionality is coming right before Google’s Core Web Vitals core algorithm update set to be unrolled in May. It plans to set the page experience quality signals as a top-ranking factor and has put a lot of pressure on website owners to get their properties in line on time. The Cumulative Layout Shift is one of the metrics that will provide information about the visual stability of sites. It refers to the jumping of the page that happens when a piece of content or ads are loading outside the viewport, causing shifts and misclicks on the user’s end.

HTTP to HTTPS Migration from the Dashboard

“Esperanza” also comes with a number of enhancements added to simplify the URL migration from HTTP to HTTPS. The 5.7 version introduces a new function wp_is_using_https(), which checks if both the Site Address (home_url()) and WordPress Address (site_url()) are set to use HTTPS and returns true if indicated so. This mechanism detects the whole website, meaning both the frontend and the backend.

Another new function wp_is_https_supported() will check if the environment already supports HTTPS. If so, in the upgraded interface of the Site Health panel, under the HTTPS Status section, will appear a new recommendation with a button to switch directly (using wp_update_urls_to_https()). This is a huge step ahead in easing the migration to HTTPS as it’s usually a process done through the hosting panel.

Moreover, the tedious work of replacing hard-coded URLs in the database which still use the HTTP version is now simplified with a single click.

site health status https wordpress

Source: WordPress

“Esperanza” introduces the wp_replace_insecure_home_url() function that relies on wp_should_replace_insecure_home_url() and both check whether to run the URL replacement logic and change to HTTPS the insecure link addresses or not.

A New Streamlined Color Palette

In line with the WCAG 2.0 AA recommended contrast ratio for more accessible design, WordPress 5.7 comes with a standardized color palette, consisting of seven main colors and 56 shades.

All color codes used in the existing CSS Core classes are associated with the new palette and contributors are encouraged to use it to ensure better design decisions.

WordPress 5.7 Color Palette

Source: WordPress

A new PostCSS tool is also available to developers that makes it easy to convert any colors in your CSS to the closest one in the 5.7 palette by replacing or creating a new CSS file.

Post Parent Related Functions

Two new functions for determining if a post has a parent and to identify the related one have been added to WordPress 5.7.

The new template tag get_post_parent() can accept one parameter – it could be a post ID or a WP_Post object. It is using by default the global variable $post if available and retrieves the parent WP_Post object for the particular post.

Another new conditional tag is has_post_parent()that can also accept one of these parameters and by default uses a global variable $post if available. If the post has a parent it returns true or false if not.

Learn more about how this new feature works here.

jQuery 3.5.1 Update Cleanup Continues

As the jQuery cleanup continues, you will see less deprecations in the core and more user-friendly and easy-to-understand messages and notifications.

The three-step plan to update the jQuery library was announced in June 2020 and is now in its last phase that includes removing the jQuery Migrate plugin.

You can find more details about the plan to update jQuery and the three-steps plan here as well as follow the planned updates for WordPress 5.8 here.

New Robots API

The new Robots API gives developers the possibility to centralize the management of the content of the robots meta tag injected into the page. It also features a toggle option to allow search engines to display large media from your website site. In the 5.7 release, a max-image-preview:large directive is now being added by default to allow large image previews to be shown in search results

More Improvements to the Core

A new export specific filter for post titles makes it now possible to export posts and excerpts without unwanted behaviors that can cause changes to the title, data loss or import issues.

What’s new in 5.7 is that the current the_title_rss filter is replaced with a new one the_title_export, which can be used to export content more precisely.

Introducing post_modified and post_modified_gmt fields in export files that will add the last modified date of each post. This feature has been included to help identify the latest version of a post and would allow the setting of an import logic related to the updates and revisions of existing pages and posts.

Updates on items in the navigation menu are now possible using the wp_update_nav_menu_item() function that makes use of the newly introduced wp_resolve_post_date(), allowing the setting a specific value instead of just “now” and ensures better performance for menu items imports.

“Esperanza” brings more advanced and important changes related to the REST API, the Data API and Gutenberg. You can see more about them here:

What Else Is New?

WordPress 5.7 is full of goodies both for users and developers alike.

Some of the other newer features include introducing a manual password reset link option for web admins, as well as improvements in the UI of the reset password screen by adding two separate buttons – “Generate Password” and “Save Password”.

wp57-login-password-reset

Source: WordPress

Developers can also make use of the new filters and functions for lost passwords that allow custom validations using more data.

And All that Jazz

If you haven’t updated your website with the newest WordPress release, it’s about time you play a Esperanza Spalding song and get the most out of the latest improvements.