A Week in Core – November 8, 2021

Welcome back to a new issue of Week in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Let’s take a look at what changed on TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. between November 1 and November 8, 2021.

  • 60 commits
  • 115 contributors
  • 45 tickets created
  • 5 tickets reopened
  • 35 tickets closed

The Core team is currently working on the next point (5.8.2) and major (5.9) releases 🛠

Worth noting that each feature slated to the 5.9 milestone has been validated, that the Twenty Twenty-Two Theme development is on the way, and the 5.9 bug scrub schedule has been published 🚀

Ticketticket Created for both bug reports and feature development on the bug tracker. numbers are based on the Trac timeline for the period above. The following is a summary of commits, organized by component and/or focus.

Code changes

Administration

  • Make dashboard widgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. control submit button text more clear – #54229
  • reword some “we” usages – #46057

Application Passwords

  • display guiding text & link in user-edit.php when unavailable – #53658

Build/Test Tools

  • Add end-to-end (e2e) tests for edit posts page – #49507
  • Add missing @covers and visibility for Tests_Admin_includesMisc#39265
  • Add missing @covers tags for Tests_Admin_includesFile#39265
  • Add missing @covers tags for Tests_Admin_includesListTable#39265
  • Introduce local visual regressionregression A software bug that breaks or degrades something that previously worked. Regressions are often treated as critical bugs or blockers. Recent regressions may be given higher priorities. A "3.6 regression" would be a bug in 3.6 that worked as intended in 3.5. testing – #49606
  • Pass workflow outcome to SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. Notifications – #53363
  • Restore changes to package.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.#54054
  • Restore the https URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org for browserify-aes#54054
  • Remove polyfills from blockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. view scripts – #53690
  • Clean up the $_REQUEST superglobal in WP_UnitTestCase_Base::clean_up_global_scope()#53363
  • Correct @covers tags in WP_Comments_List_Table tests – #39265
  • Split WP_Posts_List_Table and WP_Comments_List_Table tests into two separate files for clarity – #53363

Bundled Themes

  • TwentySixteen – correct invalidinvalid A resolution on the bug tracker (and generally common in software development, sometimes also notabug) that indicates the ticket is not a bug, is a support request, or is generally invalid. CSSCSS Cascading Style Sheets. font-style value – #46807
  • Add privacy policy link to Twenty Twenty footer – #53446
  • Ensure logo displays in CustomizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings. previewer – #51337
  • Remove the “role” attribute on HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. elements with a default landmark role – #54079

Code Modernization

  • Pass correct default value to http_build_query() in get_core_checksums() and wp_version_check()#54229

Coding Standards

  • Add public visibility to methods in tests/phpunit/includes/#54177
  • Add visibility to methods in tests/phpunit/tests/#54177
  • Consistently escape attribute in wp-admin/themes.php#54256
  • Fix some WPCSWPCS The collection of PHP_CodeSniffer rules (sniffs) used to format and validate PHP code developed for WordPress according to the WordPress Coding Standards. May also be an acronym referring to the Accessibility, PHP, JavaScript, CSS, HTML, etc. coding standards as published in the WordPress Coding Standards Handbook. errors and warnings in wp-admin/user-edit.php#53658
  • Move wp-includes/class-http.php to wp-includes/class-wp-http.php#54389, #53359
  • Rename the $strResponse argument to $str_response in WP_Http::processResponse()#53359

Comments

  • Add noopener noreferrer to author links in list table – #40916
  • Avoid reparenting during post deletion – #37703
  • Mark comment text field as required – #16206
  • remove bespoke truncation from search string HTML – #17636
  • attempt to clarify intent of “Default post settings” section – #54300

Customize

  • Fix focus() to collapse child panels and show parent panel – #34436
  • Make range controls full width – #54329

Docs

  • Clarify the path usage register_block_type_from_metadata – #53806
  • Fix some docblockdocblock (phpdoc, xref, inline docs) syntax errors and add a missing canonical reference – #53399, #52867, #38942, #53668
  • Various docblock improvements and corrections – #53399

Editor

  • Update structure of title element for editing – #52314

External Libraries

  • Update the Iris color picker to version 1.1.1 – #54224

General

  • Remove the svn:executable property from wp-admin/_index.php#54321

Help/About

  • Improve the Welcome text in wp-admin/_index.php#54321
  • Improve typography in the Welcome to your WordPress Dashboard! text – #54321
  • Simplifies WordPress version in “Help” sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme.#47848
  • add WordPress version to contextual “Help” sidebar area – #47848

