A Week in Core – February 26, 2024

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 February 19 and February 26, 2024.

  • 53 commits
  • 100 contributors
  • 73 tickets created
  • 5 tickets reopened
  • 71 tickets closed

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

  • Bump the Node.js version for Codespaces – #60555
  • Fix docblocks in a couple of test files to use two asterisks – #60513
  • Revert r57684#59647
  • Update JSHint config to remove deprecated options – #28236
  • Mock 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. response in 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 Dependencies tests – #59647
  • Query mariadb.org instead of mariadb.com in README test – #59647
  • Synchronize 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. 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. between Core and 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/#60387
  • Use assertSame() in WP_REST_Navigation_Fallback_Controller tests – #59655
  • Use assertSame() in comment_exists() tests – #59655
  • Use assertSame() in new_admin_email_subject 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. test – #59655
  • Use assertSame() in wp_insert_post() tests – #59655
  • Use assertSame() in wp_read_image_metadata() tests – #59655

Bundled Themes

  • Twenty Twenty-Three: Update XX-large font-sizes for 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)#58603

Coding Standards

  • Fix alignment in tests – #34668
  • Correct alignment in wp_get_attachment_image_src()#59650

Docs

  • Add a @since note for $preferred_ext parameter in wp_mime_type_icon()#31352
  • Correct the URLs that document the available images for 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/. and MariaDB for the local development environment – #59930
  • Improve docblockdocblock (phpdoc, xref, inline docs) for $x_redirect_by param in wp_redirect()#60209
  • Use more inclusive term in rest_filter_response_fields docblock – #59651

Editor

  • Add fallback for 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. version when registering block script module – #60233
  • Add id to the supported Image’s binding attributes – #60577
  • Allow symlinks in directories provided to get_block_asset_url()#59175, #58525
  • Ensure font collection metadata can be properly localized – #60509
  • Fix instance element styles for links applying to buttons – #60557
  • Format and sanitize font family names according the CSSCSS Cascading Style Sheets. spec – #60537
  • Improve PHPUnit tests for block pattern registration – #59532
  • Load pattern content only when used – #59532
  • Update Packages with the latest 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. fixes for 6.5 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. 2 (Round 2) – #60315
  • Update Packages with the latest bug fixes for 6.5 beta 2 – #60315
  • Block 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.: Allow hooked_block filters to return null – #60580
  • Block Hooks: Fix actual/expected order in test assertions – #60506
  • Block Hooks: Introduce a new hooked_block filter – #60574
  • Block Hooks: Make test a bit easier to read – #60580

Export

  • Include 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. for posts or pages – #17379

General

  • Handle missing field in WP_List_Util::pluck() – #59774

I18Ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.

  • Do not set translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. controller localeLocale A locale is a combination of language and regional dialect. Usually locales correspond to countries, as is the case with Portuguese (Portugal) and Portuguese (Brazil). Other examples of locales include Canadian English and U.S. English. in bootstrap – #59656

Media

  • Ensure wp_mine_type_icon() returns expected file type – #31352
  • Fix broken media modal following [57688]#58973
  • Prevent Media Library 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. from showing with no actions – #58973

Plugins

  • Plugin Dependencies: Remove auto-deactivation and bootstrapping logic – #60457, #60491, #60510, #60518
  • Output plugin card elements in the order they’re displayed – #60488

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

  • Pass correct context to embedded items – #43439

Script Loader

  • Add hooks for script modules and interactivity API only on after_setup_theme#60411
  • Fix small typo in wp_remove_surrounding_empty_script_tags docblock – #60591
  • Inject wp_remove_surrounding_empty_script_tags function name in returned error string using sprintf – #60590

Shortcodes

  • Fix small typo in inline documentation – #60603

Themes

  • Use original template paths when switching blogs – #60290

Toolbar

  • Accessibility: Keyboard navigation for screen readers – #34668, #43633

Upgrade/Install

  • Fix upgrade count decrement on Updates page – #60589
  • Improve plugin install button appearance – #60494
  • Normalize major versions in is_wp_version_compatible()#59448

Props

Thanks to the 100 (!) people who contributed to WordPress Core on Trac: @swissspidy (16), @costdev (8), @joedolson (6), @mukesh27 (6), @joemcgill (5), @youknowriad (5), @gziolo (4), @huzaifaalmesbah (4), @afragen (3), @hellofromTonya (3), @shailu25 (3), @SergeyBiryukov (3), @sabernhardt (2), @afercia (2), @netweb (2), @azaozz (2), @kkmuffme (2), @thekt12 (2), @Ankit-K-Gupta (2), @zunaid321 (2), @antpb (2), @poena (2), @dhruvishah2203 (2), @mmaattiiaass (2), @spacedmonkey (2), @jghazally (2), @audrasjb (2), @aaronrobertshaw (2), @get_dave (2), @scruffian (2), @abletec (1), @Cheffheid (1), @alexstine (1), @sparklingrobots (1), @danieltj (1), @dionysous (1), @jorbin (1), @sessioncookiemonster (1), @wazeter (1), @oglekler (1), @kevin940726 (1), @naoki0h (1), @kirasong (1), @iamarunchaitanyajami (1), @davidbinda (1), @helgatheviking (1), @nendeb55 (1), @mikachan (1), @ryokuhi (1), @sruthi89 (1), @nithi22 (1), @ivanzhuck (1), @ukdrahul (1), @grantmkin (1), @flixos90 (1), @manfcarlo (1), @metropolis_john (1), @jeremyfelt (1), @aristath (1), @billseymour (1), @nateallen (1), @petitphp (1), @duck_ (1), @jane (1), @rcain (1), @smub (1), @batmoo (1), @axwax (1), @creativeslice (1), @dlocc (1), @nacin (1), @wonderboymusic (1), @ganon (1), @hlashbrooke (1), @chriscct7 (1), @fischfood (1), @hifidesign (1), @bosskhj (1), @antonlukin (1), @maxpertici (1), @peterwilsoncc (1), @joshuatf (1), @tomjcafferkey (1), @itschristiandale (1), @mahnewr (1), @rudlinkon, @kraftbj (1), @freewebmentor (1), @ajlende (1), @dennysdionigi (1), @bgardner (1), @westonruter (1), @bernhard-reiter (1), @mamaduka (1), @timothyblynjacobs (1), @dd32 (1), @desrosj (1), @pbiron (1), @nithins53 (1), @kafleg (1), and @vivekawsm (1).

Congrats and welcome to our 14 (!) new contributors of the week: @jghazally, @abletec, @sessioncookiemonster, @wazeter, @iamarunchaitanyajami, @sruthi89, @ukdrahul, metropolis_john, @billseymour, @rcain, @axwax, @creativeslice, @ganon, @hifidesign ♥️

Core committers: @swissspidy (13), @sergeybiryukov (7), @joedolson (6), @youknowriad (5), @costdev (4), @joemcgill (3), @hellofromtonya (3), @bernhard-reiter (3), @audrasjb (3), @gziolo (2), @peterwilsoncc (1), @kadamwhite (1), @johnbillion (1), and @desrosj (1).

#6-5, #core, #week-in-core

A Year in Core – 2023

Happy new year, everyone! Here’s some aggregate data for 2023 about WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. contribution on TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress..

Please note:

  • These data only include code contributions to WordPress codebase, not contributions on 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/ repositories such as 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/.
  • The raw data for this post are available on this public spreadsheet. You might find that much easier to read if you have low vision or colorblindness; the graphics below are a snapshot pulled together to include as much information as possible in this blogpost, but they are hard to make accessible to everyone.
  • You can also compare these stats with last year’s data and data from 2021.
  • All the links for the graphics below open a new tab to display them in full size.

General Trac overview

In 2023, the WordPress Core team shipped 2211 commits (2597 in 2022). 2751 tickets were opened, 2545 tickets were closed, and 365 were reopened.

Also, 1079 people contributed to WordPress source code using Trac (988 in 2022), and 472 people made their very first contribution to WordPress Core ♥️ (398 in 2022).

JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberTotal
Commits14826517984174246209173250288108872211
Tickets closed1812972181561792592112772392681481122545
Tickets reopened253636192540422935402810365
Tickets created1852342081882082552563102502702121752751
New contributors18912318257451317546128472
Contributors13729515587150279217182295249111931079
This chart shows the number of commits per month in 2023, and the number of closed, reopened and created tickets per month. It also shows the number of contributors per month in 2023. It can be scrolled horizontally.

Check out the Trac timeline in the graphs below:

2023 Core Trac tickets by month (opens in a new tab)
2023 Core commits by month (opens in a new tab)

Here’s how many props and new contributors the Core project had per month. The most prolific months were February and September with 295 contributors each, followed by June and October. 42 of the new contributors received their first props on a commit related to the Twenty Twenty-Four theme.

2023 WordPress Core contributors by month (opens in a new tab)

Components activity

How did 2023’s commits break out by Core Component?

The most prolific components were:

  • Editor with 284 commits (12.8% of all listed commits)
  • Build/Test Tools with 265 commits (12% of all listed commits)
  • Docs with 188 commits (8.5% of all listed commits)
  • Coding Standards with 154 commits (7% of all listed commits)
  • Bundled Themes with 130 commits (5.9% of all listed commits)
  • Then came MediaHelp/About, Code Modernization (which is not an official component), Themes, Administration, General, HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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., Internationalization, 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/. and Upgrade/Install. The other components each had fewer than 30 commits this year.

Contributors data retrieved from 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/ profiles

The data below comes from matching contributors’ usernames, as mentioned in Trac props, with their profiles on WordPress.org.

One caveat: this ignores usernames that did not match a profile on dotorg, plus any that had blank or unusable country/company information (“The Universe” or “Unicorn land” are not known countries 🙂).

Contributions by country

The next graph shows the number of props received by country. The top eight countries, based on the number of props received, are these:

  • United States with 2062 contributions (1255 in 2022)
  • Russia with 795 contributions (1152 in 2022)
  • India with 683 contributions (317 in 2022)
  • France with 680 contributions (739 in 2022)
  • Australia with 611 contributions (386 in 2022)
  • United Kingdom with 471 contributions (216 in 2022)
  • Ireland with 403 contributions
  • Bangladesh with 340 contributions (145 in 2022)
Contributions by country (opens in a new tab)

Contributors (people) by country

In 2023, people from at least 62 countries contributed to WordPress Core (57 countries in 2022).

Here are the top eight countries by number of contributors:

  • United States with 164 people (152 in 2022)
  • Bangladesh with 105 people (only 43 in 2022)
  • India with 93 people (77 in 2022)
  • United Kingdom with 31 people (38 in 2022)
  • France with 30 people (22 in 2022)
  • Canada with 25 people (17 in 2022)
  • Germany with 21 people (25 in 2022)
  • Netherlands with 21 people (23 in 2022)
  • Spain with 19 people (12 in 2022)
Contributors by country (opens in a new tab)

Contributions by company

In 2023, people from at least 286 companies contributed to WP Core.

These companies (well, their employees) each contributed to more than 100 commits:

  • Automattic with 1770 contributions (866 in 2022)
  • Yoast with 985 contributions (1452 in 2022)
  • 10up with 904 contributions (501 in 2022)
  • Whodunit with 561 contributions (676 in 2022)
  • Google with 404 contributions (130 in 2022)
  • Bluehost with 238 contributions (226 in 2022)
  • XWP with 224 contributions (14 in 2022)
  • Human Made with 177 contributions (126 in 2022)
  • Advies en zo with 143 contributions (220 in 2022)
  • Dream Encode with 128 contributions (124 in 2022)
  • Emilia Capital with 123 contributions
  • Accessible WD with 120 contributions (53 in 2022)
  • GoDaddy with 111 contributions (42 in 2022)
Contributions by company (opens in a new tab)

Contributors (people) by company

A huge number of companies have only one contributor—or very few contributors. The exceptions are Automattic, with 108 core contributorsCore Contributors Core contributors are those who have worked on a release of WordPress, by creating the functions or finding and patching bugs. These contributions are done through Trac. https://core.trac.wordpress.org. on Trac in 2023, WPDeveloper (39 contributors), 10up with 25 contributors, AuthLab (21 contributors), rtCamp (17 contributors), Awsm (12 contributors), Human Made (12 contributors), Multidots (12 contributors), and Yoast (10 contributors). Only these 9 companies had at least 10 people credited on Trac in 2023.

