#13580 closed enhancement (fixed)
Ajax Tag Search crashes browsers on databases with large tag lists or slow connections
Reported by: | brianlayman | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
In short, many conditions can cause the ajax-tag-search to take a long time. This is not just limited to database size or speed but is also dependent upon the speed of the author's connection. When a browser JS call times out, the user can hit stop script, however the script is usually triggered again almost immediately. The end result currently seems to be the browser session crashing. At best, when these delays happen, getting suggestions for tags can take 30+ seconds be a very tedious process.
This simple backwards compatible patch addresses the issue by allowing site by site customization of the variables involved.
This patch references two new option values:
ats_min_chars - Allows you to specify how many letters must be typed before the search is done. Currently, this number is hard coded at "2". That is the default for the patch..
ats_min_count - Allows you to eliminate tags that are used infrequently. This uses the count column on the already included term_taxonomy table; so it does not expand the query at all. It defaults to "0"
The code in this patch has been running live at b5media for a while now with the defaults of 3 for min chars and either 10 or 20 for the post count dependent upon which site is involved.
Attachments (6)
Change History (22)
#1
@
14 years ago
- Component changed from Editor to Performance
- Keywords needs-patch added; editor tags crash removed
- Milestone changed from 3.0 to 3.1
- Priority changed from high to normal
- Severity changed from critical to normal
- Type changed from defect (bug) to enhancement
Seems sane. Too late for 3.0 however.
Suggestions:
The options should instead be filters.
We should only add the count to the SQL if the filter returns > 0.
#2
@
14 years ago
Agree on options being filters. Don't need to clog the options table, or worse, create UI for this.
@
13 years ago
Updated patch to reflect 13580.2.diff 's inclusion in 3.1. This patch should apply to 3.2's dev/trunk code.
#7
@
13 years ago
Would love to see this included in 3.2. It would be great to not have to do core hacks just to keep the editor from crashing when you have hundreds of tags... And I'd no longer have to keep updating the patch! :D
#10
@
11 years ago
- Component changed from Performance to Taxonomy
- Focuses docs added
- Keywords needs-patch added; has-patch removed
I'm happy to revisit this, with proper hook documentation. Also, we should spell out "term_search" rather than "ats".
This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.
11 years ago
#12
@
11 years ago
- Focuses docs removed
- Keywords needs-refresh needs-docs added
Looks like 13580.diff needs a refresh as this code lives in wp-admin/includes/ajax-actions.php now, and the query now uses get_terms()
.
@
10 years ago
Refreshed patch; added a filter for minimum characters for the tag search. Added documentation for the new filter.
#13
@
10 years ago
- Keywords has-patch added; needs-patch needs-refresh needs-docs removed
Refreshed patch; added a filter for minimum characters for the tag search.
Added documentation for the new filter in the correct manner (thanks @DrewAPicture).
#14
@
10 years ago
- Keywords commit added
- Milestone changed from Future Release to 4.0
13580.5.diff just slightly tweaks the docs.
Nice work @iamfriendly (another new contributor at BeachPress)!
Adds two options for altering tag search behavior defaulting the values to wp 2.x defaults