Week In Core, July 12 – July 19 2016

Welcome back the latest issue of Week in Core, covering changes [38040-38110]. Here are the highlights:

  • 71 commits
  • 40 contributors
  • 82 tickets created
  • 7 tickets reopened
  • 78 tickets closed

Ticket numbers based on trac timeline for the period above. The following is a summary of commits, organized by component.

Code Changes

Accessibility

  • Improve keyboard navigation on the themes browser modal window [38084] #37383

Bundled Themes

Canonical

Comments

  • Use wp_strip_all_tags() to strip HTML tags [38092] #37208
  • Include comment_content with html and without in blacklist_keys comparison [38048] #37208
  • Strip html tags from comment content before blacklist_keys comparison [38047] #37208

Database

  • Add unit test to test that a column type change for a table name with a hyphen is working after [38044] #31679

Docs

  • Use the three-digit, x.x.x-style version in the DocBlock for the nested lowercase_octets() function. [38107] #32246
  • Add a missing DocBlock for the lowercase_octets() function, which is nested within redirect_canonical() [38106] #32246
  • Clarify the fields argument description in WP_Network_Query::__construct(). [38104] #32504
  • Clarify the fields argument description in WP_Site_Query::__construct(). [38103] #35791
  • Correct comment_max_links_url filter and $url param descriptions to communicate values are found links [38098] #37319
  • Correct type of WP_Post_Type::$cap from array to object. [38097] #36217
  • Correct $post parameter name and description for wp_attachment_is() and wp_attachment_is_image(). [38068] #37377
  • Update a cross-reference in the DocBlock for wp_register_plugin_realpath() from plugin_basename() to wp_normalize_path(). [38061] #37357
  • Add an initial since version to wp-includes/feed.php [38056] #32246, #36295
  • Update the default value for the optional $args parameter in get_networks() following [38055] #32504
  • Add and clarify changelog entries for elements that can now accept, use, or return WP_Post_Type objects [38051] #36217

Editor

  • Enqueue the wp-embed script to fix embed previews inside the media modal. [38062] #37334

Emoji

External Libraries

Filesystem API

HTTP API

  • Pass proxy settings to Requests [38054] #33055, #37107
  • Update Requests. Fixes an issue where you couldn’t set a Requests_Proxy_HTTP object as a proxy setting. [38053] #37107, #33055
  • Remove duplicate documentation for the http_api_debug hook. [38043] #37081

I18N

  • Remove non-translatable link attributes from translatable strings in wp_plugin_update_row(), wp_theme_update_row(), and get_theme_update_available() [38082] #36048
  • Combine duplicate “Menu Locations” and “Menu Options” strings. [38080] #18218
  • Combine two duplicate “Invalid post type” strings. [38076] #18218
  • Change unnecessary uppercased words in WP_Upgrader::generic_strings() to lower case. [38074] #18218
  • Combine two duplicate “Unable to locate WordPress Theme directory” strings. [38073] #18218
  • After [38057], consistently use a context for other instances of Activate %s,Network Activate %s, and Delete %s strings [38071] #37290
  • Remove a stray translator comment added in [38070] #37290

Import

Mail

Media

Meta

  • Ensure $wp_meta_keys is an array in get_registered_meta_keys(). [38108] #37415, #35658
  • Remove object subtype handling from register_meta() [38095] #35658
  • Ensure filters are backwards compatible for pre-4.6 style meta registration [38041] #35658

Multisite

  • Correct default value for orderby in WP_Network_Query::__construct() [38102] #32504
  • Correct default values for orderby and order in WP_Site_Query::__construct() [38085] #35791
  • Set default $args to an empty array in get_networks() [38042] #32504

Permalinks

  • In wp_install_maybe_enable_pretty_permalinks() [38109] #36628
  • Rename $usingpi to $using_index_permalinks for clarity. [38067] #37380
  • After [37747], make sure $usingpi, $writable, and $update_required are defined before checking them on permalinks update.

Plugins

  • Use the correct admin screen when searching for plugins via Ajax [38091] #37373

Readme

  • Link to the Plugin Developer Handbook on DevHub as the primary resource for information on extending WordPress [38105] #37399

Role/Capability

  • Introduce capability tests for non-logged-in users. [38096] #37405

Script Loader

  • Limit resource hinting to enqueued assets [38100] #37385
  • Increase priority of wp_resource_hints() so hints get printed before scripts and styles [38046] #37317

