A Week in Core – September 12, 2022

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 September 5 and September 12, 2022.

  • 73 commits
  • 118 contributors
  • 51 tickets created
  • 4 tickets reopened
  • 72 tickets closed

The Core team is currently working on the next major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope., WP 6.1 🛠

Because of the 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. US and its Contributor DayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/., this week was particularly busy: lots of commits, lots of new contributors ♥️

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

Build/Test Tools

  • Always use the amd64 images for MariaDB and MySQLMySQL MySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/. on the local development environment – #56528
  • Consistently create a post fixture in old date or slug redirect tests – #55652
  • Consistently set the current user in the tests for retaining a sticky status – #55652
  • Correct magic methods in Basic_Object#56514
  • Correct the cache invalidation tests for old date or slug redirect – #55652
  • Correct the tests for Site Health SQL versions matching readme.html#55791
  • Correctly use the factory method – #55652
  • Do not allow tests to fail for select PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 8.1 test runs – #55656, #55652
  • Move Site Health unit testunit test Code written to test a small piece of code or functionality within a larger application. Everything from themes to WordPress core have a series of unit tests. Also see regression. class to phpunit/tests/admin/#55652
  • Prevent an Ajax test for IMAGE_EDIT_OVERWRITE from being marked as risky – #55652
  • Remove magic methods from WP_UnitTestCase_Base (without a backward compatibility break) – #56514
  • Remove redundant function_exists() check in a term_is_ancestor_of() test – #55652
  • Set the current user to Editor in test_utf8mb3_post_saves_with_emoji()#55652
  • Temporarily skip the test for recommended PHP version in readme.html#55652
  • Use the default GITHUB_TOKEN instead of a personal access token – #55652
  • Use the factory method instead of the property – #55652
  • Prevent using unsupported NPM versions – #56547

Bundled Themes

  • Twenty Fifteen: Increase the font size used for h5 headings – #52028
  • Twenty Nineteen: Add font smoothing to editor styles – #45909
  • Twenty Seventeen: Ensure long text wraps correctly in the Button 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.#55783
  • Twenty Twenty-One: Remove spacer block styles – #56222
  • Twenty Twenty: Add a missing border to button-style links with Outline style – #55824

Code Modernization

  • Add AllowDynamicProperties attribute to all (parent) classes – #56513, #56034
  • Pass correct value to parse_url() in WP_Customize_Manager::get_return_url()#55656
  • Replace deprecated string interpolation patterns – #55787

Coding Standards

  • Clarify time units for various timeout or expiration values – #56293, #55647
  • Use more meaningful variable names for output in the adminadmin (and super admin)#56448, #55647
  • Use more meaningful variable names in WP_Users_List_Table#56448, #55647

Comments

  • Make wp_required_field_indicator() and wp_required_field_message() output filterable – #56389, #54394
  • Remove aria-hidden="true" attribute for visible text in comment template – #55717

Cron APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

  • Remove unnecessary optimization getting ready events – #56092

Customize

  • Prevent JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. error in Links 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. when selective refresh is enabled – #39451
  • Use Semantically correct function – #56285

Date/Time

  • Cast extracted strings to integers in wp_resolve_post_date()#54186

Docs

  • Add a @since note for the update_network_meta_cache parameter of WP_Network_Query::__construct()#55646
  • Clarify wp-includes/update.php main docblockdocblock (phpdoc, xref, inline docs) description – #55646
  • Correct @global tags in WP_User_Query::prepare_query()#56543
  • Simplify a comment in WP_Network_Query::get_networks() and WP_Site_Query::get_sites()#55646
  • Various docblock fixes in Site Health related files, as per documentation standards – #55646
  • Various docblock fixes in wp-includes/update.php, as per documentation standards – #55646

Editor

  • Add new render property in block.json for block types – #53148
  • Add support for heading, button, and caption elements – #56467
  • Backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. Elements API updates – #56467
  • Hide query 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. pagination link arrows from assistive technologyAssistive technology Assistive technology is an umbrella term that includes assistive, adaptive, and rehabilitative devices for people with disabilities and also includes the process used in selecting, locating, and using them. Assistive technology promotes greater independence by enabling people to perform tasks that they were formerly unable to accomplish, or had great difficulty accomplishing, by providing enhancements to, or changing methods of interacting with, the technology needed to accomplish such tasks. https://en.wikipedia.org/wiki/Assistive_technology#56067
  • Preload settings and templates permissions – #56467
  • Refresh nones for metaboxes after reauthentication – #52584
  • Update single default template description – #56534
  • Update duotone block supports to allow unset for preset colors – #56467

Embeds

  • Add Google Data Studio as a trusted oEmbed provider – #55771

KSES

  • Allow min(), max(), minmax(), and clamp() values to be used in inline CSSCSS Cascading Style Sheets.#55966
  • Allow min(), max(), minmax(), and clamp() values to be used in inline CSS – #55966
  • Allow assigning values to CSS variables – #56353
  • Allow more layout-related CSS properties – #56122
  • Revert [54092] for now to address unit test failures – #55966

Media

  • Add muted property for video elements – #54788
  • Call update_post_parent_caches function in WP_Media_List_Table class – #56036
  • Generate WebP only for certain registered image sizes – #56526, #55443, #56288
  • Move wp_default_image_output_mapping() 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. callback to frontend scope – #55443, #56526
  • Output WebP by default when uploading JPEGs – #55443
  • revert the multi-mime feature – #55443

Networks and Sites

  • Use metadata api in *_network_options functions – #37181

Posts, Post Types

  • Call update_post_author_caches function in WP_Posts_List_Table class – #56100

Query

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 support for searching resources by id – #56546
  • Add support for settings to specify their own additionalProperties – #56493
  • Add the missing site_icon_url to the index – #56467
  • Block autosaving from overwriting changes when locked from editing – #55659
  • Introduce _pretty query parameter to opt in to JSON_PRETTY_PRINT – #41998
  • Use helper functions for building routes in more places – #56472

Script Loader

  • Pass startOfWeek setting to wordpress/date – #56467

Site Health

Widgets

  • Store default options for uninitialized widgets – #54677

Props

