WordPress 4.8.1 release delayed by one day

The 4.8.1 release was due out today (August 1st), however a performance problem was raised during release preparations. Specifically, the ticket in question is #35293 and its problematic commit on the 4.8 branch has now been reverted, while the changes remain on trunk. A performance fix is pending in #41501, and it may be part of a subsequent 4.8.2 minor release.

We’ve re-scheduled the 4.8.1 release to occur after the core dev chat tomorrow, at August 2nd, 21:00 UTC.

In the mean time, please continue testing the release. A new 4.8.1-RC2 package (ZIP) has been published for you to triple check on your test environments. For more information on testing, see Beta Testing. The 4.8.1-RC2 release contains 29 maintenance fixes and enhancements since 4.8.0, chief among them are fixes to the rich Text widget and the introduction of the Custom HTML widget. For a full list of changes in the release, consult the tickets closed and the changesets committed.


Fixes to Text widget and introduction of Custom HTML widget in 4.8.1

The 4.8 release caused issues for many sites that had custom HTML in Text widgets, which until now had been common practice. So we’ve been working hard on fixes in the 4.8.1 release which aim to simultaneously serve the needs of novice users and advanced users alike: the rich Text widget (introduced in 4.8), a legacy mode for the Text widget, and a Custom HTML widget.

For more background on the changes in 4.8, see Addition of TinyMCE to the Text Widget. To review, the Text widget in 4.8 includes TinyMCE—the same visual editor used for writing post content—and it looks like:

Text Widget Legacy Mode

The issues with the introduction of TinyMCE to the Text widget revolve around the ways that TinyMCE attempts to clean up HTML code by deleting empty elements (such as those for dashicons) and dropping attributes it may not recognize (such as HTML5 Microdata attributes). Also with the 4.8’s removal of the “automatically add paragraphs” checkbox, there were also issues related to paragraphs and line breaks being added incorrectly.

Note that the Text widget was already designed to preserve the old behavior of the widget until it was modified and thus upgraded, so there are many instances of Text widgets in the wild today that could very well begin to break upon being modified. For this reason the issues were not reported right away and instead started to trickle in steadily after the release.

There were various solutions that were considered, but the one that had the consensus among contributors was:

[Check if the Text widget] was previously saved from an older version of WordPress before TinyMCE was added to the Text widget. If it is such a pre-existing Text widget instance, then use heuristics to detect if TinyMCE would negatively impact the contents of the widget, including the auto-p checkbox being unchecked, whether there are empty tags, and whether there are spandivscript, or style tags. When the Text widget is in this legacy mode, it can have a notice that informs users of the new HTML Code widget and that it should be used going forward. Likewise, in the new mode when TinyMCE is present, when the Text (HTML) tab is selected, there can be a note (perhaps an admin pointer) that encourages users to use the HTML Code widget instead. By implementing this, novice users with basic content in their widgets win, and advanced users with custom HTML content in their widgets will cease from being negatively impacted.

The Text widget in legacy mode looks the same as the Text widget before 4.8, but with the addition of a new notice:

The legacy mode will only be presented for widgets created prior to 4.8.0 that have instance data which match the logic in the WP_Widget_Text::is_legacy_instance() method. The legacy mode will not be presented to newly created Text widgets. Once a Text widget is opened and saved in legacy mode, it will permanently stay in legacy mode. There is a new instance property called “visual” which will be set to false when a widget is saved in legacy mode. When a new Text widget is created, it is opened in the default visual mode and the new instance will get saved with visual=true.

Text Widget Filters

There is a change in how the filter instance property was used in 4.8.0: in that release, when a Text widget was modified, the fact that it had been upgraded was stored by overloading the filter boolean property to also have the value of "content", indicating that the widget gets content filters applied like a post does. Since this string is a truthy value, I reasoned it would normally work the same in filters that check ! empty( $instance['filter'] ), but it would fail in cases where a plugin tried true === $instance['filter']. So 4.8.1 reverts the overloading of the filter property to again be a boolean, and this should improve compatibility for widget_text filters. Whenever a Text widget is modified with the default visual mode (with TinyMCE) it will get both visual=true and filter=true saved in its instance. When a Text widget is modified in the legacy mode, it will always get visual=false and its filter property will reflect the checked state of the auto-paragraph checkbox.

