Media Meeting Recap – June 25, 2020

Here’s a summary of the #core-media chat from June 25, 2020. Weekly media meetings happen on Thursdays at 14:00 UTC; see the full transcript here, in the Make WordPress Slack.

Attendees: @paaljoachim, @joemcgill, @desrosj, @chaion07, @cdog, @sageshilling, @antpb, @afercia, @swissspidy, @JJJ, @pbiron

Discuss Media 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/. endpoints

The below post was discussed as an effort to bring visibility to the changes in image editing. Please take a moment if you haven’t to consider any Media implications of the changes. Many great ideas have been documented in the post.

Ticketticket Created for both bug reports and feature development on the bug tracker. #50105: Remove infinite scrolling behavior from the Media grid

#50105 was discussed and there is some help needed testing the most recent 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. to remove the infinite scrolling behavior in Media grid. Separately from this issue, a new 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. was found that needs some attention. The unintended consequence of the changes were that the number of items counted for the “Load More” button are incorrect as they calculate images that do not render. The ticket at minimum before 5.5 needs a more accurate count to better represent what is left to load. An issue to track this can be found in #50410.

Media Meeting Continued June 26 at 14:00 UTC

One topic that did not get a chance to be discussed was #16020 “Upload custom avatarAvatar An avatar is an image or illustration that specifically refers to a character that represents an online user. It’s usually a square box that appears next to the user’s name. for user in Dashboard” which was recently commented with a recommendation to remove from the 5.5 scope. Given the timeframe and wide range of complexities, this needs some time to:

  1. Discuss tomorrow at 14:00 UTC to determine next steps
  2. Collaborate with the Privacy team to ensure this is done in the best way for everyone and in a featured 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.

Please feel free to continue the momentum of this issue join in on the discussion tomorrow.

#core, #core-accessibility, #core-media, #media, #summary

Media Chat Agenda: 24th June, 2020

This is the agenda for the weekly Media Meeting scheduled for Thursday, June 24, 2020, 04:00 PM GMT+2.

This meeting is held in the #core-media channel in 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/..

– Topics to Discuss

Implications of the proposed experimental 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/. endpoints for image editing: https://make.wordpress.org/core/2020/06/14/shipping-experimental-endpoints-in-core-rest-api-meeting-summary-june-11-2020/

#50105: Remove infinite scrolling behavior from the Media grid – Discuss next steps. Seems that this could use testing and dev-notes. Let’s see how we can help here!

Custom AvatarAvatar An avatar is an image or illustration that specifically refers to a character that represents an online user. It’s usually a square box that appears next to the user’s name. feedback that @cdog provided last week:
https://make.wordpress.org/core/2020/06/18/media-chat-agenda-18th-june-2020/#comment-38779  

Discuss support for WebP – @joemcgill said in #core-media, “Given the announcement yesterday that Safari is about to support WebP, I’m wondering how we might go about supporting the format in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., revisiting this discussion: https://wordpress.slack.com/archives/C02SX62S6/p1581005513097600

Even if you cannot makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). the meeting, you are encouraged to share anything relevant for the discussion. If you have anything to propose for the agenda or other specific items related to those listed above, please leave a comment below.

#agenda, #media

Media Chat Agenda: 18th June, 2020

This is the agenda for the weekly Media Meeting scheduled for Thursday, June 18, 2020, 04:00 PM GMT+2.

This meeting is held in the #core-media channel in 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/..

– Updates
    – To be determined.
– Topics to Discuss
    – Custom AvatarAvatar An avatar is an image or illustration that specifically refers to a character that represents an online user. It’s usually a square box that appears next to the user’s name. Uploader: https://core.trac.wordpress.org/ticket/16020
    – Gallery 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.https://github.com/WordPress/gutenberg/issues/11436

Even if you cannot makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). the meeting, you are encouraged to share anything relevant for the discussion. 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-media, #media

Media Upload Request Flow in WordPress 5.3

After a couple of questions from hosting companies about how to detect how well uploads are working at the server/request level, I thought further documentation would help.

Here is a walkthrough of the request flow for media uploads, both before and after WordPress 5.3. Hopefully this will help with troubleshooting and debugging uploads on your infrastructure or sites!

