• After setting up exclude users under the Logging tab, nothing gets excluded.

    I tried both user login names and user IDs to no avail.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mikko Saari

    (@msaari)

    I just tested this on my test site and both user name and user ID do block searches from being logged.

    Can you walk me step by step through how you’ve tested this?

    Thread Starter lfbender

    (@lfbender)

    Hi @msaari,

    I went to Relevanssi Search Options –> Logging –> Exclude users.

    I listed the user ids, like this:
    1, 2, 3, 4
    I saved.

    I went to the search form on my home page and did a search.

    Then I went to Dashboard –> User searches to check if my search showed up (I excluded also my user id) and it did.

    I repeated all the above using user names, instead of user id with the same result.

    What did I miss?

    Plugin Author Mikko Saari

    (@msaari)

    Looks fine to me. To debug this, you’d need to look into the code. In lib/log.php, there’s a line

    $omit = explode( ',', get_option( 'relevanssi_omit_from_logs' ) );

    Change this to

    $omit = explode( ',', get_option( 'relevanssi_omit_from_logs' ) );
    var_dump($omit);
    var_dump($user->ID);
    var_dump($user->user_login);

    and do a search. What does this print out?

    Thread Starter lfbender

    (@lfbender)

    It returns the list of excluded Users:
    array(7) { [0]=> string(3) “user1″ [1]=> string(5) ” user2″ [2]=> string(7) ” user2″ [3]=> string(5) ” user3″ [4]=> string(6) ” user4″ [5]=> string(9) ” user5″ [6]=> string(7) ” user6″ } int(10) string(5) “user7” ?

    But the log still shows the searches…

    Thread Starter lfbender

    (@lfbender)

    So, I noticed that the var_dump gave the strings with spaces. So I removed the spaces from the list of excludes, only leaving:

    user1,user2,user3

    (without any spaces), and now it seems to work.

    I would put a warning regarding this, to clarify that you need the list without spaces. Or just run the list through a regex replace or something.

    Thanks for the quick response and help!

    Plugin Author Mikko Saari

    (@msaari)

    Thanks, a good catch! Yeah, of course it should trim away the spaces, I’ll make a note to fix that in the next version.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Relevanssi logging search excludes don’t exclude’ is closed to new replies.