Performance Chat Agenda: 30 August 2022

Here is the agenda for next week’s performance team meeting scheduled for August 30, 2022, at 15:00 UTC.


This meeting happens in the #core-performance channel. To join the meeting, you’ll need an account on the Make WordPress Slack

#agenda, #meeting, #performance, #performance-chat

Core Editor Improvement: Refining the template creation experience

These “CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Editor Improvement…” posts (labeled with the #core-editor-improvement 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.)) are a series dedicated to highlighting various new features, improvements, and more from Core Editor related projects. 

Alongside more template options comes some exciting refinements to the overall experience that should allow you to move faster with more accuracy to do what you want to do. In isolation, these enhancements might not catch your attention but, when viewed collectively, it’s clear that the template experience has been greatly improved. These will all be available in the future WordPress 6.1 but you can explore now in the Gutenberg plugin.

Start a new template with a strong foundation

Previously when creating a new template, you were met with an empty page. As of 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/ 13.9, you’re now given content from the closest related template in what’s called the template hierarchy. This addresses some long standing feedback around how frustrating and underwhelming it was to start from scratch each time, with some opting to copy/paste contents from other templates into their new creations. 

As a bonus, when Gutenberg 14.0 comes out, you’ll be notified right away about the new template being created upon entering the editor.

Find the exact template part you need

Template parts power parts of your site like a 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. or footer and make up some of the building blocks for templates. You can create your own, use the ones provided by your theme, and even customize the ones your theme offers. Previously, when searching the Inserter, your options were limited based on the groupings of template parts. This meant you still needed to select the template part you wanted, even after adding in an option like “Header”:

Now, you can search and add the exact template part you want directly from the inserter, saving a few clicks. It also allows you to have a nice preview before adding a template part in so you have a sense of what you’re adding ahead of time:

Going a step further, the ability to search template parts was also added to the template part setup state so you can find your favorite template part quickly:

A modal showing the option to search for a template part.

Move with accuracy

As folks make a site their own, there are two additional quality of life improvements to mention that help make it more obvious to see the impact of your actions. The first is a View Site link directly from the Site Editor so that, after saving some changes, you can quickly get a sense of how your site is coming together. While this is an interim step before something more comprehensive like a browse mode can be implemented, it’s still a step in the right direction. 

Toolbar showing new view site option in the Site Editor on a blue background

Finally, if you want to start over after making some changes, the experience to do so has had a nice copy update to make it clearer what actions you’re going to be taking. Rather than being presented with an option to clear customization, it’s now clarified that you’ll be using what’s provided directly by the theme by deleting the customized template. This aims to help ensure that important decisions made by folks lead to the outcomes they want. 

More to come

Expect work to continue here, especially as more templates are added and refinements to the experience at scale become more apparent. To learn more about what’s to come and get inspired, check out the Site Editor & Templates Roadmap overview issue.

#core-editor-improvement, #gutenberg

A Week in Core – August 22, 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 August 15 and August 22, 2022.

  • 28 commits
  • 92 contributors
  • 39 tickets created
  • 5 tickets reopened
  • 32 tickets closed

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

The team has also started working on Twenty Twenty-Three, the next bundled theme that will be included with WP 6.1 🎨

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

  • 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.2 – #56009
  • Increase the Dependabot pull request limit for GitHubGitHub GitHub is a website that offers online implementation of git repositories that can 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 – #55652
  • Only define WP_PLUGIN_DIR when running core tests – #39210
  • Assign created fixtures to the dedicated class properties in some test classes – #54662
  • Clean up test image before performing assertions in image tests – #55652
  • Consistently skip tests for non-implemented methods in 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/. test classes – #40538, #41463, #55652
  • Correct MariaDB version check in database charset tests – #53623

Code Modernization

  • Remove dynamic properties in theme tests – #56033

Coding Standards

  • Check for deprecated options before wp_installing()#55647
  • Remove a one-time variable in themes.view.Installer.browse#56283
  • Simplify the logic in wp_not_installed()#55647

Database

  • Account for utf8 being renamed to utf8mb3 in newer MariaDB and MySQLMySQL MySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/. versions – #53623

Docs

  • Remove incorrect default value for $path argument of admin_url()#55646
  • Use third-person singular verbs for function descriptions in WP_Tax_Query class, as per docblocks standards – #55646

Editor

  • Backportbackport A port is when code from one branch (or trunk) is merged into another branch or trunk. Some changes in WordPress point releases are the result of backporting code from trunk to the release branch. 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 from GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ into Core for WP 6.0.2 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta).#56414
  • Ensure get_block_templates() returns unique templates or template parts – #56271

