Category: Blogging

Pardon the Dust: Transition in Progress

Things might look a little different on the blog if you haven’t been back in a while.  And, things might not be working quite up to par for a bit.  Please pardon the dust.  I’m trying to get things back in order as quickly as my schedule allows.

So, here’s what’s going on: I am moving my website to a VPS.  My term at Hostgator expired, and I decided that this next year, I want to include SSL on my site and take it to the next level.  Doing so at Hostgator was not cost effective in the least.

So, I am rebuilding everything on my own VPS.  It’s exciting but things may be a bit rough for a few weeks.  I hoping to pull together a new theme on the blog, SSL for securit/SEO, and tie it all together on a multi-site WordPress installation.

Please keep checking back and see how it goes!

Cache Tuning for Inodes

I have been struggling with my website’s backups running.  Host Gator requires the Inode count to be under a certain level in order for the backups to run.  The best part about it is that they have added tools to the CPanel to show the usage and backup status.

After fixing the problem, here’s what my backup status panel looks like:

Backup Status Panel

Also, farther on down the left hand column, Host Gator offers an Inode measurement.  Again, after fixing, here’s what mine looks like:

Inode Status Indicator

Last time, I messed with the git repositories to clean up some of the inode usage.  This time, I looked into the WordPress Caching.  I am using a cache plugin called W3 Total Cache.  Because it was not configured correctly, it was using up more inodes than it should have.

So, it was time to check on performance again, and I wanted to do a before and after performance measurement.

Read More

Too Many Inodes

I recently switched to Host Gator, and they have policy about the number of inodes.  I just noticed that my account moved to “Not Backed Up” just recently.  So, I thought I would blog a few of the things I learned while exploring…

Determining the Number of Inodes in a Directory

I found this command would do the trick:

[sourcecode language=”bash”]find . -printf "%i\n" | sort -u | wc -l[/sourcecode]

One of the advantages of Host Gator is that they provide SSH access.  I was able to login quickly and run the command in the different directories.  If you have a host that doesn’t offer SSH access, may I suggest PHP Shell?

Git Repositories

I had a rough guess that my git repositories might be part of the culprit.  If it’s based on the number of files, I guessed that git uses a bunch to track changes.  So, I did a little tinkering.

Sure enough, most of the inodes in my project are in the .git directory:

[sourcecode language=”bash”]

$ find . -printf "%i\n" | sort -u | wc -l
2050
$ find .git -printf "%i\n" | sort -u | wc -l
1195

[/sourcecode]

I found a few options to try.  First, I tried the fsck command, but that didn’t seem to make a difference in the inodes:

[sourcecode language=”bash”]

$ git fsck –full
Checking object directories: 100% (256/256), done.
dangling commit 9e18c6e42e3f62127776bdd2f52608f904991e08
$ find .git -printf "%i\n" | sort -u | wc -l
1195[/sourcecode]

Next, I tried the gc command, and that seemed to make all the difference in the world:

[sourcecode language=”bash”]# git gc –prune=today –aggressive
Counting objects: 912, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (900/900), done.
Writing objects: 100% (912/912), done.
Total 912 (delta 525), reused 0 (delta 0)
$ find .git -printf "%i\n" | sort -u | wc -l
37[/sourcecode]

The repack didn’t do much:

[sourcecode language=”bash”]# git repack
Nothing new to pack.
$ find .git -printf "%i\n" | sort -u | wc -l
37[/sourcecode]

WordPress Cache

My next culprit is the WordPress Cache.  For example, on one of my blogs, the cache accounts for 76% of the inode count.

[sourcecode language=”bash”]

$ find . -printf "%i\n" | sort -u | wc -l
23323
$ find wp-content/cache/ -printf "%i\n" | sort -u | wc -l
17766[/sourcecode]

Well, that is another task for another day.  This is where I will start though.  If you have any ideas, please comment.

Resources

Blog Moving Again

Ok, It is time to move the blog again!  But, this time you shouldn’t have to change your bookmarks!  I am just moving the website to new web host.

The transfer is supposed to be seamless, but I suspect you might see a little downtime over the next week as the domain re-registers and points to the new site.  If it’s not working, please give me some time and check back.