Before WordPress 5.3

Before WordPress 5.3, uploads had to complete during a single 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. POST request to .../wp-admin/async-upload.php or to the REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/. with the media endpoint (.../wp-json/wp/v2/media/).

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 uses the REST API to upload, while any uploads outside the block editor (or using the popup Media Modal) use async-upload.php.

When uploads failed, they would return whatever HTTP error the server is set up to give (usually in the 5xx range). This is usually due to timeout or resource exhaustion (like running out of memory) reasons.

WordPress 5.3+

In WordPress 5.3+, uploads have been decoupled from a single request to allow for resuming. Now, when an upload returns a 5xx error, there can be up to 5 followup requests.

This is accomplished differently depending on whether async-upload.php or the REST API are used.

Legacy Uploads

Outside of the REST API, the upload happens first with a request to async-upload.php, just like before 5.3.

If it fails, a request is made to admin-ajax.php with form-data containing action: media-create-image-subsizes and attachment_id: #### to attempt to complete the action.

If all retry attempts fail, the last request to admin-ajax.php has _wp_upload_failed_cleanup: true in form-data and attempts a cleanup. This deletes the the attachment post, the uploaded file, and any intermediate sizes that were created. Then, an error message is shown to users advising them to scale down the image and try uploading again.

REST API Uploads

When using the REST API, the initial request is to .../wp-json/wp/v2/media?_locale=user, and retry requests are to .../wp-json/wp/v2/media/####/post-process?_locale=user (where #### is the attachment post ID).

If all attempts to resume post-processing fail with HTTP 5xx errors, the last is a standard “delete attachment” request, sent to .../wp-json/wp/v2/media/####?force=true&_locale=user with X-HTTP-Method-Override: DELETE 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.. It performs the same cleanup as described for the admin-ajax.php upload method.

Hopefully this helps in understanding how uploads work! If you have any questions, please ask in the comments for clarification.

Thanks to @azaozz for helping write this post!

+make.wordpress.org/hosting

#5-3, #dev-notes, #media

Media Meeting Recap – January 9, 2020

Here’s a summary of the #core-media chat from January 9, 2020. Weekly media meetings happen on Thursdays at 14:00 UTC; see the full transcript here, in the Make WordPress Slack.

Attendees: @joemcgill, @karmatosed, @antpb

Upcoming Meeting Schedule

Happy 2020! Because of the holidays, the group postponed chats until Thursday, January 9.

This morning, the group also discussed moving the regular time, so more people can join the chat – particularly people working on critical tickets in the 5.4 releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software. cycle.

Here are three options. Vote for your favorite in the comments:

  • Move the current Thursday 14:00 UTC time to 15:00 UTC
  • Move the date to Tuesday at 21:00 UTC (this option works well for the three who came to today’s meeting.)
  • Multiple meetings, to account for both sides of the world. This option would likely require a push of the currently scheduled meeting to 15:00 or 16:00 UTC as well as an agreed time and date for the second meeting. @joemcgill suggested that multiple meetings not be forced to cover the same agenda items. Some items will overlap where it makes sense, but, for example, if one meeting has cleared the ticketticket Created for both bug reports and feature development on the bug tracker. queue, it would be pointless for the next meeting to consist largely of a triagetriage The act of evaluating and sorting bug reports, in order to decide priority, severity, and other factors..

New Media ticket triage

#48194 – Unregistered image sizes used for IMG 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.) “srcset”

As @joemcgill pointed out: “The problem here seems to be that someone has deleted image files that are still referenced in the database in attachment metadata. Regenerating image sizes ( wp media regenerate ) would fix this problem, but should we only use registered sizes in `srcset` attributes if there are other sizes available?”

#48321 – Hotswapping 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. with gallery images

It seems the ask is for (after creating gallery) the option to click on one of the gallery items and set as featured image of the associated post. It was agreed by attendees that this may not be best fit in the gallery 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. UIUI User interface and perhaps would be better fit as an option within the media modal when creating galleries, images, etc.

The group changed the ticket to ask for reporter feedback.

@karmatosed made another point. The “Uploaded to this post” 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 the Set Featured Image modal, does give the reporter part of what they’re asking for.