Contributors by company (opens in a new tab)

What did 2022 hold for Core Committers?

39 Core Committers committed code to the WordPress SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. repository this year (32 in 2022):

@sergeybiryukov (552), @audrasjb (413), @desrosj (148), @hellofromtonya (134), @joedolson (93), @isabel_brison (88), @spacedmonkey (88), @flixos90 (87), @peterwilsoncc (82), @davidbaumwald (77), @bernhard-reiter (67), @jorbin (44), @johnbillion (43), @joemcgill (39), @swissspidy (30), @azaozz (27), @costdev (25), @westonruter (25), @karmatosed (24), @gziolo (22), @oandregal (15), @ryelle (15), @adamsilverstein (9), @danielbachhuber (9), @jorgefilipecosta (8), @zieladam (7), @kadamwhite (6), @youknowriad (6), @antpb (4), @drewapicture (4), @mikeschroder (4), @afercia (3), @timothyblynjacobs (3), @clorith (2), @dd32 (2), @helen (2), @ocean90 (2), @johnjamesjacoby (1), and @whyisjake (1).

Of the 2211 commits, 555 (25%) were made by people working at Yoast, 413 (19%) from people working at Whodunit, 399 (18%) from employees of Automattic, followed by Google (151 commits), Bluehost (148 commits) and 10up (123 commits).

Core Committers by company (opens in a new tab)

Automattic is the only company with more than 10 active Core Committers, and 12 of them committed code in 2023. Google has 4 people allowed to commit code to WordPress, followed by 10up with 3 Core Committers.

Worth noting that 15 of the 39 active committers come from the US, which represents 38% of the Core Committers squad. Australia, Canada, Italy, Poland and United Kingdom each had 2 committers.

More than 30% of the commits were handled by committers located in the United States, 26% by committers located in Russia, and 19% by committers located in France.

Core Committers by country (opens in a new tab)

Sponsorship

In 2023, 21.6% of the contributors and 23.1% of the committers indicated that a company sponsors their contributions.

Sponsorship of contributors in 2023 (pie chart opens in a new tab)
Sponsorship of committers in 2023 (pie chart opens in a new tab)

Many thanks to @audrasjb for help collecting the 2023 data and for adding several graphics.

#contributions, #contributors, #team-update, #week-in-core, #year-in-core

Four Weeks in Core – October 9, 2023

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 4 and October 9, 2023.

Please note that exceptionally and because of personal vacations, this Week in Core issue covers 4 weeks 😊

  • 269 commits
  • 337 contributors
  • 295 tickets created
  • 43 tickets reopened
  • 277 tickets closed

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.

Continue reading

#6-4, #core, #week-in-core

Two Weeks in Core – September 4, 2023

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 August 21 and September 4, 2023.

  • 75 commits
  • 150 contributors (!)
  • 25 new contributors (!)
  • 129 tickets created
  • 13 tickets reopened
  • 117 tickets closed

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

  • Escape post type output as field attribute – #59190

Build/Test Tools

  • Avoid doing copy:dynamic when running grunt watch when using --dev option – #59196
  • Change the version of Node.js in the Codespaces container – #56658
  • Compare results in performance measurement workflow – #58358, #58359
  • Enable running the tests on PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher 8.3 – #59231
  • Ensure database containers are prepared for commands – #30462, #58867
  • Expand database testing to account for all supported versions and types – #30462
  • Implicitly pass secrets to the called workflow – #30462
  • Merge pre-commit changes missed in [56439]#30462
  • Revert unintentional .env change in [56449]#56594
  • Tests_Formatting_MakeClickable should use data providors – #57660
  • Correct uses of ReflectionProperty::setValue() for static properties – #59231
  • Fix coding standards for Tests_Admin_wpUserSearch#41125
  • Remove webfonts tests – #59165

Bundled Theme

  • Twenty Nineteen: Improve social media icon dimension attributes – #45950
  • Ensure that pull quotes are able to use the correct font size – #57854

Coding Standards

  • Remove unused global variables in various /wp-admin/includes/ files – #59254
  • Use strict comparison in wp-includes/class-wp-hook.php#58831
  • Use strict comparison in wp-includes/class-wp-widget.php#58831
  • Use strict comparison in wp-includes/ms-files.php#58831
  • Use strict comparison in wp-includes/ms-site.php#58831

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.

  • use the correct X-Robots-Tag 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.#58865

Database

  • Improve the documentation for various methods in the wpdb class – #58833
  • Remove support for the mysql extension – #59118

Docs

  • Add missing param description in WP_Comment class – #58890
  • Clarify post_date_column_time 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. description – #59029
  • Correct default post type in page_template_dropdown() docblockdocblock (phpdoc, xref, inline docs)#58972
  • Docblock improvements in _deprecated_class() function, as per docblocks standards – #58833
  • Fix typo in a translator comment in _deprecated_class()#58833
  • Improve PHPCSPHP Code Sniffer PHP Code Sniffer, a popular tool for analyzing code quality. The WordPress Coding Standards rely on PHPCS. comments general consistency – #58833
  • Use third-person singular verbs in various function descriptions, as per docblocks standards – #58833
  • Wrap inline @see tags in curly braces – #58858

Editor

  • Add relative time strings for the wp-date inline script output – #59219, #47373
  • Don’t use fluid layout value in typography – #58754
  • Ensure main 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. is entered for singular content in 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 – #58154
  • Optimize wp_get_block_css_selector to remove array_merge calls for better performance – #59178
  • Preserve block style variations when securing theme – #59108
  • Introduce font-face styles generator and printer – #59165

External Libraries

  • Update jQuery to version 3.7.1 – #59227
  • Upgrade PHPMailer to version 6.8.1 – #59238 – #58833

General

  • Fix coding standards for translatable _deprecated_class() message strings – #41125
  • Introduce a _deprecated_class() function – #41125
  • Replace two esc_url_raw() calls in core with sanitize_url()#59247
  • Use regular core button styles for page header actions – #41986

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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.

  • Stop processing HTML when encountering unsupported markup – #59167
  • Update WP_Http class to avoid PHP deprecation warnings – #58876

Help/About

  • Match icon and text in Help for bulk edit button – #58785

Login and Registration

  • Improve test coverage for sign on related functions – #36476

Media

  • Add a filter to the get_available_post_mime_types() function to allow overriding its database query – #52759
  • Prevent warning if 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. is used without attributes – #59206
  • Remove unused $is_IE and $is_opera globals in media_upload_form()#59254

Menus

  • Fix proximity of controls to Save and Delete menus – #56594
  • Revert unintentional changes in [56449]#56594

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

  • Introduce prime_options() to load multiple options with a single database request – #58962
  • Introduce wp_set_option_autoload_values()#58964

Performance

  • Add fallback for $script_uri to prevent firing plugins_url() unnecessarily – #59181

Plugins

  • Correctly display spaces in new plugins search results – #59143

Posts, Post Types

  • Avoid redundant SQL query in get_pages() – #59224
  • Reinstate missing sort_column options in get_pages() – #59226
  • Remove redundant function calls in get_body_class()#43661

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

  • Remove misleading comment in WP_REST_Blocks_Controller->get_item_schema – #59193

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.

  • Add missing escaping function for $post_edit_link in wp-admin/revision.php#59141

Rewrite Rules

  • Prevent stampedes when flush_rewrite_rules() is called – #58998

Site Health

  • Show correct debug value for file uploads – #58737
  • fix check name used for REST API permission checks – #59236

Upgrade/Install

  • Add missing escaping function for get_option( 'home' ) in upgrade.php#59199
  • Remove unused globals in core_upgrade_preamble()#59254

Upload

  • Add a MIME type exception for .docx generated by Google Docs – #57898
  • Correct duplicate MIME type for .xlsx files generated by Google Docs – #57898

Users

  • Call add_user_meta() instead of update_user_meta() when adding metadata to a new user – #59212
  • Properly deprecate both constructors in WP_User_Search#41125
  • Remove unused wpdb global in check_password_reset_key()#59185

Widgets

  • Improve performance of has_content method in WP_Widget_Media_Gallery class – #58757

XML-RPC

  • Remove unused wpdb global in wp_xmlrpc_server::mw_newMediaObject()#59185

Props

Thanks to the 150 (!) people who contributed to WordPress Core on Trac last week:

@mukesh27 (14), @costdev (11), @sergeybiryukov (10), @joemcgill (8), @flixos90 (7), @jrf (7), @poena (6), @aristath (5), @afercia (5), @upadalavipul (5), @spacedmonkey (5), @rajinsharwar (4), @desrosj (4), @azaozz (4), @Presskopp (4), @jorbin (3), @oglekler (3), @ramonopoly (3), @swissspidy (3), @david.binda (3), @westonruter (2), @hellofromTonya (2), @oandregal (2), @boonebgorges (2), @tabrisrp (2), @gziolo (2), @daxelrod (2), @johnbillion (2), @hztyfoon (2), @davidbaumwald (2), @sabernhardt (2), @jeffpaul (2), @nidhidhandhukiya (2), @niravsherasiya7707 (1), @michelleblanchette (1), @dhruvishah2203 (1), @matthewfarlymn (1), @elrae (1), @DrewAPicture (1), @rmccue (1), @ohryan (1), @wvega (1), @ahardyjpl (1), @nekojonez (1), @dilipbheda (1), @TobiasBg (1), @Synchro (1), @aslamdoctor (1), @maltfield (1), @szepeviktor (1), @bvreeman22 (1), @johnregan3 (1), @johnjamesjacoby (1), @iammehedi1 (1), @jordanpak (1), @adhun (1), @nithi22 (1), @huzaifaalmesbah (1), @deepakvijayan (1), @zunaid321 (1), @olliejones (1), @laurelfulford (1), @maxinacube (1), @l1nuxjedi (1), @pento (1), @netweb (1), @nacin (1), @crstauf (1), @armondal (1), @tahmidulkarim (1), @crunnells (1), @TimothyBlynJacobs (1), @JordanPak (1), @emailjoey (1), @melchoyce (1), @michaelarestad (1), @danieltj (1), @helen (1), @viralsampat (1), @adamsilverstein (1), @iCaleb (1), @maciejmackowiak (1), @archon810 (1), @rcorrales (1), @varjodesigns (1), @jivygraphics (1), @whyisjake (1), @90lines (1), @sc0ttkclark (1), @jakariaistauk (1), @djcowan (1), @arena (1), @askdesign (1), @bph (1), @bradley2083 (1), @colorfultones (1), @dingo_d (1), @domainsupport (1), @annezazu (1), @dryanpress (1), @elmastudio (1), @francina (1), @garrett-eclipse (1), @gigitux (1), @grantmkin (1), @antonvlasenko (1), @andraganescu (1), @ironprogrammer (1), @Michi91 (1), @youknowriad (1), @jastos (1), @aurooba (1), @dsas (1), @jonoaldersonwp (1), @grapplerulrich (1), @jb510 (1), @annashopina (1), @soean (1), @wildworks (1), @zaguiini (1), @winterstreet (1), @mujuonly (1), @mi5t4n (1), @audrasjb (1), @simison (1), @mikeschroder (1), @manzoorwanijk (1), @adrianduffell (1), @ipajen (1), @dmsnell (1), @skorasaurus (1), @shiloey (1), @jeremyyip (1), @mburridge (1), @jffng (1), @joostdevalk (1), @jorgefilipecosta (1), @juanmaguitar (1), @mamaduka (1), @matveb (1), @mitogh (1), @scruffian (1), @ndiego (1), @ntsekouras (1), @ocean90 (1), @paaljoachim (1), @pagelab (1), @peterwilsoncc (1), @priethor (1), and @mattkeys (1).

Congrats and welcome to our 25 (!) new contributors of the week: @niravsherasiya7707, @michelleblanchette, @matthewfarlymn, @wvega, @ahardyjpl, @aslamdoctor, @maltfield, @bvreeman22, @iammehedi1, @jordanpak, @maxinacube, @l1nuxjedi, @JordanPak, @emailjoey, @varjodesigns, @jivygraphics, @90lines, @djcowan, @askdesign, @Michi91, @jastos, @winterstreet, @mi5t4n, @adrianduffell, @shiloey ♥️

