Make WordPress Core

Opened 9 years ago

Last modified 6 days ago

#40774 new enhancement

Refine error message when embedding invalid Video (URL)

Reported by: presskopp's profile Presskopp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Media Keywords: has-patch needs-refresh 2nd-opinion
Focuses: Cc:

Description

like in #40771 you get the following error when your link is invalid:

Sorry, we can’t display the video file type selected. Please select a supported video file (...) or stream (YouTube or Vimeo) instead.

When posting an incomplete youtube link for example it's not the file type but a character wrong or missing.

I propose to change the error message like in the patch attached:

Sorry, either the selected file type is not supported or the video stream is invalid. Please make sure to select one of the following video file types (%1$s) or a valid stream (YouTube or Vimeo) instead.

Attachments (1)

40774.diff (1.1 KB) - added by Presskopp 9 years ago.

Download all attachments as: .zip

Change History (9)

@Presskopp
9 years ago

#1 @jnylen0
9 years ago

This is good as an incremental improvement, and worth committing by itself IMO, but I think we can probably go a bit further here. What are the failure conditions we expect? For example:

  • Non-video file type (can we show the actual file type we received instead?)
  • Non-200 response (can we show the response code or some text about it instead?)
  • Response failed, blocked by browser (#40771; can we detect this?)

This ticket was mentioned in Slack in #core-media by presskopp. View the logs.


9 years ago

#3 @jbpaul17
9 years ago

  • Keywords has-patch needs-testing added

#4 @jbpaul17
9 years ago

  • Keywords needs-refresh added

This ticket was mentioned in Slack in #core-media by presskopp. View the logs.


9 years ago

This ticket was mentioned in Slack in #core-media by presskopp. View the logs.


8 years ago

This ticket was mentioned in PR #9887 on WordPress/wordpress-develop by @abcd95.


5 months ago
#7

  • Keywords needs-refresh removed

#8 @huzaifaalmesbah
6 days ago

  • Keywords needs-refresh 2nd-opinion added; needs-testing removed

Patch Testing Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/9887

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.30
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
  • Browser: Chrome 143.0.0.0
  • OS: macOS
  • Theme: Twenty Eleven 5.0
  • MU Plugins: None activated
  • Plugins:
    • Classic Widgets 0.3
    • Test Reports 1.2.1

Steps taken

  1. Applied PR patch locally.
  2. Navigated to Appearance → Widgets → Video Widget.
  3. Clicked "Add Video" → "Insert from URL".
  4. Tested multiple URLs:
    • Valid public YouTube video
    • Private YouTube video
    • Invalid YouTube URL (wrong ID)
    • Invalid Vimeo URL
    • Non-video direct file URL
  5. Compared behavior before and after applying the patch.
  6. ❌ No visible change

Expected behavior based on PR

Specific, contextual error messages should display depending on the failure:

  • Invalid URL → show validation message
  • Private/restricted YouTube → show YouTube-specific message
  • Missing file → show file not found message
  • Network issue → show network error message

Instead, the widget always falls back to the same generic unsupported file type message.

Additional Notes

The same generic error message appears both before and after the patch:

"Sorry, the video at the supplied URL cannot be loaded. Please check that the URL is for a supported video file (.mp4, .m4v, .webm, .ogv, .flv) or stream (e.g. YouTube and Vimeo)."

The newly introduced error messages (invalid_url, youtube_error, vimeo_error, network_error, file_not_found) are not triggered or displayed in any tested scenarios.

Note: See TracTickets for help on using tickets.