Taxonomy

  • Improve back compat of values passed to ‘terms_clauses’ filter [38099] #37378
  • Correct WP_Error usage in WP_Tax_Query::clean_query() and WP_Tax_Query::transform_query(). [38079] #37389
  • On term.php, use $taxnow when fetching currently edited term. #37205. [38069] #37205

Text Changes

  • Change Network deactivate %s to upper case, for consistency with Network Activate %s. [38081] #37290
  • Add a full stop to “Invalid taxonomy” and “Invalid term ID” strings, for consistency with similar post-related messages. [38077] #18218, #32329
  • After [37297], replace two more instances of “WordPress.org Plugin Directory” with “WordPress Plugin Directory”.

TinyMCE

  • Replace the editor iframe title on MacOS to fix the help shortcut. [38110] #36863

Twenty Thirteen

  • Fix selective refresh of Masonry-laid out widgets by deferring initialization until DOM ready [38083] #37390

Unit Tests

Update/Install

  • Give context to some install/update strings to allow for differentiation between theme and plugin translations. [38057] #37290

Users

  • Update help text for user-new.php to remove reference to sending passwords via email. [38064] #36763

WP Mail

Props

Thanks to @ramiy, @afercia, @alleynoah, @ambrosey, @anneschmidt, @azaozz, @boonebgorges, @bpetty, @celloexpressions, @cfinke, @Clorith, @dabnpits, @davidakennedy, @dlh, @DrewAPicture, @flixos, @flixos90, @iandunn, @jeremyfelt, @joemcgill, @johnbillion, @karmatosed, @morganestes, @ocean90, @pbearne, @pento, @peterwilsoncc, @rachelbaker, @ramiy, @rmccue, @ruudjoyo, @SergeyBiryukov, @stephenharris, @swissspidy, @szepeviktor, @underdude, @vishalkakadiya, @westonruter, and @zuige for their contributions!

#4-6, #week-in-core

Week in Core: Sept. 28 – Oct. 11, 2015

Welcome back to the latest issue of Week in Core, covering changes from Sept. 28 – Oct. 11, 2015, changesets [34659][35029]. Here are the highlights:

https://make.wordpress.org/core/2015/10/07/%F0%9F%8E%89-one-more-committer-for-4-4/

See that ↑ right there? That’s an oEmbed. And it’s loaded from inside this site.

Feature Plugins Merged

The Responsive Images, oEmbed Provider, and the “baby” REST API feature plugins have been merged into core. Grab the latest version of trunk and test them out.

WordPress logo with wordmark below

Responsive images in your posts. Just upload and insert!

Potent Notables

These changes were big enough to merit their own blog posts:

Deeper Reading

Some commits pack in a lot of info, from detailed background to best practices in using hooks. Here are a few worth reading the entire commit message:

  • WP_Term class introduced [34997] #14162
  • Fix scalability performance problem for previewing multidimensional settings in the Customizer. [35007] #32103
  • Ensure that wp.customize.Widgets.savedWidgetIds is defined up front. [34883] #33901
  • The history and implementation of oEmbeds. [34903] #32522
  • Improve role-related arguments in WP_User_Query. [34875] #22212
  • Use wp_installing() instead of WP_INSTALLING constant. [34828] #31130
  • Introduce *_network_option functions for Multisite installs. [34777] #28290
  • Ensure that comment permalinks reflect pagination. [34735] #34068, #34073

Continue reading

#4-4, #week-in-core

Last Week in WordPress Core

Hi there! Welcome to Last Week in WordPress Core for the week of March 3–9. By now, you’ve heard that WordPress 3.9 Beta 1 is available! Thank you for your hard work this last week. Now we’re done adding new enhancements, and on to bugs. Your help is appreciated as we continue to test and squash bugs on the way to a stable RC.

There are a couple important things that landed on Monday that are not covered in this post, but shipped in beta. Namely, please test the Theme Install screen refresh and the ability to crop headers from within the Customizer.

Admin:

  • Widgets: Add widget management to the customizer. This brings in the Widget Customizer plugin. [27419] #27112
  • Admin Menu: Introduce a .dashicons-before CSS class and use it in the admin menu. Lets you use a Dashicon before an element without copying the entire .dashicons styling to your :before styling. [27418] [27425] [27444] [27482] #26630
  • Editor: Show “View Post” for any post the author can read. This expands it to private posts and matches the logic in the toolbar. [27483] #27059

