WP-Amazon Reloaded Updated

My WP-Amazon Reloaded plugin has been updated and I’ve made a few key feature changes and additions.

UPDATE: I now have official hosting for Amazon Reloaded for WordPress

Changes in the latest version include:

  • Support for different Amazon locales
  • Faster code
  • Fixed the FOLLOWLOCATION cURL bug for those on secured PHP installations

I hope you’ll enjoy the plugin. If you are so inclined, donations are always appreciated. If you’re looking for custom plugin development after seeing this plugin, please visit Plugin-Developer.com

2007 Year In Review

Seeing how it is now March of 2008, I decided it was probably about time to break down my life in 2007 in some detail. I achieved a lot and had some really important life events that I think are of particular noteworthiness.

Personal

2007 was a big year for my personal life. First, and most importantly, I got engaged to my one true love, Angela. That happened on December 18, our 3 year anniversary of dating. To me, this was something that will stand out forever in my life: standing at the top of the Sears Tower and asking the woman that I love to marry me.

In other personal areas, I made more friends in 2007 than I think I have during any other part of my life. My dormitory floor, Blumberg 2 at Rose-Hulman is the best group of guys that I can imagine hanging out with. Its a really talented bunch, and I’m happy to call most of them good friends of mine.

Finally, I achieved a number of fitness goals that I set for myself at the beginning of the year. Through a dedicated plan of exercise and nutrition, I was able to throw up 300 pounds on bench press, lift 515 on deadlift, and squat 395. I also was able to lower my bodyfat to single digits for the first time in my life. Almost every fitness goal I set at the beginning of the year was fulfilled.

Business

In 2007, I realized the style of work I want to do the rest of my life. From February of 2007 through September of 2007, I worked as a contract web developer for a really great company, Power Advent. Most of my time was spent on one project, and I learned more about web development in that 6 month period than I had in the 2 years prior.

From this experience, I’ve realized that I want to work from home once I graduate. I want to continue telecommuting and doing software development. It can be desktop or web development, but the feeling of freedom that working from home and working at my own (generally quick) pace was the most fun I’ve ever had doing work. As such, I’m attempting to set myself up to continue the same type of work.

Continuing to reference the programming realm, I learned a lot about numerous programming languages. My Java skills increased a point where I believe I could do an adequate job of desktop development with the language. I’ve gained experience with a number of PHP open source projects and frameworks, as well as increasing my overall knowledge of the structure of the language and the tricks you can use. Finally, I’ve spent the last couple of months dedicating myself to learning C#. While I would say I’m generally proficient with the language, I’m not exactly an expert yet. There are a lot of tricks, like anonymous delegates for method prioritizing, that I haven’t learned to use effectively yet. However, I think that WPF and C# 3.0 are the forefront of desktop development for the Windows platform, and I have dedicated myself to learning these things.

Look for my follow up post on my 2008 goals.

Review — Head First Design Patterns

Recently, I’ve been doing a lot of reading to further my understanding of more advanced programming concepts and outfit myself to be a productive member of the programming elite. So far, much of my time has gone into gaining a better understanding of object oriented design and the patterns that emerge from doing it right. I’ve read a few books on the topic so far, and I have to say that the best, by far, was O’Reilly’s Head First Design Patterns.

If you’re familiar with programming textbooks and in-depth analysis of computer science topics, then you probably already know that most books on the subject make you want to fall asleep after about half an hour of reading. This book, I am glad to say, is completely different. Head First Design Patterns makes great use of visuals and humor throughout the text, and this makes the work a lot more interesting than the average book on the topic.

In addition, the problems faced and solved within the book are things that you can relate to the real world. There are no “foo bar” examples that hinder your learning. Instead, you’re faced with interesting design choices from clients that include SimUDuck and Starbuzz Coffee. Sure, the examples may be contrived at times, but the point comes across very well.

Another great thing about the book is the exercises contained within. You’re expected to read this one with a pencil in hand, ready to jot notes at any moment. This approach really increased my learning while working through the examples. I particularly liked the crossword puzzles at the end of each chapter. For me, these made me challenge myself to read more intently so I wouldn’t miss something and have to come back to it.

Of course, there were a few things that probably could have been done better. I thought the order in which the patterns were covered was somewhat lacking. Personally, I would have put the Singleton or Factory pattern second in the book because they’re essential parts of a lot of real world designs. Also, I felt some of the patterns covered in the Appendix should have been treated better than being relegated to auxiliary pattern status. That, however, is subject to personal preference.

