Archive for the 'Technology' category

SugarSync - spread the word

Recently I read on The Simple Dollar an article suggesting free equivalents to Amazon’s 25 software bestsellers.  The program that stood out the most to me was SugarSync which was all the way at the bottom of the article.

I went to SugarSync’s site and watched the CNBC interview with David Pogue, “Letting your Blackberry talk to your Desktop and your Laptop.”  I love David Pogue so after listening to him rave about it I decided to try it.  David Pogue also wrote a column over a year ago about SugarSync titled “Synching Just Became a Cinch.”

I first installed it on my MacBook and then my ThinkPad and was immediately impressed for three reasons.

  1. Automatic remote backup of your important files.

    I already do backups on my MacBook using Time Machine and on my ThinkPad using SyncBack.  Time Machine is the best backup software I have ever used and saved me when my MacBook died a year ago.  However these backups are local, i.e. they are tied to an external hard drive that is in my home.  If my home burns down everything will be lost which is why it is nice to have a simple free service for backing up my most important files to a remote location.

  2. Easy synchronization between my MacBook and my ThinkPad via the Magic Briefcase.

    Previously moving files between my MacBook and ThinkPad was a bit of a chore.  But now any time I want to move a file between the two computers I just drop that file into my Magic Briefcase and almost instantaneously it shows up on the other computer.  This model can also be extended to mobile devices.

  3. Access to my important files on the internet.

    Now whenever I am not on my home computer but I need an important file I can get just go to my SugarSync account and access it.

SugarSync’s free account service is great but it only has 2 GB of storage.  But now SugarSync is running a promotion.  If you follow the promotion link and open a 2 GB free account then you and I get an extra 500 MB of space.  Please do it, I would love the extra 500 MB. :-)

Share

twuffer

I searched for a way to schedule tweets for a future time like I schedule blog posts.  Three different services showed up at the top of my search, Tweet Later, FutureTweets and Twuffer.  Tweet Later immediately turned me off by how ugly they were.  FutureTweets looked the most attractive but then I realized I had to register for its service.

With Twuffer I could simply use my Twitter username and password.  It proved pretty easy to use its service which I did to schedule tweets while I was on my cruise vacation last week.

twuffer

Share

If a post is protected and the user does not have permission to view the post then the User Permissions Plugin redirects the user to the index page of the website, i.e. “/”.

On my blog I had previously updated this plugin so that the user is redirect to the Protected Posts page.  I have since updated the plugin to redirect to the login page if the user does not have permission to view the post.  This is because on my blog if a user does not have permission it is most likely because she is not registered and/or not logged in.  Once the user logs in she will be redirected to the post she intended to view.

To figure out how to do this I followed several steps.

  1. Figure out what properties of the post were available to me.To do this I used the new Reflection API in PHP 5 to find this information.
    Reflection::export(new ReflectionObject($post))

    It turned out that there was a page describing all the post properties available in the API.

  2. Figure out how to get information about the blog itself.  Fortunately there is a simple get_bloginfo template tag.  I used this to get the URL of the blog.
  3. Figure out how to create the login URL and redirect to that URL.  I determined that though my URL permalink structure is site-url/year/month/day/post-name, e.g. http://www.kimplicity.com/fkim/blog/2009/06/12/sample-post/, that if I gave a URL of the structure site-url/post-name that it would properly redirect.  But then I determined that an even better solution would be to use the URL site-url?p=ID where ID is the post ID.

Here are the modifications I made.