Media

  • Add filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. for post thumbnail id – #23983
  • Add filter for post thumbnail url – #40547
  • Adjust alt text info link text – #48939
  • Remove security messaging in media upload failures – #53626
  • Use WP_Query::get() method to retrieve the posts_per_page value in wp_ajax_query_attachments()#54129

Menus

  • Include 960 exact pixel width in collapse measurements – #54210

Permalinks

  • Sanitize non-visible characters inside sanitize_title_with_dashes()#47912

Posts/Post Types

  • Add filter to is_post_type_viewable()#49628

REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/.

  • Add URL Details endpoint – #54358
  • Allow sidebars and their widgets to be public – #53915
  • Improve translations, comments, and readability in URL Details endpoint – #54358
  • Support subdirectory themes in the Themes controller – #54349

Site Health

  • Add the constant WP_ENVIRONMENT_TYPE for debug data – #54340
  • Site Health: Update the icon used when no issues are reported – #53980

Themes

  • Introduce get_header_image_tag_attributes hook – #38942

Widgets

  • Add filter to disable RSS widget icon – #52224
  • Remove unused CSS breaking wp_text_diff layout – #54140

Props

Thanks to the 115 people who contributed to WordPress Core on Trac last week: @audrasjb (15), @hellofromTonya (14), @sabernhardt (14), @costdev (8), @sergeybiryukov (6), @jrf (6), @peterwilsoncc (5), @justinahinon (4), @johnbillion (4), @andraganescu (4), @mukesh27 (4), @joedolson (3), @sabbirshouvo (3), @hareesh-pillai (3), @marybaum (3), @pbearne (3), @SergeyBiryukov (3), @johnjamesjacoby (2), @swissspidy (2), @youknowriad (2), @talldanwp (2), @hellofromtonya (2), @knutsp (2), @azaozz (2), @isabel_brison (2), @spacedmonkey (2), @webcommsat (2), @dlh (2), @karmatosed (2), @afercia (2), @antpb (2), @desrosj (2), @iluy (2), @mai21 (2), @tobifjellner (1), @danfarrow (1), @mnelson4 (1), @donmhico (1), @noisysocks (1), @netweb (1), @shaunandrews (1), @obenland (1), @ocean90 (1), @retrofox (1), @timothyblynjacobs (1), @domainsupport (1), @xknown (1), @marekhrabe (1), @ipstenu (1), @jakubtyrcha (1), @get_dave (1), @webaxones (1), @lukecavanagh (1), @tobiasbg (1), @wpweaver (1), @abesell132 (1), @junaidbhura (1), @chaion07 (1), @shital-patel (1), @mamaduka (1), @aduth (1), @ashfame (1), @davidwebca (1), @beaulebens (1), @poena (1), @kevin940726 (1), @paaljoachim (1), @dhanendran (1), @Ankit K Gupta (1), @aristath (1), @westonruter (1), @alexvorn2 (1), @deepaklalwani (1), @jackreichert (1), @ibenic (1), @joemcgill (1), @rzen (1), @leogermani (1), @sebastianpisula (1), @gilbitron (1), @engelen (1), @kapilpaul (1), @strider72 (1), @rianrietveld (1), @solarissmoke (1), @infected (1), @Boniu91 (1), @mikeschroder (1), @circlecube (1), @Presskopp (1), @melchoyce (1), @powerbuoy (1), @ryelle (1), @celloexpressions (1), @ryokuhi (1), @malae (1), @Cybr (1), @mattwiebe (1), @Clorith (1), @erayalakese (1), @adam3128 (1), @cybr (1), @coreyw (1), @craigfrancis (1), @acosmin (1), @hilayt24 (1), @zodiac1978 (1), @Mte90 (1), @zieladam (1), @generosus (1), @kraftbj (1), @bjorsch (1), @bgoewert (1), @boniu91 (1), @mt8.biz (1).

Congrats and welcome to our 12 (!) new contributors of the week: @iluy, @domainsupport, @webaxones, @abesell132, @davidwebca, @gilbitron, @infected, @adam3128, @hilayt24, @generosus, @bjorsch, @bgoewert ♥️

Core committers: @hellofromtonya (19), @sergeybiryukov (12), @johnjamesjacoby (9), @joedolson (5), @antpb (4), @johnbillion (2), @clorith (2), @timothyblynjacobs (2), @gziolo (2), @peterwilsoncc (1), @davidbaumwald (1), @desrosj (1).