Core committers: @sergeybiryukov (15), @audrasjb (13), @johnbillion (6), @desrosj (5), @swissspidy (4), @drewapicture (4), @jorbin (3), @peterwilsoncc (3), @joedolson (3), @joemcgill (3), @flixos90 (2), @isabel_brison (2), @hellofromtonya (2), @timothyblynjacobs (1), @davidbaumwald (1), @antpb (1), @kadamwhite (1), @spacedmonkey (1), @westonruter (1), @adamsilverstein (1), @bernhard-reiter (1), @costdev (1), and @whyisjake (1).

#6-4, #core, #week-in-core

A Week in Core – July 24, 2023

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 July 17 and July 24, 2023.

  • 44 commits
  • 83 contributors
  • 83 tickets created
  • 13 tickets reopened
  • 56 tickets closed

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

  • Add a missing closing span 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.) for column sorting indicators – #32170, #57839
  • Update dashboard welcome panel for 6.3 – #58545

Build/Test Tools

  • Remove outmoded jsvalidate task from Gruntfile – #58645, #26615

Bundled Themes

  • Twenty Twenty-One: Enable Dark Mode in the 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. editor 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.#58835
  • Twenty Twenty-Three: Remove the perPage attribute where the query inherits from the global query. The global attribute should be used instead – #58581
  • Twenty Twenty-Three: Revert [55898]#58485

Code Modernization

  • Use str_contains() in a few more places – #58206

Coding Standards

  • Always use parentheses for class instantiation – #58831
  • Correct alignment in wp-includes/media.php#58831
  • Correct equals sign alignment in various files – #58831
  • Remove trailing tabs in wp-admin/about.php#58831, #58067
  • Use strict comparison for static strings in wp-admin/includes/class-wp-list-table.php#32170, #57839

Docs

  • Add a missing word in maybe_create_table() description – #58841
  • Fix indentation issue in WP_REST_Global_Styles_Revisions_Controller class – #57840, #58524
  • Fix various incorrect @since mentions – #58834
  • Various docblocks corrections – #57840

Editor

  • Add test for context setting in Comment Template block – #58839
  • Fix a PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher notice appearing when adding a new template part – #57851
  • Fix abbreviations of “Example” in block-template-utils.php#58879
  • Fix 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. where it was not possible to style custom block elements in theme.json#57868
  • fix popover positioning – #58847
  • load title on navigation fallback – #58557
  • update npm packages with bug fixes for 6.3 RC2 – #58804

External Libraries

  • Update deprecated jQuery code in Farbtastic lib – #57946

General

  • Commit changes after running precommit:css#57856, #58869
  • Rename wp_in_development_mode() to wp_is_development_mode()#57487

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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.

  • Change wp infix in test classes to Wp#58899
  • Introduce minimal HTML Processor – #58517

Help/About

  • Add illustrations to the Get Involved tab – #23348
  • String changes in the Contribute screen – #23348
  • Update the About page for 6.3 – #58067
  • Updates to About page – #58067

I18Ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.

  • Add missing translator comment in WP_Upgrader::generic_strings()#58831

Media

  • Adjust PDF upload handling to remove non-opaque alpha channels from previews – #39216
  • Fix Image rotation button overflow in translations – #58877
  • Fix height max value in image scaling – #50523
  • Stop using and deprecate set_imagick_time_limit(). Seems it causes more problems than it solves – #58202

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

  • Update Global styles 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. private methods to protected – #58846

Script Loader

  • Improve test coverage for wp_print_scripts()#58648

Upgrade/Install

  • Add correct parameters to add_option in upgrade_630 – #58821

Props

Thanks to the 83 (!) people who contributed to WordPress Core on Trac last week:

@costdev (11), @audrasjb (7), @joemcgill (7), @ramonopoly (6), @mukesh27 (6), @jrf (5), @peterwilsoncc (5), @azaozz (4), @flixos90 (4), @markoserb (4), @oglekler (4), @richtabor (4), @swissspidy (3), @spacedmonkey (3), @joedolson (3), @sergeybiryukov (3), @jorbin (2), @poena (2), @desrosj (2), @dmsnell (2), @dunhakdis (2), @huzaifaalmesbah (2), @westonruter (2), @peterwilson (1), @ryelle (1), @andrewserong (1), @gudmdharalds (1), @glendaviesnz (1), @oandregal (1), @TobiasBg (1), @Malae (1), @sabernhardt (1), @Presskopp (1), @mrinal013 (1), @Rahmohn (1), @mikachan (1), @robinwpdeveloper (1), @onemaggie (1), @dsar (1), @antpb (1), @hberberoglu (1), @mtxz (1), @densityapps (1), @ekazda (1), @matt_fw (1), @jameskoster (1), @soulseekah (1), @mikeschroder (1), @wildworks (1), @davidbaumwald (1), @annezazu (1), @saxonafletcher (1), @mwtsn (1), @hasanuzzamanshamim (1), @Ankit K Gupta (1), @get_dave (1), @scruffian (1), @nekojonez (1), @jordesign (1), @bhrugesh12 (1), @kebbet (1), @isabel_brison (1), @zieladam (1), @gitlost (1), @launchinteractive (1), @emirpprime (1), @ceer (1), @joen (1), @maysi (1), @madejackson (1), @6adminit (1), @crstauf (1), @james0r (1), @jpantani (1), @dansoschin (1), @mikinc860 (1), @priethor (1), @marybaum (1), @eidolonnight (1), @clarkeemily (1), @cbringmann (1), @meher (1), and @youknowriad (1).

Congrats and welcome to our 7 new contributors of the week: @mwtsn, @launchinteractive, @ceer, @maysi, @madejackson, @6adminit, @james0r ♥️

Core committers: @audrasjb (10), @sergeybiryukov (9), @isabel_brison (4), @ryelle (4), @bernhard-reiter (3), @joedolson (2), @davidbaumwald (2), @azaozz (2), @joemcgill (2), @desrosj (1), @antpb (1), @mikeschroder (1), @spacedmonkey (1), @flixos90 (1), and @kadamwhite (1).

#6-3, #core, #week-in-core

