To prevent multiple button clicks, you can use JavaScript to disable the button.
jQuery('#review_member_button').on('click', function(evt) {
jQuery(this).attr('disabled', 'disabled');
});
On the WordPress end, you can set a unique key for the form every time it’s generated and check to see if a form with that key has been resubmitted. I would recommend setting a transient, since they’re temporary and easily cached with a plugin like Batcache.
When you build your form:
<?php
$token_id = md5( uniqid( "", true ) );
?>
<form>
... Other form stuff
<input type="hidden" name="token" value="<?php echo $token_id; ?>" />
</form>
Then, when you process your form:
<?php
$token_id = stripslashes( $_POST['token'] );
// If the transient exists, this is a duplicate entry. So don't do anything
if ( ! get_transient( 'token_' . $token_id ) ) {
return;
}
// If the transient doesn't exist, set it so we don't process the form twice
set_transient( 'token_' . $token_id, 'dummy-content', 60 ); // Cache for 1 minute
// ... do your other processing