Happy Freelance Developer, Geek, and (lately) an Entrepreneur
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 | No 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 14, 2008

My First Day at Hospital

Finally, they had me!

For the first time in my life, I was in a hospital. It was quite an experience for a person like me who has never been there, believes in human adaptability & natural healing and is quite lazy too :)

The hospital was all fine and not at all like what I had imagined and read in newspapers. But I didn’t quite like it. I didn’t like the need to get checked. I hated it.

I was having lowgrade fever every other month. And some people said it might be something serious. So I was there to get tested for anything other than fever. I don’t even understand the names and effects of those disease! They have taken half a syringe of my blood. Will be applying some chemistry over them to tell me what chemicals (they call it medicine) I need to take.

I was thinking if it turns out to be serious, then… I don’t want to die :)

Written by Sohail at 4:40 pm | Posted in Death, Life | 12 Comments
June 12, 2008

I want knowledge! Not faith, not assumptions, but knowledge.

  • Antonius:
    I want knowledge! Not faith, not assumptions, but knowledge. I want God to stretch out His hand, uncover His face and speak to me.
  • Death:
    But He remains silent.
  • Antonius:
    I call out to Him in the darkness. But it’s as if no one was there.
  • Death:
    Perhaps there isn’t anyone.
  • Antonius:
    Then life is a preposterous horror. No man can live faced with Death, knowing everything’s nothingness.
  • Death:
    Most people think neither of death nor nothingness.
  • Antonius:
    But one day you stand at the edge of life and face darkness.
  • Death:
    That day.
  • Antonius:
    I understand what you mean.

This is a dialog from The Seventh Seal, one of the best movies I have ever watched. I can quote so many lines that are just close to my heart. I highly recommend you to watch this. What wikipedia has to say about this movie is:

The Seventh Seal (Swedish: Det sjunde inseglet) is an existential 1957 Swedish film directed by Ingmar Bergman about the journey of a medieval knight across a plague-ridden landscape, and a monumental game of chess between himself and the personification of Death, who has come to take his life. The film has long been regarded a masterpiece of cinema.

And here are some more lines from the movie:

“I met Death today. We are playing chess.”

“Love is the blackest of all plagues… if one could die of it, there would be some pleasure in love, but you don’t die of it. “

“I want to confess as best I can, but my heart is void. The void is a mirror. I see my face and feel loathing and horror. My indifference to men has shut me out. I live now in a world of ghosts, a prisoner in my dreams. “

“Have you met the devil? I want to meet him too. I want to ask him about God. He must know. He, if anyone. “

Written by Sohail at 4:51 pm | Posted in Life | 3 Comments
June 12, 2008

Morning In Islamabad

Posted by ShoZu

Written by Sohail at 5:26 am | Posted in Pakistan | 5 Comments
Next »