*** user-permissions.php
***************
*** 98,104 ****
  {
    if (is_single () || is_page ()) {
      if (empty($id) || $id == $post->ID) {
!       $permissions->redirect ();
      }
    }
    else
--- 98,104 ----
  {
    if (is_single () || is_page ()) {
      if (empty($id) || $id == $post->ID) {
!       $permissions->redirect ($post->ID);
      }
    }
    else
*** permissions.php
***************
*** 155,163 ****
!       function redirect ()
  {
    if ($this->redirect_read > 0)
      wp_redirect (get_permalink ($this->redirect_read));
!   else
!     wp_redirect ('/fkim/blog/2009/05/28/protected-posts/');
    die ();
  }
}
--- 155,166 ----
!       function redirect ($postid)
  {
    if ($this->redirect_read > 0)
      wp_redirect (get_permalink ($this->redirect_read));
!   else {
!     $site_url = get_bloginfo('siteurl');
!     $login_url = $site_url . '/wp-login.php?redirect_to=' .
!                  $site_url . '/?p=' . $postid;
!     wp_redirect ($login_url);
!   }
    die ();
  }
}
Share

As mentioned previously, I installed the User Permissions Plugin (version 0.8.4) so that I could control who gets to read my more personal posts.  The plugin was working great until I realized that it was denying access to posts that it should not be.

First I had to figure out how to debug WordPress plugins.  I first tried the wp pear debug plugin but I could not figure out how to get it to output anything.  Later I realized it was making things worse because for some reason it cleared all the roles from the current user.  Then I found the WiPeD debug plugin which was simple to use.

After many hours of debugging I determined that the problem was an incompatibility between the User Permissions Plugin and the Yet Another Related Posts Plugin (YARPP).  The problem was that if a public post had at least one related post that was protected the User Permissions Plugin would redirect the user away from the public post.

The simple solution was to not redirect if the post that is protected is not the post being displayed.  The trick was finding the post ID but fortunately this article, Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable, turned out to be immensely helpful.

It turns out there are three different ways to get the post ID.

  1. global $wp_query;
    $post_id = $wp_query->post->ID;
  2. global $post;
    $post_id = $post->ID;
  3. global $id;
    $post_id = $id;

Using this information I modified user.permissions.php in the User Permissions Plugin source and now this plugin works happily with YARPP.  Here are the modifications I made.  I sent these modifications to the plugin author, John Godley.

