[wp-trac] [WordPress Trac] #38782: Insert/Edit link scrolling triggers AJAX requests for both (recent and search) rivers

WordPress Trac noreply at wordpress.org
Mon Nov 14 14:57:01 UTC 2016


#38782: Insert/Edit link scrolling triggers AJAX requests for both (recent and
search) rivers
-----------------------------+-----------------------------
 Reporter:  david.binda      |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Editor           |    Version:  4.6.1
 Severity:  normal           |   Keywords:
  Focuses:  ui, performance  |
-----------------------------+-----------------------------
 I noticed quite a number of insert/edit link related SQL queries. When
 testing the feature, I have noticed that in case a search keywords is
 typed into the search field and user scrolls down the results, not only
 the search river related AJAX is made, but also a recent river triggers an
 AJAX request.

 The behaviour currently looks this way:

 1) opening the Insert/Edit link modal triggers following AJAX request:

 action: wp-link-ajax
 page: 1

 2) putting in a keyword to search input triggers following AJAX request:

 action: wp-link-ajax
 page: 1
 search: {keyword}

 3) scrolling down the results of the search query produces two AJAX
 request:

 action: wp-link-ajax
 page: 2

 and

 action: wp-link-ajax
 page: 2
 search: {keyword}

 4) as the search AJAX for page 2 returned `false`, scrolling up produces
 following AJAX only:

 action: wp-link-ajax
 page: 3

 5) removing the keyword form the search input user is taken to the recent
 river which now already contains 4 pages of results

 Since this behaviour is producing a lot of SQL queries with an increasing
 offset, those queries are getting slow with increasing dataset. Shouldn't
 the implementation be triggering AJAX requests for visible river only?

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


More information about the wp-trac mailing list