Link Post: From PHP 5 to 7

An interesting history of PHP and why they’re skipping version 6.

Here is a brief summary of the reasons outlined supporting the decision to release the next version as PHP 7:

  • PHP6 already existed, and there are plenty of numbers available (so it’s easy to make a new version number).
  • It could confuse people since PHP6 was a widely known project, and this release is unrelated.
  • There’s lots of PHP6 information on the web which does not apply to this release.

http://halls-of-valhalla.org/beta/news/from-php-5-to-7,146/

Always Specify a Key When Using Zend_Cache

I’ve been using Zend_Cache for a while to improve performance on my sites and it has this cool feature where you don’t have to specify the key when you perform the save. You end up with a lot of code that looks like this:

$key = 'permission' . $role->getId();
if(($permissions = $cache->load($key)) == false){
    $permissions = $this->someReallyComplicatedQuery();
    $cache->save($permissions);
}

This works really really well but then I started noticing some performance problem and random page failures on one of the sites I maintain. I started looking into the problems and I found some of these sections weren’t actually saving the correct data so I started breaking down what exactly someReallyComplicatedQuery was doing only to find ANOTHER one of these blocks. It turns on the second call to $cache->load() was resetting the value and causing all the problem. So from now on I’m always saving using this form (actually I’ve rewritten all of these blocks on several of my sites):

$key = 'permission' . $role->getId();
if(($permissions = $cache->load($key)) == false){
    $permissions = $this->someReallyComplicatedQuery();
    $cache->save($permissions , $key);
}

Finding Your Warnings in the MySQL Command Line

As I’ve mentioned before, I use the command line mysql client to edit data on our server (just say no to phpMyAdmin on production servers!). The other day I updated a table and got the following message:

Rows matched: 1  Changed: 1  Warnings: 1

What the hell! Why is there a warning!

To figure it out you can run the following command and it will tell you. The only downside is that you must run it as the next command on your connection.

SHOW WARNINGS;

How to Provide a Free Trial

Why?

When you put a site out one of the key metrics that you’re going to want to track is how often you convert a visitor to a customer. One of the great ways to do this is to provide a free trial of your service for anyone who wants it. What you don’t want to do is create so much friction that people abandon the process and cause a potential customer to try a competitor.

Limit the Questions

You want to limit the number and the complexity of your questions. It should include nothing that isn’t absolutely required to start the site. Does your marketing department want demographic information? You can request it after they’ve become a customer and throw in a discount for filling out all the information. I’ve tried several sites where they ask how many employees my company has and there have been times were I haven’t know.

An amazing example of just asking for the minimum amount of information is FreshBooks. Their trial form consists of two elements. TWO. When I signed up for their service a couple years ago I think it asked for a password but it looks like they removed that requirement too.

Don’t Ask for a Credit Card

Two reasons for this item.

First, if you’re going to provide a free trial don’t be a dick about it and have something about how you’ll not bill them if they cancel before the 30 day trial is up. This is just a convent way for you to get some income. What you really want to do is have such a great product that they’re going to want to give you money at the end of the thirty days so they can keep using it. Then you can present them with a message that says, hey I hope you’re enjoying your time here and if you are you really need to help us pay for it. Then if they don’t pay up you don’t need to worry about it. Just move on.

Secondly, it’s yet another barrier to getting that user to try your product. They might have to get approval, ask for a company credit card, and then fill out that information. This actually happened to me, I wanted to try a piece of software and the signup form required a valid credit card. In order to do this it would have been a three step process of getting my manager’s approval, her asking our assistant to signup for the site and then getting all the information filled out. On top of that I then need to ask my manager if I can have a credit card number for something that I haven’t even TRIED yet.

Instant Setup

The site should be setup for your potential customer as soon as they’re done filling out your minimal form. Again, this is from personal experience. I wanted to sign up for a service so I clicked on their “Free Trial” button and was presented with a form asking for my email address and name. Okay, not a horrible process. I filled out the form only to be presented with a message letting me know that someone would contact me to setup the site. That person then contacted me 3 days later and asked for a bunch of information that could have easily been asked for on the original form. After responding a full 2 days later I had my free trial. I didn’t haven’t been back.

Free Tier

If at all possible, provide a free tier. Mandrill is a service I use regularly because I can easily setup a new client (again with just a few required fields) with their service and if they hit the more than 12,000 email (which, let’s be honest, is a lot of emails and most of my clients won’t hit that) it’s simple to add credits to the account.

One screen for a free trial

I’m sure you’ve run into this before. You click “free trial”, then you have to choose what level of service you want to have the free trial at (Low Grade, Mid Grade, or Platinum). This is just another choice that will scare potential customers away. Just give them the highest level of service so they can see all the features and how they work. Then once they’ve seen the feature that will save them money they’ll be more than happy to shell out an extra couple bucks for it.

Demo Data

Load up their site with Demo data for common tasks. That way they can see what happens with actual data. Have a tasks feature in your site? Add some examples of what they might want do to in your app so it can be a learning experience.

Conclusion

It’s important to treat potential customers just like your current customers and provide a nice clean interface to get them into your system. By reducing any barrier to them trying your software you’re increasing the chance that they will give you money.