External Library updates in WordPress 5.5: call for testing

Edit 7/1/20: The post initially indicated that a minified version of Moment.js was now included in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. This was incorrect, a minified version has always been included, but as a direct copy from upstream. That copy now has a sourceMappingURL reference (which is not desired). For that reason, the library is now minified in the Core build process instead. That sentence was removed to prevent confusion. Props @sergeybiryukov for catching that.

Edit 7/2/20: After this note was published, new versions of the Moment.js and getID3 libraries were committed. The version updates for each have been adjusted appropriately.


WordPress 5.5 is currently slated to bring some long awaited updates to a handful of external libraries bundled with Core. A few of the updates are particularly large, and while backwards compatibility measures were taken, they could potentially require adjustments to plugins, themes, and custom code. For that reason, this developer note also doubles as a call for testing.

Please help test these library updates, and report back any bugs to help ensure that no edge cases were missed during the initial testing.

You can test these changes by installing the WordPress Beta Tester pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party (choose the “bleeding edgebleeding edge The latest revision of the software, generally in development and often unstable. Also known as trunk. nightlies” option), or download the nightly package directly (regenerated from trunk daily).


Remember, running the nightly version of WordPress is not recommended for production environments. Consider setting up a local development environment to test instead.


A full list of External Library tickets can be found on Trac, but below are the library updates currently slated to ship with WordPress 5.5, including all of the details you need to be aware of. The libraries that require an extra keen attention to detail are marked “please test”.

PHPMailer (please test)

Because of conflicting PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 support policies (support for PHP < 5.5 in was dropped in newer versions of the PHPMailer library), WordPress Core has been stuck on the 5.x version of PHPMailer for quite some time, even though a newer, 6.x version exists. However, now that WordPress only officially supports PHP back to version 5.6.20, PHPMailer can finally be updated.

This is a major update to the library. Please help by testing this update to ensure any edge cases are discovered.

Plugins that appear to be utilizing the library will soon receive an email to test their code. Below is what you need to know about the changes as they relate to WordPress Core.

Note: this is not an exhaustive list. For a more complete list of changes, please consult the Upgrading from PHPMailer 5.2 to 6.0 guide.

New file locations

To makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). updating the library easier, the PHPMailer files have been moved into the wp-includes/PHPMailer directory. The old files will remain for backwards compatibility and load the new corresponding files, but loading them will now throw a _deprecated_file() warning.

  • wp-includes/class-phpmailer.php is replaced by wp-includes/PHPMailer/PHPMailer.php.
  • wp-includes/class-smtp.php is replaced by wp-includes/PHPMailer/SMTP.php.

Additionally, the phpmailerException class is now separated into its own file, wp-includes/PHPMailer/Exception.php (previously, it was included at the bottom of the class-phpmailer.php file). When loading the PHPMailer library, the Exception.php file is required, and should also be loaded. If the old class-phpmailer.php file is loaded, the exception class will be loaded automatically to minimize failures.

New PHPMailer namespace

In past versions, the PHPMailer class existed within the global space. However, moving forward, the PHPMailer library is under the new PHPMailer\PHPMailer namespace. Below is an example of the old usage, and an example of the new way to utilize the library.

Old method

<?php
require_once ABSPATH . WPINC . '/class-phpmailer.php;
$phpmailer_instance = new PHPMailer();

New methods

Both examples will produce identical results.

<?php
use PHPMailer\PHPMailer\PHPMailer;
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php;
require_once ABSPATH . WPINC . '/PHPMailer/Exception.php;
$phpmailer_instance = new PHPMailer();
<?php
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php;
require_once ABSPATH . WPINC . '/PHPMailer/Exception.php;
$phpmailer_instance = new PHPMailer\PHPMailer\PHPMailer();

Similar changes must also be made when utilizing the PHPMailer Exception class.

The old classes have been registered as aliases of the new, properly namespaced classes using class_alias() in PHP (this is true for the PHPMailer, phpmailerException and SMTP classes). This means that a plugin containing code similar to the “old method” will continue to work seamlessly until it can be updated (with the exception of the _deprecated_file() notice).

Note: the aliases will only exist if the old, deprecated files are included. A plugin relying on Core to load the PHPMailer library will not have an alias present as the new files are now loaded instead.