Also, if you don’t have a reasonable grasp of Java programming (or C#) than this book probably isn’t for you. You’ll be lost in the syntax and unable to see the concepts. It’ll be the whole “can’t see the forest for the trees” problem.

In sum, I’d have to whole-heartedly recommend this book to anyone with an interest in design patterns. It does a good job explaining them, and I’ve already started to implement some of the design patterns in a personal PHP framework that I’m developing. So, if you have a chance, go sit down and read the book in a Borders or Barnes & Nobles and then shell out the cash for it. This book is definitely worth it.

Technical and Programming Books I Own

As a software developer, I consider it part of my duty to be constantly learning. It seems that I’m always reading something to attempt to improve my skills. My technical books cover a variety of things, but most concern new languages, practices, or software packages that I’m being exposed to or wish to gain a more advanced level of understanding of. I thought it would be fun to list the technical books on my bookshelf. I’ll be organizing them by fully read, half read, and not yet read (a surprisingly large category). In addition, I’ll try to provide a brief description of each book that I’ve read. Here goes:

Fully Read

  • Code Complete - 2nd. Edition - This book is an absolute must-read for anyone who considers themselves a serious software developer. Steve McConnell reviews best practices and principles in this book in a way that is easy to understand the first time through. My favorite chapters concerned object oriented techniques like encapsulation, abstraction, and inheritance hierarchies, but your opinion my differ.
  • Introducing Maya 6: 3D for Beginners - This is a decent book that I’ve read all the way through. It doesn’t assume any prior knowledge of 3D content creation and walks you step-by-step through the process of modeling with polygons, NURBS, and subdivisions. I found it was lacking mostly in texturing information. This book is outdated now (since Maya is all the way up to version 8.5) but it still provides useful information for a cheap price if you’re just going to be using Maya Personal Learning Edition anyways.
  • Pro Drupal Development - I had to learn the Drupal CMS for the job that I currently possess, and my employer was generous enough to send me this book to guide me along the way. Before reading it, I had no idea how to manipulate Drupal. Now, I can make the CMS dance at my fingertips (ok, slight exaggeration, but I did learn a lot.) If you’re going to be doing development with Drupal, I can’t recommend this book enough.
  • Don’t Make Me Think - This is a classic that belongs on every software developer’s book shelf. In this work, Steve Krug examines user behavior and what you should do to enhance the user experience at every interface level. It’s not so much a book about code as it is about the general behavior of software and its interaction with its users. You need to read it if you haven’t.
  • Money for Content and Your Clicks for Free - It’s been a while since I picked this book up, and it’s not really a must-read by any stretch of the imagination. However, if you’re having trouble generating ideas about how to make money with your web site, the work may be worth picking up. It has information on blogging, podcasting, and running membership sites. It also covers the basics of advertising and online revenue generation.
  • The Elements of User Experience - Excellent book and a must-read for every web designer out there. You need to be aware of the principles taught in this work. It’s very similar to Steve Krug’s book except that it focuses exclusively on the web. You’ll instinctively know when you need to rework designs if you read this book, plain and simple.
  • How to Start a Home-Based Web Design Business - I picked this book up on a whim because I am really interested in someday owning my own web development company. I thought this would be a good place to pick up some information that would help me prepare for the future. I can’t say I was disappointed, (I did read it cover to cover) but there were some things that the author didn’t cover in as much detail as I would have liked. For example, his section on finding jobs and clients was a little vague for me. I would have preferred a little more detail and instruction. I’d say you can probably find all the information contained in this book on various web development and design forums and websites. As such, I can’t really recommend this work.
  • The Weblog Handbook - I’m pretty sure I picked this one up in an airport bookstore because I thought it would make an interesting read. I wasn’t disappointed with the material, and the author did a great job of explaining blogging in terms that a non-technically savvy individual could understand. It was a little too basic for me, but I wasn’t really expecting a tough read. Good gift for your significant other or assorted loved ones to better understand why you write on a web site for all the world to see.
  • Beginning CSS - Cascading Style Sheets for Web Design - When I first started getting involved with web development and design, the arena was on the verge of a new day. Out went the font and color tags and in came CSS. I have used CSS for all my web development since the beginning, and this book is a big reason why. It is how I learned and I’ve used it as a reference several times since I initially put it down. This book is great for all beginners to web development and design. In addition, you people still using tables, but this book now.
  • Beginning PHP5, Apache, MySQL Web Development - This was the first programming book I ever picked up. I’m glad I did. It led to a wonderful transformation in my life and now I get paid to do something I would be doing anyways. It’s fun and all it takes is a little brainpower. Because of this book, I’m a pretty good PHP programmer and I have worked to build my skills ever since. If you’re a beginning PHP developer, this will be the only book you need for a while. I guarantee it.

Half Read

  • The Principles of Beautiful Web Design - Around the same time I started learning Drupal development, this book that I had ordered a while ago showed up. I’ve only gotten to read it about half way through, but it’s really good so far, I’d say. I appreciate the approach the book takes more than anything. At heart, I’m a developer who can’t really design, so this book will hopefully change that. I”m going to be designing a web site from scratch in the near future, so maybe this book from SitePoint will help.
  • Building Online Communities with Drupal, phpBB, and WordPress - This is another book provided by my employer to help me get up to speed on Drupal. Frankly, if you’re dealing with a 5.x build of Drupal, you should go with the Pro Drupal Development book listed earlier. However, if you really would like to know a bunch of stuff about three different open-source software platforms, I’d have to recommend this book to you.
  • Beginning .NET Game Programming in C# - I picked this book up on a whim one day because I was interested in creating games and thought the easiest language for implementation would be Microsoft’s C#. I haven’t gotten the chance to work through all the code in the book, but I’ve read a lot of it. It’s chock full of tutorials that really demonstrate the things that you’ll probably want to do if you’re programming a game. In the first chapter it’s already throwing out ways in which you can optimize your game code. I’d say it is a decent resource if you’re interested in doing exactly what the title says.
  • Beginning Game Programming - This is a good introduction to game programming as a whole. It covers a lot of the basics like drawing sprites on a screen, rendering a 3D mesh, using DirectX interfaces, and so on. I’d have to say the best part of this book is the exercises that are at the end of each chapter. I find this really helps me as I’m learning a new language or technology. I can’t say it’s something you absolutely must pick up, but it is worth a read.
  • Introduction to Game Development - I own this book because it is the textbook for my Computer Game Development class at Rose-Hulman. It is nowhere near half read because it is just plain huge. This is a standard sized technical college textbook chock full of information. If there is something you need to know the basics of how to do in game development, this book probably has information on it. I really recommend it as a good book because of the writing style and how knowledgeable the authors seem. All this, and it’s relatively cheap for a textbook. Pick it up if you’re interested in not only in programming games, but how to design and market them as well.
  • Blog Design Solutions - This book is decent. It has information on WordPress, Expression Engine, Movable Type, and TextPattern. I’ve never used anything other that WordPress for my blogs, and that is why this book is in the half-read section. The WordPress portion of the work is well-written and well-thought out, but I felt it was too basic for anyone having messed around with template tags after reading the WordPress codex. Pick it up if you’re going to be using all four CMS platforms, but leave it on the shelf otherwise.
  • Adobe Photoshop CS2: one-on-one - This book was a real eye opener for me as far as the power of Photoshop goes. I’ve always used it for the creation of web graphics and optimizing images for the web. Little did I realize that my visual optimizations were nowhere near the quality they could have been. After reading the first half of this book, I was suffering from a tad bit of information overload so I put it down. I haven’t picked it up since because I found I don’t use Adobe Photoshop that much compared to other tools and technologies.
  • The PHP Anthology: Object Oriented PHP Solutions - Volume 1 - I picked this book up because I wanted to become more well-versed in my understanding of PHP’s object model. About halfway into the book, however, I realized that I was just relearning all the same stuff that I had gotten from my fundamentals of software development class where the tool used was JAVA. It’s a good book for someone who has only ever done PHP before, but if you’ve worked in a stronger typed object-oriented language, I’d say leave this one on the shelf.
  • Professional PHP Programming - This book was another addition to my bookshelf in an attempt to upgrade my PHP skills. Unfortunately, I didn’t pay enough attention to detail and did not notice that this book was somewhat dated by the time I bought it. The best sections have to be the ones that deal with writing secure code, but other than that, the information and best practices portrayed in this work can be found elsewhere.
  • Software Engineering for Game Developers - The format of this book is great. The authors examine, in depth, a real game development project from start to finish and you’re invited to code along with them. However, the main focus of this work is definitely on engineering. How do you go about the process of game development? It’s definitely a good read when combined with the Introduction to Game Development mentioned earlier.

Not Read

  • Professional AJAX - I haven’t gotten the time to go through this one yet. One of the reasons is that most javascript libraries out there right now support some kind of AJAX calls within the framework. That means you don’t have to write your own AJAX code, and so I haven’t had the opportunity to do so yet. I do still mean to read this book, though, if only because of the quality of writing I’ve experienced in previous books by WROX publishing.
  • Game Art for Teens - I honestly cannot tell you why I bought this book. I was probably in the book store and wanted to buy something and this caught my eye. I have not had a chance to look it through even once since I bought it though.
  • DHTML and CSS for the World Wide Web - This is another book that’s fallen victim to the fact that javascript libraries make this stuff so easy that doing it yourself is almost pointless. Sure, I can write something that changes the margins on an item, creating the illusion of movement. Alternatively, I can just tell script.aculo.us to create a sweet new effect.
  • Adobe Illustrator Classroom in a Book - I want to learn this software package so bad, but my creative eye and overall design skills leave so much to be desired at this point that I just can’t bear looking at my own creations. So, this book sits sadly on the shelf, waiting for the day when I give in and test my mettle.
  • Beginning ASP.NET 2.0 with C# - This book is one that I bought recently and am going to work through as soon as I can. Unfortunately, going to school and working 35-40 hours a week doesn’t allow much time for learning. This will eventually get down, I just haven’t gotten a chance yet.

Loading Javascript Libraries in Wordpress Plugins with wp_enqueue_script()

Have a lot of Wordpress plugins? You may need server web hosting if you’ve got limited server space. Whether you use Outlook or Exchange 2007 for your email, you can get it hosted at an outside company so that you save room on your own server. Outsourcing Microsoft Exchange will definitely save you time, money and server
space.

In the process of modifying my Pre-Publish Reminders plugin for WordPress, I came upon an instance where I wanted to use a javascript library that is packaged with WordPress by default, but I couldn’t figure out how. However, after a little bit of frustration, followed by a little bit of detective work, I found an elegant solution included in the WordPress core.

First, let me share with you what doesn’t work. I originally had planned on placing things in the admin <head> section like so:

function nfoppr_add_js_libs() {
?>

}

Now, this approach didn’t work. The reason is that ABSPATH has to do with the file system and not the URL of the blog. So you end up with something like:

... src="./home/usr/nickohrn/wp-includes/js/prototype.js" ..

and this will not include your script. So, I had to find an alternative that would work. Searching through the function reference on WordPress I came across a note about the WP_Scripts object. This looked promising so I started to dig into the core WordPress files. I ended up finding the function wp_enqueue_scripts() within /wp-includes/script_loader.php which allows you to add a script to the <head> section of the page very easily. The function call looks like this:

wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false );

