WordPress Settings API Tutorial

Edit: This post has moved to here: http://ottopress.com/2009/wordpress-settings-api-tutorial/. Take your comments there.

When writing the Simple Facebook Connect plugin, I investigated how the Settings API worked. It’s relatively new to WordPress (introduced in version 2.7), and many things I read said that it was much easier to use.

It is much easier to use in that it makes things nice and secure almost automatically for you. No confusion about nonces or anything along those lines. However, it’s slightly more difficult to use in that there’s very little good documentation for it. Especially for the most common case: Making your own settings page.

So, here is my little documentation attempt.

Continue reading

Simple Facebook Connect

Working on a new WordPress plugin lately. It’s basically a simple and easy way to make Facebook Connect work with your WordPress based website.

More info about it here: Simple Facebook Connect.

Short list of current features:

  • Simple 2 step setup for Facebook Connect. Just create the App via Facebook and paste in the API key.
  • Share button, with meta support.
  • User status widget
  • Comment using Facebook Identity (alpha, not operational, for testing only, will be working soon).

Like most things I announce early, it’s not fully featured yet. I’m modifying and adding onto it as I go along, so expect a lot of updates to show up in the plugin list if you use it.

And if you have ideas for how to improve it, please email them to me. :)

How to find a backdoor in a hacked WordPress

Edit: This post has moved to here: http://ottopress.com/2009/hacked-wordpress-backdoors/. Take your comments there.

Over here, Jorge Escobar is writing about how he got hacked with the latest version of WordPress. After some minor back and forth on FriendFeed, I got him to do a search which found a malicious backdoor he might not otherwise have found.

In so doing, it occurred to me that most people don’t keep up with the world of WordPress in the way I do, and so have not seen nearly as many hack attempts. So I figured I’d post my little contribution, and show people how to find hidden backdoors when cleaning up their hacked sites.

Non-technical users can safely ignore this post. :)
Continue reading

Waze – Free iPhone Directions Application

Playing around this weekend, I discovered a neat and fun little app for the iPhone.

A lot of new apps have came out for the iPhone lately that are based around driving directions. TomTom came out with theirs for $100, and Navigon is another popular one that runs $90. But, if you want to try out something a little different, this one is free.

iPhone image

Waze is a free driving directions app, with a twist. Basically, the maps on it are “incomplete”. That is, they’ve got the map data, but like all maps, the data is inaccurate. So, to get the data to be better, they’re enlisting your help.

How do you help? Simple. You use the app in the car, then drive around. As you do so, the GPS will be reading your location and noting that there is indeed a street there. It makes it kinda fun to confirm streets in this way since a little Pac-Man like figure appears, eating dots on the map where you are driving, and giving you “points”. The points aren’t useful for much, except a ranking system with everybody else using the app, but it’s fun nevertheless.

So what else? Well, obviously it’ll do driving directions. However, when I tried it to get to my friend’s place at Cooper-Young fest this last weekend, it was laughably wrong. It suggested an 8 mile trek through ridiculous parts of town for no reason. I drove there the normal route instead, letting it complain that I was “off route” all the way and listening to the Waze-pacman gathering up the points as he munched his way down the road. However, something odd happened then. On the way back, when I turned it on, it knew that route. Investigating today, I’ve found that it really doesn’t like to route people on routes that haven’t been “confirmed” yet very much. So, since I’d confirmed that route already, it picked it for my way home.

But there’s a bonus to all that. By confirming the route, it’s getting more than street maps. It’s also getting average speeds. So it can use that information to give optimal routes, knowing how fast each street tends to be.

iPhone Event Reporting

You can even more than that though. Along the way, you can report events too.

An event is like an auto accident, or a speed trap. Whenever you see one of these, you can touch the report button and report one quickly. If you’re totally stopped in traffic, then you can also type in a short message (it won’t let you do that while moving), and the message will instantly be sent, where other drivers (and their iPhone’s) can see it. Those drivers will then get routed a different way, possibly saving them some time.

Or, even better, somebody else reports a problem, and you get to save some time.

Downsides to the app: Battery life. Like any other GPS app, it sucks the battery right down. You’ll need a car charger to run the thing. Probably a quality iPhone mount too. It does do landscape mode as well, and hidden down in the options is a “3D mode”, which makes the map lay back and look like the more expensive iPhone driving apps, if you prefer that sort of thing. The 2D map is easier to read, to me.

From what I’m reading, Waze has only been around a month or so, and not many people are using it. As far as I can tell, almost nobody in Memphis is using it, since almost all the roads are unconfirmed. But it would be pretty neat if everybody driving around was sharing data like this, what with Memphis traffic being what it is. I sure wouldn’t mind getting routed around half the crap I see on the streets around here.

If you’ve wanted to try out a driving directions app without spending $100 or so, then you cannot beat free. So I highly recommend it. I’m using it all the time now.

Google Maps traffic… it needs work.

I always wondered how Google Maps knew traffic conditions. Today, there’s a blog post where they explain it a bit better.

That ain't on an iPhone...

That ain't on an iPhone...

Basically, they simply have all the phones running Google Maps with GPS send back data as to a) where they are and b) how fast they’re moving. Both of which GPS gives you more or less by default.

It’s a clever idea, and I like it, but it fails in a couple of major ways, IMO.

Firstly, when I use Google Maps on my phone, I tend to not leave it open. Google Maps is fine, but it’s not a very good navigation system. It’s just a map. A real navigation app is worlds better. I recently got Navigon Mobile Navigator on the new iPhone, and it’s pretty slick. Thinking about a dashboard mount for it now, actually.

Secondly, this system relies on a lot of people having Google Maps open and running and sending back data. If nobody with Google Maps running has been on your street recently, you get no information.

What Google really needs to do is to open it up as an API. Let other navigation system manufacturers both send and receive traffic data from the Google Maps system. It doesn’t have to be complex.

Any good navigation app knows your location and speed, so a simple way to send that info could be made easily enough. The problem, of course, is allowing third parties to use the data.

Google Maps works in layers of images, which is one of its major shortcomings, IMO. The street views are images. The terrain are images. Just big sets of tiles that get displayed next to each other. And I’m almost certain that this traffic thing is just another set of images they’re generating or updating. For navigation providers that use 3d views and such, they don’t need that stuff in the form of images, they need it in the form of data. What streets are busy? How can that information be used to improve the navigation? Etc.

Google is generally pretty good at opening up their APIs to third parties. However, they’re generally not good at providing data in different forms. Most of their APIs are “this is what we use, if you need something else we don’t have it” sort of thing. Hopefully, the Google Maps team will see the light here and realize that to get good data, you have to give good data, and start pushing in that direction. Because open traffic data would be pretty cool for everybody.