Another note on filters: special consideration was made for shortcodes in the Text widget given the frequency of plugins and themes adding shortcode support (since the widget does not recognized them by default in core). Plugins and themes have done add_filter( 'widget_text', 'do_shortcode' ) to add support. Since the widget_text filter applies before the new widget_text_content filter (as of 4.8), it will apply before wpautop will have applied, resulting in the possibility of extra line breaks being added undesirably if the shortcode output has new line characters. So to help prevent that from happening, the Text widget will temporarily move the do_shortcode handler from widget_text to widget_text_content just in time while the filters are being applied. See the relevant logic.

Help Pointers

For users who are accustomed to pasting HTML into the Text widget, when an attempt is made to paste markup into the visual editor a pointer will be displayed informing them that they should paste it into the Text tab instead, or to alternatively use the new Custom HTML widget (see section below):

Likewise, when a user opens the Text tab, it will also open a pointer to inform them of the Custom HTML widget:

While pointers are normally displayed on upgrades, these pointers will be displayed even on new installs since they reflect changes to long-standing behavior for the Text widget that users have become accustomed to. Any tutorials that instruct users to use the Text widget for pasting in arbitrary HTML should be updated to instruct the users to select the Custom HTML widget instead.

Custom HTML Widget

For advanced users or for any use case where arbitrary HTML needs to be displayed in a widget (such as a signup form or a 3rd party JavaScript widget), there is now a dedicated “Custom HTML” widget that is specifically for this purpose. It looks very similar to the classic Text widget, except it has a monospace font and it lacks the auto-paragraph checkbox:

Since users are prompted (per the pointers above) to try using the Custom HTML widget instead of the Text widget for some use cases, it is important that the widget content be able to be freely copied between the Text widget and the Custom HTML widget. For this reason, the Custom HTML widget retains the application of the widget_text filters like the Text widget does. The type of widget for which the filter is applying can be determined by looking at the type of the WP_Widget instance being passed as the last filter argument. When the widget_text filter is applied, it will pass the second $instance parameter in the same format as the Text widget, with title, text (instead of content), and filter and visual properties that are always both set to false (as if the instance was in legacy non-visual mode). In addition to re-applying the widget_text filter, the Custom HTML widget has a dedicated widget_custom_html_content filter whereas the the Text widget has a dedicated widget_text_content filter.

In addition to filter compatibility, the Custom HTML widget also tries to retain theme styling compatibility by using the same widget_text CSS class name on the outer widget wrapper and textwidget on the inner wrapper around the content itself. For any themes that wish to style the Custom HTML widget alone, there are the widget_custom_html and custom-html-widget class names used on the outer and inner wrapper elements respectively. For themes that wish to style the Text widget alone and exclude the Custom HTML widget, the :not() pseudo selector can be used, for example .widget_text:not(.widget_custom_html) and .textwidget:not(.custom-html-widget) for the outer and inner wrappers, respectively.

The markup generated by a Custom HTML widget on the frontend will look like:

<section id="custom_html-6" class="widget_text widget widget_custom_html">
  <h2 class="widget-title">My Title</h2>
  <div class="textwidget custom-html-widget">My Content</div>

This same Custom HTML widget’s instance data will look like:

  "title": "My Title",
  "content": "My Content"

For more specifics on the Custom HTML widget, refer to the subclass: WP_Widget_Custom_HTML.

Here is a list of tickets related to the Text widget and Custom HTML widget which are closed in the 4.8.1 release:

  • #40907: Introduce widget dedicated for HTML code
  • #40951: New Text Widget – Switching Between Visual/Text Editor Strips Out Code
  • #40960: Set `’filter’ => ‘content’` on starter content “business info” widget
  • #40960: Widgets: The Text widget should respect the “Disable the visual editor when writing” setting
  • #40972: TinyMCE editor in Text widget does not have RTL contents
  • #40974: Updated text widget do not save text (when using paste)
  • #40986: Widgets: text widget and media widgets cannot be edited in accessibility mode
  • #41021: Text widget does not show Title field or TinyMCE editor
  • #41158:  Increase tinymce panel z-index
  • #41361: Text widget can raise JS error if customize-base is enqueued on widgets admin screen
  • #41386: Text Widget – Wording – Legacy Mode 4.8.1 beta
  • #41392: Theme styles for Text widget do not apply to Custom HTML widget
  • #41394: Text widget: Rename legacy mode to visual mode and improve back-compat for widget_text filters


#4-8-1, #dev-notes, #tinymce, #widgets

Dev Chat Summary: July 26th (4.8.1 week 6)

This post summarizes the dev chat meeting from July 26th (agendaSlack archive).

