• See image:

    View post on imgur.com

    As you can see, we get 2-3 entries exactly the same. We use Clean Login plugin for the user login form, rather than the wordpress login page. Also, WooCommerce which automatically creates an account and logs user in when they finish checkout. Other than that, no reason I can think of for the duplicates.

    • This topic was modified 5 years, 7 months ago by MrBrian.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Faiyaz Alam

    (@faiyazalam)

    Can you follow these following steps to debug the issue?
    This should be done on development environment only.

    1) Disable the User Login History plugin

    2) Copy and paste the following script at the end of your theme functions.php file.

    function wp_login_test() {
    ini_set(‘error_log’, WP_CONTENT_DIR . ‘/user-login-history-test.log’);
    error_log(“test”);
    }

    add_action(‘wp_login’, ‘wp_login_test’);

    3) Now do login only for once

    4) Remove the script that you pasted in step #2

    5) Share the content of the file wp-content/user-login-history-test.log

    Thread Starter MrBrian

    (@mrbrian)

    Aug 05, 09:08:15

    test

    Aug 05, 09:08:14

    test

    Plugin Author Faiyaz Alam

    (@faiyazalam)

    Since you got two log entries, it means that there is some conflict in your existing plugins (not User Login History because it is already disabled) or theme due to which wp_login hook is called two times on login.
    This is the reason that User Login History plugin is saving the record multiple times.

    • This reply was modified 5 years, 7 months ago by Faiyaz Alam.
    Thread Starter MrBrian

    (@mrbrian)

    You’re stating the obvious by pointing to another plugin or the theme. I wasn’t blaming the plugin for the cause of duplicate entries, but having entries *exactly* the same serves no purpose and is preventable if you choose to code in a dupe check.

    Plugin Author Faiyaz Alam

    (@faiyazalam)

    I think that this is not an good idea to fix an issue occurred by conflict of another plugin or theme. You are right that exact same records serves no purpose.
    To fix this I have to modify the table structure by adding a unique constant key for all the columns (not one or two columns) of the table and have to do PHP code to check if already the same record exists or not for all the columns again. Due to these changes, the code become complex and hence login would be slow which is not good. This is the reason I should not do anything for this.

    Hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Lots of duplicate entries’ is closed to new replies.