0.2.2.5 Release Note

Posted on May 11, 2021

Since I already had mentioned about changes of 0.2.2.5 beta1 compared to 0.2.2.4.1 in the previous article, I don’t have much about the release version except for the compatibility of downloading IP address database zip files for Microsoft IIS from IP2Location.

Compatibility of unzip

In the previous version, I used native ZipArchive to unzip the IP address databases downloaded from IP2Location LITE ™.

But my user Greg reported the issue which was caused on windows IIS.

Thanks to the WP core contributors, I can use download_url() and unzip_file() that works fine on his Windows 2008 server as follows:

$zip = download_url( $url );
if ( !is_wp_error( $zip ) ) {
    WP_Filesystem();
    $result = unzip_file( $src, $dest_path );
    unlink( $zip );
}

According to this document, WordPress needs IIS 8.5, but Greg’s IIS is 7. So we’re lucky to say it turned out Okay in the end!

Bug fix: Restoring revisions

In WordPress, wp-admin/revision.php controls the revisions. But when you turn on “Prevent Zero-day Exploit”, comparing revisions didn’t work in the previous version 0.2.2.4.1 because of the lack of this plugin’s special nonce.

Rivisions

The revision data would be embeded into the page like follows:

{
    "author": {
        "avatar": "<img alt='' src='...' />",
        "id": 1,
        "name": "tokkonopapa"
    }, 
    "autosave": false,
    "current": false,
    "date": "May 29, 2016 @ 10:55",
    "dateShort": "29 May @ 10:55",
    "id": 34,
    "restoreUrl": "http://localhost/wp-admin/revision.php?revision=34&action=restore&_wpnonce=...",
    "timeAgo": "7 hours ago",
    "title": "Hello world!"
}

Now a special nonce is added to “restoreUrl” and comparing revisions works well.

Updating DBs on cron job in mutisite

How do you manage your multisite? Do you activate the plugins by “Network activate”? or activate the plugins via InfiniteWP client for each blog?

In the previous version, there was an issue that updating of IP address DBs by wp-cron were not excuted on each blog but only main blog when you select “network activate” on multisite.

Actually, it will do no harm. But when you look at the “Last update” of DBs, you would have doubts that cron might not work collectly.

So in this release, “Last update” will be synchronized with each blog when you “network activate” this plugin for all blogs collectively.

Final thought

Since I built up my application development environment on my local PC, I become to have a lot of things to test use cases especially about multisite and SSL configurations.

Basically, WordPress can handle both “Sub-directory” type and “Sub-domain” type for multisite. For example, we can find the URLs both https://wordpress.org/plugins/ and https://codex.wordpress.org/, and those are based on https://wordpress.org/. I don’t know these sites share the same WordPress core. But this flexibility as a CMS brings us huge advantage. Of couse, sometimes the flexibility leads to the complexity and it brings us developers the cause of the trouble emoji .