A Happy Freelance Web Developer
July 2, 2008

Wordpress Plugin: Hide Wordpress Version from Hackers

The first thing hackers see before trying to apply any cracking attempts on your wordpress-based websites is the version of wordpress you are having. Experts say you should hide that version number from your output html to make it difficult for crackers to get into your site.

Prior to wordpress 2.5, this was written in header.php theme file. So you could simply delete that line:

<meta name=”generator” content=”WordPress <?php bloginfo(’version’); ?>” />

But from wordpress 2.5 onward, this is generated automatically by wordpress core engine and inserted in <head> part of your site’s HTML. I have written a little plugin “hide-wp-generator” that hides meta-generator tag altogether and thus helps you keeping your site secure.

Download the Plugin Here

Written by Sohail at 3:35 pm | Posted in Wordpress | 4 Comments
June 28, 2008

Twitter Nonsense

Twitter Nonsense Screenshot

Twitter Nonsense is new addition to my portfolio. Its a beautiful and nice use of wordpress to present daily-comic strips. I was responsible for implementing the design into the wordpress theme with some necessary customization to wordpress itself. The client for this project is Anton Gigov, one of the best clients I’ve been working with.

The difficult part was to show comments and commet-form on home page. It is possible with a hack: by commenting out line # 643 in wp-includes/comment-template.php:

642. if ( ! (is_single() || is_page() || $withcomments) )
643.         return;

But modifying wordpress core files is never a good option if you can achieve the results with a plugin or custom coding within theme. What I did for Twitter Nonsense was to write the following code segment at the top of header.php that redirects the user to latest-post when he visits the site:

$url = “http://” . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

if($url == ‘http://www.pink-sheep.com/twitter-nonsense/’)
{
global $wpdb;
$last_post_id = $wpdb->get_var( “SELECT ID FROM $wpdb->posts WHERE post_type = ‘post’ AND post_password = ” AND post_status = ‘publish’ ORDER BY post_date DESC LIMIT 1″);
wp_redirect( get_permalink( $last_post_id ) );
exit;
}

Written by Sohail at 5:37 pm | Posted in Wordpress, Work | No Comments
June 6, 2008

Testing wordpress mobile client

Hello all, i’m writing this post via a wordpress client for symbian os. Hope it works or i’ll write my own.

update: so it worked! The client is Scribe. Its written in python. I had to install python for symbian before installing this client. Its quite slow, may be because its not native symbian code.

Written by Sohail at 7:04 pm | Posted in Life, Mobile, Wordpress | No Comments