WordPress.org

Ready to get started?Download WordPress

Forums

Co-Authors Plus
Search-as-you-type flawed in upgrade (5 posts)

  1. mcstevem
    Member
    Posted 3 years ago #

    v2.5.1 is flaky in its search-as-you-type functionality, finding matches only in the username field, even though it flags matches in other fields if the username field match succeeds. For example, if I start typing sm the plguin finds a match for an author whose username/nicename/email is thesmith/Jean Smith/thesmith(@)here.com but does not match mcstevem/Steve McConnell/smcconnell(@)here.com. Likewise the initial string an matches chyman/Carol Hyman/chyman(@)here.com but fails to match abguy/Ann Brody Guy/annguy(@)here.com. Oddly, though, if I start with the text string guy it not only matches the username abguy but also underlines the matching text string in the nicename and email fields as well. This problem did not exist in earlier versions.

  2. Mohammad Jangda
    Member
    Plugin Author

    Posted 2 years ago #

    For 3.1 users, the plugin uses the native user search, which admittedly is not the greatest. It's a trade-off between search accuracy and performance. I'm considering adding an option where you can decide whether you want more accurate matching or faster matching. Thanks for the feedback!

  3. ericperson
    Member
    Posted 2 years ago #

    I also would vote for allowing searching by the full name (nicename) of the author. This is really important for multi-author sites where you know other authors' names but have no idea what their usernames are.

    This is the first version of Co-Authors Plus I've used. Is there a line of code that can be changed to re-activate full name searching (which mcstevem says was available previously)?

  4. Mohammad Jangda
    Member
    Plugin Author

    Posted 2 years ago #

    You can try changing line 598 to something along the lines of:

    if ( 1 == 2 && function_exists( 'get_users' ) ) {

    This will force into the alternate search. You can add additional fields (e.g. user_nicename) you want to search through in the $author_fields array, two lines above.

    Note: I would not recommend this if you have lots of users on your site, as you'll likely see a pretty significant performance hit.

  5. mcstevem
    Member
    Posted 2 years ago #

    Making these two changes to co-authors-plus.php had no apparent effect (even after the upgrade to v2.5.2). And in theory, it should already have been working, since the original code's $author_fields array already included display_name. (It turns out my original post misspoke -- the three fields I was listing were username/display_name/email rather than username/nicename/email.) So it still appears that the plugin is searching only the username field, not the other fields specified in the array. My site has 82 users -- enough that they won't all know everyone else's username, but not enough to cause a major performance hit if the code were searching an additional field or two, as apparently it is intended to. Any other suggestions for making the user search more useful?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic