Support » Plugin: Co-Authors Plus » [Plugin: Co-Authors Plus] Search-as-you-type flawed in upgrade

  • 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(@) but does not match mcstevem/Steve McConnell/smcconnell(@) Likewise the initial string an matches chyman/Carol Hyman/chyman(@) but fails to match abguy/Ann Brody Guy/annguy(@) 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mohammad Jangda


    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!

    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)?

    Plugin Author Mohammad Jangda


    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.

    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Co-Authors Plus] Search-as-you-type flawed in upgrade’ is closed to new replies.