If WordPress recognizes the handle you provide, the library will be added for you. If it doesn’t support calling the library by handle (or the library is something custom you wrote) you’ll have to supply the path to the file as a second argument. The third argument lists any dependencies that the library you are loading may have (in the form of an array or false if there are no dependences). Finally, the fourth argument is the script version which, according to the documentation is primarily for cache busting.

To use the function, you’d do something like this:

function nfoppr_add_js_libs() {
//Add the Prototype framework to the header
wp_enqueue_script('prototype');
wp_enqueue_script('my_custom_prototype_extension', 'path/to/my/lib', array('prototype'));
}

//When you're in the admin menu, add the javascript libraries
add_action('admin_menu', 'nfoppr_add_js_libs');

As I couldn’t find a comprehensive listing of what library names you can call, I’ve decided to include one here. In the following table you can find the full name and handle for each library that is include by default. If applicable, I’ve included a link to the script homepage for each of the libraries that noted one within their source. There is a separate list of libraries that can be included if the logged in user is an administrator, but I’ve left those off the list for now.

Name Calling Name
Docking Boxes dbx
Fade Anything Technique fat
Simple AJAX Code-Kit sack
QuickTags quicktags
ColorPicker colorpicker
Tiny MCE tiny_mce
WordPress Tiny MCE wp_tiny_mce
Prototype Framework prototype
Autosave autosave
WordPress AJAX wp-ajax
List Manipulation listman
Scriptaculous Root scriptaculous-root
Scriptaculous Builder scriptaculous-builder
Scriptaculous Drag & Drop scriptaculous-dragdrop
Scriptaculous Effects scriptaculous-effects
Scriptaculous Slider scriptaculous-slider
Scriptaculous Controls scriptaculous-controls
Scriptaculous scriptaculous
Image Cropper cropper
jQuery jquery

So there you have it. I think this is a really elegant solution. Plus, it prevents you from loading the same javascript library multiple times if multiple plugins are using it. If you have any questions, feel free to ask me, and I’ll try to sort things out, or you can refer to the WordPress documentation (although it didn’t have much reference to this at all.)