Thanks to the 118 (!) people who contributed to WordPress Core on Trac last week: @costdev (17), @jrf (12), @peterwilsoncc (9), @sabernhardt (7), @mukesh27 (7), @bernhard-reiter (7), @spacedmonkey (6), @audrasjb (6), @SergeyBiryukov (5), @flixos90 (4), @andrewserong (4), @cbravobernal (4), @Mamaduka (4), @ramonopoly (4), @hellofromTonya (3), @swissspidy (3), @aristath (3), @zieladam (3), @TimothyBlynJacobs (3), @scruffian (3), @noisysocks (3), @poena (3), @adamsilverstein (3), @andraganescu (2), @joyously (2), @Chouby (2), @isabel_brison (2), @uxl (2), @johnregan3 (2), @get_dave (2), @johnbillion (2), @desrosj (2), @kadamwhite (2), @afercia (2), @azaozz (2), @joedolson (2), @laurelfulford (1), @johnjamesjacoby (1), @jeremyfelt (1), @mikachan (1), @pento (1), @madhudollu (1), @mohitdadhich10 (1), @sc0ttkclark (1), @mrfoxtalbot (1), @umesh84 (1), @russel07 (1), @pratiweb (1), @burhandodhy (1), @alansyue (1), @viralsampat (1), @bph (1), @dd32 (1), @jeawhanlee (1), @gmovr (1), @antpb (1), @alaca (1), @aezazshekh (1), @thakkarhardik (1), @eugenemanuilov (1), @joegrainger (1), @czapla (1), @withinboredom (1), @ndiego (1), @Joen (1), @jorgefilipecosta (1), @ajlende (1), @hiren1094 (1), @jameskoster (1), @ntsekouras (1), @bgardner (1), @anitanenova (1), @robertghetau (1), @afrid1719 (1), @anna.bansaghi (1), @Viper007Bond (1), @Benouare (1), @prokium (1), @joemcgill (1), @primetimejas (1), @chanthaboune (1), @sathyapulse (1), @jhart35 (1), @fabiankaegy (1), @danielbachhuber (1), @matveb (1), @welcher (1), @luisherranz (1), @knutsp (1), @markjaquith (1), @ayeshrajans (1), @juliemoynat (1), @kebbet (1), @kamig478 (1), @chrisguitarguy (1), @rmccue (1), @akabarikalpesh (1), @bhrugesh12 (1), @lev0 (1), @mvraghavan (1), @robinwpdeveloper (1), @rudlinkon (1), @GaryJ (1), @krupalpanchal (1), @arrasel403 (1), @hztyfoon (1), @dpcalhoun (1), @hilayt24 (1), @mmaattiiaass (1), @onemaggie (1), @shoaibkarimali (1), @Drivingralle (1), @LinSoftware (1), @rcorrales (1), @greenshady (1), @nikeo (1), @dlh (1), and @Presskopp (1).

Congrats and welcome to our 21 (!!) new contributors of the week: @uxl, @madhudollu, @mohitdadhich10, @russel07, @jeawhanlee, @alaca, @eugenemanuilov, @joegrainger, @hiren1094, @anitanenova, @afrid1719, @annabansaghi, @prokium, @primetimejas, @jhart35, @kamig478, @mvraghavan, @arrasel403, @shoaibkarimali, @LinSoftware, @rcorrales ♥️

Core committers: @sergeybiryukov (35), @audrasjb (11), @timothyblynjacobs (3), @spacedmonkey (3), @peterwilsoncc (3), @adamsilverstein (2), @flixos90 (2), @jorbin (2), @antpb (2), @westonruter (1), @swissspidy (1), @joemcgill (1), @kadamwhite (1), @desrosj (1), @helen (1), @johnbillion (1), @clorith (1), @gziolo (1), @noisysocks (1).

#6-1, #core, #week-in-core

Performance team meeting summary 13 September 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Announcements

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

  • @adamsilverstein: In the last week the image team finished addressing the WebP feedback and switching back to the original single mime output approach. We also started work on controlling output per size and adding support to add_image_size.
  • @adamsilverstein: Yesterday during contributor dayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/. at WCUS, Matt posted on (not shipping) WebP in 6.1 which was a surprise to the team. We are currently working with the release leads to better understand his concerns and develop a path forward. I want to acknowledge this is a blow for everyone who worked on the feature (myself included) and at the same time I’d like to encourage us to focus on how we can move forward given the current position. Are there concerns we can address? Does a canonical 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 make sense?
    • @spacedmonkey: I think it makes sense to move the webp functionality found in the performance plugin to it’s own plugin. That way it will be easier to get users to test it and get feedback on just this functionality.
    • @flixos90: I think if it remains a “feature project”, it makes sense to remain in the Performance Lab plugin – we don’t know if moving it out of it would get us more testers (especially since the Performance Lab plugin has 10k+ installs which is a lot for a feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins.). If the path of a “canonical plugin” should be pursued, then of course we would need to take it out, but then the nature of the project would also change.
    • @kadamwhite: Speaking from REST experience, the times we flirted with making add-on plugins to test specific routes, they never got the traction the main plugin did.
    • @adamsilverstein: My main concern about a feature like WebP being in a canonical plugin is how users would know they should enable it.
      • @eatingrules: FWIW, millions of users are finding and installing image optimization plugins in the repo. Smush has over 1 million installs. EWWW Image Optimizer has 1+ million. Imagify has 600k. Shortpixel, 300k. WebP Express, 200k. Robin image optimizer, 100k.
    • @kadamwhite: Something I remember coming up when we initially introduced responsive images was server / cdn costs, because certain configuration could cause higher-res versions to be downloaded. Does WebP’s size benefit translate to any hosting benefit?, in terms of money?
      • @adamsilverstein: with the current implementation yes! lower storage requirements since WebPs are smaller, and lower bandwidth requirements as well, though slightly more processor effort to generate
    • @flixos90: I think this discussion is very valuable, however we won’t be able to make any decision here today since we’re still waiting for more information. Hopefully we’ll know more by next week. We definitely need to continue this discussion once we do.
  • @pbearne worked on https://github.com/WordPress/performance/pull/528 to add a fetchpriority module to the Performance Lab plugin; will be a co-owner of the module
  • @wpgurudev has been working through the feedback and comments on background job class for image regeneration: https://github.com/WordPress/performance/pull/507, this is again up for review; next PR for review will be background process runner https://github.com/WordPress/performance/pull/512, this makes use of job instance, so will be reviewed and merged post the above PR merge

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

  • @spacedmonkey got 3 commits into coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. ([54080], [54098], [54099]) and worked on PR #3178
  • @kadamwhite: We’ve been doing some work on sites with very high comment volume around understanding the comment caching in core, because we began to actually see bottlenecks in cache performance with churn from comment cache eviction. Is anybody in this group specifically knowledgable about how WP handles comment caching?