Embeds

  • Fix missing labels and duplicate IDs – #55664

External Libraries

  • Upgrade PHPMailer to version 6.6.4 – #56016

Help/About

  • Improve vertical alignment in the Additional Design Tools section – #56210

Mail

  • Prevent the last character of names in “From” headers from being trimmed – #19847

Permalinks

  • Fix aria-live text when removing custom structure – #56230

Query

  • Cast the 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. key to BINARY for case-sensitive key comparisons in WP_Meta_Query#51740

Script Loader

  • Remove default DNSDNS DNS is an acronym for Domain Name System - how you assign a human readable address to a website’s exact numeric coded location (ie. wordpress.org uses the actual IP address 198.143.164.252). prefetch entry for s.w.org – #40426, #37387

TaxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies.

  • Associate field descriptions with fields – #55651

Themes

  • Add a 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 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. in Theme Install Screen – #56283, #meta6330
  • Add support for Update URI 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.#14179, #23318, #32101
  • Include a hyphen in the Block Themes tab key on Add Themes screen – #56283

Upgrade/Install

  • Make WP_Filesystem_FTPext::size() return false on failure – #51170

Props

Thanks to the 92 (!) people who contributed to WordPress Core on Trac last week: @SergeyBiryukov (8), @costdev (4), @jrf (3), @swissspidy (2), @joyously (2), @audrasjb (2), @desrosj (2), @afercia (2), @ironprogrammer (2), @johnbillion (2), @sabernhardt (2), @Mte90 (1), @oglekler (1), @marybaum (1), @webcommsat (1), @dd32 (1), @weboccults (1), @rudlinkon (1), @hellofromTonya (1), @jonmackintosh (1), @antonvlasenko (1), @uofaberdeendarren (1), @leemon (1), @dougwollison (1), @tomepajk (1), @ayeshrajans (1), @zieladam (1), @superpoincare (1), @mattyrob (1), @kovshenin (1), @mikehansenme (1), @hakanca (1), @flixos90 (1), @aaemnnosttv (1), @garrett-eclipse (1), @jhabdas (1), @joelhardi (1), @skithund (1), @rafiahmedd (1), @luminuu (1), @johnregan3 (1), @kebbet (1), @joedolson (1), @Synchro (1), @JavierCasares (1), @lev0 (1), @gregorlove (1), @benoitchantre (1), @ryno267 (1), @infolu (1), @miqrogroove (1), @afragen (1), @apedog (1), @markparnell (1), @grapplerulrich (1), @williampatton (1), @earnjam (1), @dingdang (1), @JeroenReumkens (1), @crazycoders (1), @nhuja (1), @sean212 (1), @filosofo (1), @design_dolphin (1), @mweichert (1), @DrewAPicture (1), @markjaquith (1), @DavidAnderson (1), @rmccue (1), @jdgrimes (1), @meloniq (1), @Otto42 (1), @chriscct7 (1), @aspexi (1), @nvartolomei (1), @mordauk (1), @knutsp (1), @GaryJ (1), @TJNowell (1), @gMagicScott (1), @mikejolley (1), @damonganto (1), @Ipstenu (1), @juliobox (1), @Rarst (1), @jb510 (1), @GeekStreetWP (1), @khromov (1), @georgestephanis (1), @jorbin (1), @joostdevalk (1), and @drewapicture (1).