4.8.1 RC feedback & release timing

  • No issues on the widgets front
  • Those who reported breakage from 4.8 widget changes and have tested RC have said the fixes work
  • @westonruter to write a dev note
  • @westonruter and @obenland to work on 4.8.1 release on Tuesday, August 1st as per previous plan
  • @obenland to work with @pento or @azaozz on walk thru for releasing a minor version
  • Post-4.8.1 release action item: get more committers access & training on releasing / Mission Control

Editor / Gutenberg media intricacies

  • Last Fridays’ release of 0.6 slipped due to vacations, working to push it out as soon as feasible
  • Several media intricacies that could use help / discussion, especially Issue#1986
  • 100 PRs open that could use help in reviewing/testing
  • Gutenberg part of weekly agenda of #core-media meeting (Thursdays at 18:00 UTC)

General announcements

#4-8-1, #core, #dev-chat, #summary

Dev Chat Agenda for July 26th (4.8.1 week 6)

This is the agenda for the weekly dev meeting on July 26, 2017 at 20:00 UTC / July 26, 2017 at 20:00 UTC:

  • 4.8.1 RC feedback & release timing
  • Editor / Gutenberg media intricacies
  • General announcements

If you have anything to propose to add to the agenda or specific items related to the above, please leave a comment below. See you there!

#4-8-1, #agenda, #core, #dev-chat

Dev Chat Summary: July 19th (4.8.1 week 5)

This post summarizes the dev chat meeting from July 19th (agendaSlack archive).

4.8.1 schedule

  • Access to Mission Control was lacking and delayed 4.8.1 beta release
  • Working to commit #40974, #38964, #40794 for 4.8.1 beta
  • Final planned bug scrub is Thursday, July 20th 16:00 UTC / Thursday, July 20th 16:00 UTC
  • Bug scrub will be focused on punting anything not headed towards a commit by Friday
  • If tickets in milestone drops to zero, we will continue with the planned 4.8.1 schedule:
    • RC – Monday, July 24th (hard string freeze)
    • Launch – Tuesday, August 1st

General announcements

#4-8-1, #core, #dev-chat, #summary

Dev Chat Agenda for July 19th (4.8.1 week 5)

This is the agenda for the weekly dev meeting on July 19, 2017 at 20:00 UTC / July 19, 2017 at 20:00 UTC:

  • 4.8.1 timing
  • 4.8.1 Beta help needed (support with Mission Control)
  • General announcements

If you have anything to propose to add to the agenda or specific items related to the above, please leave a comment below. See you there!

#4-8-1, #agenda, #core, #dev-chat

4.8.1 Bug Scrubs (part deux)

The following bug scrubs have been scheduled on tickets milestoned for 4.8.1 and the conversation will take place in #core:

Reminder of the timeline for 4.8.1 is Beta on Monday, July 17th (soft string freeze), RC on Monday, July 24th (hard string freeze), and launch on Tuesday, August 1st. In order to support that, we’ll be aiming for 0 tickets in the milestone by RC so we’ll be heavily focused on punting tickets out of the milestone.

#4-8-1, #bug-scrub

Dev Chat Summary: July 12th (4.8.1 week 4)

This post summarizes the dev chat meeting from July 12th (agendaSlack archive).

4.8.1 planning

  • @westonruter to commit #40951: Add legacy mode to Text widget to trunk, all trunk commits need to be merged into the 4.8 branch
  • Custom HTML widget needs to be amended to an existing file to be part of the minor release, agreement to utilize wp-includes/default-widgets.php solely for the benefit of 4.8.x
  • Testing, especially #40907 and #40951 (testing steps)
  • Beta – Monday, July 17th (soft string freeze, translations begin on about a dozen strings)
  • RC – Monday, July 24th (hard string freeze)
  • Launch – Tuesday, August 1st (🎉)

Editor / Gutenberg

General announcements

#4-8-1, #core, #dev-chat, #summary

Dev Chat Agenda for July 12th (4.8.1 week 4)

This is the agenda for the weekly dev meeting on July 12, 2017 at 20:00 UTC:

  • 4.8.1 planning (beta, RC, translations, launch)
  • Editor / Gutenberg update
  • General announcements

If you have anything to propose to add to the agenda or specific items related to the above, please leave a comment below. See you there!

#4-8-1, #agenda, #core, #dev-chat

4.8.1 Bug Scrubs

The following bug scrubs have been scheduled on tickets milestoned for 4.8.1 and the conversation will take place in #core.:

Reminder of the tentative timeline for 4.8.1 is the last week of July so we’ll be heavily focused on punting tickets out of the milestone to ensure it’s clean ahead of the intended launch timeframe.

#4-8-1, #bug-scrub