Feedback requested

Site Health

N/A

GitHub project

  • @spacedmonkey: @furi3r has updated draft for new cache Site Health checks dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase., ready for another review

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in 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/.
  • @mehulkaklotar is working on proposal for Plugin Check plugin. Right now, we would include minimal checks in the plugin that is included in the wporg-code-analysis and check the error log for any warnings, notices when plugin activated. I would love to hear suggestions about GithubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ action that we will provide as an action that developers can use into their plugin repo.

Feedback requested

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/.

@aristath @sergiomdgomes

GitHub project

  • @mukesh27 worked on JavaScript coding standard workflow #515. Please review and share feedback.

Feedback requested

Infrastructure

@flixos90

GitHub project

  • N/A

Feedback requested

Open Floor

  • @spacedmonkey: Next steps for Dominant color feature (continued from last week)
    • @pbearne: Are we all happy to merge the theme flag version?
    • @flixos90: I think there were still some open questions and research to do on the perceived performance improvement
    • @spacedmonkey: What are those questions? It comes down to the fact, we can’t move the performance benefit when it comes to metrics. But the benefit is more about what the users sees. That benefit is not an easy one to prove with numbers. It is more like a feeling of speed.
    • @flixos90: Agreed, it’s certainly more challenging to prove anything regarding perceived performance. I don’t know but there is research on how “good” the LQIP perceived performance benefit is – so at least in theory there is something to unpack there for the dominant color perceived performance benefit as well. Maybe it’s a bit of a stretch to have us to UXUX User experience research around that, which may be the only thing we could do in terms of research. At this point, I’m not opposed to it landing in core, but I’m also not sold on it.
    • @spacedmonkey: I consider dominant color like other metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. data we generate, so why not this? It could be helpful for theme developers.

Our next chat will be held on Tuesday, September 20, 2022 at 15:00 UTC in the #core-performance channel in Slack.

#performance, #performance-chat, #summary

A Week in Core – November 15, 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 8 and November 15, 2021.

  • 116 commits (!)
  • 204 contributors (!)
  • 57 tickets created
  • 10 tickets reopened
  • 89 tickets closed

The Core team is currently working on the major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope., WordPress 5.9 🛠

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

About/Help

  • Add commas to end of multi-line array items – #54357
  • add docs links to several screens – #54357

Administration

  • Restores “Customize” menu item for non-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. themes and moves for block themes – #54418

Bootstrap/Load

  • Add HTTP/3 as a valid HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. protocol. – #54404
  • Bootstrap/Load: Check $_SERVER['SCRIPT_NAME'] exists before passing to strpos() in wp_fix_server_vars()#54142

Build/Test Tools

  • Cache the results of PHP_CodeSniffer across workflow runs – #49783
  • Exclude plugins and non-bundled themes from PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher compatibility scans – #54425
  • Make adjustments to how Quick Draft tests confirm expected behavior – #54409
  • Mock no results remote request in WP_REST_Block_Directory_Controller:: get_items() – #54420
  • Mock remote request for WP_REST_Block_Directory_Controller::get_items()#54420
  • Mock remote request for unknown 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 in WP_REST_Plugins_Controller::create_item()#54420
  • Restore the httpsHTTPS HTTPS is an acronym for Hyper Text Transfer Protocol Secure. HTTPS is the secure version of HTTP, the protocol over which data is sent between your browser and the website that you are connected to. The 'S' at the end of HTTPS stands for 'Secure'. It means all communications between your browser and the website are encrypted. This is especially helpful for protecting sensitive data like banking information. 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 – #54337
  • Update all 3rd party GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ actions to the latest versions – #53363
  • Change default GitHub branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". 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.#54399
  • Update qUnit test fixtures after [52128]#54336

Bundled Theme

  • Display required text field in core themes – #54392
  • Import Twenty Twenty-Two, the new default theme for WordPress 5.9 – #54318
  • Twenty Eleven: Improve comment form styling for required fields – #54408
  • Twenty Nineteen: Apply coding standards fix from running composer format#54392
  • Twenty Twenty-One: Add privacy policy link to footer – #53445
  • Twenty Twenty-One: Correct default image alignment in the editor – #53809
  • Twenty Twenty-One: Prevent printing skip link focus fix when SCRIPT_DEBUG is enabled – #54429
  • Twenty Twenty-Two: Import the assets directory from GitHub – #52081
  • Twenty Twenty-Two: Import the latest changes from GitHub – #54318

Coding Standards

  • Minor alignment fix after [52058]#52058
  • PHP Code style errors – #43700
  • PHP Code style errors – #43700
  • Rename the $gzData argument to $gz_data in WP_Http_Encoding::compatible_gzinflate()#53359
  • Revert accidental image changes in [52171]#54168
  • Revert unrelated change to wp_send_user_request()#43700
  • Use strict comparison in wp-admin/includes/ms.php#47422

Comments

  • Don’t output “cancel comment reply link” if comments aren’t threaded – #37267
  • Use get_comment_author() to retrieve the comment author name in get_comment_reply_link()#53678

Database

  • WPDB: Capture error in wpdb::$last_error when insert fails instead of silently failing for 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. data or value too long – #37267

Docs

  • Add missing documentation for the $javascript parameter of the wp_inline_script_attributes 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.#53399
  • Avoid using “CPT” instead of “custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept.” – #53399, #54335, #54336
  • List the expected return type first in a few functions – #53399

Editor

  • Update SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. props to ignore new asset files – #54337, #53361
  • Update SVN props to ignore new asset files – #54337, #53361
  • Add documentation for the $block_editor_context parameter of the block_editor_rest_api_preload_paths hook – #52920, #53399
  • Site Editor and PHP changes from GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ 10.1 – 11.9 – #54337
  • Site Editor: Load as full screen by default – #54337
  • Add Navigation Area infrastructure – #54337
  • Add block theme infrastructure – #54335
  • Add get_query_pagination_arrow function to core
  • Add public functions for interacting with global styles & settings – #54336
  • Fix fatal call to add_query_args() – #54337
  • Fix how the Site Editor is linked to – #54337
  • Fix incorrect access of ID field – #54337
  • Global Styles Rest endpoints – #54336
  • Global styles user content escaping – #54336
  • Load iframed assets in Site Editor – #54337
  • Update wordpress packages – #54337
  • Fix Linting error affecting trunk
  • Update wordpress packages – #54337
  • Update wordpress packages – #54337
  • Update block-theme-pl_PL.mo file. – #54336