#48325 – Additional filter in media-template.php. Let developers hide attachment page link.

@joemcgill pointed us to the code that creates the attachment link: https://github.com/WordPress/WordPress/blob/master/wp-includes/media-template.php#L511 and said, “At minimum, I think that template should check that data.link is actually a URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org before displaying [it]. [Developers] could filter the data that is used by this template.”

WordPress 5.4 Media Focuses

While it didn’t come up in the meeting, notes are a great place for all of us to develop ideas for Media focuses in 5.4.

If you have any media-related focuses you’d like to work on in the 5.4 cycle, and that you’re ready to work on, please leave a comment.

That helps the Media maintainers gather and prioritize the work. Plus, it would be great if you’d come to next week’s chat so we can all discuss your idea!

#core, #core-accessibility, #core-media, #media, #summary

Media Meeting Recap – December 19, 2019

The following is a summary of the weekly media component meeting that occurred on Thursday, December 19, 2019. Weekly media meetings are held every Thursday at 14:00 UTC. A full transcript can be found here in the #core-media room in the Make WordPress Slack.

Attendees: @joemcgill, @mikeschroder, @antpb, @flixos90, @karmatosed

Upcoming Meeting Schedule

Due to the holidays, we are postponing weekly meetings until Thursday, January 9.

Additionally, we are planning to adjust the meeting time in the new year to allow for better attendance from people working on priority tickets during the 5.4 cycle. @joemcgill will be reaching out to component maintainers to gather preferred times and will post an updated schedule before January 9.

WordPress 5.4 Media Focuses

As planning for WordPress version 5.4 is beginning, @francina has reached out to component maintainers to see if there are any major plans for this releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software.. Here are the items currently being discussed:

  • #44427: Introduce lazy-loading 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. for media and other elements@flixos90 is leading this effort and will be looking for feedback.
  • @azaozz plans on working on more meaningful error messages when uploads fail (possibly in cooperation with Site Health).
  • @azaozz also plans to look into deprecating some of the “notoriously misused” image related functions, like constrain_size_for_editor().
  • Several other regular contributors are still working out how much time they’ll have to contribute in the new year and what their focuses will be.

If anyone has any additional media-related focuses they plan to work on during the 5.4 cycle, please leave a comment below so we can gather and prioritize work in the new year.

Hope to see you all in 2020 🎊

#core, #core-accessibility, #core-media, #media, #summary

Media Meeting Recap – November 14, 2019

The following is a summary of the weekly media component meeting that occurred on Thursday, November 14, 2019. Weekly media meetings are held every Thursday at 14:00 UTC. A full transcript can be found here in the #core-media room in the Make WordPress Slack.

Attendees: @sergeybiryukov , @pbiron, @spacedmonkey, @afercia, @dinhtungdu, @azaozz

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

There were a few issues that came to light after folks updated to the 5.3 releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software..

Issues discussed:

  • #48632 : Cannot upload images directly from blogpost – Meeting participants attempted to replicate but were unable. Related issues were #48620 and #48604 in which one of the issues were due to a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party.
  • #48618 : Cursor doesn’t default to 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. box in insert from URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org@afercia has responded that this change was intentional per this commit: https://core.trac.wordpress.org/changeset/45524 .

That’s all that was reported as of meeting time last week! Thank you to everyone that contributed to WordPress 5.3! It really is a great update.

Meeting Scheduling Discussion

As you may have noticed, the time for the meeting was adjusted for Daylight Savings Time and moved later by one hour. There was some discussion in the meeting around adding a second meeting to the week allowing folks from both sides of the planet to participate. If you are in the AMEA region, please leave your thoughts on when the day and time of the week that works best. This topic will be revisited in the next meeting on Thursday, November 21, at 14:00 UTC

It was also mentioned that in this new scheduling model, it would be desired to move the currently scheduled meeting later one hour. This is of course only if there is another AMEA friendly meeting scheduled.

New Issues Triage

