Speeding Up WordPress – Gravatars

Speeding Up Wordpress - Gravatars

After monkeying with OptimizePress a bit and updating some on-page elements to my liking, I decided that I would see how my site was performing in some of the page speed testers.  I don’t like using these things because there are so many calls being made that I was not aware of and it typically takes me on a wild goose chase of time wasting.  So, let me give you the skinny on what I noticed and how I quickly “fixed” it.

Gravatars are cool.  It simply allows you to put a face to a name…and in the digital age, that is a good thing in my book.  However, if you have a post with a lot of comments, and like me, you want to have them displayed on the same page as the post (rather than paginated after say 10 comments), you may be seeing a large performance hit.  On a post with over 60 comments, I noticed that each gravatar was making its own request.  While I am sure their servers are lightning fast, it is still a lot of “unnecessary” requests.  To me, the Gravatar is a luxury item in the world of, “everything now.”  So, I decided to switch them off and see what happened.

NOTE:  I tried the “blank” option and that simply put a blank image in there…not a great solution!

Find the Discussion Menu

WordPress Discussion Menu
WordPress Discussion Menu

The “Discussion” menu is located in the Settings menu in WordPress.   Settings -> Discussion.  Scroll down the page and you will see a section about Avatars.

De-Select display Gravatars

When Gravatars are Set to be Displayed
When Gravatars are Set to be Displayed

At the top (above this screenshot!)  You will find a check box to turn of the default of displaying Gravatars.  Uncheck the box and click “Save Changes.”

What It Should Look Like

When Gravatars are Set to be Displayed
When Gravatars are Set to be Displayed

Everything will shrink up after you save your new settings.  You should see this.

Using the GT Metrix tool, I went from an “F” to an “A” simply by removing the display of avatars.  This is subjective, but the page load time dropped from ~2.1 seconds to ~1.2.  THAT, was enough to make me drop avatars for now.

Cheers!

WordPress Help – Adding Author & Updated to Posts and Pages

WordPress Help - Adding Updated and Author Information to Your Poasts and Pages

The Microdata Problem

Using Google’s Webmaster Tools is a great way to find little issues that might be holding your site back from ranking better in the Google SERPs.   It had been a few years since I hopped into Webmaster Tools, and when I did, I noticed a number of errors in the Structured Data section.  Clicking a few links it seemed that Google wanted to see “Updated” and “Author” data called out on many of my pages and posts.  After poking around a big on the WordPress forums, I found that most people answering questions didn’t really understand what was being asked, nor what Google was looking for.  I have played around with Rich Snippets and other Microdata information, so I had a good idea of how to solve the problem…it was just going to take a little poking around in the WordPress Codex (their repository of the code snippets that give users access to all of the information we have entered into our blogs).

[feature_box style=”1″ only_advanced=”There%20are%20no%20title%20options%20for%20the%20choosen%20style” alignment=”center”]

NOTE:

This information is for people with “self-hosted” WordPress blogs. In other words, your website is not hosted on wordpress.com. Also, use this information at your own risk. Don’t freak out if you don’t know what your doing and your website goes blank when you start changing code in your wordpress files. Computers need things to be perfect, not close. So, take your time and make sure you don’t leave out punctuation, or add extra spaces here and there…sometimes, a semicolon can be the difference. Use of any information you find here is at your own risk. You have been warned.

[/feature_box]

Adding Author Data / Updated to Your Posts

For the un-initiated, delving in to the workings of a WordPress blog can be a bit daunting.  But, it need not be so.

Most (not all) WordPress themes use the “single.php” file as a template to generate the web pages for your posts.  Basically, all of the fancy stuff on the screen around your post is found here.  WordPress just grabs your post content and sticks it in the middle of the single.php file and, boom, you have a post.  Somewhere in your single.php file, you should see something like this:

 

<?php the_content(); ?>

 

This is the piece of code that grabs the post you have written and puts it into your theme’s post template (single.php in this case).  At this point, you have two choices.  You can add information just above, or just below your post’s content.  To automatically add the date your post was last modified AND add the author responsible for the post, enter the code below just above or below the code above:

 

Updated on: <span class=”date updated”><?php echo get_the_modified_date();?></span> by <span class=”vcard author”><span class=”fn”><?php the_author_link(); ?></span></span>.

 

