WordPress 2.8: What’s new

After six months in preparation, the first beta version of WordPress 2.8 was released on 16 May 2009. Following WordPress 2.7, which focused mainly on the UI, WordPress 2.8 brings changes that are more evenly distributed across all areas. There are big improvements in the user interface, but there is a much larger amount of not immediately obvious improvements in two main areas:

  • Extensibility
  • Optimization/Performance

Also, many bug fixes and enhancements, big and small: This version saw more tickets opened and, most importantly, closed than any other version of WordPress before. The closed tickets are almost 800 at this moment. — All in all, WordPress 2.8 is a better tool than WordPress 2.7.

A NOTE ON COMPATIBILITY

In general, backward compatibility seems good. With two exceptions (one theme that broke itself and another that broke WordPress), all themes I’ve tried work well. Same with plugins: A few have problems but most work well. Of the about 20 plugins used in op111.net only one explicitly supports WP 2.8 at this moment; yet, all work without problems. (op111.net has been running on development snapshots of v. 2.8 since March.)

On to what’s new, in alphabetical order…

Accessibility improvements

WordPress 2.8 brings several improvements, big and small, to accessibility. A lot of work went into two areas in particular:

  1. Adding labels and alternative text to input elements that did not have them.
  2. Making the functionality of the new Widgets UI (more on that later) fully available without JavaScript.

Authentication: more pluggable

The authentication mechanism is now improved, so that authentication methods like OpenID and authorization methods like OAuth can cooperate easier with it (without replacing it and then having to deal with other issues). Read more:

Improvements in this area also pave the way for OAuth support in the core (which will probably come in ver. 2.9).

Columnification and pagination in Screen Options

Screen Options has two new options, depending on the type of screen:

  1. Number of columns
  2. Number of items per page

WordPress 2.8: Option to select number of columns in Dashboard

WordPress 2.8: Option to select number of columns in the Edit Post screen

WordPress 2.8: Option to select number of displayed items in Edit Pages

Items per page is the one I’ve found more useful, but I can imagine columnification would be very useful too in some situations, e.g. on a netbook with an 800×480 display.

CSS: new dynamic classes with body_class()

Dynamic CSS classes were first brought to WordPress by the innovative Sandbox of Scott Wallick and Andy Skelton, offering a simple way to modify to any extend the appearance of a WordPress site by CSS alone. They offer possibilities that would otherwise require JavaScript or PHP.

WordPress 2.7 added dynamic CSS classes for the post div(ision). Version 2.8 adds dynamic classes for the body element too. Both implementations were based on Sandbox.

For theme authors. To add this to a theme, simply open the body element like so:

<body <?php if (function_exists('body_class')) { body_class(); } ?>>

More on the body_class() function:

WordPress 2.8 and the body_class() function — Nathan Rice

Feed links for everything

WordPress 2.8 automatically adds feed links specific to the page viewed. For example, when you view the archive of the category Cooking, it adds a feed link for that category. When you view the archive for Lauthor Cyrus, it adds a feed link for that author, etc.:

WordPress 2.8: Automatic autodiscoverable feed links

FOR THEME AUTHORS. The two main feed links—all posts and all comments—are not added automatically. To let WP add them too, put the automatic_feed_links() function (defined in general-template.php) in your functions.php.

NOTE. Extra Feed Links, a plugin by scribu, adds the same functionality to earlier WP versions.

JavaScript at the bottom

JavaScript files properly registered via the script API can now be placed at the bottom of the page. In most cases this is preferable, because JavaScript blocks parallel downloads (browsers need to evaluate it before proceeding) and can delay the time by which a page is usable and also the time by which the rendering is complete. So, unless a JavaScript file needs to be at the top, it can be moved to the bottom for better performance.

FOR PLUGIN/THEME AUTHORS. This is done with a new optional argument in the wp_enqueue_script() function. The argument defaults to “false” (that is, not in the footer). To put a script in the footer, set the argument to “true”. E.g.:

wp_enqueue_script('script_handle', 'script/url/file.js', '', '', true);

More:

LiveJournal Importer: Redone and improved

Importing a LiveJournal blog into a WordPress 2.8 blog is easier and more complete thanks to the rewritten LiveJournal Importer, which uses the LiveJournal API. Read more:

The All-New LiveJournal Importer for WordPress « Dented Reality

Minification and concatenation of CSS and JS…

… or faster admin pages.

Most CSS and JavaScript files in the administration area are now concatenated (chained together into one file) and, depending on the server setup, compressed too. Javascript files are also minified. Using minification, concatenation and compression improves performance in two ways:

  1. The total size of files to get is reduced.
  2. The browser requests fewer files from the server.

This kind of optimization could prove even more beneficial to the frontend (the public part of a website). Of course, things can become more complex there, but the current impementation could serve as a testing ground for applying something similar to the frontend at a later time.

What is minification? Minification is the practice of removing from a file bits useful to humans but unneeded for machine execution, like comments, spaces, line breaks and indentation. On the web it is used mainly for CSS and JS files, to reduce the amount of bytes sent from the server to the browser.

Plugin Installer

The plugin browser/installer was first introduced in the previous version, six months ago. I’m including it here for two reasons:

  1. It seems it’s not very well known yet
  2. It’s been improved in v. 2.8. Meanwhile, the search mechanism of wordpress.org was improved too, and now the whole system works much better.

Here is how to install a plugin the new way:

WordPress 2.8: Installing a plugin, Step 1

WordPress 2.8: Installing a plugin, Step 2

WordPress 2.8: Installing a plugin, Step 3