The meeting transitioned to a bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. scrub after discussion about scheduling.

  • #48562 : Audio keeps playing on closing of media/attachment details popup in WP Adminadmin (and super admin) – This was reproducible via the Media Library page in grid view. This issue has been around since 5.2 also so this is not a regressionregression A software bug that breaks or degrades something that previously worked. Regressions are often treated as critical bugs or blockers. Recent regressions may be given higher priorities. A "3.6 regression" would be a bug in 3.6 that worked as intended in 3.5.. Work is happening in the ticketticket Created for both bug reports and feature development on the bug tracker. to fix it up. The remainder of the meeting was filled with bunnies and discussion around a fix for the issue.

Feedback

If you have any feedback on the above, please feel free to leave a comment, join in #core-media for a chat, or attend the next meeting on November 21, 2019 at 14:00UTC!

#core, #core-accessibility, #core-media, #media, #summary

Media Meeting Recap – November 7, 2019

The following is a summary of the weekly media component meeting that occurred on Thursday, November 7, 2019. Weekly media meetings are held every Thursday at 14:00 UTC. A full transcript can be found here in the #core-media room in the Make WordPress Slack.

Attendees: @joemcgill , @mikeschroder, @afercia, @desrosj, @dinhtungdu, @karmatosed, @greglone, @azaozz

Meeting Time Discussion

It’s that time of year again (for some of us!) Fall Daylight Savings Time historically makes the meeting time move forward one hour. The next meeting will take place Thursday, November 14, at 14:00 UTC.

There was discussion in a group message consisting of meeting facilitators around potentially doing a rotation of one week at a convenient time for each side of the planet. The Hosting-Community room does this and it seems to work very well. This would allow for participation from groups outside of the normal hour that we hold the meeting while also allowing folks that have been stretching outside their normal work hours to catch the meeting async. Please let us know in the comments what you think about this! There was mention of potentially doing a few months on one schedule and a rotation after. Another suggestion was around doing many meetings instead of rotating meetings. This would entail two designated meeting times a week in an effort to encourage new participants. This topic will be discussed in the next Media Meeting. Any additional ideas would be appreciated.

WordPress 5.3 Tasks

There were three tickets discussed in the meeting.

  1. #48518 Inconsistent behavior when a registered image size is larger than the big image threshold – Testing is being done around this issue and should be ready for 5.3.
  2. #48451 Regression: wp_update_attachment_metadata filter now fires very often and without complete metadata – The Follow Up Post around this outlines a few areas to focus on with the recent uploads changes. Some discussion took place around whether or not a new hook would help folks adjust to the changes. This is still to be determined.
  3. #48522 Attachment size not generated when large images uploaded – A few more details about this issue can be found at this Slack Link. Testing would be appreciated on this ticketticket Created for both bug reports and feature development on the bug tracker..

Feedback

If you have any feedback on the above, please feel free to leave a comment, join in #core-media for a chat, or attend the next meeting on November 14, 2019 at 14:00UTC!

#core, #core-accessibility, #core-media, #media, #summary

Improvements in Media component accessibility in WordPress 5.3

Form controls are still unlabelled in WordPress media views. Some don’t have associated <label> element, <aria-label>attribute or some have an empty label.

Properly labeling form controls is essential for a basic level of 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), as labels give form controls their accessible name. The name is then used by assistive technologies to inform users what the form control is about. Not to mention visible <label> elements are clickable and help users with motor impairments to set focus on the associated form control.

Also, the WordPress accessibility coding standards recommend explicitly associated labels (with for/id) attributes instead of implicitly (wrapping) labels.

WordPress 5.3 will now include some accessibility improvements of all the media views from controls:

  • Changes the media views form controls to have explicitly associated labels with for/id attributes
  • Adds a few missing labels / aria-labels
  • Improves a few existing labels / aria-labels
  • Improves semantics in a few places, by adding visually hidden headings, fieldset + legend elements, aria-describedby attributes
  • Improves the image custom size input fields and their labeling
  • Adds role=”status” to the “saved” indicator so that status messages are announced to assistive technologies
  • Swaps the columns source order in the image details template, to makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). visual and DOM order match
  • Swaps the “Replace” and “Back” buttons source order in the Replace Image view, to make visual and DOM order match
  • Gallery settings: move checkbox label to the right: checkboxes are supposed to have labels on the right
  • Merge similar strings, unified to “Drop files to upload” (removed “Drop files here”, and “Drop files anywhere to upload”)
  • Makes the “upload-ui” consistent across the media views
  • Hides the IE 11 “X” ::-ms-clear button in the Insert from URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org field, as it conflicts with the uploading spinner
  • Adds comments to all the media templates to clarify their usage
  • Slightly increases the vertical spacing between form fields in the media 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.
  • Removes some CSSCSS Cascading Style Sheets. selectors introduced as backwards compatibility for WordPress pre-4.4
  • Removes some CSS still targeting Internet Explorer 7 and 8
  • Fixes buttons group layout for Internet Explorer 11

