Support » Plugin: Simple User Listing » Search Output Repeats Same Result

  • Resolved CK MacLeod


    Thanks for the plug-in.

    Unfortunately, out of the box on my test site, I get unexpected behavior on a simple search. I have only three members (though anticipate many more), and, when I put a last name into the search box, the same result is repeated over and over until it fills up the page and each succeeding page with 10 identical results (Name + 0 posts).

Viewing 9 replies - 1 through 9 (of 9 total)
  • I’ve marked this topic as resolved since I’ve discovered the conflict was with the Custom Author URL plug-in. Since I want the functionality of that plug-in, I’ll have to see if I can figure out the problem, and I’ll post an answer if I find one.

    OK – took a little looking around… I’ll just add this note in case anyone else runs into this problem perhaps while, like me, trying to cobble together a solution for a membership site that bypasses the numerous complications and problems of, as far as I can tell, all current WordPress membership plug-ins when it comes to providing a simple searchable list of members, linked to member profiles.

    If you are using the Custom Author URL or some other function to change the “author base” link, you also need to re-save your Permalink Settings in admin, and flush your rewrite rules. Why exactly failing to do so produces the odd behavior I initially described, I do not know.

    I don’t believe the Custom Author URL plug-in is currently being updated, so I wouldn’t necessarily expect an adjustment to it by its author.

    Plugin Author helgatheviking


    Glad you were able to solve the problem. It is always a good idea to disabled plugins to try to isolate the problem. Any time you change the permalinks you need to flush your rewrite rules by re-saving the Permalinks settings. That isn’t specific to the Custom Author URL plugin… though perhaps the plugin could trigger the flush on activation or something.

    The Custom Author URL plug-in is, apparently, no longer being maintained. There are a few others that offer this functionality, and I haven’t checked them all for how or if they handle the Permalinks/rewrite issue. I think it might make sense to add the functionality, or a note on it – presuming this support thread isn’t notice enough. It also points to a potential direction for further work by plug-in developers, perhaps relating to the multi-term search functionality that others have been looking into.

    So, if you’re thinking about how to build on this work, I’d recommend moving to a fuller integration with “author” profiles, also integrating custom URLs and multi-item search. It happens to be what I’m implementing on my own site: After extensive searching around and experimentation with all of the membership and participant apps I could find, I finally determined I had to do this piece of it myself, though I began with the Simple User Listing code by Christian Antohe, and wrote my own simple plug-in that I also called Simple User Listing. The way I found yours was when admin told me there was an “upgrade” available! (BTW, if you’re working off Antohe’s example I think you ought to credit him somewhere.)

    A full build-out of the concept would entail a lot of work and further research, of course, but it would fill a need described by a range of serious site designers and developers who learned WordPress backwards and forwards as a blogging application, but now use it as a framework for installations in which blogging is often at best an afterthought.

    Plugin Author helgatheviking


    Christian is credited in the main plugin file. His tutorial was a great start.

    There are apparently a few other plugins that change the author permalink structure, though you hardly need one since you can change the slug with a few lines:

    // change base of author pages- need to save permalinks to take effect
    function kia_author_base_permalink(){
    	global $wp_rewrite;
    	$wp_rewrite->author_base = 'editorial'; // or whatever
    	$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base . '/%author%';

    then re-save your permalinks.

    I’m not considering building on SUL at this time. Permalinks can be changed as described and multiple searches can also be custom coded by creating your own search form template and filtering the query args. (except multiple roles, which isn’t supported by WP_User_Query and so would need a work-around). I wrote SUL for a project I needed it for. If I add every featured imaginable to the plugin itself it becomes too difficult to maintain for me.

    There is a exmaple of converting the search to a user meta field in the FAQ:

    And since the plugin relied on WP_User_Query, you can query by more than one meta field… just like WP_Query.

    Well – you or I might not need more than those few lines to solve the problem – but lots of users don’t have even the first idea of where to put them! That’s why they install plug-ins.

    Whether you choose to expand upon the work you’ve done here is, of course, entirely up to you.

    I’ve only just begun my experimentation with WP_User_Query. Odd that multiple roles isn’t supported, though I’m not sure what you mean precisely, or how precisely it will limit what I’m attempting. Even odder that the function that WP uses itself in the admin side user listing, with a function that apparently searches the entirety of both user tables, is “internal” and “private” and not for developers!

    Thanks again. I hope the discussion will be helpful for someone, and I won’t bother you more on these questions since you say you’re not much interested in further development.

    Plugin Author helgatheviking


    True, but sometimes you have to be willing to get your hands dirty with code if you want to do something outside the box. Or, there are plenty of people to hire if coding isn’t something a person wants to do.

    Multiple roles isn’t supported… so you can list all users, or all authors, but you can’t list all admins and all authors. Well you can… I’ve see some work arounds, such as 2 queries merged together, but nothing using core yet.

    I am curious to hear what you think are the main missing pieces from membership plugins / this plugin? Just the permalinks? I’m in training camp now for my sport so I am not doing any coding until September, but could be interested in adding features to a Pro version if there were enough features and/or enough demand to merit such a thing.

    I could write a book about what’s missing or clumsily realized in the various membership and member-list plug-ins.

    In addition to customizable membership/subscription levels, capacities, and management, I needed a searchable public list of a potentially large number of members at different levels. The list had to be linked to unique, secure, easily user-maintainable public member profiles different from (but overlapping with) WP user profiles, and not bring the members into the normal WP back end.

    In my research I ran across numerous developers and designers struggling to cobble something similar together. It’s the kind of implementation that social, political, governmental, educational, professional, etc., organizations might find useful. In other words, it’s for a site where membership itself – not the same as “community” or “content” or “items” – is the “product” being “sold.”

    No single plug-in did it all or integrated smoothly and simply with the ones that filled particular gaps. I could, for instance, have tried to integrate BuddyPress and S2Member, but would have had to hack away a ton of front- and backend BuddyPress stuff completely irrelevant to my purposes, then newly construct the main capacities.

    So I decided to build up to the minimum I needed and add to it instead, and eventually realized that for my site the “search” and “search results” are more important than the “list” part. In fact, in the hacked version of your plug-in that I’m using, though it’s only a first-phase minimum implementation, the “list” doesn’t appear at all except when a search for a member name happens to turn up multiple results.

    Well, like I said, I could write a book on it. I presume that a lot of organizations of the type I mentioned, if they’re of sufficient size, would be using or developing enterprise solutions within some other framework entirely.

    (I should add that every one of those plug-ins I called inadequate was put together by someone or a group possessing coding skills and knowledge far superior to mine. I’m just giving a perspective based on my own position/needs, not attacking their work on its own terms. The clumsiness often has as much to do with documentation and interfaces as with core functionality.)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Search Output Repeats Same Result’ is closed to new replies.