[wp-trac] [WordPress Trac] #39691: wpLink autocomplete search improvement

WordPress Trac noreply at wordpress.org
Wed Jan 25 18:39:56 UTC 2017

#39691: wpLink autocomplete search improvement
 Reporter:  enrico.sorcinelli  |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Editor             |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:                     |
 This patch offers a small improvement to wpLink (and tinymce plugin)
 autocomplete search in order to reduce requests to the server.

 It normalizes the search terms by make it lowercase (based on DB collate
 setting) and trims / removes redundant blank spaces before to send a new
 one search.

 I know, this way (for example by putting two words separate by several
 blank spaces), it can skip the first `CASE`/`WHEN` in the `ORDER BY`
 clause, since the exact query is used into a `LIKE` statement to determine
 the order value.

 The patch also exposes `dbcollate` JavaScript variabile in the admin
 header that is used to check case insensitive DB setting. I think that it
 could be useful also in other situations.

 Feedback and suggestions are appreciated


 PS: I haven't seen any tests (phpunit/qunit) related to wpLink so
 currently I haven't provided a new one.

Ticket URL: <https://core.trac.wordpress.org/ticket/39691>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list