Use the WordPress Codex for more information on get_the_modified_date() and the_author_link() functions and options for changing how they work.

Adding Author Data / Updated to Your Pages

Adding updated and or author data to your pages is just as easy.  Instead of using single.php, your theme likely uses the page.php file as a template for your pages.

So, fire up your favorite text editor and look for the same function in the page.php code:

<?php the_content();?>

Add the code again either above or below to display author and last modified date information:

Updated on: <span class=”date updated”><?php echo get_the_modified_date();?></span> by <span class=”vcard author”><span class=”fn”><?php the_author_link(); ?></span></span>.

You should see this data listed at the bottom of this post to get an idea of what you can expect.

The Problem With This Technique

Ok, so as with anything, there is no perfect solution.

Modifying your theme’s files is a dicey proposition.  This is because when you update your theme, it may overwrite the changes we just made.  To deal with this, I keep a note in Evernote of the modifications I make to the theme I use.  When I need to update the theme, I know that I have to make a few changes on top of the them update.  This happens very infrequently, so I am ok with this system.

If you have any questions, please leave a comment below and I will try my best to respond.

Enjoy!

 

How To: Scan to PDF for Free

Today we are going to learn how to use free software to scan a single or multiple page document to a PDF. This is great if you have an old flatbed scanner laying around like I do.

Danielle asked me if we could scan a document to PDF recently and I forgot I had a nice “old” Epson Perfection 1650 flatbed scanner laying around (well preserved).  I have been spoiled in recent times because we had a very nice enterprise level printer/scanner at the office with a 50 page document feeder on it. It would man handle a 2 page document and email it to me almost faster than I could make it back to my desk.  These days, we are rollin’ with the Perfection 1650 flatbed…OG style homey.

The Search for Free Scanning to PDF Files Begins

I start with the standard Google search for “scan to pdf” and it brought up a number of different applications, all commercial, with some free offerings.  Most had some kind of free PDF creation application that tied into Windows’ printing function…allowing you to select a PDF “printer” just like Adobe Acrobat does….except without the big price tag.  All of the top Google results did not have a free scan to pdf application…some had trialware, but they all watermark the the image that is created so that you will buy the application…and, I am being cheap today.

NOTE: I am not going to mention any of the sites I visited that watermarked because one ticked me off so badly by saying it was a full functioning version and when I went to print it a big black stripe went across the pdf image I was looking at and prompted me to buy the full version if I wanted to print watermark free images. 🙂  I will say that CutePDF has a free version that people like and that is what I use to print out/generate PDF files in my solution…

The Free Scanner to PDF Solution: iCopy + CutePDF

I finally came across an article on scanning on About.com that listed an open source project called iCopy.  I copy is being billed as a “free photocopier” and that is pretty much how I see it.  All of the applications I installed to scan items, watermarked scans that were output to image files as well as those output as PDF files.  iCopy outputs everything to an image file and then I use the free CutePDF creator to “print” to a PDF. Let’s look at the process…

[feature_box style=”2″ only_advanced=”There%20are%20no%20title%20options%20for%20the%20choosen%20style” alignment=”center”]

UPDATE 2/24/2012:  Matteo Rossi just dropped by (see comment below) that significant improvements have been made in version 1.5 of iCopy including support for ADF or Automatic Document Feeders.

[/feature_box]

How to Use iCopy

When you first install iCopy you have the option to let the button on your scanner “notify” iCopy of the coming scan.  None of the other applications that I used had this functionality (that I could see). iCopy makes it easy.  Once installed, the main iCopy application is small, clean and simple.

iCopy Main Screen
iCopy Main Screen

As you can see, there is not a lot going on and only the necessary items are in front of you.   The first drop down box allows you to specify what the scanner should be looking for: Colors, Grayscale, or Text.  Using colors makes for a slower scanning pass, grayscale a little faster and text much faster.  Selecting the Printer drop down box, you will find two options: color or black and white.  The last drop down for Paper Size allows you to select paper sizes you know and have never heard of (and probably never will again)…let’s just say they have you covered no matter what you are scanning.

Configuring iCopy

The first order of business is to configure the scanner. I was fortunate to find a Windows 7 TWAIN driver for the Epson Perfection 1650 on the Epson website and clicking the “Choose scanner…” button revealed the scanner straight away.