#5-8-2, #5-9, #core, #week-in-core

Last Week in WordPress Core

Hi Everyone! This is the first Last Week in WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. for WordPress 4.0! Last week, a minor update, 3.9.1 was released, and autoupdates started shortly afterwards. Development on 4.0 is ongoing, and you can see notes and meeting details posted by @helen on this blogblog (versus network, site) as well.

Media:

  • In wp.media.view.Settings::update(), when handling checkboxes, check for a value of false in addition to casting value to boolean. !! false evaluates to true. [28371] #23954
  • Allow users to set overrides for MediaElement instances by always passing _wpmejsSettings instead of just _wpmejsSettings.pluginPath. [28370] #25243
  • When pausing “all” players attached to MCE views, don’t reach into global scope and pause every player. Only pause the players bound to MCE views. [28364] #27971
  • In wp_read_image_metadata(), the values from exif_read_data() should only override values from iptcparse() that are empty. [28367] #23706
  • Support loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. for [audio] and [video] shortcodes that specify files that are played using MediaElement’s Flash 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 bridge. [28363] #27368
  • MediaElement players need clear: both to play nice with adjacent floated elements. [28361] #27385

Widgets:

  • Custom Navigation WidgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user.: Force users to choose a nav menu in the custom nav menu widget, for a better customizerCustomizer Tool built into WordPress core that hooks into most modern themes. You can use it to preview and modify many of your site’s appearance settings. UXUX User experience. Before, they had to make a dummy change to get it to render. Now they are made to choose a nav menu from the dropdown, which feels more natural. [28197] #27878
  • Recent Posts Widget: Use ob_end_flush() instead of ob_flush(). ob_end_flush() flushes the output buffer and turns output buffering off, same as ob_get_flush(). [28195] #28009

Themes and Templates:

  • Prevent paged-* from being added to body classes and prevent Page %s from being added to page title on 404 error pages on default themes. [28249] #16468
  • Bundled Themes:Prevent Page %s from being added to page title on 404 error pages in bundled themes. [28250] #16468.
  • Bundled Themes: Use correct logic in IE conditional comments in headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. template. [28341] #28151
  • Set the proper value for wp_title() when is_author() and is_post_type_archive() are both true. post_type should always win due to the precedence indicated in get_queried_object(). [28251] #25398
  • Update the default (WP-defined) styles for MediaElement players to be more in-line with our flat aesthetic. Use the new official colors. [28365] #27516

Custom Headers:

  • Allow to skip cropping header images if image width is smaller than or equal to theme width. [28219] #27936
  • Avoid hiding ‘Remove’ buttons unrelated to custom headers. [27882] #27848
  • Keep header image from being removed when background image is removed. [28269] #28046
  • Avoid warnings in the process_default_headers() method. #27850
  • Fix logic when a theme doesn’t set default-text-color. [28294] #28042

Internals:

  • Move home option to the top of populate_options() to make it easier to find next to siteurls for manual changes. [28260] #28141
  • Scrutinizer Cleanup: @wonderboymusic has started the process of cleaning up core with Scrutinizer. Check out the full list of fixes so far on #27882.
  • Hack/HHVM Compatibility: More from @wonderboymusic. See #27881 and #22400.
  • Dev Tools: Introduce default wp-cli.yml for core development. [28221] #28036
  • Add .dfxp and .srt files to mime-type whitelist in wp_get_mime_types(). They are both captioning formats supported by MediaElement. [28259] #27643
  • Add .xps and .oxps extensions to list of supported document types. More about the types on Wikipedia. [28372] #15697
  • When $type is atom in get_the_category_rss(), use get_bloginfo_rss( 'url' ) when setting the scheme attribute for the <category> node. [28258] #24444
  • In WP_Date_Query::get_sql_for_subquery(), don’t parse duplicate parameters – only parse one of w and week or month and monthnum. [28252] #25835
  • Add a filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. for wp_list_comments() arguments. [28285] #19581
  • In get_the_author_posts(), if there is no current $post, return 0 and bail. [28362] #27998
  • In WP_Terms_List_Table::single_row(), call sanitize_term() on the passed term ($tag). [28360] #16864

Externals:

TinyMCE:

  • First pass at wpview logic for the shortcodeShortcode A shortcode is a placeholder used within a WordPress post, page, or widget to insert a form or function generated by a plugin in a specific location on your site.. URLs pasted on their own line are parsed as well. The toolbar will appear with the “remove” button when the view is clicked. Edit has not been implemented yet, nor have safety measures for non-iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser. embeds. [28358] #28195
  • Audio, video, and playlist shortcodes: [28342] #22400, #27881
    • Convert all instances of variable variables to array properties
    • Stop using extract()
    • Rename $atts to $html_atts where collision with new $atts (shortcode atts holder) var might occur
  • Shortcode JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors.: Avoid errors when an escaped shortcode includes a newline between brackets. [28223] #27907

Multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site:

  • Fix case sensitivity regressions in 3.9. [28276] #27866
  • Treat “www” as a special subdomain, reversing 3.9 regressionregression A software bug that breaks or degrades something that previously worked. Regressions are often treated as critical bugs or blockers. Recent regressions may be given higher priorities. A "3.6 regression" would be a bug in 3.6 that worked as intended in 3.5.. [28280] #27927

Thanks to @andrezrv, @arnee, @avryl, @azaozz, @boonebgorges, @celloexpressions, @Clorith, @danielbachhuber, @dimadin, @ebinnionm, @ehg, @ericlewis, @feedmeastraycat, @GaVrA, @gcorne, @greenshady, @helen, @hlashbrooke, @imath, @jartes, @jdgrimes, @jeremyfelt, @johnbillion, @jorbin, @jupiterwise, @mattwiebe, @MikeHansenMe, @m_i_n, @obenland, @ocean90, @pavelevap, @psoluch, @rob1n, @rzen, @sergej.mueller, @SergeyBiryukov, @t4k1s, @Tmeister, @westonruter, and @wonderboymusic for their help!

For the complete list of commits to trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision., check out the log on Trac. We’ve been chatting about 4.0 plans, and things are shaping up. Come chat this Wednesday to continue the discussion, and please note if you encounter issues with 3.9.1 on Trac.

#4-0, #week-in-core

Finding and Fixing JavaScript errors with JSHint

The JavaScript Coding Standards have been updated, so it’s time to move on to tackling our JSHint errors!

JSHint is a tool to check for errors in JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/. code. As was discussed last week, we’re kicking off a small effort to work through our coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. JavaScript files. To get through the errors revealed by JSHint as quickly as possible, we’re following the model established by the Inline Docsinline docs (phpdoc, docblock, xref) team and posting a list of files with issues so that people can “claim” the files they’d like to fix!