Deprecated elements have been removed

Another big change in the 6.x update was the removal of all deprecated properties and methods. A full list of removed elements can be found in the upgrade guide.

Plugins using PHPMailer

All plugins that appear to be utilizing PHPMailer will soon be receiving an email notification to test their code and make any necessary adjustments.


For more information, check out the full list of changes included with this update, the PHPMailer 6.0 upgrade guide, or the related TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets (#41750, #50379, #50380).

SimplePie (please test)

SimplePie is a RSS and Atom feed framework bundled with WordPress Core to handle the consumption of RSS and Atom feeds. The library has remained largely untouched for several years, but has been updated from version 1.3.1 to the latest version (1.5.5) for WordPress 5.5.

This update includes bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fixes, compatibility fixes for newer versions of PHP, added support for additional date formats, and minor improvements to ensure that feeds continue to be parsed correctly. Support for caching feed data to Redis and Memcached has also been added.

It is highly recommended that you test your code if your sitesite (versus network, blog) fetches and processes RSS/Atom feeds.

Plugin authors were previously notified to test their code against the 1.5.5 update in early May, and the authors of plugins that were identified as using SimplePie should have received an additional follow up email. While no issues have been reported so far, it’s still possible that there may be undiscovered edge cases.

For more information, check out the full list of changes in SimplePie 1.3.1 to 1.5.5, or the related Trac ticketticket Created for both bug reports and feature development on the bug tracker. (#36669).

Twemoji

Earlier this year, the Unicode Consortium announced that Emoji v13.0 had been finalized. In addition to the 62 brand new emojis that were added, 55 gender and skin-tone variants were also added.

Platforms will begin rolling out native support later this year. But why wait? The Twemoji library has already been updated to support the new emojis, and that update will be included in WordPress 5.5.

So start spicing up your blogblog (versus network, site) about ninja (🥷) techniques, using tamales (🫔) and olives (🫒) on your food blog, and beavers (🦫) or polar bears (🐻‍❄️) on your wildlife blog.

For more information, check out the full list of new emojis added in Emoji v13.0, the Twemoji 13.0 release notes, or the corresponding ticket on Trac (#50148).

Masonry & imagesLoaded

The Masonry library has been updated from version v3.3.2 to 4.2.2, and the related imagesLoaded library has been updated from v3.2.0 to v4.1.4.

The biggest change in this update is the removal of support for IE versions 8 & 9. Core has not supported these versions of IE since WordPress 4.8, but if supporting these versions of Internet Explorer is important to your user base, please explore enqueuing your own versions of these libraries instead.

For more information, check out the full list of changes in Masonry, the full list of changes in imagesLoaded, or the related Trac ticket (#37675).

getID3

The getID3 library has been updated from version v1.9.18 to v1.9.20. This is a minor update that fixed several bugs. These fixes included one that caused a PHP notice when using PHP 7.4 and processing MP3 audio files.

For more information, check out the full list of changes in getID3 or the related Trac ticket (#49945).

Moment.js

The Moment.js library has been updated from version 2.22.2 to 2.27.0. For more information, check out the full list of changes in Moment.js, or the related Trac ticket (#50408).

clipboard.js

The clipboard.js library has been updated from version v2.0.4 to v2.0.6. For more information, check out the related Trac ticket (#50306).

Props @earnjam for technical review, @newyorkerlaura and @justinahinon for proof reading.

#5-5, #dev-notes, #external-libraries

WordPress 5.3: Backbone Upgrade Guide

In WordPress 5.3, the version of Backbone bundled with WordPress will be updated from v1.3.3 to v1.4.0. Developers who override on and off events on their models may run into a few issues if they have listenTo events being applied to them.

Consider the example below:

// Model
class Model extends Backbone.Model {
    initialize() {
        this.collection = new Backbone.Collection()
    }

    on() {
        this.collection.on.apply( this.collection, arguments )
    }

    off() {
        this.collection.off.apply( this.collection, arguments )
    }
}

// View
class View extends Backbone.View {
    initialize() {
        this.listenTo( this.model, 'event-name', null )
    }
}

// Create an instance of Model and View
const model = new Model()
new View( { model } )

// Remove callbacks from model
model.off();

A TypeError will now be thrown at model.off, as when the model’s callbacks are removed, Backbone attempts to remove the set of listeners applied to the model as well. These sets of listeners are no longer on the model, but instead are on the model’s collection.

The reason for this is because Backbone now uses the listened object’s public on method when applying the listenedTo event, and in the example above, the on event will be applied to model.collection. A simple fix to this error is to instead pass model.collection as the object to be listened to.

For a full list of changes in this releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software., see the Backbone Changelog. For reference on this update, see the TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. #47478.

Props @adamsilverstein and @desrosj for peer review.

#5-3, #dev-notes, #external-libraries

External library updates in 4.6

The following are external libraries that have been updated during the 4.6 releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software. cycle.

Masonry

Masonry was updated to version 3.3.2 from version 3.1.4 (#32802). Notable changes:

  • jQuery events are now triggered.
  • CommonJS is supported.
  • Percentages can now be used for horizontal positions.
  • Various browser compatibility issues are now resolved.

Full Changelog: https://github.com/desandro/masonry/releases

imagesLoaded

imagesLoaded was updated to version 3.2.0 from version 3.1.4 (#32802). Notable changes:

  • Background images are now supported.
  • setTimeout no longer triggers multiple events errantly.
  • Internal cache has been removed. Each image will now be checked.
  • Various browser compatibility issues are now resolved.

Full Changelog: https://github.com/desandro/imagesloaded/releases

NOTE: imagesLoaded and Masonry are now in separate files. This means that imagesLoaded can be enqueued without Masonry being enqueued. For backward compatibility reasons, imagesLoaded remains a dependency for Masonry.

MediaElement.js

MediaElement.js was updated to version 2.22.0 from version 2.18.1 (#36759, #37363). Notable changes:

  • Several YouTube embed issues have been resolved.
  • More Vimeo APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. support added.
  • A few a11yAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility) and i18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill. issues have been fixed.
  • General stability enhancements.

Full Changelog: https://github.com/johndyer/mediaelement/blob/2.22.0/changelog.md

TinyMCE

TinyMCE was updated to version 4.4.1 from version 4.3.10 (#37225, #37327, #37476). Notable changes:

  • Various contentEditable bugs fixed.
  • Various browser compatibility bugs fixed.
  • General stability and performance enhancements.

Full Changelog: https://github.com/tinymce/tinymce/blob/4.4.1/changelog.txt

Backbone.js

Backbone.js was updated to version 1.3.3 from 1.2.3 (#37099). Notable changes:

  • 4 major regressions were fixed.
  • Added findIndex and findLastIndex Underscore methods to Collection.
  • Added options.changes to Collection “update” event which includes added, merged, and removed models.
  • Removed component package support.

Full Changelog: https://cdn.rawgit.com/jashkenas/backbone/1.3.3/index.html#changelog

#4-6, #dev-notes, #external-libraries

jQuery UI datepicker localization in 4.6

In WordPress 4.6 (#29420) localization defaults were added for the jQuery UI datepicker based on the current localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English. using the new wp_add_inline_script() function. With 4.6 you can enqueue the datepicker and you are set. It works out of the box.

Instead of using the language files from the jQuery UI project the necessary information, mainly from the WP_Locale class, is directly passed to the datepicker. The list of localized information: closeText, currentText, monthNames, monthNamesShort, nextText, prevText, dayNames, dayNamesShort, dayNamesMin, dateFormat, firstDay, and isRTL.

If you are using the files from jQuery UIUI User interface in your theme or pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party, please be aware of this change. With 4.6 you can omit calling these files and enqueue the default datepicker which will use the built-in defaults from WordPress.

If you want to change the defaults or add custom settings, you can still use all the arguments from the datepicker. WordPress only sets sane defaults for the chosen locale. But you should check if jQuery UI datepicker is enqueued and you should check if the browser is showing a native datepicker (like Chrome).

@ipstenu has scanned the plugin repo for plugins including the jQuery UI files. The following plugins can be changed to use WordPress’ own translations.

Advanced Booking Calendar, Albo Pretorio On line, Altos Toolbar, AWPCP – Classifieds Plugin, Appointment Calendar, Banner Garden Plugin for WordPress, BBS e-Popup, Beaverlodge Maintenance, Beaverlodge Menu Styler, BigContact Contact Page, Blog Post Calendar Widget, Booking Calendar Contact Form, Events Calendar, Class Booking, Contact Form 7 IE DatePicker and Number Spinner Fix, Custom fields, Datepicker i18n, Easy Calendar, EEXCESS, Event Post Type, Events Made Easy, Events Manager, Social Marketing Scheduler, FormCraft – Form Builder, Date Picker in List Fields for Gravity Forms, Gravity Forms (Spanish), Gravity Forms (nl), inquiry form creator, Jet Event System for BuddyPress, JQuery Accessible Accordion, JQuery Accessible Autocomplete, JQuery Accessible Button, JQuery Accessible Carousel, JQuery Accessible Checkbox, JQuery Accessible Datepicker, JQuery Accessible Dialog, JQuery Accessible Menu, JQuery Accessible Progressbar, JQuery Accessible Slider, JQuery Accessible Tabs, JQuery Accessible Tooltip, JQuery Accessible Tree, Js-appointment, LearnPress – WordPress LMS Plugin, LePress, List Urls, Livemesh SiteOrigin Widgets, Lodgix.com Vacation Rental Listing, Management & Booking Plugin, MailChimp List Subscribe Form, Social Media Share Buttons | MashShare, Member Register, Membership 2, Meta Collections, mind-body, Tribulant Newsletters, Orbis, Order Delivery Date for WooCommerce, OpenWebAnalytics, Pay2Post, PDF Catalog, Pronamic Events, RPB Calendar, Vinum Master Tracking Plugin, Simple Ads Manager, Simple Photos Contest, Sk Multi Tag, Solidres – Hotel booking plugin for WordPress, Cubilis Fastbooker, Surbma – Datepicker localization for Gravity Forms, teachPress, TemplatesNext ToolKit, TheNextTable, Toolset Types, Uiform – Cost Estimation & Payment Form Builder, Uiform – Form Builder, Vacation Rentals, Video Central for WordPress, Visual Form Builder, Webagency Widget – Website builder, WEeventscalendar, WooCommerce Checkout Manager, WooCommerce Quick Donation, WP Agenda, WP-AMD – Global JS and CSS handling, WP Any Form, WP Contact Slider, wp-creator-calculator, WP-CRM – Customer Relations Management for WordPress, WP FEvents Book, wp-greet, WP-Invoice – Web Invoice and Billing, WP Maintenance, WP Online Store, WP-Property – WordPress Powered Real Estate and Property Management, Wp-Recall, WP Scripts Updater, WP Swiper, wpShopGermany Free, and XO Event Calendar.

#4-6, #dev-notes, #external-libraries, #i18n

jQuery Updates in WordPress 4.5

jQuery was updated from version 1.11.3 to 1.12.2, see [36285], [36680], and [37070].
At the same time jQuery Migrate – the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party to detect and restore APIs or features that have been deprecated in jQuery – was updated from 1.2.1 to 1.4.0 ([36285] and [37072]).

The non-minified version of jQuery Migrate throws a few more warnings now. See some examples from coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. in [36286-36288].

🔬 Please test your plugins and themes with the non-minified version to makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). them compatible with future versions of jQuery.

Ticketticket Created for both bug reports and feature development on the bug tracker.: #35380

#4-5, #dev-notes, #external-libraries

jQuery UI and wpdialogs in WordPress 3.9

WordPress 3.9 does not use the “wpdialogs” TinyMCE pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party as part of the TinyMCE 4.0 update ( #16284, #24067), which comes with a new dialog manager. (For more, see this post and their migration guide.) This was a jQuery UIUI User interface wrapper we had introduced back in WP 3.1. If you were using this in your own scripts, please be sure you are setting “wpdialogs” as a script dependency.

If you were using jQuery UI for anything on the post screen, please be sure you are setting this as a script dependency.

In both cases you may need to enqueue the “wp-jquery-ui-dialog” stylesheet, if you are using the WP UI dialog design.

#3-9, #dev-notes, #editor, #external-libraries