The most important change to clarify is that the labeling changed from this (implicit labeling):

<label>
    My input
    <input type="text" />
</label>

to this (explicit labeling):

<label for="my-input">My input</label>
<input type="text" id="my-input" />

Simplified code sample


More details on these improvements can be found in TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. #47122.

This note was drafted by @justinahinon and proofread by @afercia.

#5-3, #accessibility, #dev-notes, #media

Updates to Image Processing in WordPress 5.3

WordPress 5.3 includes several enhancements to how images are used and post-processed after upload.

When an image is uploaded to WordPress, alternate smaller sizes are automatically created. Some of these “intermediate” sizes are defined by coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., and others by themes or plugins. These are used both for art direction uses, like alternate crops, and automatically by core for responsive images if they are the same aspect ratio.

Resizing images is very resource intensive. As average image sizes have increased over time, this has only increased the chances that requests may time out or run out of memory. WordPress 5.3 includes several enhancements to help more uploads succeed, and to aid users in recovery when they do not. These changes also enable WordPress to generate two new, higher resolution default sizes, to help user images look their best.

Saving of image metadata while creating intermediate sizes

Before 5.3, WordPress would first generate all intermediate sizes before saving proof of their existence in the database in 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..

This meant that if an upload failed in the middle, there could be many sizes that had completed successfully stored, but this wouldn’t be reflected in the database. A user’s only recourse was to re-upload over and over again in the hope that their server was less busy and all of the sizes would be generated.

In 5.3, this problem is fixed through saving metadata for each size as it is created in the database. This means more database writes, but allows WordPress to use the sizes generated earlier, and to resume failed uploads.

To makemake A collection of P2 blogs at make.wordpress.org, which are the home to a number of contributor groups, including core development (make/core, formerly "wpdevel"), the UI working group (make/ui), translators (make/polyglots), the theme reviewers (make/themes), resources for plugin authors (make/plugins), and the accessibility working group (make/accessibility). this possible, a new method make_subsize() was introduced in the WP_Image_Editor_GD and WP_Image_Editor_Imagick classes. It returns the new sub-size image path and dimensions ready to be added to the image meta’s sizes array. See #40439.

Additional changes:

  • Introduces wp_get_missing_image_subsizes() and wp_update_image_subsizes() to generate image sub-sizes that are missing or were not created after the upload.
  • Adds a way to display errors that happened while creating sub-sizes.
  • Introduces wp_create_image_subsizes() intended for use after an image was uploaded. It saves/updates the image metadata immediately after each sub-size is created.

With that in place it became possible to attempt to finish post-processing of images after upload if the server runs out of resources while creating intermediate image sizes (the dreaded “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. Error” message). See #47872.

“BIG image” enhancements

Until now it was possible to use the originally uploaded images on the front-end even when they are were not “web ready”. In WordPress 5.3 when a large image is uploaded it is stored in the uploads directory but is not used on the web site. A new scaled down image is created and used as the largest available size. This scaled down image is usually much more suitable for web use, the file size is up to ten times smaller than the original. See #47873.

Additional changes:

  • Introduces wp_get_original_image_path() that retrieves the path to the originally uploaded image in all cases.
  • Introduces big_image_size_threshold 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. to set the pixel value above which images will be scaled. The same value is used as max-width and max-height when scaling the original.

These enhancements also made it possible to automatically rotate uploaded photos according to the EXIF data, and to add two additional default image sizes to better support high-density displays. See #14459 and #43524.

Thanks @mikeschroder for helping to write this post.

#5-3, #dev-notes, #media, #upload