A Week in Core – July 17, 2023

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 July 10 and July 17, 2023.

  • 78 commits
  • 135 contributors
  • 61 tickets created
  • 12 tickets reopened
  • 70 tickets closed

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

  • Add a missing closing `span> 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.) for column sorting indicators – #32170, #57839

Bootstrap/Load

  • Require wp-includes/compat.php in src/index.php#58206

Build/Test Tools

  • Remove outmoded jsvalidate task from Gruntfil – #58645, #26615
  • Prevent 404 errors in the E2E tests – #58777
  • Reset main query object after each test – #58776
  • Suppress E2E test suite 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 – #58779
  • Add tests to ensure the contribute Toolbar node is added when appropriate
  • Use assertSame() in Tests_Comment – #57855

Bundled Theme

  • fix height of featured images in Twenty Twenty Three – #58766
  • Twenty Seventeen: Use wp_register_script() to register HTML5 Shiv script – #56699
  • Twenty Twenty-Three: Add a border to Quote 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.#57506
  • Twenty Twenty-Three: Remove the perPage attribute where the query inherits from the global query. The global attribute should be used instead – #58581
  • Twenty Twenty-Three: Revert [55898]#58485

Code Modernization

  • Use str_contains() in a few more places – #58206

Coding Standards

  • Use single quotes for a string in Tests_Comment#57855
  • Use strict comparison for static strings in wp-admin/includes/class-wp-list-table.php#32170, #57839
  • Use strict comparison in wp-includes/class-wp-network.php#57839
  • Use strict comparison in wp-includes/class-wp-rewrite.php#57839
  • Use strict comparison in wp-includes/load.php#57839
  • Use strict comparison in wp-includes/rewrite.php#57839

Docs

  • Clarify where the wp_get_development_mode() value is retrieved from – #57487, #57840
  • Fix incorrect type for $crop param is various WP_Image_Editor classes and methods – #58271, #57840
  • Fix various incorrect @since mentions – #58834, #57840
  • Replace multiple single line comments with multi-line comments – #58459
  • Replace multiple single line comments with multi-line comments – #58459
  • Replace multiple single line comments with multi-line comments – #58459
  • Replace multiple single line comments with multi-line comments – #58459
  • Replace multiple single line comments with multi-line comments – #58459
  • Replace multiple single line comments with multi-line commentsProps costdev, audrasjb – #58459
  • Use consistent wording for development mode – #57487, #57840
  • Various docblocks corrections – #57840

Editor

  • Add test for context setting in Comment Template block – #58839
  • Fix a PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher notice appearing when adding a new template part – #57851
  • Fix 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. where it was not possible to style custom block elements in theme.json#57868
  • Fix layout of no-js state in site editor – #56228
  • Fix open_basedir warnings on the classic Edit Post screen when additional TinyMCE plugins are use – #54354
  • Lazily load Duotone settings only when needed – #58673
  • fix duotone filters in classic themes – #58734#46132
  • fix since annotation in rest blocks controller class – #58677
  • opt out of Navigation fallback – #58750
  • remove one preloaded navigation endpoint – #58749
  • trim footnote anchors from post excerpts – #58805
  • update npm packages with bug fixes and blessed tasks – #58745
  • update npm packages with first round of bug fixes for 6.3 RC1 – #58804
  • update npm packages with second round of bug fixes for 6.3 RC1 – #58804
  • update string incorrectly marked for translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. in Chrome – #58716

External Libraries

  • Update deprecated jQuery code in Farbtastic lib – #57946

Filesystem 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 wp_tempnam() does not produce file names longer than 255 characters as this is the limit on most filesystems – #35755

General

  • Escape nonce used for block theme activation – #58712
  • Introduce all development mode – #57487
  • Rename wp_in_development_mode() to wp_is_development_mode()#57487
  • add nonce for block theme preview activation – #58712
  • fix botched file move in r56199#58712

Help/About

  • Add a “Get Involved” tab to the About page – #23348
  • Adjust horizontal padding on the tabs under 960 pixels width – #23348
  • Fix closing contextual help when scrolled – #55342
  • Fix typo in [56171]: support forumSupport Forum WordPress Support Forums is a place to go for help and conversations around using WordPress. Also the place to go to report issues that are caused by errors with the WordPress code and implementations. “topic”, not “ticket”
  • String changes in the Contribute screen – #23348
  • Update the About page for 6.3 – #58067
  • Update “Get Involved” tab content with the latest edits – #23348

I18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.

  • Improve the use of dashicons-external icon for external links – #47303
  • Move translator comments inside sprintf for tagline field description – #57675

Media

  • Fix adminadmin (and super admin) image editor layout at intermediary widths – #58692
  • Fix responsive views in image editor – #58692
  • Improve layout of image rotation options panel – #58756
  • Optimize images created in shortcodes – #58681
  • Set default state for image rotation button – #58800
  • Stop using and deprecate set_imagick_time_limit(). Seems it causes more problems than it solves – #58202

Menus

  • Fix critical errors when the page_on_front and/or page_for_posts options contain references to non-existing posts – #58345

Script Loader

  • Improve test coverage for wp_print_scripts()#58648

Toolbar

  • Make the ‘Edit site’ link open the editor with the current template – #58746

Upgrade/Install

  • Add correct parameters to add_option in upgrade_630 – #58821

Props

Thanks to the 135 (!) people who contributed to WordPress Core on Trac last week:

@costdev (24), @mukesh27 (13), @audrasjb (13), @sergeybiryukov (12), @ramonopoly (9), @poena (9), @sabernhardt (8), @spacedmonkey (8), @flixos90 (8), @swissspidy (8), @joemcgill (7), @peterwilsoncc (7), @oglekler (7), @afercia (6), @joedolson (6), @azaozz (5), @mrinal013 (4), @aristath (4), @desrosj (3), @wildworks (3), @westonruter (3), @mikinc860 (3), @davidbaumwald (3), @richtabor (3), @eidolonnight (3), @andrewserong (3), @jpantani (2), @nithi22 (2), @annezazu (2), @priethor (2), @tobifjellner (2), @marybaum (2), @dunhakdis (2), @vivekawsm (2), @robinwpdeveloper (2), @meher (2), @mikeschroder (2), @get_dave (2), @SeReedMedia (2), @antpb (2), @Presskopp (2), @ryelle (2), @nithins53 (2), @jameskoster (2), @alexstine (2), @ajlende (2), @scruffian (2), @isabel_brison (2), @jorbin (2), @mikachan (2), @nacin (1), @jeffmora (1), @bridgetwillard (1), @jenmylo (1), @boemedia (1), @davidmusnik (1), @lukecavanagh (1), @mehdi01 (1), @hugobaeta (1), @TacoVerdo (1), @joostdevalk (1), @johnbillion (1), @markoheijnen (1), @helen (1), @bacoords (1), @fierevere (1), @skorasaurus (1), @andraganescu (1), @dhrumilk (1), @zoonini (1), @akrocks (1), @nidhidhandhukiya (1), @syamraj24 (1), @jomonthomaslobo1 (1), @Toro_Unit (1), @eric.7186 (1), @thunderdw (1), @paaljoachim (1), @courane01 (1), @clubkert (1), @Shelob9 (1), @beckej (1), @abitofmind (1), @Mamaduka (1), @thekt12 (1), @antonvlasenko (1), @mohiuddinomran (1), @estelaris (1), @webcommsat (1), @cathibosco1 (1), @deepakvijayan (1), @mt_suzette (1), @Malae (1), @soulseekah (1), @matt_fw (1), @ekazda (1), @densityapps (1), @mtxz (1), @hberberoglu (1), @dsar (1), @onemaggie (1), @TobiasBg (1), @Rahmohn (1), @oandregal (1), @glendaviesnz (1), @gudmdharalds (1), @saxonafletcher (1), @joen (1), @markoserb (1), @cbringmann (1), @clarkeemily (1), @peterwilson (1), @youknowriad (1), @karmatosed (1), @MadtownLems (1), @brasofilo (1), @jeryj (1), @nazmul111 (1), @Chouby (1), @suzettefranck (1), @ugyensupport (1), @ibrahimmonir (1), @njsamsatli (1), @rembem (1), @mcsf (1), @josklever (1), @wplindavantol (1), @hbhalodia (1), @dansoschin (1), @Heiko_Mamerow (1), @piotrek (1), @mai21 (1), @studionashvegas (1), @mikecho (1), and @doems (1).

Congrats and welcome to our 23 (!!) new contributors of the week: @jeffmora, @davidmusnik, @mehdi01, @beckej, @mohiuddinomran, @mt_suzette, @matt_fw, @ekazda, @densityapps, @mtxz, @hberberoglu, @dsar, @gudmdharalds, @saxonafletcher, @nazmul111, @suzettefranck, @ibrahimmonir, @njsamsatli, @rembem, @wplindavantol, @Heiko_Mamerow, @mikecho ♥️

Core committers: @audrasjb (17), @sergeybiryukov (17), @isabel_brison (13), @joedolson (7), @azaozz (6), @joemcgill (5), @peterwilsoncc (5), @davidbaumwald (2), @spacedmonkey (2), @ryelle (1), @bernhard-reiter (1), @flixos90 (1), @kadamwhite (1), @jorbin (1), and @mikeschroder (1).

#6-3, #core, #week-in-core

A Week in Core – July 3, 2023

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 June 19 and July 3, 2023.

  • 88 commits
  • 143 contributors
  • 87 tickets created
  • 19 tickets reopened
  • 115 tickets closed

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

  • Improve the name of the e2e test jobs on 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 – #58661
  • Run E2E tests with and without SCRIPT_DEBUG enabled – #58661
  • Switch frame container when testing 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. editor output – #58592
  • Switch frame container when testing block editor output – #58592
  • Update terser-webpack-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#58660, – #57657

Bundled Themes

  • Twenty Fourteen: Fix text color issue on Button block hover – #58509
  • Twenty Nineteen: Add fragment ID to paginated links – #45920
  • Twenty Nineteen: Always set background color and foreground color together – #45916
  • Twenty Seventeen: Various docblockdocblock (phpdoc, xref, inline docs) fixes – #58695, #57840
  • Twenty Sixteen: Replace deprecated unbind method with off#58225
  • Twenty Sixteen – Twenty Ten: Reflect Quote block text color on the entire block – #57204
  • Twenty Ten: Prevent Block Inserter icon color override – #57414
  • Twenty Ten: Reflect Heading block text color on front-end – #56603
  • Twenty Twenty-One: Improve various globals documentation, as per docblock standards – #58684
  • Twenty Twenty-Three: Allow changing Site Title font size in Marigold and Whisper styles – #57971
  • Twenty Twenty-Two: Adjust selector to apply bottom margin to top-level comments – #58653
  • Twenty Twenty: Fix Button block text color when located in footer widgets – #57087
  • Twenty Twenty: Remove various unused function parameters and variables – #57371

Coding Standards

  • Fix a PHPCSPHP Code Sniffer PHP Code Sniffer, a popular tool for analyzing code quality. The WordPress Coding Standards rely on PHPCS. issue found in wpPluginsListTable.php
  • Revert use of str_starts_with() and str_contains() in update-core.php#58206

Database

  • Move the if statement outside of the 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.. – #56541

Docs

  • Correct @return description for wp_count_posts()#58685
  • Fix image_get_intermediate_size() docblock – #58686, #57840

Editor

  • Add block theme previews – #58561
  • Allow Query Block to show posts from multiple selected authors – #58426
  • Enqueue commands package styles – #58667
  • Revert unnecessary changes to .jshintrc files – #12009
  • Update block-serialization-default-parser package for WP 6.3 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 – #57832
  • Update npm WordPress npm packages – #58623
  • Update npm packages to fix gutenberg_ prefix – #58651
  • add Post Template fallback styles – #58570
  • add box shadow support to blocks – #58590
  • add 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. around post editor – #58626
  • add navigation fallback – 58557
  • adds deprecation for deleted block_core_navigation_submenu_build_css_colors function – #58623
  • allow filtering block patterns by source – #58622
  • delete test file from update duotone support – #58555
  • navigation post preloading – #58556#58589
  • refactor and stabilize selectors 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.#58586
  • stabilise layout and refactor definitions – #58550
  • update WordPress npm packages – #58623
  • update duotone support – #58555
  • update function name in test commentSee #58522
  • update npm packages to latest 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. versions – #58654
  • update npm packages with 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. fixes and blessed tasks – #58701

Emoji

  • Give name to web worker in emoji loader and terminate when finished – #58472
  • Optimize emoji loader with sessionStorage, willReadFrequently, and OffscreenCanvas#58472
  • Pass functions as arguments in loader to account for minification and worker script – #58472

Filesystem API

  • Allow optional inclusion of hidden files in list_files()#53659
  • Define password as null if not set when using SSH2 with public/private key – #33196

General

  • Add missing parentheses to functions referenced in _deprecated_function() calls added in 6.3 – #58235, #58301, #58555
  • Ignore 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. types for the ‘_wp_http_referer’ URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org query variable – #57670

HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. API

  • Fix a fatal error when processing malformed document with unclosed attribute – #58637
  • Declare a few default parameters in WP_Http_Curl and WP_Http_Streams#52622

Media

  • Fix inconsistent docs for existing wp_img_tag_add_loading_attr 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 remove duplicate – #58235
  • Only show “Copy” and “Download” actions when an attachment URL is available – #57893

Menus

  • Allow themes and plugins to pass HTML attributes to various Nav Walker outputs – #57140

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

  • Check if the gmt_offset value is numeric in sanitize_option()#57728
  • Prime networknetwork (versus site, blog) options in a single cache call using wp_cache_get_multiple – #56913

Plugins

  • Introduce the plugins_list filter – #57278

Quick/Bulk Edit

  • Add an action hook to bulk_edit_posts() function – #28112
  • Ensure scheduled posts are published when using Bulk Edit – #31635

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

  • Cache schema in block pattern and menu item endpoints – #58657
  • Check post meta update authorization only when value is changed
  • Expose current $request object to cors_header filters in WP_REST_SERVER->serve_request() – #57752
  • add 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. endpoint for global styles – #58524
  • ignore empty templates – #58615
  • updates test annotations for global styles revisions – #58524

Script Loader

  • Fix performance issues in wp_common_block_scripts_and_styles#58560
  • Fix unintended adding of async to scripts that are printed directly with wp_print_scripts() without enqueueing them beforehand – #58648
  • Prevent fatal error in load-styles.php#57629

Site Health

  • Add server time debug data – #56378
  • Correct the label for wp-content directory check – #58678
  • Include new WP_DEVELOPMENT_MODE in the list of constants – #58646

Themes

  • Block template is located twice in get_query_template()#58299
  • Fix layout issue on the Themes page background overlay – #58164
  • Use get_theme_file_path() in wp_theme_has_theme_json()#57629
  • Use improved support for child themes in wp_theme_has_theme_json()#57629

Upgrade/Install

  • Initialize the local $checkout variable in WP_Automatic_Updater::is_vcs_checkout()#58563
  • Only show errors if there is nothing to update – #57999
  • Pass the full database version string to 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/ for parsing – #58584

Users

  • Introduce the wp_update_user action – #57843

Props

Thanks to the 143 (!!) people who contributed to WordPress Core on Trac last week:

@audrasjb (23), @spacedmonkey (23), @mukesh27 (23), @costdev (19), @ramonopoly (17), @sabernhardt (15), @oglekler (15), @sergeybiryukov (12), @peterwilsoncc (11), @joemcgill (10), @flixos90 (7), @kebbet (6), @azaozz (5), @Clorith (5), @dd32 (4), @westonruter (4), @shailu25 (4), @dmsnell (4), @zunaid321 (3), @oandregal (3), @get_dave (3), @desrosj (3), @dlh (3), @jrf (3), @poena (3), @pooja1210 (3), @mikeschroder (3), @ironprogrammer (3), @onemaggie (3), @johnbillion (3), @youknowriad (2), @isabel_brison (2), @mayur8991 (2), @bernhard-reiter (2), @crstauf (2), @webcommsat (2), @adi3890 (2), @umesh84 (2), @aaronrobertshaw (2), @shuvoaftab (2), @alvitazwar052 (2), @talldanwp (2), @upadalavipul (2), @rutviksavsani (1), @TimothyBlynJacobs (1), @valterlorran (1), @hellofromtonya (1), @tanner m (1), @Cybr (1), @danyk4 (1), @lphoumpakka (1), @davidwebca (1), @ecorica (1), @azzaoz (1), @yani.iliev (1), @fischfood (1), @nateallen (1), @tyxla (1), @API (1), @jeremyfelt (1), @laurelfulford (1), @ellatrix (1), @manfcarlo (1), @rajanpanchal2028 (1), @aristath (1), @TobiasBg (1), @jorgefilipecosta (1), @andrewserong (1), @hareesh-pillai (1), @hrrarya (1), @robinwpdeveloper (1), @sebastienserre (1), @joyously (1), @options (1), @andraganescu (1), @styling (1), @flexible (1), @more (1), @enabling (1), @selectors (1), @the (1), @stabilizing (1), @config (1), @own (1), @their (1), @into (1), @scruffian (1), @ckoerner (1), @helgatheviking (1), @ramonjd (1), @Ov3rfly (1), @itpathsolutions (1), @ugyensupport (1), @afragen (1), @pbiron (1), @Presskopp (1), @pitamdey (1), @ehsanakhgari (1), @J-Dill (1), @thekt12 (1), @xknown (1), @sccr410 (1), @arafatjamil01 (1), @pavanpatil1 (1), @cadic (1), @siobhan (1), @jqz (1), @wildworks (1), @hellofromTonya (1), @sjoerdlinders (1), @ryelle (1), @hasanmisbah (1), @hrdelwar (1), @dhrupo (1), @nithins53 (1), @thakordarshil (1), @darshitrajyaguru97 (1), @Mte90 (1), @amin7 (1), @kajalgohel (1), @timothyblynjacobs (1), @anilvaza (1), @nidhidhandhukiya (1), @marybaum (1), @mensmaximus (1), @pento (1), @itowhid06 (1), @mrasharirfan (1), @afercia (1), @helen (1), @shwetabathani2312 (1), @felixarntz (1), @chaion07 (1), @rachelbaker (1), @bor0 (1), @clorith (1), @ajlende (1), @dilipbheda (1), @Malae (1), @monzuralam (1), @orestissam (1), @zodiac1978 (1), and @madhudollu (1)

Congrats and welcome to our 18 (!) new contributors of the week: @adi3890, @shuvoaftab, @valterlorran, @danyk4, @lphoumpakka, @yaniiliev, @fischfood, @rajanpanchal2028n, @hrrarya, @pitamdey, @ehsanakhgari, @sccr410, @sjoerdlinders, @hrdelwar, @darshitrajyaguru97, @anilvaza, @shwetabathani2312, and @orestissam ♥️

Core committers: @audrasjb (22), @isabel_brison (20), @sergeybiryukov (8), @davidbaumwald (6), @spacedmonkey (6), @azaozz (3), @westonruter (3), @johnbillion (3), @flixos90 (3), @bernhard-reiter (3), @kadamwhite (3), @joemcgill (2), @clorith (2), @peterwilsoncc (2), @mikeschroder (1), and @dd32 (1).

#6-3, #core, #week-in-core

Proposal: The Interactivity API – A better developer experience in building interactive blocks

What if effortlessly creating performant, fluid, and idiomatic frontend interactivity on 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.-based WordPress sites was possible? Imagine plugins providing interactions like “heart this post” or “add to cart” without page reloads. Picture instant search, commenting, and native full-page transitions as best-in-class built-ins without complex scaffolding or external tools. Envision achieving this in any block theme by default without sacrificing PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher server rendering and the 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 ecosystem for a JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. runtime. Visualize block developers easily declaring and extending such behaviors in a way that is immediately familiar and compatible with the block ecosystem.

That’s what we, the contributors involved in this project, aim to explore and unlock with the Interactivity 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.. The demo below shows some of this power and flexibility in action.

Live site demo / WP Movies GitHub

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/ has evolved a lot over the past few years, though most of the improvements have focused on the block developer experience within the block editor. Today, we’d like to update you on the Interactivity API, which aims to be a standard way to allow developers to add interactivity to the frontend of their blocks.

Your feedback will be highly appreciated to help shape its next iteration. Here’s some background reading on the Interactivity API.

A couple of important notes before diving in:

  • The Interactivity API is for the frontend of blocks, not for the block editor. This means the API is not expected to be used inside the edit function. It’s a way to create interactive user interfaces for your site visitors. Having said that, we’d like to explore whether some directives could be reused across the frontend and the editor to unify the whole block developer experience.
  • This is still experimental. Functionalities are missing, documentation is scarce, and the final API may look different. The API’s design is open to debate, and any feedback is key to ensuring the Interactivity API accounts for the entirety of WordPress’ diverse needs and requirements.

Table of contents

API Goals

The main goal of the Interactivity API is to provide a standard and simple way to handle the frontend interactivity of Gutenberg blocks.

A standard makes it easier for developers to create rich, interactive user experiences, from simple cases like counters or popups to more complex features like instant page navigation, instant search, or carts and checkouts.

All these user experiences are technically possible right now without the Interactivity API. However, the more complex the user experience and the more blocks interact with each other, the harder it becomes for developers to build and maintain sites. There are a lot of challenges they have to figure out themselves. The API aims to provide out-of-the-box means for supporting these kinds of interactions.

To address this challenge, before researching different approaches, some requirements/goals for the API were defined:

  • Block-first and PHP-first: The API must work well with PHP and the current block system, including dynamic blocks, widely extended in WordPress. It must support server-side rendering. Server-rendered HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. and client-hydrated HTML must be exactly the same. This is important for SEO and the user experience.
  • Backward compatible: The API must be compatible with WordPress 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., which could, for example, modify server-rendered HTML. It must also be compatible with internationalization and existing JS libraries on the site (such as jQuery).
  • Optional and gradual adoption: Related to the previous point, the API must remain optional. It should be possible to adopt it gradually, meaning that interactive blocks not using this API can coexist with those using it.
  • Declarative and reactive: The API must use declarative code, listen to changes in the data, and update only the parts of the DOM that depend on that data.
  • Performant: The runtime must be fast and lightweight to ensure the best user experience.
  • ExtensibleExtensible This is the ability to add additional functionality to the code. Plugins extend the WordPress core software.: In the same way WordPress focuses on extensibility, this new system must provide extensibility patterns to cover most use cases.
  • Atomic and composable: Having small reusable parts that can be combined to create more complex systems is required to create flexible and scalable solutions.
  • Compatible with the existing block development tooling: The API must be integrated with the existing block-building tools without requiring additional tooling or configuration by the developer.

Apart from all these requirements, integrating client-side navigation on top of any solution should be easy and performant. Client-side navigation is the process of navigating between site pages without reloading the entire page, which is one of the most impressive user experiences demanded by web developers. For that reason, this functionality should be compatible with this new system.

What’s being proposed?

The Interactivity API is a standard system of directives, based on declarative code, for adding frontend interactivity to blocks.

Directives extend HTML with special attributes that tell the Interactivity API to attach a specified behavior to a DOM element or even to transform it. For those familiar with Alpine.js, it’s a similar approach but explicitly designed to work seamlessly with WordPress.

Why directives?

Directives are the result of deep research into different possibilities and approaches. We’ve found that this design covers the requirements most effectively.

Block-first and PHP-friendly

The API is designed for the world of blocks and takes WordPress history of being closely attached to web standards to heart.

As directives are added to the HTML, they work great with dynamic blocks and PHP.

Dynamic block example

<div
  data-wp-interactive='{ "namespace": "wpmovies" }'
  data-wp-context='{ "isOpen": false }'
  data-wp-watch="callbacks.logIsOpen"
>
  <button
    data-wp-on--click="actions.toggle"
    data-wp-bind--aria-expanded="context.isOpen"
    aria-controls="p-1"
  >
    Toggle
  </button>

  <p id="p-1" data-wp-show="context.isOpen">
    This element is now visible!
  </p>
</div>

As you can see, directives like data-wp-on--click or data-wp-show are added as custom HTML attributes. WordPress can process this HTML on the server, handling the directives’ logic and creating the appropriate markup.

Backward compatible

As the Interactivity API works perfectly with server-side rendering, you can use all the WordPress APIs, including:

  • WordPress filters and actions: You can keep using WordPress hooks to modify the HTML or even to modify directives. Additionally, existing hooks will keep working as expected.
  • CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Translationtranslation The process (or result) of changing text, words, and display formatting to support another language. Also see localization, internationalization. API: e.g. __() and _e(). You can use it to translate the text in the HTML (as you normally would) and even use those APIs on the server side of your directives. 

Optional and gradual adoption

The Interactivity API pipeline promotes progressive enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. by building on top of WordPress’s solid foundation and patterns. It was carefully designed not to force any use cases to pay for the costs of other use cases.

For example, blocks with directives can coexist with other (interactive or non-interactive) blocks. This means that if there are other blocks on the page using other frameworks like jQuery, everything will work as expected.

Declarative and reactive

The Interactivity API follows an approach similar to other popular JS frameworks by separating state, actions, and callbacks and defining them declaratively. Why declaratively?

Declarative code describes what a program should do, while imperative code describes how the program should do it. Using a declarative approach, the UIUI User interface automatically updates in response to changes in the underlying data. With an imperative approach, you must manually update the UI whenever the data changes. Compare the two code examples:

Imperative code

<button id="toggle-button">Toggle Element</button>
<p>This element is now visible!</p>
<script>
  const button = document.getElementById("toggle-button");

  button.addEventListener("click", () => {
    const element = document.getElementById("element");
    if(element) {
      element.remove();
    } else {
      const newElement = document.createElement("p");
      newElement.textContent = "This element is visible";
      document.body.appendChild(newElement);
    }
});
</script>

Declarative code

This is the same use case shared above but serves as an example of declarative code using this new system. The 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/. logic is defined in the view.js file of the block, and add the directives to the markup in the render.php .

// view.js file

import { store, getContext } from "@wordpress/interactivity";

store( 'wpmovies', {
  actions: {
    toggle: () => {
      const context = getContext();
      context.isOpen = !context.isOpen;
    },
  },
});
<!-- Render.php file -->

<div
  data-wp-interactive='{ "namespace": "wpmovies" }'
  data-wp-context="{ 'isOpen': true }"
>
  <button
    data-wp-on--click="actions.toggle"
    data-wp-bind--aria-expanded="context.ispen"
    aria-controls="p-1"
  >
    Toggle
  </button>

  <p id="p-1" data-wp-show="context.isOpen">
    This element is now visible!
  </p>
</div>

Don’t worry if you don’t fully understand this example yet. It will be explained in detail later in the post.

Using imperative code may be easier when creating simple user experiences, but it becomes much more difficult as blocks become more complex. The Interactivity API must cover all use cases, from the simplest to the most challenging. That’s why a declarative approach using directives better fits the Interactivity API.

Performant

The API has been designed to be as performant as possible:

  • The runtime code needed for the directives is just ~10 KB, and it only needs to be loaded once for all the blocks.
  • It only loads the directives needed by the blocks present on the page. For example, if no blocks are using data-wp-show, the code for this directive won’t be loaded.
  • The scripts will load without blocking the page rendering.
  • There are ongoing explorations about the possibility of delaying the scripts loading once the block is in the viewport. This way, the initial load would be optimized without affecting the user experience.

Extensible

Directives can be added, removed, or modified directly from the HTML. For example, users could use the render_block filter to modify the HTML and its behavior.

In addition to using built-in directives, users can create custom directives to add any custom behaviors to their HTML.

Atomic and composable

Each directive controls a small part of the DOM, and you can combine multiple directives to create rich, interactive user experiences.

Compatible with the existing block development tooling

Using built-in directives does not require a build step and only requires a small runtime. A build step is necessary only when creating custom directives that return JSX. For such use cases, the API works out of the box with common block-building tools like wp-scripts.

Client-side navigation

The Interactivity API comes with built-in primitives for adding client-side navigation to your site. This functionality is completely optional, but it opens the possibility to create these user experiences without having to opt out of the WordPress rendering system.

It also pairs very well with the View Transitions API allowing developers to animate page transitions easily.

Why a standard?

Blocks using the Interactivity API and interactive blocks using other approaches like jQuery can coexist, and everything will work as expected. However, the Interactivity API comes with some benefits for your interactive blocks:

  • Blocks can communicate with each other easily. With a standard, this communication is handled by default. When different blocks use different approaches to frontend interactivity, inter-block communication becomes more complex and almost impossible when separate developers create blocks.
  • Composability and compatibility: You can combine interactive blocks, and nest them in structures with defined behaviors. Thanks to following the same standard, they are fully cross-compatible. If each block used a different approach to interactivity, they would likely break.
  • Fewer KBs will be sent to the browser. If each plugin author uses a different JS framework, more code will be loaded in the frontend. If all the blocks use the same one, the code is reused.
  • If all the blocks on a page use this standard, site-wide features like client-side navigation can be enabled.

Additionally, with a standard, WordPress can absorb the maximum amount of complexity from the developer because it will handle most of what’s needed to create an interactive block.

Complexities absorbed by the standard

Two columns table comparing some aspects with and without a standard. Without a standard, block developers have to take care of everything, while having a standard:
- Totally handled by the standard: Tooling, hydration, integrating it with WordPress, SSR of the interactive parts, inter-block communication, and frontend performance.
- Partially handled: Security, accessibility, and best practices.
- Developer responsibility: Block logic.
In the without a standard column, everything is under the developer responsability.

With this absorption, less knowledge is required to create interactive blocks, and developers have fewer decisions to worry about.

Additionally, if the community adopts a standard, learning from other interactive blocks would be simpler, which fosters collaboration and code reusability. This should simplify the development process and make it friendlier to less experienced developers.

How to create interactive blocks using the API

It’s important to highlight that the block creation workflow doesn’t change.

Until now, WordPress has been intentionally unopinionated about the different solutions used on the frontend of blocks. The Interactivity API changes that. It adds a new standard way to easily add frontend interactivity to blocks while the APIs handling the Block Editor remain the same.

To add interactivity to blocks using the Interactivity API, developers would need to:

  1. Add directives to the markup to add specific behavior to the block.
  2. If needed, create a store with the logic (state, actions, or callbacks) needed for interactivity. Blocks using only directives with self-sufficient logic like data-wp-link, don’t need this step.

Before explaining each step in more detail, let’s return to our example: a button that shows and hides some text. We’ll also add logic to send a message in the console whenever the button is hidden/revealed.

Add directives

Directives are added to the markup of your block. In the render.php file (for dynamic blocks) or the save.js file (for static blocks).

<div
  data-wp-interactive='{ "namespace": "wpmovies" }'
  data-wp-context='{ "isOpen": false }'
  data-wp-watch="callbacks.logIsOpen"
>
  <button
    data-wp-on--click="actions.toggle"
    data-wp-bind--aria-expanded="context.isOpen"
    aria-controls="p-1"
  >
    Toggle
  </button>

  <p id="p-1" data-wp-show="context.isOpen">
    This element is now visible!
  </p>
</div>

In this example, the directive data-wp-context is used to define some local state ("isOpen": false) that will be available to that HTML node and all its children. All the actions and callbacks used in those nodes can access that data. Knowing that, other directives like data-wp-on--click can trigger actions and callbacks reading that context.

Create the store

In this part, the logic (actions and callbacks) called by the directives is defined.

The store is created in the view.js file of each block. Although it works at a block level right now, the possibility of sharing code that multiple blocks need will be investigated as well.

// view.js
import { store, getContext } from "@wordpress/interactivity";

store( 'wpmovies', {
  actions: {
    toggle: () => {
      const context = getContext();
      context.isOpen = !context.isOpen;
    },
  },
  callbacks: {
    logIsOpen: () => {
      const context = getContext();
      // Log the value of `isOpen` each time it changes.
      console.log(`Is open: ${context.isOpen}`);
    },
  },
});

For those familiar with ReactReact React is a JavaScript library that makes it easy to reason about, construct, and maintain stateless and stateful user interfaces. https://reactjs.org/., this would be an equivalent React component:

const Comp = () => {
  const [isOpen, setIsOpen] = useState(false);

  useEffect(() => {
    // Log the value of `isOpen` each time it changes.
    console.log(`Is Open: ${isOpen}`);
  }, [isOpen]);

  const toggle = () => {
    setIsOpen(!isOpen);
  };

  return (
    <div>
      <button
        onClick={toggle}
        aria-expanded={isOpen}
        aria-controls="p-1"
      >
        Toggle
      </button>
      {isOpen && <p id="p-1">This element is visible!</p>}
    </div>
  );
};

Let’s take a look at each step in detail:

1. Add the directives

Directives are custom HTML attributes whose value can contain options or references to the store.

Let’s return to our previous example:

Dynamic block example

// render.php

<div
  <?php echo get_block_wrapper_attributes(); ?>
  data-wp-interactive='{ "namespace": "wpmovies" }'
  data-wp-context='{ "isOpen": false }'
  data-wp-watch="callbacks.logIsOpen"
>
  <button
    data-wp-on--click="actions.toggle"
    data-wp-bind--aria-expanded="context.isOpen"
    aria-controls="p-1"
  >
    Toggle
  </button>

  <p id="p-1" data-wp-show="context.isOpen">
    This element is now visible!
  </p>
</div>

This is how it would work in a static block:

Static block example

// save.js

const save = () => {
  return `
    <div
      {...useBlockProps()}
      data-wp-interactive='{ "namespace": "wpmovies" }'
      data-wp-context='{ "isOpen": true }'
      data-wp-watch="callbacks.logIsOpen"
    >
      <button
        data-wp-on--click="actions.toggle"
        data-wp-bind--aria-expanded="context.isOpen"
        aria-controls="p-1"
      >
          Toggle
      </button>

      <p id="p-1" data-wp-show="context.isOpen">
          This element is now visible!
      </p>
    </div>
  `;
};

The example above uses directives like wp-show and wp-on to add interactivity to the HTML. Below is the initial list of core directives planned, which aims to cover the most common use cases for adding interactivity. It has been inspired by other frameworks like Alpine, VueVue Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. https://vuejs.org/., or Svelte:

  • wp-context provides local state available to a specific HTML node and its children.
  • wp-on runs code on dispatched DOM events like click or keyup. The format of this directive is data-wp-on--[event], like data-wp-on--click or data-wp-on--keyup.
  • wp-show shows and hides elements depending on the state or context.
  • wp-each creates DOM elements by iterating through a list.
  • wp-bind allows setting HTML attributes on elements.
  • wp-class adds or removes a class to an HTML element, depending on its value.
  • wp-style adds or removes inline style to an HTML element, depending on its value.
  • wp-text sets the inner content of an HTML element.
  • wp-html sets the innerHTML property of an HTML element.
  • wp-slot / wp-fill moves snippets of HTML from one place (fills) to another (slots).
  • wp-watch runs an expression when the node is created and runs it again when the state or context changes.
  • wp-init runs an expression only when the node is created.
  • wp-error captures errors in other interactive blocks.

Please bear in mind that this list may vary, and not all these core directives have been implemented yet. Additionally, the API is extensible: anyone can create their own directives if needed.

An important feature is that, when needed, directives support server-side rendering in PHP. This results in a better user experience and better SEO. This is usually taken for granted with WordPress but, when using modern frameworks like React to add interactivity to blocks, it is common to show empty content until client-side JavaScript updates the HTML.

2. Create the store

The store contains the reactive state and the actions and callbacks that modify it.

  • State: Defines data available to the HTML nodes of the page. It is important to differentiate between two ways to define the data:
    • Global state:  It is defined using the store() function, and the data is available to all the HTML nodes of the page.
    • Context/Local State: It is defined using the data-wp-context directive in an HTML node, and the data is available to that HTML node and its children.
  • Actions: Usually triggered by the data-wp-on directive (using event listeners) or other actions.
  • Callbacks: Automatically react to state changes. Usually triggered by data-wp-callback or data-wp-init directives.

Returning to our example, this could be a simple store in one block:

// view.js
import { store, getContext } from "@wordpress/interactivity";

store( 'wpmovies', {
  actions: {
    toggle: () => {
      const context = getContext();
      context.isOpen = !context.isOpen;
    },
  },
  callbacks: {
    logIsOpen: () => {
      const context = getContext();
      // Log the value of `isOpen` each time it changes.
      console.log(`Is open: ${context.isOpen}`);
    },
  },
});

In this specific case, only actions and callbacks are defined, but some state could also be included. For example, you could define the state in another block to create a list with your “Favorite movies”. It might look something like this:

// view.js - A favorite movies block
import { store, getContext } from '@wordpress/interactivity';

const { state } = store( 'wpmovies', {
 state: {
   favoriteMovies: [],
 },
 actions: {
   addMovie: () => {
     const context = getContext();
     // We assume that there is a `wp-context` directive 
     // on the block which provides the item ID.
     state.favoriteMovies.push(context.item.id);
   },
   clearFavoriteMovies: () => {
     state.favoriteMovies = [];
   },
 },
});

Note: The store function will automatically merge the store definitions from all the blocks using store into a single reactive object. This way, you can use the global state defined in other blocks.

Initializing the store on the server with wp_initial_state()

The state can also be initialized on the server using the wp_initial_state() function. You would typically do this in the render.php file of your block (the render.php templates were introduced in WordPress 6.1). Initializing your state on the server allows you to populate it with some data from the server without worrying about serializing that data or making additional API requests.

The store defined on the server with wp_initial_state() gets merged with the stores defined in the view.js files. For example, the “Favorite movies” block from above could initialize its store on the server like this:

// render.php 

wp_initial_state( 'wpmovies', array(
     favoriteMovies => get_favorite_movies(),
) );

And then its `view.js` file would be simplified to:

// view.js - A favorite movies block
import { store, getContext } from '@wordpress/interactivity';

const { state } = store( 'wpmovies', {
 actions: {
   addMovie: () => {
     const context = getContext();
     // We assume that there is a `wp-context` directive 
     // on the block which provides the item ID.
     state.favoriteMovies.push(context.item.id);
   },
   clearFavoriteMovies: () => {
     state.favoriteMovies = [];
   },
 },
});

Initializing the store in the server also allows you to use any WordPress API. For example, you could use the Core Translation API to translate part of your state:

// render.php

wp_initial_state(
  'wpmovies',
  array(
    "favoriteMovies" => array(
      "1" => array(
        "id" => "123-abc",
        "movieName" => __("someMovieName", "textdomain")
      ),
    ),
  )
);

References

When creating a directive, you might notice that its value is a string pointing to a specific state, an action, or a callback. For instance, in the example that we’ve been using in this post, the value of the data-wp-on--click directive was actions.toggle, and the value of data-wp-watch was callbacks.logIsOpen.

Those values are references to a particular property in the store. They are wired to the directives automatically so that each directive “knows” what actions.toggle refers to without any additional configuration.

When a directive is evaluated, the reference callback receives an object with:

  • The store containing the state, actions and callbacks.
  • The context (an object containing the context defined in all the wp-context ancestors).
  • The reference to the DOM element on which the directive was defined (a ref).
  • Other properties relevant to the directive. For example, the data-wp-on--click directive also receives the instance of the MouseEvent triggered by the user.
import { store, getContext, getElement } from "@wordpress/interactivity"
 
const { state } = store( 'wpmovies', {
    state: {
        theme: false,
    },
    actions: {
        toggle: ( event ) => {
            console.log(state);
            // `{ "theme": false }`
            const context = getContext();
            console.log(context);
            // `{ "isOpen": true }`
            const { ref } = getElement();
            console.log(ref);
            // The DOM element
            console.log(event);
            // The Event object if using the `data-wp-on`
        }
    }
})

This approach enables some functionalities that make directives flexible and powerful:

  • Actions and callbacks can read and modify the state and the context.
  • Actions and state in blocks can be accessed by other blocks:
  • Actions and callbacks can do anything a regular JavaScript function can do, like access the DOM or make API requests.
  • Callbacks automatically react to state changes.

How can users learn more and keep track of the API?

If you are interested in this proposal, let us know in the comments or the Interactivity API GitHub repo. Your feedback is highly appreciated. If you want to learn more about the Interactivity API, here is a list of relevant links with more information:

  • GitHub repo: This is where most aspects are discussed and a way to follow the development process. Feel free to open any issue, discussion, or pull request.
  • Movies demo repo: An example with some interactive blocks and user experiences. If you are interested in the code or even reproducing it locally, the information is gathered here.

There will be more resources in the future, including technical documentation, to explain everything in more detail.

Next steps

There will be two sessions on April 17th, 2023 (one at 08:00UTC and another at 17:00UTC) featuring a live product demo followed by a Q&A. The specifics for each session will be announced on the Make Core blogblog (versus network, site). If you’re interested in the Interactivity API, have any related questions, or want to provide feedback, feel free to join us. For those who cannot attend or prefer to share feedback in writing, comment on this post. Additionally, the session will be recorded and posted it here.

EDIT: These are the links to both sessions, where the Interactivity API is explained in more detail and answered some questions:

  • First session: Hosted by Michael Burridge and led by Mario Santos and Luis Herranz.
  • Second session: Hosted by Ryan Welcher and led by Michal Czaplinski

With this in mind, these are the next steps for the Interactivity API:

  • Gather and address the feedback received in the live session and this post.
  • Keep developing the API, incorporating the feedback.
  • Work on more technical documentation to explain in detail how the Interactivity API works.
  • Once there is enough feedback and the API feels confident enough, the intent is to add the API as an experimental feature to Gutenberg so block authors can start building with it (with the eventual goal of including it in Core).

FAQ

How does the Interactivity API work under the hood?

Its three main components are:

There will be more technical documentation to explain the API in more detail in the future. In the meantime, please share any questions in the comments or on the GitHub repo.

Why did you choose Preact to build the directives system? Why not React or another JavaScript framework?

Preact has a number of advantages over React and other JavaScript frameworks like Vue, Svelte, or Solid in the context of the frontend (which is the focus of the Interactivity API):

  • It’s small: 8kB, including hooks and signals.
  • It’s battle-tested.
  • It’s performant (even more when used with signals).
  • It’s compatible with React (through preact/compat, useful to share the same Editor components for some use cases where SSR is not important, and the components are very complex, like an e-commerce cart and checkout, for example).
  • It’s HTML-friendly (unlike React).
  • It gives us DOM diffing out of the box.
  • It’s extremely extensible through their Option Hooks. They use that extensibility for the hooks (preact/hooks), compatibility with React (preact/compat) and their signals (@preact/signals). Basically, everything but the DOM diffing algorithm.
  • Its core team has been great and very helpful. They are also interested in enhancing this “island-based” usage of Preact.

Is Gutenberg going to move from React to Preact since the Interactivity API uses it?

No. At the moment, there are no plans to make that transition. The requirements and advantages of the editor, as a fully interactive application, are quite different. Preact does have a @preact/compat package that enables full compatibility with the React ecosystem, and many large web applications use it. However, using Preact in the block editor would not offer advantages like it does on the frontend in the Interactivity API.

What approaches have been considered instead of using directives?

Many alternative approaches were considered. Here’s a brief summary of some of them:

React and other JavaScript frameworks

React was considered first because Gutenberg developers are familiar with it. Other popular JS frameworks like Svelte, Vue.js, or Angular were also considered, but none of them (including React) are PHP-friendly or compatible with WordPress hooks or internationalization. See above for a longer explanation.

Alpine.js

Alpine.js is a great framework, and it inspired a lot of functionality in the Interactivity API. However, it doesn’t support server-side rendering of its directives, and having a similar system tailored for WordPress blocks has many benefits.

Plain JavaScript

See the answer below. 

Template DSL

The possibility of creating a DSL for writing interactive templates was also researched. The code written in that Template DSL would then be compiled into both JavaScript and PHP. However, creating a production-grade Template compiler is complex and would be a large and risky investment of effort. This approach is still being considered for the future, with the directives serving as a compilation target.

Why should I, as a block developer, use the Interactivity API rather than React?

Using React on the frontend doesn’t work smoothly with server rendering in PHP. Every approach that uses React to render blocks has to load content using client-side JavaScript. If you only render your blocks on the client, it typically results in a poor user experience because the user stares at empty placeholders and spinners while waiting for content to load.

Now, it’s possible to server-render a block in PHP and use React to render the same block on the frontend. However, this results in a poor developer experience because the logic has to be duplicated across the PHP and React parts. Not only that, but you have now exposed yourself to subtle bugs caused by WordPress hooks!

Imagine installing a third-party plugin with a hook (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.) that modifies the server-rendered HTML. Let’s say this filter adds a single CSSCSS Cascading Style Sheets. class to your block’s HTML. That CSS class will be present in the server-rendered markup. On the frontend, your block will render again in React, but now the content will not include that CSS class because there is no way to apply WordPress hooks to React-rendered content!

On the other hand, the Interactivity API is designed to work perfectly with WordPress hooks because directives enhance the server-rendered HTML with behaviors. This also means it works out of the box with WordPress backend APIs like i18ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill..

To summarize, using the Interactivity API rather than just using React comes with these benefits:

  • If you use React, your interactive blocks must generate the same markup on the client as they do on the server in PHP. Using the Interactivity API, there is no such requirement as directives are added to server-rendered HTML.
  • The Interactivity API is PHP-friendlier. It works out of the box with WordPress hooks or other server functionalities such as internationalization. For example, with React, you can’t know which hooks are applied on the server, and their modifications would be overwritten after hydration.
  • All the benefits of using a standard.

What are the benefits of Interactivity API over just using jQuery or vanilla JavaScript?

The main difference is that the Interactivity API is declarative and reactive, so writing and maintaining complex interactive experiences should become way easier. Additionally, it has been specially designed to work with blocks, providing a standard that comes with the benefits mentioned above, like inter-block communication, compatibility, or site-wide features such as client-side navigation.

Finally, comparing it with jQuery, the Interactivity API runtime is ~10kb, which is much more lightweight. Actually, there is an ongoing effort to remove heavy frameworks like jQuery across the WordPress ecosystem, and this would help in this regard.

Do I need to know React, PHP, and this new Interactivity API?

If you want to add frontend interactivity to your blocks using this API, the short answer is yes. If your block is not interactive, the block creation workflow will remain exactly the same.

As mentioned in the post, this API only adds a new standard way to easily add frontend interactivity to blocks, which didn’t exist until now. This means that you will still need to use React to handle the editor part of your blocks.

In the future, we’d like to explore the possibility of expanding the usage of directives to unify the developer experience among the Editor as well.

On the other hand, if you want to create an interactive block, with the Interactivity API you don’t have to deal with complex topics like tooling, integration with WordPress, inter-block communication, or the server-side rendering of the interactive parts.

Does this mean I must migrate all my interactive blocks to use this API?

No. Blocks outside the Interactivity API can coexist with blocks using it. However, as explained above, keep in mind that there are some benefits for blocks that use the API:

  • Blocks can communicate with each other easily. With a standard, this communication is handled by default. When different blocks use different approaches to frontend interactivity, inter-block communication becomes more complex and gets almost impossible when separate developers create blocks.
  • Composability and compatibility: You can combine interactive blocks, nest them in structures with defined behaviors, and, thanks to following the same standard, they are fully cross-compatible. If each block were to use a different approach to interactivity, they would likely break.
  • Fewer KBs will be sent to the browser. If each plugin author uses a different JS framework, more code will be loaded in the frontend. If all the blocks use the same one, the code is reused.
  • If all the blocks on a page use this standard, site-wide features like client-side navigation can be enabled.

What are the performance implications of using this API? Is it worth loading the Interactivity API for very simple use cases?

The API has been designed with performance in mind, so it shouldn’t be a problem:

  • The runtime code needed for the directives is just ~10 KB, and it only needs to be loaded once for all the blocks.
  • It only loads the directives needed by the blocks present on the page. For example, if no blocks use data-wp-show, that directive won’t be loaded.
  • All the scripts that belong to the Interactivity API (including the `view.js` files) will load without blocking the page rendering.
  • There are ongoing explorations about the possibility of delaying the scripts loading once the block is in the viewport. This way, the initial load would be optimized without affecting the user experience.

Can I use directives in the block editor?

No. Right now, directives only work in the frontend of blocks. However, it’ll be investigated whether some directives (and also your custom directives) could be reused across the frontend and the editor. It’s worth emphasizing that the realities of the editor application and the frontend of a website are very different, particularly around the interactivity they afford. It needs to be ensured that the right tools are built for the right context. An interesting area to explore further would be to expose directives in the editor so users and builders can use them to attach behaviors to their sites on demand.

Does it work with the Core Translation API?

It does! As the Interactivity API works perfectly with server-side rendering, you can use all the WordPress APIs including __() and _e(). You can use it to translate the text in the HTML (as you normally would) and even use it inside the store when using wp_initial_state() on the server side. It might look something like this:

// render.php

wp_initial_state(
  'wpmovies',
  array(
    "favoriteMovies" => array(
      "1" => array(
        "id" => "123-abc",
        "movieName" => __("someMovieName", "textdomain")
      ),
    ),
  )
);

How can I test it?

Before testing, bear in mind that the Interactivity API is still experimental and very likely to change before an official release. There are still missing functionalities that may break your site, and the API hasn’t been documented yet properly. If you plan to use it, do so at your own risk.

If you want to test the Interactivity API, you can install the latest version of the plugin on your site. Note that it requires the latest version of Gutenberg to work. Once installed, you can start creating interactive blocks using the API.

If you prefer to test the Interactivity API in a demo site with some interactive blocks already in place, you can look at the WP Movies demo.

How can interactive blocks update/save the state on the server?

It is still an active area of research, but is on the roadmap for the Interactivity API. For example, there’s an ongoing experiment to create an interactive version of the Comments Form block that can persist comments on the site and refresh itself without a full page reload.

Is it going to be a plugin? Or will it be part of Gutenberg/Core?

Although it is now distributed as a plugin, it aims to be added as an experimental feature to Gutenberg. The goal is to include it in Core once enough feedback has been gathered, and it’s clear that it’s the right direction.

I’m concerned about XSS; can JavaScript be injected into directives?

No. The Interactivity API only allows for References to be passed as values to the directives. This way, there is no need to eval() full JavaScript expressions, so it’s not possible to perform XSS attacks.

Does this work with CSP?

Yes. The Interactivity API does not use eval() or the Function() constructor, so it doesn’t violate the unsafe-eval content security policy. It is also designed to work with any custom content security policy.

Can you use directives to make AJAX/REST-API requests?

Sure. Actions and callbacks called by directives can do anything a JavaScript function can, including making API requests.


As mentioned during the post, it’d be great to hear your thoughts and new ideas in the GitHub repo.

Special props to @czapla , who coauthored this blog post with me from the start, and to @kristastevens for her invaluable help in shaping the document and ensuring everything was cohesive.

And also thanks to @luisherranz, @bernhard-reiter, @poliuk, @darerodz, @cbravobernal, @dmsnell, @gziolo, @zieladam, @artemiosans, @matveb, @richtabor, @annezazu, @isabel_brison, @azaozz, @westonruter, @flixos90, @fabiankaegy, @tweetythierry, @mamaduka, @kadamwhite, @alexstine, @andraganescu, @greenshady, @juanmaguitar, @mburridge, @welcher, @bph, @griffbrad, @jsnajdr, @youknowriad, @mcsf, @nerrad, @assassinateur, @yscik8, @jorbin, and @davidbaumwald for all the feedback about the API and reviewing and helping shape this post!

#interactivity-api, #block-developer-experience, #block-api, #gutenberg

A Year in Core – 2022

Happy new year everyone! Here’s some aggregate data for 2022 about WordPress CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. contribution on TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress..

Please note: these data only include code contributions to WordPress codebase, and it does not include contributions on 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/ repositories 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/.

The raw data for this post are available on this public spreadsheet. You might find that much easier to read if you have low vision or colorblindness; the graphics below are a snapshot pulled together to include as much information as possible in this blogpost, but they are hard to make accessible to everyone.

You can also compare these stats with last year’s data.

Last note: all the graphics below link to to a new tab to display them in full size.

General Trac overview

In 2022, the WordPress Core team shipped 2597 commits (1852 in 2021). 2656 tickets were opened, 2413 tickets were closed, and 353 were reopened.

Also, 988 people contributed to WordPress source code using Trac (832 in 2021), and 398 people made their very first contribution to WordPress Core ♥️ (305 in 2021).

JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberTotal
Commits2291562302791331721832353203741821042597
Tickets closed2142171871901941462201482692782401102413
Tickets reopened554622233427192023334011353
Tickets created2972522301322352301941712182312991672656
New contributors18322037151869316843434398
Contributors11512216820011010519621132723716256988
This chart shows the number of commits per month in 2022, and the number of closed, reopened and created tickets per month. It also shows the number of contributors per month in 2022. It can be scrolled horizontally.

Check out the Trac timeline in the graph below:

2022 WordPress Core Trac Timeline

Here’s how many props and new contributors the Core project had per month. The most prolific month was September, followed by October, August and July, during the WordPress 6.1 development cycle. March and April were also prolific months (WP 6.0 development cycle).

2022 WordPress Core Contributors by month

Components activity

How did 2022’s commits break out by Core Component?

The most prolific components were:

  • Build/Test Tools with 366 commits (17% of all listed commits)
  • Docs with 297 commits (14% of all listed commits)
  • Editor with 207 commits (10% of all listed commits)
  • Coding Standards with 145 commits (7% of all listed commits) and Code Modernization (which is not an official component) with 135 commits (6% of all listed commits)
  • Bundled Themes with 128 commits (6% of all listed commits)
  • Then comes MediaAdministration, 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/.Themes, General, Upgrade/InstallHelp/About, InternationalizationPosts/Post Types, Query and Users. The other components each had fewer than 30 commits this year.
2022 WordPress commits by component

Contributors data retrieved from 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/ profiles

The data below comes from matching contributors’ usernames, as mentioned in Trac props, with their profiles on WordPress.org.

One caveat: this ignores usernames that did not match a profile on dotorg, plus any that had blank or unusable country/company information (“The Universe” or “Unicorn land” are not known countries 🙂).

Contributions by country

The next graph shows the number of props received by country. The top eight countries, based on the number of props received, are these:

  • United States with 1255 contributions (1142 in 2021)
  • Russia with 1152 contributions (227 in 2021)
  • France with 739 contributions (266 in 2021)
  • Australia with 386 contributions (211 in 2021)
  • India with 317 contributions (219 in 2021)
  • Netherlands with 225 contributions
  • United Kingdom with 216 contributions (112 in 2021)
  • Sweden with 182 contributions (102 in 2021)
2022 WordPress Contributions by Country

Contributors (people) by country

In 2022, people from at least 57 countries contributed to WordPress Core (56 countries in 2021).

Here is the top eight countries by number of contributors:

  • United States with 152 people (155 in 2021)
  • India with 77 people (58 in 2021)
  • Bangladesh with 43 people (only 13 in 2021)
  • United Kingdom with 38 people (34 in 2021)
  • Germany with 25 people (23 in 2021)
  • Netherlands with 23 people (20 in 2021)
  • France with 22 people (26 in 2021)
  • Canada with 17 people (16 in 2021)
  • Italy with 13 people (15 in 2021)
2022 WordPress Contributors by Country

Contributions by company

In 2022, people from at least 229 companies contributed to WP Core.

These companies (well, their employees) each contributed to more than 100 commits:

  • Yoast with 1452 contributions (379 in 2021)
  • Automattic with 866 contributions (785 in 2021)
  • Whodunit with 676 contributions (215 in 2021)
  • 10up with 501 contributions (30 in 2021)
  • Bluehost with 226 contributions (146 in 2021)
  • Advies en zo with 220 contributions (191 in 2021)
  • Spacedmonkey with 132 contributions (38 in 2021)
  • Google with 130 contributions (87 in 2021)
  • Dream Encode with 124 contributions (20 in 2021)
  • Human Made with 126 contributions (131 in 2021)
  • Awesome Motive with 122 contributions (29 in 2021)
2022 WordPress Contributions by Company

Contributors (people) by company

The graph below is also interesting, because it shows that a huge number of companies have only one contributor—or a very few contributors. The exceptions are Automattic, with 88 core contributorsCore Contributors Core contributors are those who have worked on a release of WordPress, by creating the functions or finding and patching bugs. These contributions are done through Trac. https://core.trac.wordpress.org. on Trac in 2022, 10up with 38 contributors, Yoast (18 contributors), WPDeveloper (15 contributors), Multidots (14 contributors), and rtCamp (10 contributors). Only these 6 companies had more than 10 people credited on Trac in 2022.

2022 WordPress Contributors by Company

What did 2022 hold for Core Committers?

32 Core Committers committed code to the WordPress SVNSVN Subversion, the popular version control system (VCS) by the Apache project, used by WordPress to manage changes to its codebase. repository this year (33 in 2021):

@sergeybiryukov (755), @audrasjb (414), @peterwilsoncc (126), @desrosj (125), @davidbaumwald (87), @gziolo (72), @spacedmonkey (53), @hellofromtonya (48), @johnbillion (45), @joedolson (31), @azaozz (21), @jorgefilipecosta (19), @ryelle (15), @flixos90 (12), @adamsilverstein (10), @clorith (10), @noisysocks (9), @ocean90 (7), @antpb (6), @bernhard-reiter (6), @jorbin (5), @timothyblynjacobs (4), @swissspidy (4), @jffng (4), @westonruter (3), @pento (2), @helen (2), @youknowriad (2), @kadamwhite (1), @joemcgill (1), @mcsf (1), and @mikeschroder (1).

Of the 1901 commits, 755 (39%) were made by people working at Yoast, 414 (21%) from people working at Whodunit, 199 (10%) from employees of Automattic, followed by 10up (128 commits) and Bluehost (125 commits).

2022 WordPress Commits by Company

Automattic is the only company with more than 10 active Core Committers. Google has 4 people allowed to commit code to WordPress, followed by 10up and Human Made with 2 Core Committers.

2022 WordPress Committers by Company

Worth noting that 14 of the 32 active committers come from the US, which represents 43% of the Core Committers squad. Australia comes second with 3 committers and Portugal third with 2 committers.

More than 39% of the commits where handled by committers located in Russia, 21% by committers located in France, and 18% by committers located in the US.

2022 WordPress Committers by Country
2022 WordPress Commits by Country

Many thanks to @sabernhardt for his help to collect the 2022 data and to proofread this recap.

#contributions, #contributors, #team-update, #week-in-core, #year-in-core

A Week in Core – November 14, 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 October 31 and November 7, 2022.

  • 47 commits
  • 120 contributors
  • 97 tickets created
  • 27 tickets reopened
  • 104 tickets closed

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

  • Add missing escaping for a few strings used as HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. attributes – #57093

Bundled Themes

  • Twenty Seventeen: Improve letter-spacing reset for non-latin alphabets – #56994

Canonical

  • Protect against error for term not exists queries – #55955

Coding Standards

  • Apply spacing changes after composer format#57057
  • Declare $wp_taxonomies global at the top of unregister_taxonomy()#57058
  • Use consistent spelling for “cacheable” in WP_Query::get_posts()#57012

Docs

  • Document the usage of $wpdb global in WP_Date_Query methods – #57033
  • Document the usage of globals in some functions – #57082
  • Fix block_editor_rest_api_preload() parameter type – #56810, #56792
  • Improve globals documentation in unregister_taxonomy() and wp_term_is_shared()#57058, #56792
  • Replace 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. links with 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. in class-json.php docblocks – #57017, #56792
  • Replace HTTP links with HTTPS in class-pop3.php docblocks and JSJS JavaScript, a web scripting language typically executed in the browser. Often used for advanced user interfaces and behaviors. vendor readme file – #57017, #56792
  • Typo correction in get_registered_nav_menus() docblockdocblock (phpdoc, xref, inline docs)#57101, #56792
  • Various docblock fixes in 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 administration functions – #56792

Editor

  • Avoid running certain logic around theme.json parsing unnecessarily for classic themes – #56945
  • Correctly style separator blocks when only a background-color is defined – #56903
  • Improve Archive template description – #57001
  • Improve frontend performance for get_default_block_editor_settings()#56815
  • Improve how min/max font sizes are calculated for fluid typography – #57075
  • Improve performance of WP_Theme_JSON class by reducing usage of expensive array functions – #56974, #57067
  • Update 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. editor packages to the latest 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. releases – #57038, #56818, #56955, #56923

Filesystem

  • Return FTPFTP FTP is an acronym for File Transfer Protocol which is a way of moving computer files from one computer to another via the Internet. You can use software, known as a FTP client, to upload files to a server for a WordPress website. https://codex.wordpress.org/FTP_Clients./FTP Sockets exists() methods to a previous state – #56966, #51170, #28013

Formatting

  • Check that both normalizer_* functions exist in remove_accents()#56980

General

  • Use HTTPS for the b2/cafélog link in readme.html#57018

Help/About

  • Fix inconsistency in auto-updates help tabs – #56921

I18Ni18n Internationalization, or the act of writing and preparing code to be fully translatable into other languages. Also see localization. Often written with a lowercase i so it is not confused with a lowercase L or the numeral 1. Often an acquired skill.

  • Always pass $locale to load_textdomain()#57060
  • Initialize textdomain registry in wp_load_translations_early()#57051

Media

  • Prevent decoding attribute corrupting 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. data – #56969

Menus

  • Apply menu-item-has-children class in sub-menus – #56946, #28620

Networks and Sites

  • Replace “N/A” with “Not applicable” in choose_primary_blog()#57040

Posts, Post Types

Query

  • Bypass caching for filtered SELECTs – #57012
  • Don’t attempt caching if running a WP_User_Query before plugins_loaded – #56952
  • Prevent ID only queries erroring when starting the 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.#56948

Tests

  • Combine duplicate update_posts_count() tests – #57023, #56793
  • Correct the test for get_blogaddress_by_id() with a non-existing ID – #56793
  • Resolve WP_Query test failures on MariaDB due to indeterminate sort order – #57012
  • Restore blogblog (versus network, site) switching in update_posts_count() test – #57023

Text Changes

  • Improve the wording of the email sent to confirm site deletion – #56921
  • Remove capitalization on “site editing” – #57026
  • Replace “Full site editing” with “Site Editor” – #57026
  • Update @since mentions for [54786] changes – #57026

Themes

  • Improve WP_Query call getting global styles – #56900
  • Re-order valid link pseudo classes – #56928
  • Reduce usage of wp_get_theme function. – #57057
  • Revert one instance of wp_get_theme() from [54817] – #57057

Update/Install

  • Deactivate 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/ 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 version older than 14.1 – #56985

Upgrade/Install

  • Delete the comments-query-loop folder in wp-includes/blocks#57080

Props

Thanks to the 120 (!) people who contributed to WordPress Core on Trac last week: @mukesh27 (12), @SergeyBiryukov (12), @desrosj (11), @spacedmonkey (10), @peterwilsoncc (9), @audrasjb (7), @flixos90 (6), @costdev (5), @TimothyBlynJacobs (5), @ocean90 (4), @hellofromTonya (4), @sabernhardt (3), @aristath (3), @andrewserong (3), @NekoJonez (2), @wildworks (2), @mikachan (2), @dd32 (2), @ironprogrammer (2), @swissspidy (2), @upadalavipul (2), @miguelaxcar (2), @mxbclang (2), @czapla (2), @poena (2), @davidbaumwald (2), @mamaduka (2), @azaozz (2), @nithins53 (2), @ramonopoly (2), @kowsar89 (2), @joen (2), @cbravobernal (2), @namithjawahar (1), @rjasdfiii (1), @dilipbheda (1), @10upsimon (1), @Bjorn2404 (1), @itpathsolutions (1), @kadamwhite (1), @codesdnc (1), @nuvoPoint (1), @outrankjames (1), @oandregal (1), @manuilov (1), @pbiron (1), @webmandesign (1), @sippis (1), @petitphp (1), @mattkeys (1), @stentibbing (1), @rajeshraval786 (1), @pento (1), @pypwalters (1), @haritpanchal (1), @webaxones (1), @Chaton666 (1), @obenland (1), @oakesjosh (1), @subrataemfluence (1), @carazo (1), @johnwatkins0 (1), @claytoncollie (1), @Clorith (1), @chouby (1), @janthiel (1), @JeffPaul (1), @johnbillion (1), @amirrezatm (1), @lozula (1), @konyoldeath (1), @Mamaduka (1), @hiren1094 (1), @larsmqller (1), @LeonidasMilossis (1), @adamsilverstein (1), @innovext (1), @bernhard-reiter (1), @bph (1), @noisysocks (1), @mciampini (1), @talldanwp (1), @andraganescu (1), @scruffian (1), @get_dave (1), @isabel_brison (1), @ntsekouras (1), @ellatrix (1), @aaronrobertshaw (1), @gisgeo (1), @jchambo (1), @zodiac1978 (1), @gamecreature (1), @pkolenbr (1), @afragen (1), @jsh4 (1), @tyxla (1), @mcsf (1), @fpodhorsky (1), @kacper3355 (1), @davidvongries (1), @glendaviesnz (1), @mw108 (1), @joelmadigan (1), @rodricus (1), @jorbin (1), @azurseisme (1), @jrf (1), @vtad (1), @krunal265 (1), @ryankienstra (1), @riccardodicurti (1), @0mirka00 (1), @ndiego (1), @kevin940726 (1), @alexstine (1), @youknowriad (1), @cybr (1), @krupalpanchal (1), and @rajanpanchal2028 (1).

Congrats and welcome to our 31 (!!!) new contributors of the week: @miguelaxcar, @kowsar89, @rjasdfiii, @10upsimon, @Bjorn2404, @itpathsolutions, @codesdnc, @nuvoPoint, @outrankjames, @stentibbing, @carazo, @amirrezatm, @lozula, @konyoldeath, @larsmqller, @LeonidasMilossis, @innovext, @gisgeo, @jchambo, @gamecreature, @pkolenbr, @jsh4, @fpodhorsky, @kacper3355, @davidvongries, @mw108, @joelmadigan, @rodricus, @azurseisme, @krunal265, @riccardodicurti, ♥️

Core committers: @audrasjb (14), @sergeybiryukov (11), @peterwilsoncc (8), @desrosj (7), @flixos90 (3), @spacedmonkey (1), @ocean90 (1), @hellofromtonya (1), and @timothyblynjacobs (1).

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