Nutrition Labels for WordPress

I’ve just released a plugin for WordPress, wp-nutrition-label. It provides a WordPress shortcode which generates an HTML FDA-style nutrition label. For instance,

Nutrition Facts Serving Size 1/2 cup Servings 2
Amount Per Serving
Calories 87 Calories from Fat 27
% Daily Value*
Total Fat 3g 4%
Saturated Fat 1g 5%
Trans Fat 0g
Cholesterol 0mg 0%
Sodium 250mg 10%
Total Carbohydrate 10g 3%
Dietary Fiber 0g 0%
Sugars 0g
Protein 5g 10%
* Percent Daily Values are based on a 2,000 calorie diet. Your daily values may be higher or lower depending on your calorie needs. wp-nutrition-label

The label is styled to scale but doesn’t yet scale well. Some elements of it work well but the “Nutrition Facts” text sometimes scales poorly. I’m looking at ways to improve the way that the label scales.

I’m also working on adding more nutrients (vitamins and minerals) to the label but haven’t quite decided on how to do it yet.

This is the first piece of software I have publicly released in a very long time. It’s quite likely the first piece of GPL’d software I’ve ever written – most of the software that I have publicly released (MIT’s PC/IP, in particular) was written pre-GPL. It’s ironic that it’s written in PHP, one of the my least favorite programming languages ever, though as much as I dislike PHP I have a great deal of respect for WordPress.