Embeds

  • Conditionally enqueue wp-embed only if needed and send ready message in case script loads after post embed windows – #44632, #44306
  • Fix inclusion of wp-embed-template script and style when SCRIPT_DEBUG is disabled – #44632
  • Fix parsing of post embeds in wp_filter_oembed_result() by appending wp-embed script instead of prepending it in get_post_embed_html()#44632

External Libraries

  • Update the regenerator-runtime package to version 0.13.9#54027
  • Update ‘reactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/.’ and ‘react-dom’ – #54337

General

  • Add “noopener” to wp_list_bookmarks() output – #53839
  • General: Convert wp_list_filter() into a wrapper for wp_filter_object_list()#53988
  • General: Minor fixes to Global Style related code – #54336

HTTP APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways.

  • Ensure value returned from 'http_allowed_safe_ports' is an array to avoid PHP 8+ TypeError fatal error – #54331
  • Introduce 'http_allowed_safe_ports' filter in wp_http_validate_url()#54331

Internationalization

  • Add language switcher on login/registration screens – #43700
  • Add missing translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. wrapper for the Global Styles post type description – #54336

Login and Registration

  • Fix failing test for “email already exists” registration error improvement – #53631
  • Improve “email already exists” registration error message – #53631
  • Improve messaging for invalid log-out nonces – #52600
  • Pass $errors parameter to registration_redirect filter – #53992
  • Wrap long usernames in login error message – #37617

Mail

  • Add wp_mail_succeeded hook to wp_mail#53826

Media

  • Add “webp” extension to wp.media.controller.Library isImageAttachment#53917
  • Change upload button to a file input for better e2e targeting – #54168
  • Featured imageFeatured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts. modal loads only selected image – #42937
  • Featured image modal loads only selected image – #53765
  • Refine the heuristics to exclude certain images and iframes from being lazy-loaded to improve performance – #53675, #50425
  • Revert media uploader input change in [52059]#54168, #54411
  • Add audible notice on menu item add or remove – #53840

Options, MetaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. APIs

  • Correct docs for $_meta_value parameter in xxx_{$meta_type}_meta 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.#53102

Posts, Post Types

  • Add $old_status parameter to {$new_status}_{$post->post_type} action – #36180
  • Mark the wp_global_styles post type as _builtin#54336
  • Remove gutenberg text domain from post type strings – #54336, #54337
  • Update _edit_last meta when posts are edited in bulk – #42446

Quick/Bulk Edit

  • Disable auto-correct for slugs – #50499

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 /wp/v2/block-navigation-areas endpoint – #54393
  • Add batch support for posts and terms controllers – #53063
  • Expose the site icon in the REST API index – #52321
  • Introduce Menu management endpoints – #40878
  • Regenerate wp-api-generated.js after [52068]#53063
  • Remove experimental block menu item types – #40878

RevisionsRevisions The WordPress revisions system stores a record of each saved draft or published update. The revision system allows you to see what changes were made in each revision by dragging a slider (or using the Next/Previous buttons). The display indicates what has changed in each revision.

  • Introduce wp_get_post_revisions_url() to get URL for editing revisions – #39062

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.

  • Allow get_*_*_link() and edit_term_link() functions to accept a term ID, WP_Term, or term object – #50225
  • Change some static strings to registration labels – #43060
  • Clarify the taxonomy labels for customizing the field descriptions on Edit Tags screen: – #43060
  • Display update notices when adding terms – #42937
  • Document that the get_terms filter can have null for $taxonomies#54222

Template

  • Fix “undefined index: 00” when archive month query is empty in wp_title()#31521

Themes

  • Avoid fatal error loading adminadmin (and super admin) styles when SCRIPT_DEBUG is false#54401, #54336
  • Check both parent and child themes for a theme.json file – #54401
  • Force a scrollbar on the Themes page to prevent visual shake on hover – #53478
  • Twenty Twenty-Two is now the default theme – #54318
  • Update theme.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. classes for WordPress 5.9 – #54336
  • Hide Customize from admin bar when using a block theme – #54337

Upgrade/Install

  • Deactivate the Gutenberg plugin if its version is 11.8 or lower – #54405
  • Update screen reader text counts in adminbar – #29022

Users

  • Introduce wp_list_users() function – #15145
  • Prevent infinite 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. when using capability checks during determine_current_user on 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#53386

Widgets

  • Use isset() in WP_Widget:: display_callback() to support ArrayIterator and ArrayObject#52728
  • Wraps long 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. titles in classic Widgets screen – #37451

Props

Please note that it was the most prolific week since we restarted the Week in Core blogblog (versus network, site) posts last year!