Media:

  • First pass at bringing the Image Editor into the media modal. Please test me! [27445] #21811
  • First pass adding a loading indicator to the Media Library. [27438] #24859
  • Allow $crop in add_image_size() and set_post_thumbnail_size() to receive crop anchors (top, left, right, bottom, center). [27472] #19393.
  • Add subtitle support to Video editing in the Media Modal. [27481] #27016
  • Do not output default gallery styles if the theme has opted into HTML5 galleries. [27396] #27045; see #26697
  • Add a class attribute to the caption shortcode to allow additional classes to be specified. [27404] #25295
  • Add playlist_styles and wp_playlist_scripts filters to allow users to roll their own playlist themes. [27486] #26631 & [27488] #26631

TinyMCE:

  • Update TinyMCE to 4.0.18. [27387] #24067
  • Add TinyMCE placeholders for audio and video shortcodes and provide a UI to both edit shortcode attributes and replace the src media file in an audio or video shortcode. Also, a flurry of improvements and fixes to them, visible in the full changelog. [27411] #27016
  • Add a Ctrl+K shortcut to open the linking dialog, which is the “de-facto standard”. [27449] #27305
  • Add the <hr> plugin and button to the toolbar. [27428] #27159
  • With drag-and-drop uploading, support multiple editor instances, limit to IE10+, and other small fixes. [27378] [27372] [27464] #19845
  • When parsing a caption shortcode, recreate missing width attributes using the image tag’s width. [27426] #23103
  • Restore the “link” button state to disabled by default and enabled when text or image is selected. Remove the (recently added) default link plugin; not needed. [27447] #27309

Templates:

  • Add has-post-thumbnail as a post class. [27429] #18804
  • Rename the new page_templates filter to theme_page_templates, and pass it a post object for proper context. [27470] [27471] #13265
  • Introduce get_the_permalink() as an alias for get_permalink(). This better aligns it with other the_* and get_the_* function pairs. [27409] #24164
  • Let get_the_date() accept a post object. [27380] #13771
  • Add the ability to short-circuit wp_nav_menu() via the pre_wp_nav_menu hook. [27386] #23627
  • Better plural handling for labels in wp_generate_tag_cloud() / wp_tag_cloud(). [27376] #27262, see #7989, #14424

Multisite:

  • Incremental improvements and bug fixes with the multisite load process. Please test your networks! [27406] [27439] [27407] #27003
  • Fix bulk activation of network-only plugins. [27413] #26487

Query:

  • Add has_password and post_password query variables to WP_Query. has_password true means posts with passwords, false means posts without. post_password can query for posts with a particular password. [27395] #20308
  • Allow a posts_per_rss query variable to be set to override the posts_per_rss option. [27456] [27455] #25380
  • Allow get_page_by_path() and get_page_by_title() to accept an array of post types. [27423] #24763

Internals:

  • Allow for custom authentication handlers for all requests. Turn the logic used by wp_get_current_user() into a determine_current_user filter. [27484] #26706
  • Allow the role attribute in kses for all elements. [27388] #24098
  • Add a pre_set_theme_mod_$name filter to set_theme_mod(), modeled after pre_update_option_$option in update_option(). [27393] [27402] #14721.
  • Improve HHVM compatibility by eliminating some of our last remaining create_function() calls and making OBJECT a case sensitive constant. [27373] [27374] [27465] #14424 [27377] #27231
  • Pass $reassign parameter to delete_user and deleted_user actions. [27462] [27466] #23057
  • Bail early from shortcode functions if no delimiter is present. It’s the little things; performance results on-ticket. [27394] #23855
  • Update PHPMailer to 5.2.7 from 5.2.4. Includes two trivial modifications for WordPress (no impact to plugin developers); see the commit message. [27385] #25560
  • Use SSL when linking to WordPress.org. [27469] #27115

For the complete list of commits to trunk, check out the log on Trac. Interested in joining in? Write or test a patch for 3.9.

Thanks to @adamsilverstein, @akeda, @avryl, @bassgang, @bigdawggi, @bobbravo2, @bpetty, @bradt, @celloexpressions, @coffee2code, @danielbachhuber, @dd32, @DJPaul, @DrewAPicture, @empireoflight, @ericlewis, @ericmann, @frank-klein, @gcorne, @genkisan, @gradyetc, @hakre, @Hanni, @Jayjdk, @jenmylo, @johnregan3, @jorbin, @JoshuaAbenazer, @kadamwhite, @kasparsd, @Kopepasah, @kovshenin, @kpdesign, @lpointet, @markjaquith, @mcadwell, @melchoyce, @michael-arestad, @mikecorkum, @mordauk, @nacin, @obenland, @Otto42, @pavelevap, @Rarst, @rhyswynne, @ricardocorreia, @rmccue, @robmiller, @seanchayes, @SergeyBiryukov, @shaunandrews, @simonwheatley, @sirzooro, @tanner-m, @TobiasBg, @tomauger, @topher1kenobe, @topquarky, @toszcze, @westonruter, @wokamoto, @wonderboymusic, @zbtirrell, and @zodiac1978 for their efforts this week!

