404 Issues with WP Rewrite

The last couple days I’ve struggled with adding custom rewrite rules to WordPress so that a user can edit settings for their account on the front end. The code and methods are straight forward enough and can be found on the codex page. But I was running into an issue where when I went to the edit page and passed a custom parameter it would throw a 404 error. I dug through all the filters I could find having to do with query vars and every time I output the query vars I would see page_id=0 which was causing the 404. I could figure out why that variable was being set to 0. After hours of digging I was finally looking through the source of the WP class and found it calling a function called get_page_by_path on the codex page I noticed that when it was called for a sub page the value would be passed in like so:

The issue was that I was passing just the sub page page name in with my request.

A simple change in the regular expression, to include the whole path, was all that was needed to get the correct page and stop the 404.

People never realize just how important a dog is until it’s too late. In life we get yelled at and cursed and kicked around, but when we’re gone, people wish they had us back.Hank the Cowdog

Detect Timthumb

There was recently a scare over a zero day vulnerability it timthumb timthumb pushed a fix out right away. I’ve seen people posting saying they didn’t know where to look for timthumb.php or if their themes used it so I threw together a quick plugin to find references to timthumb in your WordPress install.

The Detect Plugin page will be blank if timthumb is not detected anywhere in your themes or plugins.

Download: detect-timthumb

You are not running out of time

These questions are also why comparisons don’t really make any sense. Julius Caesar was weeping for all the wrong reasons. Alexander and he had different visions, they were looking to build different things in different times. Similarly, it was meaningless for my 17-year-old self to measure myself against a very different person’s desires at a completely different time and place. In doing so, I was denying my own dreams, and trying to live someone else’s – and that too, dreams I imagined that person to have, without knowing what their dreams really were. Maybe all Bill Gates was trying to do at 17 was impress his high school crush. Maybe Alexander was trying to live up to the dreams of his father. The reality is that nobody will ever know!
via You are not running out of time – Rahul Bijlani


Sugar was a 1 ½ year-old boxer pit bull mix. I found her while taking my neighbors on a tour of the shelter. She had a litter of two-day-old puppies with her in the kennel. She’d had them in the shelter right before I picked her up.

It took a little convincing, but Kelly said we could bring them home. Sugar was an excellent mamma. We had to lure her out of the shelter with one of her puppies because she wouldn’t go anywhere until she was sure they were with her. When we got her home and were getting everything situated she crawled into the puppies box and laid right on top of them; because she was nervous about the other dogs being near them. For the first week we could barely get her away from her puppies long enough to go to the bathroom. She would go out and do her business then rush back to her puppies.

Once we had moved her puppies her personality started to show through a lot more. She would snuggle on the couch with Ireland, the little girl who Kelly babysits. She would also get really excited for our morning walks. She would run around the front room, jump into the air, spin in circles and bounce in and out of play bows.

CAWS took Sugar in after we moved her puppies, and she was adopted by a nice young couple. She seemed very happy the last time we saw her.

The Puppies

Sugar’s puppies were the hardest group of puppies we’ve done so far. I attribute the difficulty to the fact that we took them during the winter, and weren’t well equipped to do so. When we took on Mia’s puppies it was the middle of the summer, so we were able to keep them outside most of the time. We weren’t quite so lucky with this group since we got them at the beginning of December. They stayed in a crate at the foot of our bed until they were big enough to walk around. Once they reached that point we moved them to a fenced in area in the laundry room.

Things didn’t get too bad until they were about 8-weeks-old then things started getting out of hand. They made such a mess of their run that it had to be cleaned everyday if not twice daily, and that didn’t even take care of the smell. It was extremely hard to keep them clean as well. We would take them out clean the cage, and give them baths, but as soon as we put them back they would poop everywhere and get it all over themselves. They also couldn’t go outside without freezing, so they ended up with a lot of pent-up energy. Any time you would walk by they would cry and jump up on the fence.

We were finally able to move them to Furburbia which was better equipped to handle them once they were 12-weeks-old. They still managed to make a good sized mess once there though. We drove them up to Furburbia, and right as we got there one of them puked all over in their crate. We took them in and bathed them, and as soon as they were clean and in the kennels they pooped everywhere, and got it all over themselves. We ended up bathing them twice.

I’m sure they’ve since been adopted, but we couldn’t keep a very close watch on them.

Hack Utah

In the last week I’ve become very interested in how much a group of hackers could change the landscape of an area just by providing apps that open up data resources and make them easier to access and use. I initially got the idea from @onyxfish‘s Hack Tyler project.

However, what I’m most interested in focusing on is how I can improve the things I don’t like, either through application of will or technology or both:

  • Tyler has a reasonably extensive bus system, but its online schedule is only available as a PDF. (You can probably already see where this is going, right?)
  • The local newspaper, The Tyler Morning Telegraph circulates to nearly a third of the city’s population according to the Access Bureau of Circulations, but I could find virtually no information about the politics of local government online.
  • Smith County’s only method of finding a polling place online is with a clumsy map viewing application.
  • The city and county both make significant amounts of data available online (surprising given their small size), but no one seems to have done any analysis of it (disappointing since the town has four colleges).

The list goes on. Tyler has information that could be freed. Tyler has government that could be opened. Tyler has news that could be hacked. Moreover, Tyler has an almost completely unexploited market. There are no hackers there. The small number of high-tech businesses that exist in the region are either web development shops serving local businesses or robotics companies.

The thing I’m currently most interested in is archiving and cross referencing things like City/County/State Code. I’m sure the reason for this is because I’ve recently been looking into Provo City’s dog code, and wanted to look at the minutes that applied to a certain section. The only minutes available online were those for 2010 and 2011 so I called the city recorder and requested the minutes I needed. When on the phone with her I got the impression that she knew exactly what files I needed and would email them to me that day, but it has now been two weeks and I still haven’t heard anything. I find it strange that it’s strange that public information like that is so hard to get ahold of which is one of the problems I’d like to solve.

On top of that there seems to be plenty of information available. Provo has a lot of things like video and gis data available online, and the state of Utah seems to have quite a bit available too; as does Salt Lake City I’m sure. I hope to compile lists of these data sources at hackutah.com

The Washington Animal Rescue League

[youtube]http://www.youtube.com/watch?v=jZFuBQ99MLE[/youtube]I’ve had this sitting in my drafts for a while now. It would be great if we could get more shelters running like this. In Utah we are lucky enough have No More Homeless Pets which provides spay/neuter, vaccinations and many other veterinary services at reduced prices, but I’d really like to see more shelters move towards this standard.