Five-Five Release notes

Published Categorized as WordPress Releases

While I was doing quick GoDaddy Pro retrospective in one of their zoom meetups, I was asked to help WP Marketing team with same topic.

Questions I got from the Marketing team, and I tried to help with answers and making some changes more clear for everyone.

Plugin deployment

When do I need to deploy plugin manually?

Some plugins you created or you bought might not be available on the WP.org repo, and do not have a mechanism for auto-update.

Now you can simply upload a plugin and if the version is increased, it would be updated.

If zip file will have an error or during installation error will accrue, do I lose the working version of this plugin?

No, as with other plugin updates, and if update fails, you will not lose your plugin.

What types of archives are supported to upload plugins?
Currently, only ZIP archives are supported for theme/plugin upload/update

If the plugin is only one file, do I need to zip it to install?

WordPress allows only for ZIP archive files to be uploaded as themes or plugins. This leads to the fact that even if you have a single-file theme or plugin you have to archive it.

What will be if a new version of a plugin will not be compatible with WordPress or the current environment, how can I reverse installation?

As with any upgrade of WordPress, plugin or theme make a backup. It will save you hours and bucks and it takes moments to generate.

Test your plugin on your development / staging environment so you will not end up with broken plugin.

If you end up with a broken plugin on your installation you will not be able to restore it without the use of additional plugins.

Can be custom plugins installed automatically from developers repository?

Not without additional “help” from plugins. However, with a new feature that allows for plugin and theme updates, you can download the ZIP archive from Github, Gitlab, Bitbucket, or another software of your preference for code versioning.

Lazy loading

Is it possible, that current lazy loading implementation will have compatibility problems with plugins that are handling image loading differently for their own purposes?

Most of the plugins or any 3rd party integration are using javascript-based lazy loading. The new lazy loading feature that is getting into WordPress core is browser-based, and there are no implications of possible compatibility issues.

However, having 2 lazy loading available at same time calls for testing before any production changes if you have a website where you do use lazy loading.

How to decide what to use, new native implementation or plugin?

If you do not have any specifics regarding lazy loading, and your website is not graphic heavy with plenty of javascript running around your course of implementation might be a native one. However, if you do have intense graphic elements, custom made javascript transitions, etc on your website, you might consider using a plugin or even better, custom made javascript implementation.

Block Patterns

What is Block Pattern?

To make it stupid simple block patterns are groups of blocks set in certain way, predefined and coded in WordPress core.

Can I download Block Patterns from somewhere?

Currently, block patterns can be added as hard as installing new plugin.
However, there might be some time before we get to a point that there is a separate repository for block patterns.

Is it possible to use Block Patterns combined with Block Plugins?

If coded as such, block patterns can use any of blocks available in your WordPress installation.

Can you delete Block Pattern?

As mentioned before, block patterns are defined in core.
They can’t be deleted, but they can be unregistered.
While this is developer approach only, function to be used is

unregister_block_pattern

Do my page will be broken in I will delate Block Pattern?

Since block pattern is a set of blocks defined in a certain order that is constantly repeated, but at its core it still uses blocks, and as such, if block pattern is deleted from installation no changes what so ever would be made on your website.

How to find if Block Pattern is used somewhere in a site?

Block patterns are not identified on page itself, so even if the block pattern is used on-page, there is no identification on that very page that block pattern has been used for certain page content.

Can I rework Block Pattern and will it affect my pages?

If the block pattern changes after it has been created and added to the page those changes would not be affected on existing pages using that block pattern.

Environment variables & type

Why do I need environment variables?

Using environment variables makes it easier to move same installation across servers (production, staging, development). While this looks like it is mostly developer-oriented feature, it helps end users too.

With using environment variables it means more easy we can move installation between testing/staging environments and production one.

How can I send EV to a template?

If you really have to, there are ways to pull in environment variables in your template. However, templates should be and stay env agnostic, meaning they do no change based on environment.

If you need to pass anything to template (header, footer, template part) rather than using env variable in template itself, you might want to try using arguments for those template files.

This can be done by using same functions as before. However, now those simple functions do allow for arguments to be passed on.

Grab env variable in your “class”, generate associative array and pass that array to template. Try to avoid checking for env variable in template itself.

In which cases I need to use EV and when it’s better to use WP_Cache, global variables, custom function, or object?

This will depend on your implementation and specific problem you are dealing with here.

Environment type – big thing or small update?

It might look like something minor, but the introduction of env type is something that can bring great benefits, especially with WordPress’s specialized hosting services.

Theme and plugin authors will not have to “hijack” or “hack” into log files and they will have an easy and simple way to have logs available “out-of-the-box”.

In order for this to become a big thing hosting companies will have to take this seriously, as it can be up to them to popularize env in WordPress.

On top of all this, environment variables would relay on this too.

switch ( wp_get_environment_type() ) {
    case 'development':
        do_nothing();
        break;
     
    case 'staging':
        do_staging_thing();
        break;
     
    default:
        do_production_thing();
        break;
}

REST-API changes

In which cases update to WP 5.5 can have problems with REST-API functionality and what to do if it will happen?

If you are using plugins with custom REST API endpoints, or you have theme/plugin you designed yourself check permission_callback.

For example:

register_rest_route(
    'my-ns',
    'echo',
    array(
        'methods'  => WP_REST_Server::EDITABLE,
        'callback' => function ( WP_REST_Request $request ) {
            return new WP_REST_Response( $request->get_param( 'echo' ) );
        },
    )
);

In given example above permission_callback is omitted. If you have similar case in your plugin you might experience error being returned when opening your rest endpoint

The REST API route definition for my-ns/echo is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback.

As stated in error it would be thrown, you can simply add one line in case you have public endpoint

register_rest_route(
    'my-ns',
    'echo',
    array(
        'methods'  => WP_REST_Server::EDITABLE,
        'callback' => function ( WP_REST_Request $request ) {
            return new WP_REST_Response( $request->get_param( 'echo' ) );
        },
        'permission_callback' => '__return_true',
    )
);

If you have endpoint that requires for user to be logged and have proper privileges you might want to use “current_user_can” function.

register_rest_route(
    'my-ns',
    'echo',
    array(
        'methods'  => WP_REST_Server::EDITABLE,
        'callback' => function ( WP_REST_Request $request ) {
            return new WP_REST_Response( $request->get_param( 'echo' ) );
        },
        'permission_callback' => function( WP_REST_Request $request ) {
            return current_user_can( 'manage_options' );
        },
    )
);

PHP support

Are there any changes in currently supported versions of PHP?

Looking into Site Health tab, the minimum recommended version of PHP is 7.4. So no changes there.

PHP 8 is coming in November 2020. When we can expect this version in Core support and what plugin/themes developers need to do about it?

This might be the next big thing.
The first thing that will interest everyone is what would be broken if PHP is updated from 7.4 to 8.

In theory – nothing.
If you’ve kept up to date with the latest releases though, the upgrade shouldn’t be too hard, since most breaking changes were deprecated before in the 7.*

Everything should be working as it was. PHP 8 might bring a new developer’s perspective on background processing and scheduled jobs?

Welcome JIT (The JIT — just in time — compiler promises significant performance improvements, albeit not always within the context of web requests. There haven’t been any accurate benchmarks done at this point, but they sure will come.)


These questions were made by WordPress Marketing team for the release of WordPress 5.5