WordPress.org

Ready to get started?Download WordPress

Forums

Spam user registrations - my solution (4 posts)

  1. Matthew
    Member
    Posted 5 years ago #

    This was driving me insane so I thought I would share with you how I got around this.

    I wasn't getting any comment spam as I am using the Disqus Comment System plugin and had that configured so commentors had to register to make a comment.

    However, I was getting heaps of spam users being registered on my site.. sometimes up to 20 per day.

    I had the following anti-spam plugins installed as well,
    - Akismet
    - Bad Behavior

    I was still getting spam users being registered.. so I then installed,
    - SABRE (Simple Anti Bot Registration Engine)

    Even though I had this configured to the max, I was still getting spam users being registered.

    Then the penny dropped.. I have a bbPress forum integrated into my site and that's how the spam bots were getting through. They were registering through the bbPress registration interface.

    So I installed the following bbPress plugin,
    - Clickcha

    Problem solved!

    No more spam users being registered.. fingers crossed it stays that way.

    Hope this helps.

  2. deko
    Member
    Posted 4 years ago #

    Discovered Clickcha yesterday... seems to be working well so far. Would be nice if there was a developer forum or programmers reference... has a lot of potential as a comment spam prevention tool.

    The problem I had was that it broke my CSS and caused the page to fail validation. Here's how I fixed that:

    1) Go to your wp-content/plugins directory and edit clickcha.php (about line 155) Remove all style directives--that is, everything between (and including) the <style> tags. Paste it in notepad for now--you'll want it later.

    2) remove the <noscript> and <small> tags (and anything in between) that appear around the javascript code within the clickcha_comment_form function. Below is how my clickcha_comment_form function looks after editing.

    Note the /* <![CDATA[ */ ... /* ]]> */ addition. This tells HTML validator to ignore the script.

    function clickcha_comment_form($post_id) {
    	$public_key = get_option('clickcha-public-key');
    	$help_text = get_option('clickcha-help-text');
    	if(empty($public_key)) {
    		echo "<div id='message' class='error fade'><p>Clickcha is not yet active. Please enter Clickcha API keys in settings.</p></div>";
    	}
    	// Bypass clickcha for logged-in user (except 'subscriber')
    	else if(!current_user_can('level_1')){ ?>
    
    	<input type="hidden" name="clickcha_token" id="clickchatoken" value=""></input>
    	<?php echo $help_text; ?>
    	<input type="image" name="clickcha" id="clickcha" alt="" src=""></input>
    
    	<script type="text/javascript">
    	/* <![CDATA[ */
    		function clickcha_token(token) {
    			document.getElementById('clickchatoken').value = token;
    			document.getElementById('clickcha').src = 'http://api.clickcha.com/challenge?key=<?php echo $public_key; ?>&token=' + token;
    		}
    		function clickcha_get_token() {
    			var e = document.createElement('script');
    			e.src = 'http://api.clickcha.com/token?output=json&key=<?php echo $public_key; ?>&rnd=' + Math.random();
    			e.type= 'text/javascript';
    			document.getElementsByTagName('head')[0].appendChild(e);
    		}
    		clickcha_get_token();
    		// Firefox's bfcache workaround
    		window.onpageshow = function(e) {if(e.persisted) clickcha_get_token();};
    	/* ]]> */
    	</script>
    <?php
    	}
    }

    3) Edit your stylesheet and put in what you took out of clickcha.php:

    here's how it looks in my stylesheet:

    #clickcha input {
    	height: 100px;
    	width: 200px;
    	border: 0;
    	margin: 0;
    	padding: 0;
    	display: block;
    }
    
    #submit { display: none; }
    #commentform input [type="submit"] { display: none; }
    #commentform button [type="submit"] { display: none; }
    #commentform span.submit { display: none; }

    Now my CSS looks like it should, and the page validates as XHTML 1.0 Transitional.

  3. kenny503688
    Member
    Posted 4 years ago #

    this plugin is very useful for everyone .
    I suggest that you make a Chinese one .
    that mean is that it is Chinese on the pic.
    I think there are lots of people will use it in Chinese.
    thank you and wait your message with email.
    any questions please let me know.

  4. iDope
    Member
    Posted 4 years ago #

    @kenny503688: If you can provide the Chinese translations please let me know.

Topic Closed

This topic has been closed to new replies.

About this Topic