I’ll update you on the other side!

Great Link: WordPress Plugins

via http://www.flickr.com/photos/pimkie_fotos/2451289441/sizes/o/in/photostream/
via Flickr

I am always open to more lists of WordPress Plugins:

Lunarpages Blog: Ten WordPress Plugins Worth Considering

The one I picked up from this list was WP Super Cache.  My blog definitely needs a speed boost.

The next one I probably need to come back to is the Mobile Press.  The only problem is that the link was broken.  I’ll have to come back and research that later.

So, let me add a few of my own:

Ad Injection: Previously, I had tried to implement the ads manually into my theme.  I found that they were slowing the site down.  This plugin makes implementing ads correctly easier, and it gives you more options as well.

Edit Flow: While it is just me blogging, I still use this plugin to try to organize my posts.  I have created a “Stub” status that I use when I find a topic that I want to write about.  Then, I created a “Needs Research” status to indicate that I still have work to do before finishing the article.  I also created a “Pending Review” status to remind myself to review the article one more time before publishing.

Jetpack: If you don’t already have this installed, WordPress should start to bug you about it.  For me, it just means better looking stats.  I need to delve into setting up some of the other features in it.

Yet Another Related Post Plugin: I need to spend more time on theming the related section, but this plugin seems to make the “related” section at the bottom pretty easy.

Adding the Google +1 to Garland Theme in WordPress

Today, I came across a suggestion on Google AdSense to add the Google +1 Widget to my posts on my website.  Here’s what the notification looked like:

If you want a short description on what the +1 button does, you can watch this short video from the +1 Website:

So, here’s how I made it work in my theme (I am using Garland Revisited). First, I added the javascript link at the bottom of my header.php file.  Here’s the code I added:

[sourcecode language=”php”]
<!– begin Google +1 button –>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<!– end Google +1 button –>
[/sourcecode]

So, here’s what the bottom of my header.php looks like (wp-content/themes/garland-revisited/header.php):

[sourcecode language=”php”]
</ul>
</div> <!– /header –>
<?php get_sidebar(); ?>
<div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
<!– begin Google Adsense –>
….(Adsense code removed)
<!– end Google Adsense –>
<!– begin Google +1 button –>
<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
<!– end Google +1 button –>
<!– begin content –>
<div class="node">
[/sourcecode]

Next, I added the button to the home page. This is the line of code that i added to index.php:

[sourcecode language=”php”]
<div style=’float:right’><g:plusone href="<?php echo get_permalink() ?>"></g:plusone></div>
[/sourcecode]

Update: I added the href=”<?php echo get_permalink() ?>” code for the index.php.  Without that, the user would be indicating a plus one for the home page rather than the article that the button is next to.

So, here’s what the top of my index.php looks like (wp-content/themes/garland-revisited/index.php):

[sourcecode language=”php”]
<?php get_header(); ?>
<?php is_tag(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<div style=’float:right’><g:plusone></g:plusone></div>
<h2><a href="<?php echo get_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<span class="submitted"><?php the_time(get_option(‘date_format’)) ?> &#8212; <?php the_author() ?> <?php edit_post_link(__(‘Edit’), ‘ | ‘, ”); ?></span>
<div class="content">
<?php if ( (function_exists(‘has_post_thumbnail’)) && (has_post_thumbnail()) ) {
the_post_thumbnail(array( 75,75 ), array( ‘class’ => ‘alignleft’ ));
}
?>
[/sourcecode]

Now, that only affects the home page. If you go into one of the posts, you won’t see the button. To fix that, we need to add it to single.php. And, here’s what the top of my single.php looks like (wp-content/themes/garland-revisited/single.php):

[sourcecode language=”php”]
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<div style=’float:right’><g:plusone></g:plusone></div>
<h2><?php the_title(); ?></h2>
<span class="submitted"><?php the_time(get_option(‘date_format’)) ?> &#8212; <?php the_author() ?> <?php edit_post_link(__(‘Edit’), ‘ | ‘, ”); ?></span>
<div class="content">
[/sourcecode]

Resources