iCopy Scanner Selection
The Epson Perfection 1650 was found by iCopy right away.

Next order of business is to configure the printer options.  Clicking the “Printer Options” button brings up the standard Windows printer selection window. I selected CutePDF Writer so that when I scan and print the documents, PDF files will be generated automatically.  NOTE: It can take a  bit for CutePDF Writer to spit out the pdf file depending on the resolution you select…be patient fast clickers.  This printer is saved as the default for iCopy NOT for Windows.

iCopy Printer Selection
Selecting CutePDF Writer as the default printer for the iCopy application.

Last, we need to configure the image settings.  You can change the Brightness, Contrast, Scaling, Resolution and the JPEG quality (as it is creating an image when scanning).  I left the first 3 alone, but stepped up the resolution to 600dpi.  This made for pretty nice scans that were not outrageously big.  You can select resolutions from 75dpi up to 1600dpi.

icopy Resolution Settings
Setting the resolution to 600dpi in iCopy.

One of the nice things that iCopy does on the main screen (see first image above) is show you what scanner and what printer you have selected.  Not something you normally find, but very thoughtful and useful.

Scanning and Making a Multi-Page PDF

Now that we have everything setup, it is time to make a PDF file.  A single page scan is easy enough to accopmlish, you click the big blue button on the main screen and iCopy starts the scan. Alternately, if your scanner has a scan button on front that iCopy can recognize, push that bad boy and away you go.  But, if you are scanning a document, chances are there are more than one page.  In this case you need to click the “Other Scan Modes” button found directly below the “big blue button.”  This brings up a window offering you two choices:  Scan Multiple Pages (Ctrl + M) or Scan to a File.  Option #1 is what we are looking for to create a multi-page file, Option #2 allows you to create an image file for a single page scan rather than outputting to a printer.  Selecting “Scan Multiple Pages” activates the scan process, so you will need to have your document in the scanner before selecting this.  Once the first page is done, you will have the below in front of you:

Add Multiple Pages to Scanned Document
Add more pages or print the ones you have scanned.

If you have more pages to add to the file, click “Add Another Page,” otherwise, click the “Print Pages” button to output to a PDF using CutePDF Writer (or your PDF creation application of choice).

Final Thoughts

Overall, this is a very workable and simple system to use if you are too cheap and too lazy to get a document scanner.  The PDFs I created using this combination were quite nice and worked well for our needs.

How to Run Disk Defragmenter as a Scheduled Task

Disk Defragmenter
Disk Defragmenter

Command Line Kung Fu

I was trying to figure out how to run Disk Defragmenter from the command line on a SBS2003 box as I was not sure how to specify what drive I want defrag.exe to run on at a specific time. Turns out that you can just browse to defrag.exe (…/system32) and then tell it what drive to run on in the advanced properties of the Task Scheduler. Microsoft has a write-up on the whole process.

iPhone and Exchange 2003 Configuration Troubleshooting How-To

Ok, I have to admit, I don’t like reading manuals. But, in the case of the new iPhone 2.0 software and Microsoft Exchange 2003, I did in fact read the Apple Exchange 2003 deployment guide. It is about zero help for someone who has configued Exchange 2003 to work with Windows Mobile devices in the past. But, I could not for the life of me get the iPhone to pull email, contacts or my calendar. I knew that the first thing that was needed was Exchange SP2…but, I thought I had checked what version of Exchange I was running…and, thought wrong. Instinctively, I did the Properties of My Computer and thought that I saw something somewhere that said Exchange was running SP2. Well, here is the deal, apparently you cannot get SP2 for Exchange 2003 via Windows Update. You have to download Exchange 2003 SP2 manually. The short of it is, I am an idiot.

There were a number of issues that I thought I was seeing. First, when I configured the Exchange settings on the iPhone, I would see Configured Sync with (null). I thought this was a little glimpse into where the sync problem was. It turns out that the iPhone inserts “null” if the name you specify for the Exchange account is too long (I verified this is the case). I finally decided to start from scratch to make sure I was not missing something. I found out how to check what version of Exchange 2003 I am running. Once I did that, I saw that I was running SP1. DUH. So, I downloaded Exchange 2003 SP2 from Microsoft, installed it and BOOM. Email, Contacts and Calendar. What a rookie move.

 

How to Make the POP3 Connector Check for Email More Frequently