Thanks to the 204 (!) people who contributed to WordPress Core on Trac last week: @hellofromTonya (28), @audrasjb (21), @sabernhardt (14), @desrosj (11), @sergeybiryukov (11), @costdev (10), @johnbillion (9), @oandregal (8), @spacedmonkey (7), @peterwilsoncc (7), @poena (6), @swissspidy (6), @afercia (6), @youknowriad (6), @noisysocks (5), @davidbaumwald (5), @hellofromtonya (4), @birgire (4), @TimothyBlynJacobs (4), @SergeyBiryukov (4), @mukesh27 (3), @Mamaduka (3), @adamsilverstein (3), @antonvlasenko (3), @aristath (3), @pento (3), @dd32 (3), @chaion07 (3), @westonruter (3), @jorbin (3), @TobiasBg (2), @chrisvanpatten (2), @joedolson (2), @soean (2), @dilipbheda (2), @manishamakhija (2), @kjellr (2), @garrett-eclipse (2), @flixos90 (2), @kafleg (2), @Clorith (2), @dlh (2), @Boniu91 (2), @justinahinon (2), @ryelle (2), @ocean90 (2), @mte90 (2), @hareesh-pillai (2), @jrf (2), @webcommsat (2), @drewapicture (2), @tobifjellner (2), @bgardner (1), @rviscomi (1), @sourav926 (1), @jonoaldersonwp (1), @azaozz (1), @briceduclos (1), @colorful-tones (1), @tweetythierry (1), @pbearne (1), @sebastianpisula (1), @aaroncampbell (1), @kapilpaul (1), @xknown (1), @chriscct7 (1), @donmhico (1), @gziolo (1), @malthert (1), @greenshady (1), @nacin (1), @rohan013 (1), @bernhard-reiter (1), @ntsekouras (1), @tw2113 (1), @Nikschavan (1), @keyur5 (1), @paaljoachim (1), @jdy68 (1), @dgwyer (1), @almendron (1), @kallookoo (1), @zieladam (1), @palmiak (1), @andraganescu (1), @dingo_d (1), @isabel_brison (1), @utz119 (1), @kadamwhite (1), @scruffian (1), @NateWr (1), @schlessera (1), @Spacedmonkey (1), @ribaricplusplus (1), @talldanwp (1), @wpscholar (1), @pgking (1), @andynick (1), @richtabor (1), @kraftbj (1), @dimadin (1), @gregrickaby (1), @ellenbauer (1), @jffng (1), @dansoschin (1), @karmatosed (1), @littlebigthing (1), @williampatton (1), @onemaggie (1), @matveb (1), @mburridge (1), @mtoensing (1), @nickcernis (1), @nielslange (1), @wparslan (1), @georgestephanis (1), @davidkryzaniak (1), @lukecarbis (1), @galbaras (1), @jdgrimes (1), @justindocanto (1), @kwisatz (1), @liammitchell (1), @lucasw89 (1), @nettsite (1), @dpegasusm (1), @nlpro (1), @procodewp (1), @psufan (1), @richardfoley (1), @skunkbad (1), @travisnorthcutt (1), @fpcsjames (1), @asif2bd (1), @zoiec (1), @ianhayes94 (1), @david.binda (1), @mista-flo (1), @jeffpaul (1), @bravokeyl (1), @gkloveweb (1), @hitendra-chopda (1), @ovann86 (1), @anthonyeden (1), @pankajmohale (1), @sabrib (1), @xkon (1), @dlt101 (1), @mnelson4 (1), @datainterlock (1), @anandau14 (1), @woodyhayday (1), @henrywright (1), @aadilali (1), @jeremyescott (1), @davidmosterd (1), @herregroen (1), @michelwppi (1), @kebbet (1), @iaaxpage (1), @mclaurent (1), @theMikeD (1), @paulschreiber (1), @jeremyfelt (1), @dontgo2sleep (1), @swb1192 (1), @afragen (1), @JeffPaul (1), @Collizo4sky (1), @antpb (1), @hasanuzzamanshamim (1), @jigneshnakrani (1), @sourovroy (1), @rachelbaker (1), @soniakash (1), @benitolopez (1), @danielbachhuber (1), @PieWP (1), @szaqal21 (1), @mjulian7 (1), @pputzer (1), @mamaduka (1), @karpstrucking (1), @mcjambi (1), @ashfame (1), @annezazu (1), @calebwoodbridge (1), @guillaumeturpin (1), and @timothyblynjacobs (1).

Congrats and welcome to our 36 (!!) new contributors of the week: @manishamakhija, @rviscomi, @briceduclos, @keyur5, @kallookoo, @pgking, @andynick, @dansoschin, @mburridge, @mtoensing, @nickcernis, @wparslan, @justindocanto, @kwisatz, @liammitchell, @lucasw89, @nettsite, @dpegasusm, @psufan, @skunkbad, @zoiec, @ianhayes94, @anthonyeden, @sabrib, @dlt101, @datainterlock, @woodyhayday, @aadilali, @mclaurent, @dontgo2sleep, @swb1192, @hasanuzzamanshamim, @benitolopez, @mjulian7, @mcjambi, @calebwoodbridge. ♥️

Core committers: @hellofromtonya (23), @desrosj (18), @noisysocks (14), @joedolson (12), @sergeybiryukov (8), @jorgefilipecosta (7), @davidbaumwald (6), @peterwilsoncc (5), @timothyblynjacobs (5), @westonruter (4), @johnjamesjacoby (2), @jorbin (1), @johnbillion (1), @spacedmonkey (1), @adamsilverstein (1), @ocean90 (1), @youknowriad (1), @flixos90 (1), @antpb (1), @jffng (1), and @ryelle (1).

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

REST API Batch Framework in WordPress 5.6

WordPress 5.6 introduces a framework for making a series of 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/. calls in one request to the server. At its simplest, this is a helpful performance optimization when a large number of write operations need to be made. It also optionally offers basic concurrency controls.

Registration

In order to be used in a batch request, routes must first declare support for the feature during their registration. For example:

register_rest_route( 'my-ns/v1', 'my-route', array(
	'methods'             => WP_REST_Server::CREATABLE,
	'callback'            => 'my_callback',
	'permission_callback' => 'my_permission_callback',
	'allow_batch'         => array( 'v1' => true ),
) );

If the REST API route was implemented using best practices, declaring support should be sufficient for the route to be writable via the batch endpoint. Specifically, these are the things to look out for:

  1. Routes must use the WP_REST_Request object to get all request data. In other words, it shouldn’t access the $_GET, $_POST or $_SERVER variables to get parameters or headers.
  2. Routes must return data. This could be a WP_REST_Response object, a WP_Error object or any kind of 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. serializable data. This means the route must not directly echo the response and die(). For example by using wp_send_json() or wp_die().
  3. Routes must be re-entrant. Be prepared for the same route to be called multiple times in a batch.

Making a Request

To send a batch, make a POST request to https://yoursite.test/wp-json/batch/v1 with an array of the desired requests. For example, the simplest batch request looks like this.

{
  "requests": [
    {
      "path": "/my-ns/v1/route"
    }
  ]
}

Request Format

Each request is an object that can accept the following properties.

{
  "method": "PUT",
  "path": "/my-ns/v1/route/1?query=param",
  "headers": {
    "My-Header": "my-value",
    "Multi": [ "v1", "v2" ]
  },
  "body": {
    "project": "Gutenberg"
  }
}
  • method is the HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. method to use for the request. If omitted, the POST method is used.
  • path is the REST API route to call. Query parameters can be included. This property is required.
  • headers is an object of 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. names to a header values. If the header has multiple values, it can be passed as an array.
  • body is the parameters to pass to the route. It is filled in the POST parameter type.

Discovering Max Requests

By default, the REST API accepts up to 25 requests in a single batch. However, this value is filterable so it can be scaled up or down based on server resources.

function my_prefix_rest_get_max_batch_size() {
	return 50;
}

add_filter( 'rest_get_max_batch_size', 'my_prefix_rest_get_max_batch_size' );

As such, clients are strongly encouraged to make a preflight request to discover the limit. For example, making an OPTIONS request to batch/v1 will return the following response.