***************
*** 90,109 ****
  {
    if (!empty ($posts))
    {
!           global $current_user, $id;

!           foreach ($posts AS $idx => $post)
      {
        $permissions = Permissions::get ($post->ID);
        if ($permissions && $permissions->can_read ($current_user) == false)
        {
!               if (is_single () || is_page ()) {
!                 if (empty($id) || $id == $post->ID) {
!                   $permissions->redirect ();
!                 }
!               }
          else
!                 unset ($posts[$idx]);
        }
      }

--- 90,106 ----
  {
    if (!empty ($posts))
    {
!           global $current_user;

!           foreach ($posts AS $id => $post)
      {
        $permissions = Permissions::get ($post->ID);
        if ($permissions && $permissions->can_read ($current_user) == false)
        {
!               if (is_single () || is_page ())
!                 $permissions->redirect ();
          else
!                 unset ($posts[$id]);
        }
      }
Share

I noticed some blogs list at the end of the post other posts that are related to them.  They also list the most popular posts.

To do related posts I first tried the Yet Another Related Posts Plugin (YARPP).  However I got some strange results like my post Wild Goose Chase – Yawning Angels being related to the posts WaMu Free Checking and Poisonous Wild Mushrooms.  Also this plugin didn’t find any posts related to my Sort of Vegetarian post.

I next tried the WordPress Related Posts plugin but that did not work at all, I think it wasn’t updated for WordPress 2.7.1.  So I went back to YARPP and configured it to not show excerpts, not promote the plugin, and to use a lower match threshold of 4.25.

For popular posts I first tried the WordPress Popular Posts plugin but it reported no popular posts.

Next I tried the WordPress.com Popular Posts plugin which uses WordPress.com Stats.  Fortunately it works quite well even though I got a warning during installation that it had not been tested with WordPress 2.7.1.  The only configuration change I made was to list the number of views for each post.

I always wanted to be popular. :-)

Update 06-07-2009: I just found out that YARPP does not play well with User Permissions.  If a post that is not protected has related posts that are protected then the User Permissions plugin redirects instead of allowing the user to see the unprotected post.

Share

By accident I discovered that you can schedule posts.  Here is what you do to schedule a post to be published in the future.

  1. Click on the Edit link next to "Publish immediately" inside the Publish box of the Edit Post screen.

    image

  2. Change the date to a future date when you want the post to be published.  Then click on the OK button.

    image

  3. After you clicked on the OK button in the previous step the Publish button changed to say Schedule.  Click on the Schedule button to schedule your post to be published in the future.

    image

This is how I scheduled all my Dominion posts.  I actually wrote all of them on June 1 but I scheduled only one to appear per day.  There are still four more posts. :-)

Update 2009-08-19: To cancel a scheduled post you have to set the scheduled date to a date in the past.  Then the Schedule button should change back to the Publish button.  Press the Publish button and the post will be published with the date you just set.

Share

Blog Update Services

 | May 29, 2009 10:43 AM

blog ping services

When you install a WordPress blog on Dreamhost it automatically sets up the update service to notify people that you’ve updated your blog.

The default pinging service is http://rpc.pingomatic.com/
but this blog article suggests using these.

http://rpc.pingomatic.com

http://www.blogpeople.net/servlet/weblogUpdates

http://ping.myblog.jp

http://ping.bloggers.jp/rpc/

http://bblog.com/ping.php

And that’s what I did.  What do you use?

Share

Stickiness

 | 10:07 AM

In an attempt to help increase traffic and make my site “stickier” I added two plugins, Add to Any and Subscribe to Comments.

Share/Save/BookmarkThe first plugin adds this lovely button which allows the reader to share a post from my blog or save it to their blog or bookmarks.

The second plugin allows users who comment on one of my posts to be notified via email if there are new comments made on the same post by simply clicking on the checkbox like below.

I was considering a different plugin, Comment to Reply Notification, because users were complaing about the Subscribe to Comments plugin and recommended this plugin.  The Comment to Reply Notification is newer and is designed for WordPress 2.7, the latest version as of this writing.  However this plugin did not work for me and thankfully Subscribe to Comments is.

Share

This article, Google Analytics script, has a comment thread where people debate whether Google Analytics or WordPress.com Stats is better.  The consensus seems to be that you might as well use both and that though Google Analytics has more info it might be overkill.

WordPress.com Stats was easy enough to install and I could use the same WordPress.com API key for all my blogs.  The only issue was that to see the stats in my dashboard I had to enable third-party cookies in my browser (normally I don’t to keep out unwanted cookies).

Google Analytics took a little longer to set up but was still easy.  I had to create separate Google Analytics accounts for each of my blogs.  Google asked if I wanted to share my data and though I was suspicious I said yes because they said I would have access to other services if I did.  I then configured the plugin for each blog with the correct Analytics Account ID.  For this blog the footer does not call wp_footer(); for some reason so I placed the tracking script in the header.  For my professional blog I placed the tracking script in the footer since that is the default.

I have a feeling I am going to end up liking WordPress.com stats better because it is simpler and more tuned to the stats I want from a blog.  Below is a sample screenshot.

WordPress.com Stats screenshot

But I am glad I am also at the same time compiling stats on Google Analytics.

Share

Protected Posts

 | May 28, 2009 7:13 AM

You are most likely viewing this page because you tried to access a post that is protected.  To view that post you must be registered and logged in.  After doing this please try accessing the post again.

Restricted Content

Previously I was concerned about privacy, i.e. my blog posts showing up in unexpected places and being read by unintended guests.  I tried to address it by having everyone log in to view my blog but that proved to be a problem because RSS feeds no longer worked.  Recently I opened my blog to search engines and noticed a spike in traffic but I think that was mostly from Google.

I have searched for a solution for awhile and I finally found a good compromise, the User Permissions Plugin.  By using this plugin I can restrict certain posts to only be available to readers who are registered and logged in.  Also these restricted posts will not show up in RSS feeds.  I modified the plugin to redirect to this post instead of “/“.

The downside is that my regular readers will have to be logged in to read these restricted posts.

Regular readers please register if you have not already and always log in if you want to read all the posts, especially posts about my kids.

Share