• Resolved christianwhitehat

    (@christianwhitehat)


    Still getting a few duplicate entries from users using the same email address.
    The email field is set as the unique field on all forms. Going to try Unique entries per user setting since the default is not doing the trick.
    Note, that I cannot reproduce and make a duplicate entry myself but several other users have and it even stores the duplicates in the Duplicate Killer Database page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author NIA

    (@wpnia)

    Hello @christianwhitehat

    Please let me know some duplicate examples that the user managed to store into Duplicate Killer Database.

    Thank you

    Thread Starter christianwhitehat

    (@christianwhitehat)

    Hi, I was getting the duplicates going out to our CRM when users multi clicked the submit button in contact form 7. Your plugin was preventing the email from duplicating in WordPress but not in the CRM. I fixed by adding a “transient lock” to my form handler (a php file connected using CF7s 3rdparty Services) to store the users email in a 60 second transient, and exit out if the same email was detected in the timeframe.

    My fix:

    // load the WP environment so get_transient(), etc. exist
    require_once _DIR_ . ‘/wp-load.php’;

    // 2) Build a dedupe key: email (or IP) + minute
    if ( ! empty( $_POST[‘primaryemailhome’] ) ) {
    $email = strtolower( trim( $_POST[‘primaryemailhome’] ) );
    } else {
    $email = $_SERVER[‘REMOTE_ADDR’];
    }

    $key = ‘bd_sent_’ . md5( $email . ‘|’ . date( ‘Y-m-d H:i’ ) );

    // 3) If it’s in transient cache, stop right here
    if ( get_transient( $key ) ) {
    exit; // already sent in the last 60s
    }

    // 4) Otherwise set the lock for 60 seconds
    set_transient( $key, true, 60 );

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Sometimes duplicates come through’ is closed to new replies.