Congrats and welcome to our 5 new contributors of the week: @jonmackintosh, @uofaberdeendarren, @tomepajk, @hakanca, @jhabdas ♥️

Core committers: @sergeybiryukov (18), @joedolson (3), @desrosj (3), @audrasjb (3), and @gziolo (1).

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

Performance team meeting summary 23 August 2022

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

Announcements

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

  • N/A

Feedback requested

Site Health

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.
  • @furi3r: Both the core PR for persistent object cache check and PR for full page cache check are ready; @flixos90 will review both of these this week again and commit them if they’re good to go

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or ping in Slack
  • N/A

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath @sergiomdgomes

GitHub project

  • N/A

Feedback requested

Infrastructure

@flixos90

GitHub project

  • N/A

Feedback requested

Open Floor

  • @adamsilverstein: fetchpriority module proposal
    • @adamsilverstein: basically the idea here is to give the browser a hint about which image it should prioritize loading
    • @adamsilverstein: we already have logic in place in core to exclude the loading=lazy attribute from images we expect will be the LCP image; so we should be able to apply the fetchpriority=high to those exact image and see improved/prioritized loading for those images; so we shouldn’t need new logic to determine which image to apply the attribute to
      • @eugenemanuilov: so, we are going to use the wp_get_loading_attr_default function to determine whether we want to use the fetchpriority  attribute or not, right? if so, i think this won’t work because it will return false (which is when we want to add the fetchpriority attribute) only once in the default setup, and most likely that once time will be used when we render a thumbnail
      • @flixos90: Potentially, definitely something along those lines. Or we could check if the image has loading="lazy" on it and only add fetchpriority="high" if not
      • @adamsilverstein: was thinking the latter, running on the same hook where loading=lazy is added, but later
    • @flixos90: this seems to be a technically rather straightforward potential module for the Performance Lab 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. As Adam mentioned, the main purpose of the module would be to allow us to test how this behaves and measure the impact in the real world; from there it could be refined as needed and eventually proposed for WordPress core
    • @adamsilverstein: this is a “good first module” if someone wants to try to pick it up!
    • @olliejones: do you propose to include anything to measure the improvements? Or will measurement be based on lighthouse, etc?
      • @flixos90: I think measurement is generally happening outside of the Performance Lab plugin, e.g. using Lighthouse, WebPageTest (for lab tests) or CrUX, 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. Archive (for field tests)
      • @adamsilverstein: the generator 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.) should indicate the active modules, so part of putting it in a module is helping being able to detect it; that said we could also query for the presence of the fetchpriority attribute itself as well
    • @masteradhoc: nice module. Interested to see how this could turn out on real sites and how much it will help. Read this guide some time ago: https://web.dev/priority-hints/; anything planned or could also be useful with the opposite priority?
      • @flixos90: Hmm I’m unfamiliar for which cases you would realistically want to use fetchpriority="low"; at least for images, we already have lazy-loading, so there adding this probably wouldn’t do much, but of course there are other types of resources where the attribute can be added, so maybe there’s some value there
    • @adamsilverstein: worth noting we recently added “preload” capabilities to core (#42438), but fetchpriority serves a slightly different use case that should have better results for LCP images
  • @olliejones: Database Performance Health Checks module proposal
    • @olliejones: This is 100% back end stuff. The DBMS world (MariaDB / 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/.) has lots of new performance-enhancementenhancement Enhancements are simple improvements to WordPress, such as the addition of a hook, a new feature, or an improvement to an existing feature. stuff. I propose pointing out that stuff to site owners. Five tests in this module:
      • DBMS server version, with a detail check for the availability of the latest table format.
      • DBMS Connect / Query response time test.
      • Two tests for latest’n’greatest table formats: one for core tables (incl WooCommerce) and another for plugin tables.
      • Finally, a comparison of the data size of the site’s tables with the size of the DBMS server buffer pool, to detect underprovisioned DBMS machines.
    • @olliejones: A previous proposal also included instructions for using wp-cliWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ to correct some inefficiencies, but that doesn’t work for Performance Lab: it’s aimed at site owners not server ops people.
    • @flixos90: I think there is a lot to unpack here. I wonder if it might be best to start the module with only 1 or 2 of these checks; we could easily make those different checks even different modules, not sure what the benefit would be to having it all in one module except that it’s all related to DBs
      • @olliejones: Benefit for one module? simpler Settings page, that’s it (also shared code among the tests, but that’s not so important)
      • @flixos90: fair point. But maybe we can still start with a subset of the checks. A bit easier to reason about and focus better. Discussing all these topics at once will be challenging. Maybe you can suggest a first check from the list above to focus on discussing?
      • @olliejones: Either Connect/query latency or buffer pool sizing.
    • following up on this new module proposal will be the first special agenda item next week

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

#performance, #performance-chat, #summary

Devchat agenda, August 24, 2022

1. Welcome

Feel like catching up ahead time? Here’s last week’s summary.

2. Announcements

WordPress 6.0.2 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1 has landed! Please download and test.

3. Blogblog (versus network, site) posts of note

@zieladam would like feedback by September 9 on a new system for updating HTML attributes.

Got a post to share? Add it to the comments.

4. Upcoming releases

The next major is 6.1.

If you have an update, plan to bring it up here.

The next minor is 6.0.2.

The RC is out! Look for the release next Tuesday at 16:00 UTC.

5. Components and tickets

Are you a component maintainer? Shepherding a ticketticket Created for both bug reports and feature development on the bug tracker.? 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 is five weeks away, so the time is ripe!

6. Open floor

Please add your item to the comments.

See you tomorrow at 20:00!

#agenda, #core, #dev-chat

WordPress 6.0.2 RC1 is now available

WordPress 6.0.2 Release Candidaterelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). 1 (RC1) is available for testing! Some ways you can help test WordPress 6.0.2 RC1:

  • Use the WordPress Beta Tester 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
    • As this is a minor RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). release, select the Point ReleaseMinor Release A set of releases or versions having the same minor version number may be collectively referred to as .x , for example version 5.2.x to refer to versions 5.2, 5.2.1, 5.2.3, and all other versions in the 5.2 (five dot two) branch of that software. Minor Releases often make improvements to existing features and functionality. channel and the Nightlies stream. This is the latest build including the RC and potentially any subsequent commits in trunk.
  • Use WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ to test:
    wp core update https://wordpress.org/wordpress-6.0.2-RC1.zip
  • Directly download the Beta/RC version.