{
  "namespace": "",
  "methods": [ "POST" ],
  "endpoints": [
    {
      "methods": [ "POST" ],
      "args": {
        "validation": {
          "type": "string",
          "enum": [ "require-all-validate", "normal" ],
          "default": "normal",
          "required": false
        },
        "requests": {
          "type": "array",
          "maxItems": 25,
          "items": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "enum": [ "POST", "PUT", "PATCH", "DELETE" ],
                "default": "POST"
              },
              "path": {
                "type": "string",
                "required": true
              },
              "body": {
                "type": "object",
                "properties": [],
                "additionalProperties": true
              },
              "headers": {
                "type": "object",
                "properties": [],
                "additionalProperties": {
                  "type": [ "string", "array" ],
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        }
      }
    }
  ],
  "_links": {
    "self": [
      {
        "href": "http://trunk.test/wp-json/batch/v1"
      }
    ]
  }
}

The limit is specified in the endpoints[0].args.requests.maxItems property.

Response Format

The batch endpoint will return a 207 status code and the responses of each request in the same order as they were requested. For example:

{
  "responses": [
    {
      "body": {
        "id": 1,
        "_links": {
          "self": [
            {
              "href": "http://trunk.test/wp-json/my-ns/v1/route/1"
            }
          ]
        }
      },
      "status": 201,
      "headers": {
        "Location": "http://trunk.test/wp-json/my-n1/v1/route/1",
        "Allow": "GET, POST"
      }
    }
  ]
}

Internally, the REST API envelopes each response before including it in the responses array.

Validation Modes

By default, each request is processed in isolation. This means that a batch response can contain some requests that were successful, and some that failed. Sometimes it’s desired to only process a batch if all the requests are valid. For instance, in GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ we don’t want to save some menu items, ideally all would be saved or none would.

To accomplish this, the REST API allows for passing a validation mode of require-all-validate. When this is set, the REST API will first check that each request is valid according to WP_REST_Request::has_valid_params() and WP_REST_Request::sanitize_params(). If any request fails validation, then the entire batch is rejected.

In this example, a batch of two requests is made and the second one has failed validation. Since the order of responses is still the same as the order of requests, null is used to indicate that the request didn’t fail validation.

{
  "failed": "validation",
  "responses": [
    null,
    {
      "body": {
        "code": "error_code",
        "message": "Invalid request data",
        "data": { "status": 400 }
      },
      "status": 400,
      "headers": {}
    }
  ]
}

Note: Using require-all-validate is not a guarantee that all requests will be successful. A route callback may still return an error.

Validate Callback

Those WP_REST_Request methods use the validate_callback and sanitize_callback specified for each parameter when the route is registered. In most cases, this will mean the schema based validation.

Any validation done inside the route, for instance in the prepare_item_for_database method, will not cause the batch to be rejected. If this is a concern, it is recommended to move as much validation as possible into the validate_callback for each individual parameter. This can be built on top of the existing schema based validation, for instance.

'post' => array(
	'type'        => 'integer',
	'minimum'     => 1,
	'required'    => true,
	'arg_options' => array(
		'validate_callback' => function ( $value, $request, $param ) {
			$valid = rest_validate_request_arg( $value, $request, $param );

			if ( is_wp_error( $valid ) ) {
				return $valid;
			}

			if ( ! get_post( $value ) || ! current_user_can( 'read_post', $value ) ) {
				return new WP_Error( 'invalid_post', __( 'That post does not exist.' ) );
			}

			return true;
		}
	)
)

Sometimes when performing validation, the full context of the request is needed. Typically, this validation would have been done in prepare_item_for_database, but WordPress 5.6 introduces an alternative. When registering a route, a top-level validate_callback can now be specified. It will receive the full WP_REST_Request object and can return a WP_Error instance or false. The callback won’t be executed if parameter-level validation did not succeed.

register_rest_route( 'my-ns/v1', 'route', array(
	'callback'            => '__return_empty_array',
	'permission_callback' => '__return_true',
	'validate_callback'   => function( $request ) {
		if ( $request['pass1'] !== $request['pass2'] ) {
			return new WP_Error(
				'passwords_must_match',
				__( 'Passwords must match.' ),
				array( 'status' => 400 )
			);
		}

		return true;
	}
) );

Note: Request validation happens before permission checks take place. Keep this in mind when considering whether to moving logic to a validate_callback.

Limitations

No built-in routes currently allow batching. This will be added in a future release, most likely starting immediately with WordPress 5.7.

GET requests are not supported. Developers are instead encouraged to use linking and embedding or utilize parallel requests for the time being.

Further Reading

See #50244, [49252], [48947], [48945].

Props @kadamwhite, @m_butcher, @jeffmatson for reviewing.

#5-6, #dev-notes, #rest-api

REST API Chat Summary: November 14

This post summarizes the weekly 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/. chat meeting for November 7, 2019. (Slack transcriptAgenda). Weekly REST API component office hours are held every Thursday at 18:00 UTC in the #core-restapi room in the Make WordPress 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/..

Authentication

A new wp-api/authentication GitHub repository was created last week to facilitate the design & development of a REST API authentication solution for WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress..

We continue to be in the information gathering stage. For all interested in contributing to this effort, we will be using part of our weekly REST API office hours each Thursday at 18:00 UTC (Thursday, November 14, 2019, 01:00 PM EST) as a weekly standup to coordinate work.

We also invite you to log issues describing use cases the authentication solution should support.

Registered 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. Types REST API

#47620 aims to create REST API routes to discover the list of registered block types. It is based off the Gutenberg Block Type Registration RFC. @spacedmonkey worked on 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. and is in the process of soliciting feedback from the GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ team, Mobile team, and other members of the REST API team.

A particular point of concern @spacedmonkey brought up was the difficulties about handling the asset fields ( editorScript, script, editorStyle and style ). The RFC defines the fields as either absolute URLs or relative paths to the source files. However the WP_Block_Type class defines those fields as asset handles.

Further the asset URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org or handle is not sufficient to make the asset functional. The list of dependencies, inline scripts, translations, and localized data are all necessary for the script to work.

@timothyblynjacobs mentioned that the RFC discusses statically discovering that information from an associated .asset.json file located “next” to the script file. @aduth mentioned that section is slightly out of date since @wordpress/scripts now outputs a .php file instead of a 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. file.

The participants discussed whether it would be better to include this additional information inline in the Block Type response, or to develop a separate wp/v2/dependencies APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways..

@timothyblynjacobs suggested that including this information inline would be simpler. @spacedmonkey pointed out that then we’d be including full data from a separate resource within the block type response. Elsewhere in the REST API that would be handled by creating a separate API and linking to it.

Additionally, @timothyblynjacobs pointed out that just exposing the list of dependencies isn’t sufficient. The client needs access to the entire dependency graph to ensure each dependency’s dependencies are loaded, and that all scripts are loaded in the correct order.

This all points to a dedicated REST API endpoint being a better solution. The team then discussed the potential privacy and security ramifications about retrieving this information about any registered asset.

A developer may include sensitive data in a wp_localize_script or wp_add_inline_script after registering the script with wp_register_script. Currently, this data would only be exposed when the script is enqueued, which may be protected by a current_user_can or $hook-suffix check. If the REST API allowed returning information about an arbitrary asset handle, this data may be exposed.

Additionally, a developer may conditionally registers asset based on a 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’s settings. By allowing a user to check if a handle is registered via the REST API, it may be possible to determine the setting configuration of a plugin. This may not be desirable for security or privacy related plugins.

@kadamwhite mentioned that historically the REST API has been pretty conservative about what data is exposed. If possible, he’d like to continue along that path. Or theoretically authentication could be required for some pieces of the API since the use case seems to mostly be for editorial interfaces which would require auth anyway. @spacedmonkey also suggested a capability check.

@spacedmonkey and @timothyblynjacobs proposed limiting the assets exposed to ones registered via WP_Block_Type and all WordPress Core assets. Additional assets could be exposed via a registration flag of some kind, like show_in_rest.

Both @aduth and @youknowriad mentioned that this functionality would not just be useful for blocks. As WordPress moves more and more to JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. powered interfaces, the ability to lazy load assets will become increasingly important. The problem here could be generalized to “retrieve all the information necessary to properly load a handle”.

@youknowriad opened a ticketticket Created for both bug reports and feature development on the bug tracker., #48654, to continue the discussion on TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress..

Agenda for November 21

The next REST API meeting is happening in #core-restapi at Thursday, November 21 at 18:00 UTC. Agenda:

  • REST API Authentication project weekly meeting
  • Menus API discussion
  • WP Dependencies API
  • Review open tickets which should be provisionally milestoned for 5.4
  • Open floor

#meeting-notes, #rest-api

REST API Chat Summary: November 7

This post summarizes the weekly 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/. chat meeting for November 7, 2019. (Slack transcript, Agenda). Please note that this meeting did not change time for daylight savings, and Weekly REST API component office hours continue to be held every Thursday at 18:00 UTC in the #core-restapi room in the Make WordPress 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/.. 🙂

Authentication

The first half of the meeting discussed the newly-created wp-api/authentication GitHub repository, a follow-up to discussions at WCUS contributor dayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-contributor-day/. around rebooting work towards a canonical, coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Authentication solution to permit the Mobile team to use the REST API instead of XMLRPC.

Our target for a merge proposal some time next year is to have an use the OAuth 2 handshake flow with dynamic client registration, which issues revocable, long-lived JWT tokens. The repo has no content so far, but we will start work by focusing on UX and the desired user-facing and technical flow rather than diving immediately into code.

@spacedmonkey, @derekherman, and others intend to drive this project over the coming months. If you who is reading this or any colleagues of yours are interested in contributing to this effort, we will be using part of our weekly REST API office hours each Thursday at 18:00 UTC (Thursday at 18:00 UTC) as a weekly standup to coordinate work.

Priorities & Goals

Priorities for Next Release

Key tickets highlighted for consideration as part of the next release cycle include, but are not limited to,

  • Improve performance in route matching #48530
  • Support registered default metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. values #43941
  • Permit schema filtering #47779

If you have a ticketticket Created for both bug reports and feature development on the bug tracker. to highlight or propose for the next bugfix or major releasemajor release A release, identified by the first two numbers (3.6), which is the focus of a full release cycle and feature development. WordPress uses decimaling count for major release versions, so 2.8, 2.9, 3.0, and 3.1 are sequential and comparable in scope., please leave it as a comment below or raise it in #core-restapi. Thank you once more, as well, to everybody who helped drive our API improvements in 5.3!

Documentation

We are behind schedule in updating the REST API handbook to cover the recent changes in WordPress 5.3. @timothyblynjacobs and @kadamwhite will be working to roll these updates out over the coming week. Handbook content is managed at github.com/wp-api/docs.

Open Floor

@timothyblynjacobs raised #44568 and #44886. Because WordPress operations are non-atomic, these race condition issues are not limited to the REST API and were determined to be out-of-scope, so #44886 was closed as wontfixwontfix A resolution on the bug tracker (and generally common in software development) that indicates the ticket will not be addressed further. This may be used for acceptable edge cases (for bugs), or enhancements that have been rejected for core inclusion..

Several bugs were raised and have been provisionally milestoned for 5.4, with the option to backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. as needed once addressed.

To increase contributor awareness of REST API tickets, we discussed holding periodic component scrub meetings in the main #core channel.

Agenda for November 14

The next REST API meeting is happening shortly in #core-restapi at Thursday, November 14, 18:00 UTC. Agenda:

  • REST API Authentication project weekly meeting
  • Review open tickets which should be provisionally milestoned for 5.4
  • Open floor

#meeting-notes, #rest-api

Filtering nested REST response _fields in WP 5.3

WordPress 4.9.8 introduced the ability to limit the fields included in the 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. objects returned from the 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/., for example specifying

/wp/v2/posts?_fields=id,title,author

to return a list of posts with only id, title & author fields in situations where we don’t need all of the data contained in other fields like content or media (see #38131). Since 4.9.8 we’ve made further improvements to skip computing fields we did not explicitly request when _fields is present, saving time on the server in addition to slimming down the JSON response object.

In WordPress 5.3 we are adding the ability to 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. by nested fields. Previously we could only request top-level properties like content or meta, which would return the full content object (with raw and rendered properties when using an edit context) or the object containing all metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. values. We can now specify a nested path such as content.raw and the REST API will skip computing the rendered content, a useful performance boost for applications like GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ which only require that underlying raw post content.

Now that we can register complex array or object meta, we may similarly ask for only a few of many registered meta fields, or certain properties within a complex object, using a query such as this:

?_fields=meta.meta-key-1,meta.meta-key-2,meta.meta-key-3.nested-prop

(Note that this specific meta example depends on bugfix #48266, which will ship as part of RC1.)

Thank you @timothyblynjacobs, @dlh, @danielbachhuber, and @rmccue for assisting with the development of this useful feature!

#5-3, #dev-notes, #rest-api

Dev Chat summary: September 18

@francina was the chat leader. Archives for the chat can be found in #core on 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/..

Announcements

@francina shared a devnote by AccessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility) team. We also had an update from @audrasjb from Accessibility team who said they are working on creating accessibility devnotesdev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. for 5.3.

Upcoming Release Discussions

@ianbelanger gave an update of the work on default theme Twenty Twenty. A working version of the theme will be available on Monday for BetaBeta A pre-release of software that is given out to a large group of users to trial under real conditions. Beta versions have gone through alpha testing in-house and are generally fairly close in look, feel and function to the final product; however, design changes often occur as part of the process. 1 of WordPress 5.3. The development of the theme is happening on GitHub and contributions are more than welcome on the repository or in #core-theme channel on Slack.

@audrasjb make an update for Accessibility focus for 5.3. He remembered that they have 2 dedicated scrubs per week and that the team is currently coordinating with the Design team to determine which changes will be included in 5.3.

@jorbin gave an update for PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 7.4 in WordPress. All the changes for the version are already landed in trunk. He also highlighted the great work of @desrosj and @jrf to make this possible. He finally announced the target is to fully support PHP 7.4 with WordPress 5.3.

@desrosj made a call for help for tickets in this report on WordPress TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress.. People who own tickets in that report are invited to give them a status and to puntpunt Contributors sometimes use the verb "punt" when talking about a ticket. This means it is being pushed out to a future release. This typically occurs for lower priority tickets near the end of the release cycle that don't "make the cut." In this is colloquial usage of the word, it means to delay or equivocate. (It also describes a play in American football where a team essentially passes up on an opportunity, hoping to put themselves in a better position later to try again.) them if they feel that the tickets will not be ready for 5.3 release. Also owners who are not anymore available to continue working on their tickets are invited to remove themselves as owner and leave a status so that another contributors can take the relay.

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/. component maintainer @kadamwhite announce that the team is about to land a good set of enhancements before the Beta 1 deadline. Dev-notes for these changes will be published soon of Make/CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blogblog (versus network, site).

@garrett-eclipse from Privacy team announced that 4 privacy related enhancements have already been included for the release with no issues.

@antpb made an update for Media component, and remembered that the focus for the the release is around image handling and UIUI User interface improvement and accessibility issues. Tickets for the focus can be found on WordPress Trac here.

5.3 Marketing Lead @mikerbg announced that the marketing team is working to organize content for the about page and other assorted release announcements. Progress on their work is tracked here.

@davidbaumwald remembered that scrubs schedule for 5.3 can be found here and that @marybaum volunteered to lead the one of October 9. Scrubs take place on #core channel on Slack and anyone interested in welcome to participe or to run scrubs.

Calls from component maintainers

@kadamwhite said 5.3 is probably the best release for REST API improvements in a long while, and that the team is grateful for everybody who has contributed to the component.

Open floor

@ianbelanger said Twenty Twenty team have been discussing the idea of having a demo site for the theme asked if this is something that can be done, and what happened for previous default theme. @kraftbj volunteered to help on this.

@kadamwhite asked for another persons eyes on #42094.

@garrett-eclipse asked help for review from available committers on #37782 before Monday.

@audrasjb pointed out #46312, a candidate for an easy commit action.

@hareesh-pillai asked for movements on https://meta.trac.wordpress.org/ticket/4706 as it is a blockerblocker A bug which is so severe that it blocks a release. on #22994.

#5-3, #dev-chat, #summary

Dev Chat Summary: August 14

After the close of our every-two-weeks new contributor chat, the weekly coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. chat started at 2000 UTC, give or take a few minutes. (backscroll)

Announcements

Next Minor: 5.2.3

Next Major: 5.3

  • All but two focus lead type people are settled. An update post is upcoming (and will be shared by the end of the week regardless of whether those final two are settled or not).

Open Floor

To Do List from this Chat

  • First 5.2.3 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. scrub Thursday, August 15 @ 1700 UTC
  • If you want to help with the 5.2.3 minor releaseMinor Release A set of releases or versions having the same minor version number may be collectively referred to as .x , for example version 5.2.x to refer to versions 5.2, 5.2.1, 5.2.3, and all other versions in the 5.2 (five dot two) branch of that software. Minor Releases often make improvements to existing features and functionality. and weren’t mentioned above, you can indicate your interest in the comments of this post.

#summary #5-2-3 #5-3 #rest-api #auto-update

Editor chat summary: 7 August 2019

This post summarizes for the weekly editor chat meeting on Wednesday, August 7, 2019 at 1300 UTC held in Slack.

The agenda can be found here.

Task Coordination

  • @nadir working with @joen on improvements to the Separator 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. (may end up as new Divider block), and is looking into making the Stylelint config more strict.
  • @youknowriad gave feedback on PRs, is exploring a full screen modal proposal, and would like help moving the Structure and Block Navigation PR forward.
  • @karmatosed triaging PRs and modal excitement.
  • @mapk working on grid system and table block. Would like dev help with widgets and “Replace Image“.
  • @kjellr working on Tips and the Notice component.
  • @gziolo published and improved WordPress npm packages. Working on unification of text blocks and More menu accessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility) with @noisysocks and @afercia.
  • @brentswisher wants feedback on a PR review for documentation about reviewing PRs. Wants to integrate updated prototype from @tinkerbelly for updating publishing flow and keep reviewing open PRs.
  • @chrisvanpatten will be triaging docs tickets 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. for Publishers.
  • @pierlo updated a PR to show anchors in the block navigation.
  • @paaljoachim added mockups for alternative heading icons.

Open Floor

@karmatosed and @chrisvanpatten brought up the need for leadership in user focused documentation for GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/.

Graphics requested for Gutenberg documentation can be found on the Design team’s board.

@paaljoachim offered to reach out to the docs team for assistance in moving forward. If you’re interested in helping with user-focused docs for Gutenberg, please reach out in the comments here or in the #core-editor channel!

@kadamwhite mentioned that the 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/. team is working on catching up with requests for feedback on tickets and invited folks to the the #core-restapi channel to connect.


Note: Anyone reading this summary outside of the meeting, please drop a comment if you can/want to help with something.

The agenda for the next meeting, 14 August 2019 13:00 UTC is here, please add anything you want to discuss.

#editor, #gutenberg, #meeting-notes