Blog

  • Clobber spam users WordPress plugin

    I’ve built another plugin for WordPress websites with open registration. This plugin makes it easy to prevent spam accounts from publishing posts.

    A screen shot of the dashboard this plugin creates

    Frequently asked questions

    What does this thing do?
    This plugin adds an item to the Users menu of your administration dashboard. Click the “Clobber Spam” link and you will see a page that puts the most recently created user names next to the email address and the title of the most recently created post by that user. You can check a box next to the users that have submitted spam and click a button to delete all their posts and prevent them from logging in again.
    Why not just delete the users?
    Because the software these spammers use will try to submit more than one post for each account, sometimes days later. If you delete the user, the same user name can be recreated. We can prevent the account from being used by changing the password and email address. The spam software is forced to create a new account to continue bothering us. Also, I already use a really good plugin to delete old and unused user accounts. It is called Inactive User Deleter by shra and I regularly use it to delete users with no posts and no comments that are at least 6 months old.
    Can this process of deleting spam post submissions be automated?
    I would love to build the “akismet for posts” because I could make a lot of money selling it. I have been using Ban Hammer and Stop Spammer Registrations and I still decided to build this plugin to handle about 50 posts a week that these plugins are failing to prevent.
    Can you add feature X?
    Send me your idea, and we can have a conversation.

     

    I have been running a WordPress website with open author registration for a few years, and the majority of the plugins I have written have been focused on making the management of that sort of site easier. Here is a list of the unreleased plugins I am using that I have created:

    • Count comment author URL as link: Include the comment author URL in the max links allowed for comment moderation
    • Disable comment author homepage links: Removes home page links from comment author user names
    • Hold posts with links: Set post status to pending when a new post is published containing any hyperlinks
    • Show pending posts count: Show the number of pending posts in the admin dashboard menu just like comments

    A list of the plugins I have published is always available on WordPress.org. I also use a version of WP Status Notifier that I have modified to include a post excerpt and a hyperlink that starts the user deletion process.

    With this plugin, Clobber spam users, I am going to stop deleting spam user accounts immediately and simply prevent their use for a number of months instead. I have given some thought to making the registration process more cumbersome for everyone, but I don’t want to sacrifice the user experience of real humans to fight the bots.

    Here is a download link: clobber-spam-users.zip @ WordPress.org

  • Detecting mixed case strings in ASP Classic

    I needed to detect a mixed case string in classic ASP. I define a mixed case string as containing both upper and lower case characters, like AuxagGsrLpa. I could not find a free function on the web to make this decision, so I wrote one.

    <%
    	Function isMixedCase( str )
    		'detects mixed case strings using the english alphabet
    		'ignores spaces and other non-alphabetic characters
    		str = trim( str )
    		isMixed = false
    		lastCase = ""
    		for i=1 to len( str )
    			currentChar = mid( str, i, 1 )
    			if asc( currentChar ) >= 65 and asc( currentChar ) <= 90 then
    				if lastCase <> "" and lastCase <> "upper" then
    					isMixed = true
    					exit for
    				else
    					lastCase = "upper"
    				end if
    			else
    				if asc( currentChar ) >= 97 and asc( currentChar ) <= 122 then
    					'lower
    					if lastCase <> "" and lastCase <> "lower" then
    						isMixed = true
    						exit for
    					else
    						lastCase = "lower"
    					end if
    				else
    					lastCase = ""
    				end if
    			end if
    		next
    		if isMixed then
    			isMixedCase = true
    		else
    			isMixedCase = false
    		end if
    	End Function
    %>

    Here are a few test strings to demonstrate the functionality:


    <% response.write "Hello " & isMixedCase( "Hello " ) & " <br>" response.write "hello! " & isMixedCase( "hello!" ) & " <br>" response.write "HELLO " & isMixedCase( "HELLO " ) & " <br>" response.write "hello there " & isMixedCase( "hello there" ) & " <br>" response.write "hellothere " & isMixedCase( "hellothere" ) & " <br>" response.write "hellotherE " & isMixedCase( "hellotherE" ) & " <br>" %>

    Here is the resulting HTML output of the tests:

    Hello True
    hello! False
    HELLO False
    hello there False
    hellothere False
    hellotherE True