What’s in this release candidate?

6.0.2 RC1 features 12 bug fixes on Core, as well as 5 bug fixes (view PRs merged from July 5th onwards) for 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.

The following coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. tickets from TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. are fixed:

The following block editor issues from GitHubGitHub GitHub is a website that offers online implementation of git repositories that can 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/ are fixed:

What’s next?

The developer-reviewed workflow (double committercommitter A developer with commit access. WordPress has five lead developers and four permanent core developers with commit access. Additionally, the project usually has a few guest or component committers - a developer receiving commit access, generally for a single release cycle (sometimes renewed) and/or for a specific component. sign-off) is now in effect when making changes to the 6.0 branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch"..

The final release is expected on Tuesday, August 30th, 2022. Please note that this date can change depending on possible issues after RC1 is released. Coordination will happen in the 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/ 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/. #6-0-release-leads channel.

A special thanks to everyone who helped test, raised issues, and helped to fix tickets. With this release candidate, testing continues, so please help test!

The WordPress 6.0.2 release is led by @sergeybiryukov @gziololo

#6-0, #6-0-2, #minor-releases, #releases

#6-0, #minor-releases, #releases

Editor Chat Agenda: 24th August 2022

Facilitator and notetaker: @zieladam.

This is the agenda for the weekly editor chat scheduled for Wednesday, August 24, 2022, at 03:00 PM GMT+1.