#3-9, #week-in-core

Brainstorming ticket reports

One thing I’d like to work on is improve our reports on Trac with the hope we can better manage the ticket queues. We currently have about 50 reports on Trac. Many of them were created in a push 5-6 years ago to build reports around keywords. A number of others are one-offs created in the last few years for specific use cases. In reality, few of these are ever used on a day-to-day basis.

I checked the access logs to get an idea of the most popular reports. Besides the first six reports (my favorite “home base” is report 6), they are report 16 (“Needs Patch”), report 18 (“Blockers for Releases”), and report 21 (“Latest Tickets”).

What I’d like to do is brainstorm all sorts of new reports we should have. How can we make what we have better? I’ll then go to work about implementing them. Dream big — if the data’s there, I’ll figure out the gnarly SQL required. We can also think about how we can improve columns, grouping, ordering, etc. If you have a concept for a report but aren’t sure how we’d query for those tickets, toss the idea out there and maybe someone will add to it.

I’l probably design a new /report screen so it’s not just a list ordered by something random like when the report was created, and so we can highlight important reports, group similar reports together, and put less emphasis on some of the more specialized ones.

Here are some half-baked ideas, to start us off:

  • Open tickets without a response. Find all tickets where no one has commented, or where only the reporter has commented. This would create a punchlist of tickets to review. (Ideally, the report should always be empty.) The ability to group or filter this by component would be helpful, for contributors who specialize in and want to take responsibility for different areas.
  • Report of “dead” tickets. Tickets that haven’t been modified in four years are ripe for action and/or closure. We should empty a report of this nature, then reduce it to 3.5 years, then 3 years, etc.
  • Good first bugs. A report of all tickets marked as a good first bug. (None yet, as the keyword is new.) Next steps: How can we best identify these kinds of tickets?
  • Report of “untriaged” tickets. Our milestones have gotten out of hand, which is something we should discuss. Tickets should immediately leave “Awaiting Review” once they’ve been initially reviewed, but then not forgotten about if they are shifted to “Future Release”. Let’s figure out metrics for what makes a ticket “untriaged”. We could create a simple UI to filter by component for a report like this. We currently have Tickets Awaiting Review which groups tickets by the “Version” they were reported against — maybe this is a good start.

What’s your idea?

#reporting, #trac

Widgets Area Chooser – 3.8 Proposal

Placing widgets with drag-and-drop can be tedious and annoying — especially if you have lots of sidebars on which to drop widgets. The Widgets team has been working on a few solutions (for this problem, and more), including redesigning the wp-admin widgets interface and adding the ability to manage widgets from within the customizer. These projects are still ongoing, and not ready for 3.8. However, along the way we’ve found a few incremental changes which improve the overall experience of working with widgets. Some of these improvements have made their way into MP6. Others involve more functional changes which don’t belong in MP6. This plugin is one of those improvements.

The Widgets Area Chooser is available at: https://wordpress.org/plugins/widget-area-chooser/

The Problem
Dragging widgets from the available widgets in the top-left, to a sidebar “below the fold” is hard. Almost impossible. Dragging widgets on a touch screen device is also difficult.

The Solution
Clicking (or tapping) on an available widget brings up a list of available sidebars that you can place the widget in to — its pretty simple, and works great on touch devices.

Accessibility
There’s also the accessibility problems that drag-and-drop introduces, which necessitates the need for the separate (and often neglected) Accessibility Mode. This plugin provides a much easier way for those with screen readers to add new widgets without having to drag-and-drop. In fact, this could be the first step towards removing the need for an Accessibility Mode for widgets.

Demonstration
Here’s what the chooser looks like:

Here’s a quick video of the plugin in action:

Please let us know what you think!

#3-8, #widgets

Omnisearch / Global Admin Search, Final Pitch

Plugin: https://wordpress.org/plugins/omnisearch/
Diff: https://cloudup.com/cC6IbXxoHXN

