Tag Archives: Wordpress

WordPress: Fixing the broken links from Jetpack top stats

I use the upgraded awesome plugin Jetpack by WordPress.com to show the ‘Top Posts’ is the sidebar. I recently noticed that the links for these post were broken, even though I wasn’t doing anything wrong at all. I queried the plugin for top 5 posts using:

$top_posts = stats_get_csv('postviews', 'days=-1&limit=6&summarize');
echo '<ul class="most-viewed">';
  foreach ( $top_posts as $p ) {
    if($p['post_id'])
      echo '<li><a href="'. $p['post_permalink'] .'" title="'.
        $p['post_title']. '">'. $p['post_title'] .'</a> - <strong>'. $p['views'] . '</strong> views</li>';
  }
echo '</ul>';

But somehow, the value at post_permalink key was wrong. Instead of pulling out my hair, I downloaded the Jetpack plugin’s source code, opened the file stats.php and copied a few lines and now the following works awesomely well.

if ( function_exists('stats_get_csv') && $top_posts = stats_get_csv('postviews', 'days=-1&limit=6&summarize')) {
  echo '<ul class="most-viewed">';
  foreach ( $top_posts as $p ) {
    if($p['post_id'] && get_post($p['post_id']))
      echo '<li><a href="' . get_permalink( $p['post_id'] ) . '">' .
          get_the_title( $p['post_id'] ) . '</a>', number_format_i18n( $p['views'] ) </li>';
  }
  echo '</ul>';
}

I hope this helps people looking for a quick fix to this problem.

WordPress: WP ShareThisPost

Although the third party bookmarking and sharing tools are quite useful to analyze the sharing trends on your blog, they do slow down the whole process of sharing. Also, as mentioned in my Sharing and Bookmarking Tools post, I was not comfortable with the small icons available with Bookmarkify and Socialable. WP ShareThisPost is a small custom wordpress plugin which provides large icons along with the flexibility to add your favorite sharing and bookmarking sites (if not included by default).

WP ShareThisPost includes the following sharing and bookmarking sites, by default:

  • del.icio.us
  • Digg
  • Google Bookmarks
  • StumbleUpon
  • Facebook
  • Twitter
  • Technorati

Continue reading

WordPress: Security check for your Blog

Most of the bloggers ignore various security loop-holes in their WordPress installation, thinking that the chances of Crackers intruding their small and unpopular websites are slim. Never even think of this. No one is going to check your page rank or Alexa rank before hacking your site, so better secure it now than to regret later. There are a lot of wordpress plugins that will do the job for most users. But if you are a freak like me, keep reading to know how to secure your blog without installing any wordpress plugin.

Here is a list of methods that will enhance the security of your blog:
Continue reading

Sharing and Bookmarking Tools

It takes me quite a lot of time to write a post here, mainly because I have very less going on in my life at the moment. But if you were following this blog closely (I know you weren’t 🙂 ), you might have noticed that I kept playing with the SHARING and BOOKMARKING tools. I started off with the bookmarkify, then tried addthis and then finally settled for tellafriend. Although, I am still thinking of shifting back to Bookmarkify, right now I am sticking with TellaFriend. As far as the features are concerned, they all almost provide the same kind of features. All of them provide access to over 50 Bookmarking sites, not to forget the “Email this” option. Here is a short review on the following Bookmarking tools.
Continue reading