This meeting is held in the #core-editor channel in the Making WordPress SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..

If you cannot attend the meeting, you are encouraged to share anything relevant to the discussion:

  • If you have an update for the main site editing projects, please feel free to share as a comment or come prepared for the meeting itself.
  • If you have anything to share for the Task Coordination section, please leave it as a comment on this post.
  • If you have anything to propose for the agenda or other specific items related to those listed above, please leave a comment below.

#agenda, #core-editor, #editor

Performance Chat Agenda: 23 August 2022

Here is the agenda for next week’s performance team meeting scheduled for August 23, 2022, at 15:00 UTC.


This meeting happens in the #core-performance channel. To join the meeting, you’ll need an account on the Make WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Editor chat summary: 17 August, 2022

This post summarizes the weekly editor chat meeting (agenda here) held on 2022-08-17 14:00 UTC. in Slack. Moderated by @zieladam.

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 releases

Key project updates

Key project updates:

Task Coordination

@paaljoachim

@zieladam

  • Here’s what I’ve been up to:
  • WP_HTML_Walker – a reliable way to update the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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. markup from PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher, forget about regexps. An official make coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. blogblog (versus network, site) proposal is coming soon!
  • I published the proposal to Stop merging experimental APIs from the Gutenberg plugin to WordPress core
  • I’m transforming the Create your First App with Gutenberg Data tutorial into a course on learn.wordpress.org!

@oandregal

  • I’m getting back into the swing of things, so a lot of catchup. Helped with the gutenberg release and I’m ramping up to help in the area of “locking a pattern” (Add: Content lock ability started by JorgeCosta).

Open Floor

Announcements, questions and discussions.

@ndiego

There was previously some concern around adding Font Family support to more blocks since the Web Fonts 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. was still being finalized. Given this recent tracking ticket and all the associated PRs, I’m assuming that are good to move forward with full typography support across blocks? 

A reply from @hellofromtonya

  • The Webfonts API is still in development, yes. This is true. It’s entire architecture is being changed. However, the API itself as it is in Gutenberg works. The issue of using these enqueued / selected fonts within blocks though is outside the scope of the API itself. What do I mean by that? Right now, any block level interface could get the fonts from the API. That functionality exists now in Gutenberg.
  • For WP 6.1, it’s highly likely the Webfonts API will not be ready.

See the full conversation on Slack.

@priethor

The WordPress 6.1 feature freeze is scheduled for September 20th (Tuesday), and the Gutenberg 14.2 RCrelease candidate One of the final stages in the version release cycle, this version signals the potential to be a final release to the public. Also see alpha (beta). is planned for Sept 21st. It has been common in past releases to arrange the last pre-freeze RC to align with the Feature Freeze, so I was thinking of moving the Gutenberg 14.2 RC1 one day earlier to align with the WP 6.1 Feature Freeze. There are mainly three options for the feature freeze:

  • Make 14.1 the last version included; effective feature freeze on Sept 7th, 13 days of buffer time until WP 6.1 FF.
  • Make the 14.1 cycle one week longer; effective FF on September 14th, 6 days of buffer time.
  • Make 14.2 the last version, but shorten the RC period, with the 14.2 RC1 and effective feature freeze on September 15-16th.

The last two options are very similar, but I would prefer the last one (making 14.2 RC shorter) so that we avoid altering the biweekly release cycles/dates.

See the full conversation on Slack.

@hellofromtonya

PHPUnit tests > to help reduce backporting effort, I’m working on bringing parity between Core’s and Gutenberg’s PHPUnit testing. For example:

  • Turning on and testing of PHP notices and deprecations > which means source code may need adjustment to get rid of these errors
  • Running the tests against all PHP supported versions to ensure there are no incompatibilities

Why? Tests will fail in Core when backported. So catching issues early and continuously throughout the development cycle will help to ensure the PHP side of things is Core commit ready.

To get more details go directly to the Open Floor discussions in the Core Editor 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/. channel.