Previous posts:
https://make.wordpress.org/core/2013/08/14/present-your-3-8-feature-idea-at-tomorrows-meeting/#comment-9948
https://make.wordpress.org/core/2013/08/30/omnisearch/
https://make.wordpress.org/core/2013/10/08/omnisearch-user-testing/

IRC chats in #wordpress-core-plugins:
https://irclogs.wordpress.org/chanlog.php?channel=wordpress-core-plugins&day=2013-08-30&sort=asc#m21304
https://irclogs.wordpress.org/chanlog.php?channel=wordpress-core-plugins&day=2013-09-12&sort=asc#m23506
https://irclogs.wordpress.org/chanlog.php?channel=wordpress-core-plugins&day=2013-09-19&sort=asc#m24911
https://irclogs.wordpress.org/chanlog.php?channel=wordpress-core-plugins&day=2013-09-26&sort=asc#m25942
https://irclogs.wordpress.org/chanlog.php?channel=wordpress-core-plugins&day=2013-10-10&sort=asc#m27386

We were a small, but scrappy group. It was mostly myself, @japh, and @lessbloat.

Omnisearch currently adds three ways to search.

  • A Dashboard Widget:
    Omnisearch Dashboard Widget
  • An admin page under the Dashboard:
    Omnisearch Admin Page
  • And as a search box on  the adminbar — when you’re on the admin side of the site:
    Omnisearch Admin Bar

All three turn up the same results page:

Omnisearch Results Page

And all is happy with the world.

We were trying to solve the proliferation of different search forms for different data structures in the admin.  When trying to find content, it’s inconvenient and difficult to always navigate to the right data structure and then search it — especially if you’re unsure if something was in a comment or a post (all too frequent in p2s)– and you just want to pull in all relevant results.

Other things we’d considered were potentially adding an Alfred-like pop-up modal where you could enter omnisearches, and see results from the menus on the page that happen to match — very much like WP Butler’s current functionality.  We opted not to add it in this pass, though, figuring better to keep a slimmer implementation.

Our user testing confirmed that this was a definite win.  In fact, the user even remarked that there should be a centralized search when we had them running through the initial steps where they were to search each data structure independently, before activating Omnisearch and seeing how that compared.

We’re eager to hear any feedback on code, methods, or even name.  I’ve had some people mention that they’d prefer it have a less ‘marketing’ name, and more of a generalized “Global Admin Search”.  I prefer Omnisearch for brevity, but would love to hear some discussion on the pros and cons of whether it would be better to use a more general name.

#3-8, #core-plugins, #feature-plugins, #omnisearch, #proposal

Trac updates and a design refresh

Every few months we make a few improvements to Trac. Given how many hours so many of us spend on there, even the smallest changes can make a big difference. Today, a few new changes were deployed.

The first thing you’ll notice is a design refresh, from @helenyhou and @ocean90. It cools down the colors a bit and places more of our own mark on it (more WP-like, less Trac-y). They also added responsiveness for mobile devices, and made some adjustments to improve readability. See #18211. If you notice any bugs or quirks, please leave a comment there.

From @iammattthomas, the WordPress logo is now HiDPI.

If you’re a bug gardener (i.e. you can change milestones, etc.), you can now change the resolution of a closed ticket. This should make @sergeybiryukov happy — no more re-open to re-close.

Over the last few weeks I’ve given more than a dozen people bug gardener status. We’d like to empower the people we know and trust to make decisions, while making Trac simpler for others.

For those who aren’t bug gardeners, we’re trying to make it as easy and streamlined as possible for you to create and contribute to tickets. @bpetty has been studying our workflow and recommending changes. One of those is we’ve hidden the ability to change ownership of a ticket (accept/assign/reviewing). A big issue with ownership is it sometimes discourages others from contributing. I hope this change can free us up to using that field for tracking responsibility and accountability.

Non-gardeners can also no longer label tickets a “task”. Also, once the Version field is set, a user can’t update the field to a newer version, only an older one. (As @sergeybiryukov says, “version number indicates when the bug was initially introduced/reported.” It’s the earliest known affected version for a bug, or the earliest applicable version for an enhancement.)

And finally, if you add the “has-patch” keyword to a ticket, “needs-patch” will automatically be removed, and vice versa. (It’s the little things.)

I hope you enjoy this round of changes. If you have any further suggestions, please share in the comments.

Bonus. A few weeks ago, we added a ticket graph, inspired by jQuery and using their plugin as a base. I hope to add some more functionality to this in the future. For now, a few of us are using it to study trends and come up with some new ideas for how we can best maintain the ticket queues.

#trac