RSS

Timani I

Open Source web blogging

Archive for February, 2010

 

Open Source PHP Project Management

Saturday, February 27th, 2010

When we were planning on setting up our project management solution we wanted to get something that would meet a number of criteria that we had.

(more…)

jQuery Google gMap Plugin

Thursday, February 25th, 2010

I think with the growing trend and movement towards geolocation based services, like on Twitter, and Foursquare google maps applications are going to need to be geolocation specific. What this means is that there may need to be some rewriting of some older maps or it could just be a chance to refactor and upgrade, at what would seem an ideal time considering some of the utilities and libraries available.

Now when you are looking for a plugin or functionality from a library your needs have grown or may be more specific. For example having the ability to dynamically populate and remove custom markers, or even for performing transitions on the map.

Welcome the gMaps plugin

Plugin Name: jQuery gMaps Plugin

Plugin URL: http://gmap.nurtext.de/

Demo: Plugin Demo

Docs: Plugin Documentation

When it comes to describing a plugin or platform, i find it is often best to give the official description before i give my evaluation. If you go over here you can see it is described as:

gMap is a lightweight jQuery plugin that helps you embed Google Maps into your website. With only 2 KB in size it is very flexible and highly customizable. – gmap.nurtext.de/

Sample Code

When looking at a plugin its always good to see what it takes to actually get it working? Do you need a PHD to go in and decipher it or do you simply need to make a easy call to a function and easily add parameters.

Lets take the code for the example below:

$("#gMap").gMap({ markers: [{ latitude: 47.660937,
longitude: 9.569803,
html: "Tettnang, Germany",
popup: true }] });

Verdict

Now if anyone has ever had to do this they will tell you that what ends up happening is one of two things.

  1. You find a js library to make this less painful
  2. You decide to venture on your own and write painful mix of code

The plugin is really sounds, and minus a sticky point or two is really a good option when comparing the available options.

Pros

  1. Lightweight and compact.
  2. Fast.
  3. Simple API interface.
  4. Easily add custom icons and markers.
  5. jQuery 1.4 compaitble.
  6. Developer is Google Map API 3 aware.

Cons

  1. Unfortunately for now it will only take longditute and latitude but i believe that the developers are working on this.

Summary

The fact that the documentaion is very thorough and has plenty of examples means that you can spend more time getting your application to do what you need it to do rather than trying to learn the intricacies of some confusing plugin.

It also solves the problem of having to write extremely blended code with the google maps jQuery API, and that is always a plus are more time can be spent on development.

The gMap plugin itself takes the list of available parameters as a JSON object and pass it into the gMap() function, which means you can put in fairly complex information in an easy-to-read and understand, structured format. This is also a bonus as as you get a very extensive list of parameters from the google maps API you can access. Add this to the fact that the developers seem to be keeping track of the Google Maps 3 status upgrading should be a fairly painless process one hopes.

Most importantly when you use this plugin in conjuction with a free service Geonames, you can start to see how you can have geo-specific content for your users. Overall though this was a pretty good showing and worth a try.

Further Reading (External Links)

  1. jQuery Google Maps Tutorial Basics
  2. Google Maps the jQuery Plugin Way
  3. jQuery and Google Maps
  4. jQuery GPS plugin
  5. jQuery and Google Maps Tutorial using ajax
ass a JSON object to the gMap() functiothn

jQuery Uniform plugin

Thursday, February 25th, 2010

With the advent of CSS3, HTML 5 and the power of the ever-growing jQuery the internet is turning out to be a more interesting place. Previously you were given fairly limited access to input form elements in terms of how you could style them. Of course you could always access the css style attributes, however, if you wanted to add a background images, or add some advanced look and feel without loads of code and hacking it was almost impossible.

To add to that the headache of even considering how long this would take to test cross-browser may not even be worth the effort in the end. But at least that has changed with a bit of extra magic.

A fresh look with the jQuery Uniform  plugin

The jQuery Uniform plugin that all changes how you can customize your UI now with the addition of richer styling for your form elements. Just taking a look at the example page you can see the pretty clear mix of the CSS3 formatting on the text-shadows, as well as the form elements rendered by the jQuery plugin. Just take a look at the screenshot below.

Plugin Name: jQuery Uniform Plugin

Plugin URL: http://pixelmatrixdesign.com/uniform/

Demo: Plugin Demo

Docs: Plugin Documentation

Sample Code

Getting into the source code and getting to testing the plugin is not too bad. It is a pretty clean function and the parameters are available are pretty extensive, but to transform every select or input that were a checkbox, this could be achieved with a singe line call of the uniform() function.

$("select, input:checkbox").uniform();

Verdict

The uniform plugin is very handy, especially when it comes to styling form elements that you may previously not have had access to. But despite this, there are some limitations that this plugin has the hold it back slightly, yet overall it is still pretty clear that this delivers.

Pros

  1. Fair size 34kb zipped.
  2. Allows for styling of range of elements: Selects (Drop downs), Checkboxes, Radio Buttons and File Upload Inputs.
  3. Cross Browser tested  -  Except for ie6.
  4. Simple to install and Use.
  5. Good Simple Documentation
  6. Themes samples available.

Cons

  1. No styling for text inputs – It would be great to see this for uniformity.

Summary

When creating a custom UI or just spicing up your forms, this is definitely a plugin worth using. Other than the minor fact that it does not do your text inputs as well is something that you can live without.