#core-editor, #core-editor-summary, #gutenberg, #meeting-notes, #summary

A new system for simply and reliably updating HTML attributes

This call for feedback will be open until September 9th.

Let’s introduce a reliable tool WordPress could use to adjust the HTMLHTML HyperText Markup Language. The semantic scripting language primarily used for outputting content in web browsers. 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. markup. The current practice of using basic replacements seems fine at a first glance but is easy to break. The system proposed here will help avoid these common pitfalls.

Consider this example of adding a style HTML attribute in the cover block:

preg_replace( '/class=\".*?\"/', '${0} style="' . $styles . '"', $html );

It assumes a specific HTML structure:

  • There is a class attribute
  • The style attribute isn’t already defined, as browsers ignore the repeated attributes.
  • There is no other attribute ending with the string class="", such as data-replace-class="…" or title='how to set the class="" attribute'
  • The existing class attribute uses double quotes and no single quotes or no quotes.
  • Regular HTML does not contain the class="" substring, for example in a post describing how to use the class attribute in an HTML document.

These assumptions are typically true, but only until they’re not. For example, applying a padding produces a markup such as below where the browsers ignore the second style attribute:

<!-- Formatting applied for clarity -->
<div
    class="wp-block-cover"
    style="background-image:url(/img.png);"
    style="padding-top:4px">

The original preg_replace could be patched, but eventually another assumption would break. The deeper, fundamental problem is that string replacements are not the right tool for updating HTML. They’re used out of necessity as WordPress does not provide any better tools. Well, let’s change it!

Let’s introduce a dedicated tool for reliably updating the HTML markup. It’s called WP_HTML_Walker:

$w = new WP_HTML_Walker( '<div></div>' );
$w->next_tag();
$w->set_attribute( 'style', $styles );
$updated_html = (string) $w
// <div style="display: block"></div>

Simple string replacements don’t account for nuances in HTML

The problem of updating HTML attributes frequently appears in block-related work. Recently @dmsnell and I (@zieladam) investigated how HTML attributes are typically updated in the WordPress codebase while exploring adding a CSS class to all Gutenberg blocks. We found the typical approach is to use string replacements similar to the one covered above.

Here are a few examples already in CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. where we run into these nuanced problems:

The Site Logo block attempts to remove the href attribute:

// Remove the link.
preg_replace( '#<a.*?>(.*?)</a>#i', '\1', $custom_logo );

However, it also unintentionally removes all the attributes, including class and style.

The gallery block adds a CSSCSS Cascading Style Sheets. class:

preg_replace('/' . preg_quote( 'class="', '/' ) . '/', 'class="' . $class . ' ', $content, 1);

However, if there’s no existing class attribute, it will skip over the 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.) without adding the required class. The same technique is used in the duotone feature, and the block supports API.

As a side note, it’s easy to lean on the existing pattern of using more complicated functions such as preg_replace(). Calling preg_quote() in this example isn’t appropriate and the entire regular expression pattern does nothing more than a basic str_replace().

The block-supports 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. attempts to find the first HTML tag:

preg_match( '/<[^>]+>/', $block_content, $html_element_matches, PREG_OFFSET_CAPTURE );

However, it also matches non-tags like text hearts and mathematical expressions (<3, f(x) = {x, x<5; -1, x>=5}), DOCTYPE declarations, and HTML comments.

The media library adds the srcset attribute:

preg_replace( '/<img ([^>]+?)[\/ ]*>/', '<img $1' . $attr . ' />', $image );

However, a > character inside a tag attribute (e.g. title="why tacos > burritos")  would break the srcset functionality and potentially introduce a vector for injection attacks.

The list goes on, and it’s not just blocks.

Here’s an example from shortcodes:

if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {

Media Embeds:

if ( preg_match_all( '#<(?P<tag>' . $tags . ')[^<]*?(?:>[\s\S]*?<\/(?P=tag)>|\s*\/>)#', $content, $matches ) ) {

Media Galleries:

preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER );

Twentynineteen:

preg_replace( '/<a\s.*?>/', $link, $item_output, 1 );

And many, many other places. The point is, this is how WordPress does it today.

Many features demand a more reliable way of updating HTML attributes. Block theming code, in particular, tends to modify block markup to apply visual styling:

The only way to reliably update HTML attributes is to follow the HTML specification. However, doing that from scratch every time a CSS class is added would only cloud the entire codebase with HTML parsing nuances and distract from the work being done. That’s why @dmsnell, @gziolo, and I (@zieladam) want to move this complexity into Core. It would be exposed as a tailored and restricted API that’s easy to use, hard to mess up, and easy to find.

The new system tokenizes HTML

WP_HTML_Walker (Pull Request 43268) recognizes HTML tags and updates their attributes. It’s reliable because it implements the same official HTML specification as WebKit, Chrome, Firefox, and other major browser engines.

Unlike full-fledged HTML parsers, the walker avoids handling malformed markup, semantic problems, and building a document tree. Any problems that are present on the input are passed on to the browser. The walker doesn’t fix HTML just as it won’t break HTML.

The tradeoff is that it only offers a simplified API to modify HTML attributes. If you want to replace an img tag with a full-fledged figure layout, this API won’t offer that functionality. Similarly, the walker won’t help you replace all the child nodes of a particular div with a completely new markup. This system is focused on finding specific HTML tags and adding, removing, or updating the attributes on those tags.

Remove the href attribute from an anchor tag:

$w = new WP_HTML_Walker( $html );
$w->next_tag( 'a' );
$w->remove_attribute( 'href' );

Add a style attribute to the first tag in the document:

$w = new WP_HTML_Walker( $html );
$w->next_tag();
$w->set_attribute( 'style', 'display: none' );

Add a CSS class to the first tag having the wp-block-media-text__content class:

$w = new WP_HTML_Walker( $html );
$w->next_tag(array(
    'class_name' => 'wp-block-media-text__content'
));
$w->add_class( 'wp-foo-bar' );

Add the srcset attribute to all image tags:

$w = new WP_HTML_Walker( $html );
while ( $w->next_tag() ) {
    if (
        isset( $w->get_attribute( 'src' ) ) &&
        ! isset( $w->get_attribute( 'srcset' )
    ) {
        $srcset = build_srcset( $w->get_attribute( 'src' ) );
        $w->set_attribute( 'srcset', $srcset );
    }
}

Processing HTML using this Core API could help avoid a broad array of mistakes that appear due to the oversimplification presented by the array of ad-hoc solutions. A common interface for operations on block markup would alleviate competition between changes. You can check the refactoring PR to see how this new API could improve code readability in the existing core blocks.

Why build a new API instead of using DOMDocument?

Using DOMDocument was extensively discussed. It’s not installed on every host so a polyfill would still be necessary. And even if it was available everywhere, it’s based on libxml2 designed to parse XML. Libxml2 does not implement the WHATWG HTML parsing spec, does not support HTML5, and brings with it a variety of parsing failures and quirks.

Like many DOM libraries, DOMDocument is a heavy interface that rewrites entire documents after several stages of transformation. In contrast, the walker exposes a focused interface closer to what string functions offer. For the kind of modifications occurring in WordPress this is a more natural and convenient approach.

If this resonates with you then please speak out before September 9th

This post will be open for feedback for the next three weeks until September 9th. After that @dmsnell, @gziolo, and @zieladam would like to merge the new API into the GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ 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 to power adding CSS classes to Gutenberg blocks, block layout improvements, and changes in CSS style variations.

Also see the WP_HTML_Walker Pull Request.

Props to Dennis Snell (@dmsnell), Grzegorz Ziółkowski (@gziolo), Andrei Draganescu (@andraganescu), Carolina Nymark (@poena), and Ramon Dodd (@ramonopoly) for their reviews and help in putting this proposal together.
#core, #editor, #gutenberg, #proposal