WordPress 2.8: Installing a plugin, Step 4

WordPress 2.8: Installing a plugin, Step 5

WordPress 2.8: Installing a plugin, Done

Plugins management

The plugins manager was retouched, and is still being worked on at this writing. It now offers views/filters by plugin state, which I’ve found to be very convenient:

WordPress 2.8: Plugins management

Pretty permalinks for IIS 7

IIS 7, the current version of the Microsoft web server, recently got an official rewrite module and can now do URL rewriting like Apache does. WordPress 2.8 detects if the server is IIS 7 with the rewrite module and offers the option to use fully pretty permalinks with IIS 7 too — not just the semi-pretty ones with index.php in the middle. Read more:

IIS 7 URL Rewrite Module support in WordPress 2.8 : Ruslan’s Blog : The Official Microsoft IIS Site

Proxy support

Easy proxy support (without editing core files) had been missing from WordPress and was a frequent request. Now it is part of the WordPress HTTP API. You enable it by defining a few constants in wp-config.php.

The documentation for this, along with an example, can for now be found in the file wp-includes/http.php (look for the WP_HTTP_Proxy class).

Quotation marks locale-aware

WordPress has a smart typography filter that, among other things, replaces ASCII quotes—"like these"—with proper quotation marks “like these”. Before version 2.8 this filter only knew about quotation marks as used in American English. Now translators can specify the appropriate quotation marks for a language, and, if you use a localized version, they will be used instead. For example, «αβγδ» for Greek, „abcd“ for German, and so on and so forth.

Relational navigation links

A relational link in an HTML document points to another document and states its relation with the current document. Examples of such links that are used for navigation are “prev” (previous in a series) and “index” (index for current). Browsers can use them to offer an interface for navigation, much like they do when they show an icon/menu in the URL address bar for the feed links in a document.

WordPress 2.8 generates four types of relational navigation links: home, index, prev, next. If your browser supports such links (not many do, at least natively), you’ll be seeing them more often as WordPress sites upgrade to v. 2.8:

WordPress 2.8: Relational navigation links

An interesting possibility of relational links is that browsers can also use them as hints to prefetch (predownload) a page, cache it, and then serve it from the cache, for better speed. Firefox—the only browser that does link prefetching currentlydoes this with relational links of the type next. (I have not been able to verify if it works in WordPress sites.)

Smilies: Now faster!

Version 2.8 cuts in half the time needed to convert text smilies to image smilies! :-o The faster code is also availabe as a plugin for WordPress 2.7: Faster Smilies — Of course, you can always turn graphical smilies off in Settings › Writing › Formatting, and WordPress will be even faster!

Theme Installer

Installing themes in v. 2.8 is as quick and easy as installing plugins is in v. 2.7:

WordPress 2.8: Installing a theme, Step 1

WordPress 2.8: Installing a theme, Step 2

WordPress 2.8: Installing a theme, Step 3

WordPress 2.8: Installing a theme, Step 4

Theme/Plugin Editor with highlighting and lookup

I was never fond of this feature of WP: I don’t see any need for it and I also think that it encourages bad habits. But others like it. They’ll be happy to know that the theme/plugin editor is now improved, with syntax highlighting and function lookup:

WordPress 2.8: Theme and plugin editor

NOTE. In Chrome and Safari you’ll see the plain old text area without fancy colours. These two browsers (that share the same rendering engine) are not supported at the moment.

Timezone selection and DST

Settings › General had been displaying for a long time this apologetic message:

Unfortunately, you have to manually update this for Daylight Savings Time. Lame, we know, but will be fixed in the future.

Well, the future is here! Now you only need to enter your location:

WordPress 2.8 adjusts to DST automatically

NOTE. Automatic DST adjustment uses functions that were introduced in version 5.1.0 of PHP. So, you won’t see it if your server has an older version. (The minimum requirement to use WordPress remains PHP 4.3.)

Automatic Timezone is the plugin on which this enchancement was based. It adds the same functionality to WordPress 2.5, 2.6 and 2.7.

Widgets API: new and multiple-instance

Another part rewritten in v. 2.8 is the Widgets API. Writing widgets is now simpler and, importantly, widgets based on the new API are multiple-instance by default, like the Text/HTML widget in previous versions. (Writing multiple-instance widgets was already possible but convoluted.) Read more in this announcement by Ryan Boren:

New Widgets API – wp-hackers | Google Groups

As a bonus, the new function the_widget() lets you display the output of a widget anywhere in a template.

Widgets management UI: Redone, much improved

This took a lot of work and is, in my opinion, the most important improvement in the user interface of WordPress 2.8.

The new Widgets manager:

  1. Does everything by simple drag-and-drop (and is fully functional without JavaScript too).
  2. Has better memory/storage: You can deactivate a widget without losing its configuration, and widgets that are deactivated automatically retain their configurations too.

Also, thanks to the new Widgets API, widgets can now have multiple instances. You can add a widget as many times as you wish.

See the screenshots:

WordPress 2.8: Widgets management, Overview

WordPress 2.8: Widgets management, Contextual help

WordPress 2.8: Widgets management, Drag and drop

WordPress 2.8: Widgets management, Inactive Widgets area

That was it!

If you think I left out some important feature, please leave a comment to say so. If you want to try test versions of WordPress 2.8 as they come out, watch the official blog: wordpress.org/development — Usual warnings apply, of course: This is not a final product! Do not install on a live website unless you are prepared to spend time investigating and reporting bugs!

NOTE. The menu icons on the screenshots are not the default ones. If you like them, you can have them too!

/δκ

Changes