If you are running SBS2003 and Exhange and you are using the built in POP3 connector to check for email on other pop3 boxes, you are probably really annoyed that you cannot check pop email boxes more frequently than every 15 minutes. Well, there is a way to make the POP3 Connector in SBS2003 check for email as frequently as you like. Here is what I did and it seems to work fine on the two SBS 2003 boxes I am running:

1. Open regedit and browse to the following registry key:
HKEY_LOCAL_MACHINE/SOFTWARE/
Microsoft/SmallBusinessServer/Network/POP3 Connector

2. On the “Edit” menu, point to “New”, and then click “DWORD Value”.

3. Type “ScheduleAccelerator” (no quotation marks) as the entry name, and then press ENTER.

5. On the “Edit” menu, click “Modify” or just double click ‘er.

6. In the “Value data” box, type the value that you want, and then click “OK”. To determine the polling interval, the value that is configured on the “Scheduling” tab in the GUI is divided by the value that you type for the ScheduleAccelerator entry. Assuming you already have this at 15 minutes, the value you put in here would divide 15. So, if you enter 5 the POP3 Connector will check for email every 3 minutes. Boom.

FYI, you can enter the value as Hexidecimal, which should be the default.

7. I then restarted the POP3 Connector Service by going into the Services console, finding POP3 Connector, right clicking it and selecting restart.

Enabling Multiple Remote Desktop Sessions in Windows XP Professional and Media Center Edition 2005

If you have ever used a real remote computer system like Citrix, then you have probably been craving multiple Remote Desktop sessions since you first fired up Windows XP Professional and/or Media Center Edition. Here is a HACK (translated: USE AT YOUR OWN RISK), to enable multiple Remote Desktop sessions on your XP Pro or MCE 2005 box:

NOTE: You will have to have knowledge of the Windows operating system and more specifically the Windows Registry. If you have no experience with the registry, then I would recommend you find someone who does or leave these alone. I do not make any kind of warranty that this will work for you or your friends. This is provided for entertainment purposes only. Don’t call me if your computer stops working. Got it?

  1. Print these directions so that you have them to work from.
  2. Restart your computer in Safe Mode – Follow this link to learn how to restart Windows XP in Safe Mode
  3. Turn off/disable Remote Desktop Connection (RDC) and Terminal Services
  1. Right click My Computer
  2. Select Properties
  3. Click on the Remote tab at the top of the window
  4. UNCHECK the box next to, “Allow users to connect remotely to this computer
  5. Click OK
  6. Go to Start -> Control Panel -> Administrative Tools -> Services
  7. Find Terminal Services in the list
  8. Right click on Terminal Services and click Properties
  9. In the Startup Type box, select Disabled
  10. Click OK to close the window
  • Next you will replace the current version of the Terminal Services DLL (termsrv.dll) with an unrestricted version from a previous release of Terminal Services.
  1. Here is a copy of the (NOTICE: I have removed the link to this file as the one I had was reported as carrying a trojan…try googling it) – Save it to your Desktop or other suitable location
  2. Using a file manager like Windows Explorer open C:\Windows\system32\dllcache
  3. Rename the file termsrv.dll to termsrv_dll.bak or whatever you would like.
  4. Copy the downloaded termsrv.dll file (the one you just downloaded from the web) to C:\Windows\system32\dllcache
  5. Open the C:\Windows\system32 folder
  6. Delete the file termsrv.dll in C:\Windows\system32
  • Now we can edit the Windows Registry to enable more than one RDP connection. Go to Start -> Run and type regedit – Hopefully you knew that already
  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Licensing Core
  • Add a DWORD Key named EnableConcurrentSessions and give it a value of 1
  • Close the Registry Editor window
  • Go to Start -> Run and type gpedit.msc to run the Group Policy Editor
  • Browse to Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services and double click Limit number of connections
  • Select the Enabled button and enter the number of connections you would like to enable….at least 2.
  • Restart Windows
  • Right click My Computer and select Properties.
  • Click on the Remote tab at the top of the window
  • CHECK the box next to, “Allow users to connect remotely to this computer
  • Click OK
  • Go to Start -> Control Panel ->Administrative Tools -> Services. Select Terminal Services from the list and double click it or right-click -> Properties. Set the Startup Type to Manual.
  • Restart Windows/Computer

You should be good to go.