[wp-trac] [WordPress Trac] #46456: Customize: widgets search shouldn't search by widgets id
WordPress Trac
noreply at wordpress.org
Sat Mar 9 13:57:39 UTC 2019
#46456: Customize: widgets search shouldn't search by widgets id
--------------------------+-----------------------------
Reporter: afercia | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 3.9
Severity: normal | Keywords: has-screenshots
Focuses: ui |
--------------------------+-----------------------------
Noticed while reviewing #28888.
When searching for available widgets in the Customiser, the search checks
for matches in the widgets name, id, and description:
https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/wp/customize/widgets.js?rev=44539&marks=101#L87
See [27650].
However, the widget ID isn't necessarily a good place where to search for
a match:
- IDs may change at any time
- IDs are not supposed to have a meaning for humans
- custom widgets added by plugins are not guaranteed to have meaningful
IDs
- the IDs of all the new media widgets contain the term "media", which can
produce unexpected search results
- more importantly, **IDs can't be translated**
A couple examples in the screenshot below:
[[Image(http://cldup.com/eGFM1LwArc.png)]]
On the left: When searching for the term "med", all the 4 media widgets
are returned in the search results. However, only the "Video" widget has
some visible text that contains the term "med". This is confusing for
users, as it's not so clear why "med" returns also the Audio, Gallery, and
Image widgets.
This happens because under the hood the search is made against the
following strings:
{{{
Audio media_audio-1 Displays an audio player.
Gallery media_gallery-3 Displays an image gallery.
Image media_image-3 Displays an image.
Video media_video-1 Displays a video from the media library or from
YouTube, Vimeo, or another provider.
}}}
On the right: When the admin interface is set to a language other than
English, the search will still match the IDs and, of course, they're in
English. For example, when the admin language is German, searching for
"im" returns also the "Bild" widget, which doesn't have any visible text
matching "im". This is only an example: the amount of potentially
confusing cases is endless, considering all the available languages.
Suggest: remove the widgets ID from the search "haystack".
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46456>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list