The availability of pre-made themes for you to try out and develop upon makes this the perfect plugin for designers who may have previously had to use something like flash or an intricate hack to get the effect they were looking for.

The ease to get through the documentation and installation also means that is should be fairly easy for anyone who is familiar with how to add a jQuery plugin will be able to install this and get going fast.

Site Security and file permissions matter

Wednesday, February 24th, 2010

The other day we were talking over a coffee about site security and was it really wise to trust plugins and without a second inspection, or a look at the code.

Now i am sure that many of us have gone and installed a plugin or two without actually looking at the code, but does it really mean we are at risk? I think the undeniable answer is yes, and this is for the very reason of the widespread, and almost unrestricted release of themes and plugins for WordPress. The allure of “free” themes and plugins often leaves the casual blogger or website developer at risk for being exposed by these various sites that offer “free themes”.

Background

I think the even though it is slightly dated many of the points in the post remain valid:

Do not download WordPress themes distributed by 3rd party sites5thirtyone.com

Even though the article is dated 2007 it still contains very valid points. I have worked in theme development many years for WordPress and when themes do not need any sort of encryption or otherwise to be functional.

A lot of the times this is the method that those who are trying to get access to your private data may choose to go.

There are a number or reasons why this method is pretty prevelent

  1. The code is often an encrypted string of data so filters for spam and malware may not immediately be able to detect them.
  2. The encoded strings are harder to trace than plain-text because a file-search or grep may not be able to parse the encoded script.
  3. To the unknowing eye an eval() of an encrypted script may seem no more harmful than any other PHP snippet in the code.

Scenario

This actually became an issue on a discussion on linkedIn where someone there was having a problem installing a theme. At first inspection he was getting this error:

Parse error: syntax error, unexpected ‘{‘ in /www/webroot/foo/wp-content/themes/Wood3/functions.php on line 149

Which is usually symptomatic of a couple of things:

  1. The theme author may have accidently added in an extra brace when the theme was released.
  2. The user had taken to the code and maybe deleted a line or added in.

Seeing as the theme was released i decided to go and download it and take a look and i opened the coded and perused to line 149 and found something slightly disturbing, here is a snippet.

eval(str_rot13('shapgvba purpx_sbbgre().....

I am not sure what it does in once evaluated and i shall not be trying to find out. I think it is good it broke before it executed because it could have done a number of malicious things, especially if it had been installed in production environment.

For example if you had an e-commerce site and you stored Credit card information on your server for some reason, it would be easy to grab any and all data.

Conclusion

I am sure there will be those that say this is true of any theme, but i usually look at the code of mine before installing. Perhaps it should be a more common practice, or for those who are not as well versed avoid less reputable sites for themes and plugins.

I think one of the easiest ways is to see what the various aspects of the themes are, such as links in the footer, or if you can take a look at the source code for anything that may seem suspicious.

Foursquare – geolocation + social network

Wednesday, February 24th, 2010

It seems that more and more as social networks evolve that there is a greater demand and influence on social currency as a means of stimilating user interaction and participation. That in combination with the fast growing trend of geolocation based services has led to some interesting mashups, but of interest today is the nifty Foursquare website that offers something for both users as clients and for business too. So lets get down to the basic questions so we know what is going on: who, what, where, when, how and why!

Who is Foursquare?

Well according to the about section of foursquare it seems that this was the idea of a couple of friends or developers who got together and decided to create a mashup application that would build on the last phase of social applications like Twitter, and Facebook. Digging slightly deeper we were able to find their Crunchbase profile and get the a better idea of who they are.

What is Foursquare?

We’ll help you meet up with your friends and let you earn points and unlock badges for
discovering new places, doing new things and meeting new people. – foursquare.com

The ultimate goal is to become a “Mayor” of you city, and along the way earn badges, find out what is happening in your city, and enjoy all the cool things that your friends in your various social circles are having fun with.

What makes this so dynamic is the “Real” real-time aspect of this application. Previously with twitter, you were merely able to just post a tweet from your phone with 140 characters of where you were or what you were doing. That was a limited amount of information and a lot of the impact could have been lost.

This isn’t the case with Foursquare as you can add extra information to the location such as a handy tip like a time of day for free coffee, promotions and other give-aways that may exist.. Thus, this way you can have a more involved experience, and make determinations and decisions about where to go, when, and what to do once you go there.

Why would anyone bother to do all this?

Well the concept of getting information out in real time is not new, as seen in the status messages on networks like facebook, myspace, and twitter, to activity feeds that stream real-time data about your social network. This really in the end bears no benefits in the long term other than knowing what people are randomly doing.

With foursquare you get the opportunity to earn great rewards from business who would like to have their places promoted more on the site. This ranges from a very long list of restaurants and bars to sound recording studios and retail stores. Some of the perks are:

  1. $1 macchiatos
  2. Free Slice & drink on your 10th checkin.
  3. Free Shot on your 10th check-in
  4. Free Auto-Tune Karaoke

Conclusion

The thing that makes foursquare so immediate is because it is so focused on real-time and you have the ability to check-in to various places to earn points from your phone or mobile device as well as your pc. It seems that there was clear planning and foresight as you can download a number of mobile platforms, like the iPhone app, the Android app, and the Blackberry app.

So as the service continues to rapidly grow you can be sure that you can expect the list of business that support, and list of offers to grow. Thus getting connected to foursquare may not be that bad of an idea.