At the bottom is a list of every file in core that is displaying JSHint errors. Files with a checkmark have been patched and should now be passing lint. Files marked with (@username #xxxxx) are already claimed, and being worked on.

Please read and understand the process we’ll be following to address these issues! Many thanks to @azaozz, @nacin and @jorbin for helping identify the safest way to approach fixing these errors, and to @rzen for posting the Inline Docs article on which we based this guide.

How to contribute:

  1. Leave a comment on this post with the file* you’re about to edit (check the list first to make sure it hasn’t already been claimed).
  2. Update your local WordPress SVN to the latest version of WordPress trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. (currently 3.8-alpha).
  3. Create a new ticket on Trac for the file.
    JSHint-related trac ticket settings
    • Format the title as “jshint shouldn’t throw errors – path/to/file.js”.
    • Assign the ticketticket Created for both bug reports and feature development on the bug tracker. to the “Build Tools” component.
    • Make sure your email is stored in TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.’s preferences

    If you are logged in, you can click this link to automatically open a ticket with the right settings.

  4. Edit the file, and make a patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing.. Please make sure you create the patch from the root directory of your WordPress SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. checkout. If you are working on a large file, consider making multiple patches for each type of change.
  5. Upload your patch to the Trac ticket you created, and add the keyword “has-patch”.

*Note: We strongly encourage you to work on one file at a time. These shouldn’t take very long, but if you call a bunch at once and get tied up, we won’t be able to get through these as quickly as possible. To quote @rzen from the inline docs effort, “your edits should be made and patched swiftly so that they aren’t invalidated by (or don’t invalidate) another patch.”

Keeping Discussions Focused:

Any discussion about the specifics of a patch itself should happen on Trac. Discussion about the overall effort should take place during our standing weekly meeting, on Wednesdays at 1900 UTC in #wordpress-dev*.

Files needing patches:

Checked files are now passing JSHint

  • wp-adminadmin (and super admin)/js/common.js (@jorbin, #25912)
  • wp-admin/js/custom-background.js (@jorbin, #25915)
  • wp-admin/js/custom-header.js (@jorbin, #25916)
  • wp-admin/js/customize-controls.js (@jorbin, #25917)
  • wp-admin/js/dashboard.js (@tommcfarlin, #25943) (@nacin)
  • wp-admin/js/edit-comments.js (@adamsilverstein, #25979)
  • wp-admin/js/editor.js (@dougwollison, #25947) (@nacin)
  • wp-admin/js/gallery.js (@dougwollison, #25999) (@jorbin)
  • wp-admin/js/image-edit.js ( #26000)
  • wp-admin/js/inline-edit-post.js ( #26001) (@jorbin)
  • wp-admin/js/inline-edit-tax.js ( #26002) (@jorbin)
  • wp-admin/js/link.js ( #26034)
  • wp-admin/js/media-gallery.js (@tommcfarlin, #25942) (@nacin)
  • wp-admin/js/media-upload.js ( #26023)
  • wp-admin/js/media.js ( #26020)
  • wp-admin/js/nav-menu.js (51 errors)
  • wp-admin/js/password-strength-meter.js ( #25990)
  • wp-admin/js/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-install.js ( #25993)
  • wp-admin/js/post.js ( #25994)
  • wp-admin/js/postbox.js (10 errors)
  • wp-admin/js/revisions.js ( #25864)
  • wp-admin/js/set-post-thumbnail.js ( #26008)
  • wp-admin/js/tags.js ( #26009)
  • wp-admin/js/theme-install.js (@kovshenin, #26045) (@nacin)
  • wp-admin/js/theme-preview.js (@tommcfarlin, #25944) (@nacin)
  • wp-admin/js/theme.js (22 errors) (@nacin)
  • wp-admin/js/user-profile.js ( #26016) (@jorbin)
  • wp-admin/js/user-suggest.js ( #26017) (@jorbin)
  • wp-admin/js/word-count.js ( #26018) (@nacin)
  • wp-admin/js/wp-fullscreen.js ( #26029)
  • wp-admin/js/xfn.js ( #25997)
  • wp-content/themes/twentyfourteen/js/functions.js ( #26031) (@jorbin)
  • wp-content/themes/twentyfourteen/js/slider.js ( #26032) (@jorbin)
  • wp-includes/js/admin-bar.js (@kadamwhite, #25970)
  • wp-includes/js/autosave.js ( #26035)
  • wp-includes/js/comment-reply.js ( #26038)
  • wp-includes/js/customize-base.js ( #26039)
  • wp-includes/js/customize-loader.js ( #26040)
  • wp-includes/js/customize-preview.js ( #26019)
  • wp-includes/js/heartbeat.js ( #25986)
  • wp-includes/js/jquery/jquery.table-hotkeys.js ( #26015)
  • wp-includes/js/media-editor.js ( #26022)
  • wp-includes/js/media-models.js (@kadamwhite, #26132)
  • wp-includes/js/media-views.js (@kadamwhite, #25974)
  • wp-includes/js/mediaelement/wp-mediaelement.js (3 errors)
  • wp-includes/js/plupload/handlers.js ( #26041)
  • wp-includes/js/plupload/wp-plupload.js (@atimmer, #26044)
  • wp-includes/js/quicktags.js (@kovshenin, #26046)
  • wp-includes/js/shortcode.js (@tommcfarlin, #25945) (@nacin)
  • wp-includes/js/tinymce/mark_loaded_src.js ( #26014)
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js ( #26048)
  • wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js ( #26048)
  • wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js ( #26048)
  • wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js ( #26048)
  • wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js ( #26048)
  • wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js ( #26024)
  • wp-includes/js/tinymce/plugins/wpview/editor_plugin_src.js ( #26027)
  • wp-includes/js/utils.js (@adamsilverstein, #25957)
  • wp-includes/js/wp-ajax-response.js (@originalexe, #25954)
  • wp-includes/js/wp-auth-check.js ( #26009)
  • wp-includes/js/wp-list-revisions.js (#25864)
  • wp-includes/js/wp-lists.js ( #26012)
  • wp-includes/js/wp-pointer.js ( #26012)
  • wp-includes/js/wp-util.js ( #25957)
  • wp-includes/js/wplink.js (@jorbin, #25914)

See all open tickets in the Build Tools component

For tips on dealing with global variables, inlined third-party code within first-party scripts, etc, see the JSHint tips in the JavaScript Coding Standards

For the curious, this list was created with a jazzy little command @nacin came up with to pipe Grunt output through ack:

grunt jshint --force | ack '^Linting src/' | ack -o 'wp-.*.js' | sort | uniq -c | sort

What we’re NOT doing

The two JSHint options called out in the earlier post, “curly” and “eqeqeq,” would ordinarily make up the vast majority of the errors JSHint reports in our files. We’ve currently set Grunt and JSHint to ignore these two types of errors when JSHint is run against core. While these are best practices, we’ll come back to them once we address the more significant code smell issues like undefined variables.

Also note that we’re not tackling whitespace or non-JSHint-related refactoring during this effort. We’ll get there, but we have to mitigate the risk to core as much as possible so we don’t interrupt the 3.8 cycle. Keep your changes focused on passing JSHint this go-around.

#build-tools, #javascript, #jshint

The State of Inline Docs

We haven’t posted an update in several weeks, so thought we’d bring everyone up to speed on the Inline Docsinline docs (phpdoc, docblock, xref) project.

This project started July at WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. San Francisco as a 3.7 release action item. Work continues into the 3.8 release cycle, and we would like to have the hook documentation completed by the time 3.8 is released in December.

PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher Documentation Standards

The PHP Documentation Standard has been amended several times since it was first published in early September. The latest amendments include:

If you are one of our contributors, please make sure you read the standards again to familiarize yourself with the changes.

WordCamp Contributor Days

We would like to thank WordCamp Toronto (10/6), WordCamp Europe (10/7), and WordCamp Sofia (10/27) for including Inline Docs as part of their respective Contributor Days. Approximately 35 files were documented, and several new contributors had their first patches committed to WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. as a result. Woot!

Contributors

So far, 47 people have received props for submitting inline docs patches:

@admiralthrawn, @aeg0125, @a.hoereth, @andg, @aralbald, @bananastalktome, @ben.moody, @betzster, @bftrick, @dllh, @drewapicture, @dougwollison, @dustyf, @enej, @ericlewis, @Faison, @FrankKlein, @gayadesign, @gizburdt, @johnafish, @johnbillion, @jonlynch, @kpdesign, @l10nL10n Localization, or the act of translating code into one's own language. Also see internationalization. Often written with an uppercase L so it is not confused with the capital letter i or the numeral 1. WordPress has a capable and dynamic group of polyglots who take WordPress to more than 70 different locales., @nacin, @naomicbush, @NikV, @ninio, @miyauchi, @morduak, @Nao, @natejacobs, @netweb, @nukaga, @nullvariable, @pauldewouters, @r3df, @rzen, @sboisvert, @SergeyBiryukov, @ShinichiN, @Siobhyb, @swissspidy, @tmtoy, @tomauger, @tw2113, @vinod dalvi

There are 10 other contributors with patches waiting to be reviewed and committed that will be added to this list. We want to thank everyone for their participation so far, and hope you continue contributing!

Progress To Date

According to the “master list“, there are 185 files containing hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. to be documented. The current status, as of today:

  • Completed: 92 files (49.72%)
  • In progress: 23 files
  • Available to claim: 70 files

Weekly Office Hours

We continue to hold weekly office hours meetings on Wednesdays at 19:00 UTC in #wordpress-sfd.

#3-8, #inline-docs

Add Inline-Docs for Hooks

The time to document ALL THE HOOKSHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. used throughout coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. is nigh.

We’ve hashed out the process in a couple of different meetings in #wordpress-dev, and we’ve added a new page to the Core Contributor Handbook that covers the broader PHPDoc standards, as well as the specific hook documentation standards (the praise for the bulk of that work should go to @kpdesign and @drewapicture, by the way).

At the bottom is a list of every file in core that has a call to either do_action() or apply_filters(). Files with a checkmark have been patched and are considered completed. Files marked with (username #xxxxx) are already claimed, and being worked on.

Directly below is the process we’re attempting to make sure each of these files can get patched swiftly with no duplicated nor wasted efforts.

How to contribute:

  1. Check the list first to make sure the file you want to work on hasn’t already been claimed.
  2. Update your local WordPress SVN or GitGit Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/. repo (use git pull) to the latest version of WordPress trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. (currently 3.9-alpha).
  3. Create a new ticket on Trac for the file.

    New Hook Docs Ticket Example

    • Format the title as “Hooks Docs: path/to/file.php”.
    • The Type should be “defect (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.)”.
    • Assign the ticketticket Created for both bug reports and feature development on the bug tracker. to the component the file is associated with.
    • Leave the Version blank.
    • Add the docs focus.
  4. Edit the file, and make a patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing.. Please make sure you create the patch from the root directory of your WordPress SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. or Git checkout.
  5. Upload your patch to the TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticket you created, and add the keyword “has-patch”.

*Note: We strongly encourage you to work on very few files at a time. In many cases, one at a time is probably best. In some cases it may make sense to tackle several at once. The important thing is that you realize your edits should be made and patched swiftly so that they aren’t invalidated by (or don’t invalidate) another patch. It’s also important to note that we’re working with a small time-table, and need to be able to claim, edit, patch quickly — which is hard to do if someone were to lay claim to 20 files at a time, and then sit on them for a few days.

Determining the since version for hooks

The recommended tool to use when searching for the version something was added to WordPress is svn blame. An additional resource for hooks is the WordPress Hooks Database. If, after using these tools, the version number cannot be determined, use @since Unknown.

Note: All @since tags should follow the three digit x.x.x format, unless it was ported from MU. Anything ported over from WPMU should use @since MU. Existing @since MU tags should not be changed.

Keeping Discussions Focused:

Any discussion about the specifics of a patch itself should happen on Trac. Any discussion about the broader scope of what we’re trying to do should take place during the weekly Inline Docsinline docs (phpdoc, docblock, xref) meeting on Wednesdays at 19:00 UTC in #wordpress-sfd.

Files needing patches:

Checked files are completed, marked files are claimed


Current status:

#3-7, #inline-docs

WordPress 3.7 organization

With WordPress 3.7 and 3.8, we’re a project in major transition. Version 3.7 aims to solve for a lot of things that are weighing us down. (See the initial kickoff post.) What do you want to do? In terms of process, here is what is being worked on for 3.7:

Processes, Tools, Workflows

  • New development tools — develop.svn.wordpress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ — run by @koop. If you are interested in Grunt, unit testing (including JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. testing), and how we can streamline and modernize our workflows, this is for you.
  • Code reference — inline documentation efforts — run by @rzen, @ericlewis, and @drewapicture. If you are interested in inline documentation, this is for you. See this post to get started.
  • Process changes (including improvements to TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. and how we organize around components). If you want to write some Python for Trac, this is for you. If you’re just interested in helping with component reorganization, stay tuned here — there will be a post soon outlining a new component tree.

Security, Stability, and Updates

We have a few other focuses that all deal with a general theme of security and stability.

  • Passwords. We are aiming to improve the adoption of best security practices by assisting with password generation. #24633@duck_ is also working on some changes to strengthen cookies. #20276. If you are interested in security, this is for you.
  • Updates. @dd32 and @pento will be heading up automatic updates for minor releases, as well as improving the trustworthiness of our upgrader. If you love updates and stability, this is for you.
  • Language packs. We need to separate language files from plugins, themes, and coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., allowing them to be maintained and updated independently (and, ideally, automatically). #18200. If you want to help WordPress’ global reach, hook up with me, @dd32, and @markoheijnen.

General Triagetriage The act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors.

Finally, we have 3,800 (already only 3,600) open tickets on Trac. There are dozens of components with many, many tickets. Already, there have been a few components with a strong base of contributors working on them, including:

  • Multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site, currently being smashed by @jeremyfelt and others. If you like multisite and want to make it better and more stable, this is for you. There are currently 122 open tickets.
  • JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.. A number of you have expressed interest on working on JavaScript in core. Whether that is shoring up the stability of existing features, improving existing JS, or working on a JS testing framework, this should be a great working group. @carldanley, @adamsilverstein, @nbachiyski, @kadamwhite, and others expressed interest.
  • Query and TaxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.. These two advanced areas of core kind of go hand-in-hand, not in the least because @wonderboymusic smashes query tickets with his left hand and taxonomy tickets with his right. If you’re interested in bringing down these tickets (68 and 93 open), this is for you.
  • General triage. Folks like @c3mdigital and @avryl have been already going through old tickets either closing them out or finding diamonds in the rough. Or maybe you find that one of the many open components catches your interest. (Go here and choose any component from the drop-down to see all open tickets.) We’ll be coordinating efforts to work together both in IRCIRC Internet Relay Chat, a network where users can have conversations online. IRC channels are used widely by open source projects, and by WordPress. The primary WordPress channels are #wordpress and #wordpress-dev, on irc.freenode.net. (especially during the weekly meetings) and here on make/core.
  • Components with a lot of open tickets: General (376 tickets), Administration (302 tickets), Media (221 tickets), Template (161 tickets), Comments (135 tickets), Users (107 tickets), Themes (105 tickets), Formatting (98 tickets), Menus (96 tickets), Widgets (90 tickets), Plugins (90 tickets), Editor (85 tickets), Upgrade/Install (84 tickets), Import (70 tickets). If you want to do general triage, General and Administration in particular need a lot of work!

Today during the weekly meeting, we’ll be talking about ongoing efforts, rallying the troops and helping to assemble working groups, and setting up some times for regular triage meetings.

So, what do you want to work on? Let’s start coordinating in the comments.

#3-7

Better Inline Docs for 3.7

For the 3.7 cycle we’re going to focus hard on improving the inline docsinline docs (phpdoc, docblock, xref) throughout WP coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Eric Lewis, Drew Jaynes and myself will be leading this charge, and we invite anyone who is interested to join us.

You can join us for a meeting on the subject in #wordpress-dev IRCIRC Internet Relay Chat, a network where users can have conversations online. IRC channels are used widely by open source projects, and by WordPress. The primary WordPress channels are #wordpress and #wordpress-dev, on irc.freenode.net. on Tuesday, August 13, 18:00 UTC.

For the first time ever, we’ll be adding inline docs to the many, many hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. found within core. This is the area I’ll be contributing the most, personally. Since we’ll mostly be marching to the beat of our own drum to document the hooks, so I’d like to use the remainder of this post to explain a bit more about our plan of attack – which we’ll discuss during Tuesday’s meeting.

Hook Doc Style

We’ll be using the same inline PHPDocPHPDoc (docblock, inline docs) standard that is used for functions to documenting each of the hooks. This means both short description and long descriptions (where applicable), along with @since and @param tags. We will not be using the @return tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.), however, because actions return nothing and filters simply return the first param.

The DocBlocks will appear, in almost every case, on the line directly preceding the call to do_action() or apply_filters. We feel this is the most logical placement when grokking the code as a human, and also the most convenient position for the parser that will power developer.wordpress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/.

Some Examples:



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


<?php
/**
* The location to send commenter after posting
*
* @since 1.5.0
*
* @param string $location The 'redirect_to' URI sent via $_POST
* @param object The comment object
*/
$location = apply_filters('comment_post_redirect', $location, $comment);



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


<?php
/**
* Return the ID of the uploaded attachment of a given type
*
* @since 2.5.0
*
* @param int $id The uploaded attachment ID
*/
echo apply_filters("async_upload_{$type}", $id);



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


<?php
/**
* Allow definition of default variables
*
* @since MU
*
* @param array $user_data The user data to define {
* @type string $user_name The username
* @type string $user_email The user's email
* @type array $errors
* }
*/
$filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors ));
view raw

wp-signup.php

hosted with ❤ by GitHub

Note that in this third example we are using on the PHPDoc spec for describing hashes in order to document each of the passed items in the array. This, I think, provides a great deal of context for the array and a much greater value to our documentation (especially given the number of filters in core that pass arrays). As an aside, I agree that it may be odd we’re referencing the associative array keys as var names, rather than a string literal, but it’s necessary for parsing the docs properly.

Some Potential Issues

  1. I know there are a few hooks that appear in more than one location. In this case we’ll be documenting them in just one function and adding a pointer to that function across all other instances. We’ll determine the best way to handle this pointer in the weeks to come, for the immediate future I’ll just be using a shorthand comment for my own references.
  2. Many filters throughout core passed unnamed parameters and just embed the values of their parameters directly. In these instances I look first to core to see if an add_filter() is being called on the filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. and then default to the var names passed there. If core is not calling the filter anywhere I’ve used names that seem most logical (e.g. $output)
  3. Several hooks have variable names. I don’e believe this will actually pose an issue, but I do want to make note of it.

Process

Because of the sheer volume of things we need to document, the best idea I’ve got so far (as recommended by Mark Jaquith) is to allow anyone willing to contribute an opportunity to “claim” the files they’d like to document. This would grant them a 2 day “lock” on the file(s) to document everything and submit a patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing.. This will help us minimize or eliminate duplicated efforts and stale patches as much as possible. We’ll likely have 2 separate tickets: one for documenting hooks, one for documenting functions, and all patches will be made directly to those tickets. This could become unwieldy, and we’ll discuss the merits of this approach in Tuesday’s meeting.

Don’t worry if you really want to help, but can’t attend the meeting. It will all be logged, and we’ll be posting updates back to the blogblog (versus network, site) here (using the inline-docs tag). Once we get underway you’ll be able to track progress directly on the tracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets.

Hope you’re as excited about this as I am!

#3-7, #inline-docs