Blog

  • Export comments WordPress plugin

    I launched a new WordPress plugin to export a blog’s comments. Specifically, this plugin creates a tab-delimited text version of the wp_comments database table. Options include approved, pending or spam (or any combination of) comments.

    This page will soon expand. For now…

    Download this plugin from WordPress.org

  • WordPress comment paging creates duplicate content

    I learned something today about WordPress that I would like to share. The “break comments into pages” feature can create duplicate content for all posts that have only a single page of comments. I made this graphic to explain exactly what happens.

    comment-page-1

  • Landing page triggers WP plugin free version

    This plugin redirects users of your WordPress website to any page you like after they publish a new post or log out. You can provide any URL, so the page can even be on a different website altogether.

    Landing pages can help coordinate, congratulate or incentivize users who are already interacting with your website.

    I have also written a non-free version that includes redirects after leaving a comment and user login in addition to the free features.

    Installation Instructions

    1. Download landing-page-triggers-free.zip
    2. Decompress the file contents
    3. Upload the landing-page-triggers-free folder to a WordPress plugins directory (/wp-content/plugins)
    4. Activate the plugin from the Administration Dashboard
    5. Visit “Landing pages” under Settings to configure the triggers

     

    Control panel screen shot:

    landing-page-triggers-free-version

     

    I have been using this functionality to thank contributors for their posts, and it works wonderfully. If you are interested in the enhanced feature set, that version is available here for 6$ USD.

  • WP Plugin: Recent comments widget with excerpts

    I wrote a WordPress plugin to modify the behavior of the recent comments widget. Since WP version 2.8.0, popular widgets have been included as core functionality. I don’t like how the recent comments widget works, so I changed it. Instead of displaying the post titles that received comments, my plugin shows comment excerpts. I made this graphic to show the difference between the default behavior and the effect of this plugin:

    recent-comments-widget-with-excerpts

    WordPress.org link

    Visit this plugin’s page in the official WP plugin directory.

     

    Installation Instructions

    1. Download recent-comments-widget-with-excerpts.zip
    2. Decompress the file contents
    3. Upload the recent-comments-widget-with-excerpts folder to a WordPress plugins directory (/wp-content/plugins)
    4. Activate the plugin from the Administration Dashboard
    5. Open the Widgets page under the Appearance section
    6. Drag the Recent Comments widget to the active sidebar

    Enjoy!

  • Disable WordPress New User Email Notification

    When a new user creates an account on a wordpress.org blog, the administrator is sent a notification email. Websites that have a large number of signups each day can generate a lot of emails announcing each new user.

    I wrote a simple WordPress plugin to disable the new user notification email. Visit this plugin’s page in the official WP Plugins Directory.

    Installation instructions

    1. Download disable-wp-new-user-notification.zip
    2. Decompress the file contents
    3. Upload the disable-wp-new-user-notification folder to a WordPress plugins directory (/wp-content/plugins)
    4. Activate the plugin from the Administration Dashboard
  • WordPress Sidebar Stats Widget

    I wrote a WordPress plugin that displays a small collection of site stats in a sidebar widget. Here is a screen shot of sample output:

    sidebar-stats-widget

    Widget options screen shot

    The widget includes a control panel to change the title and format the HTML that is inserted before and after each numerical stat.

    sidebar-stats-widget-options

    Installation Instructions

    1. Download sidebar-stats-widget.zip
    2. Decompress the file contents
    3. Upload the sidebar-stats-widget folder to a WordPress plugins directory (/wp-content/plugins)
    4. Activate the plugin from the Administration Dashboard
    5. Open the Widgets page under the Appearance section
    6. Drag the Sidebar Stats Widget to the active sidebar
    7. Configure the widget options to suit your needs and click Save

    WordPress.org plugin page

    This plugin is in the official WordPress Plugin Directory here.

  • Clear default text from input boxes using Javascript

    Providing labels is a great way to help users interact with your website properly. I like to put instructional text inside text boxes to save space. Users get annoyed when the text inside the box they click on does not disappear when they are ready to type. Users do not want to backspace default instructional text before typing in boxes, so some code is required to make this happen.

    I would like to share two small Javascript functions. The first clears out default text box contents automatically when a user clicks on the box. The second restores the default instructional text if the user leaves the box empty.

    Implement these functions using onfocus=”wash(this);” and onblur=”checkWash(this);” on your text input control. You may want to avoid the second function on text fields where input is optional, so the user can leave the text box blank.

    function wash( anInput ){
    if(anInput.value == anInput.defaultValue) anInput.value = '';
    }

    function checkWash( anInput ){
    if(anInput.value == '') anInput.value = anInput.defaultValue;
    }

    Try it

    Look, I made a demo!


  • Get Longitude and Latitude from Bing Maps

    To get longitude and latitude coordinates from Bing Maps, follow these steps:

    1. Position the map center on your point of interest
    2. Type this into your web browser’s address bar:
      javascript:map.GetCenter()
    3. Hit enter or click an appropriate button to query the address

    If you are using a browser with a lot of built-in security roadblocks like Internet Explorer, you may have to acknowledge security warnings before javascript code will execute.


  • Why are craigslist ads flagged flowchart

    Today, I made a simple flowchart to describe how and why craigslist ads are flagged and removed.

    http://www.gliffy.com/publish/1892404/

  • Classic ASP and Server.GetLastError in IIS7

    My classic ASP error logging scripts were dead in the water when I moved them to a Windows Server 2008 with IIS 7.0.

    Some code like this is useful to record errors in a database:

    dim objErrorInfo, errorStringStr
    set objErrorInfo = Server.GetLastError
    errorStringStr = objErrorInfo.File & ", line: " & objErrorInfo.Line & ", error: " & objErrorInfo.Number & " " & objErrorInfo.Description & ", " & objErrorInfo.ASPDescription & objErrorInfo.Category
    errorStringStr = replace( errorStringStr, "'", "''" )

    Instead of using the default 500 item in the list, create a new handler for status code 500.100. Point this at your script, and you should be all set to log errors.

    Another way is to enter the Error Pages module of the website profile, and click “Edit Feature Settings” on the right hand sidebar.

    This screen will appear:

    iis7getLastError

    Configure yours in a similar fashion, and Server.GetLastError will start working in your script.

  • I made a Keyword Multiplier

    While revamping a PPC advertising account last week, I discovered the lack of a convenient keyword multiplier. I am sure there is some fancy pants way of combining keyword lists in a spreadsheet application, but I find no fun in writing macros for some piece of software.

    I installed the Google Adwords desktop editor because it has a built-in keyword multiplier. It sucks. The Goo’s multiplier only combines three lists at a time, and I wanted four. It also automatically removes keywords that have low Google search volume, so if you are using their tool for any other purpose it is rather useless.

    I made my own keyword multiplier, and you can use it, too. Please try it out, and let me know if you find it to be a useful keyword tool.

    Keyword Multiplier Features

    • Fast, easy and web-based
    • Apply PPC match types to result lists
    • No uploading your keywords to a third party

    Try it yourself!

  • Disguise Email Addresses for online publishing

    Disguise your email address or any text with this character obfuscation. This code corey@example.com will show up on a web page as [email protected]. You can share your email address without worrying that it will be collected by a spam bot.

    Enter some plain text



    Some losers send spam email for a living, and will send garbage to any email they can find online. Obfuscating email addresses in character codes cloaks them from some of the leeches. I decided to create code to automate this task.

    Here is an ASP classic function that will convert a string to ASCII characters. PHP code below. These characters will display as normal text to the casual user. The difference between alphabet characters and ASCII characters is that encoded characters must be evaluated before they look like an email address. This thin veil of secrecy is enough to fight off some email harvesters.

    
    public function asciiDisguise( string )
    	build = ""
    	for i=1 to len( "" & string )
    		build = build & "&#" & asc( mid( string, i, 1 )) & ";"
    	next
    	asciiDisguise = build
    end function

    Here is the same function in PHP.

    
    function asciiDisguise( $str ){
    	$build = "";
    	for( $i=0;$i<strlen( $str );$i++ ){
    		$build .= "&#" . ord( substr( $str, $i, 1 )) . ";";
    	}
    	return $build;
    }