WordPress Members Plugin – Allow access to widgets

For a project, I needed to enable a specific role to have access to widgets but not the rest of the admin area. There doesn’t appear to be a specific permission for this so with the help of the good people at WP Australia, I gave it a red hot go.

//include in your functions.php file
//create a 'publisher' role to test this with
function custom_admin_menu() {

	global $pagenow;

	$user = new WP_User(get_current_user_id());

	if (!empty( $user->roles) && is_array($user->roles)) {
			foreach ($user->roles as $role)
			$role = $role;
	}

	if($role == publisher') {
		remove_submenu_page( 'themes.php’, 'themes.php’ );
		remove_submenu_page( 'themes.php’, 'nav-menus.php’ );

			if ($pagenow == 'themes.php’ || $pagenow == 'nav-menus.php’) {
				wp_redirect( 'index.php?cheeky_notice=1' ); exit;
			}
		}
}

add_action('admin_menu’, 'custom_admin_menu’);

function cheeky_publisher_admin_notice() {
	global $pagenow;
	if ('index.php’ === $pagenow && ! empty($_GET['cheeky_notice']))
		{echo 'You cant access themes or nav menus.';
	}
}

add_action('admin_notices’, 'cheeky_publisher_admin_notice’);

Virtual hosts on XAMPP OSX

I was running into a bit of trouble setting this up as most blogs’ purported solutions didnt work for me.

This is how I do it:

1. Edit the httpd.conf file. (located: /Applications/XAMPP/etc/httpd.conf). Uncomment this line: Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf

2. Edit the httpd-vhosts.conf file. (located: /Applications/XAMPP/etc/extra) Here is what mine looks like:

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerName localhost

#
# My example for the yourlocalsite domain
#
ServerAdmin webmaster@yourlocalsite.com
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/yourlocalsite"
ServerName yourlocalsite.local
ServerAlias www.yourlocalsite.local
ErrorLog "logs/yourlocalsite.local-error_log"
CustomLog "logs/yourlocalsite.local.com-access_log" common

3. Edit the hosts file :

sudo nano /etc/hosts

Add the following entry:

127.0.0.1 yourlocalsite.local 

ctrl+o  to save, enter, then ctrl+x

4. Restart Apache, flush the cash from Terminal (dscacheutil -flushcache) and away you go.

The Rollover, a Gallery Usability Issue?

Now I am a huge fan of Amazon and am always buying stuff from them. They are also not the only offender of what I consider to be a usability issue…

A short time ago, I was trying to watch the Kindle video and (while it was playing) look at other parts of the page. However, anytime I moused over any image in the gallery, the video would stop and the image I had moused over would load up. This was quite frustrating as upon going back to the video tile and re-starting it, I would have to wait for it to buffer again.

While this may seem trivial, I believe that details matter in design and usability. I am a huge fan of loading images for display on roll over, but shouldn’t this functionality be temporarily disabled whilst a video is playing? (Hmmm… Maybe that then breaks another rule…)

Emails and unsubscribing

Working in the digital space you tend to receive a lot of emails from various companies that you have done business with etc. There are many facets to a good email and the functionalities that go with it. This article deals with one critical function that two companies have implemented very differently: the unsubscribe…

Adobe:

I received an email from Adobe about some other product that they were releasing, but having received enough emails about a product I wasn’t going to use, I wanted to adjust my email preferences. Clicking the unsubscribe link took me to this screen:

The page itself looked like it hadn’t been updated in quite some time and didn’t have a whole lot of options for what to do once there. I would have gladly answered a few questions about why I was unsubscribing etc. Also I didn’t necessarily want the nuclear option of unsubscribing from everything but as I was doing an email list cull, I decided to push the big red button.

NFL.com:

Now I was receiving a lot of email from NFL.com as well. Being that it was in the off season I didn’t really want to be getting emails from them anymore so I clicked the unsubscribe button which took me to this page:

 

Get out of my head NFL.com! The top option is exactly what I wanted! Now I could ‘unsubscribe temporarily’ but still be on the list for next year/future emails. Adobe on the other hand, really missed an opportunity by not letting me adjust my preferences or ‘temporarily suspend’ emails. By doing so, they may have lost out on future business or other communication opportunities on events etc to a customer. *

* This is probably unlikely though as I use a lot of their products daily and generally am on top of what they are doing in the Digital space. Had it been another company that I am not ‘following’, it would have been a bigger missed opportunity.

The lesson stands: Details matter. Don’t ignore an opportunity by dismissing the unsubscribe functionality of your email platform.

Dreams – Link Up

This feels a little strange to be writing something personal on my blog as most of the topics are nerdy in nature but a few really good friends of mine and the most beautiful woman in the world are participating in a link up with the topic of “dreams”. Here is my entry:

When I think of the topic ‘Dreams’, I think of my first backpacking trip down under. There isnt any single thing I have done in my life that has changed me more as a person than traveling to oz and aotearoa almost 8 years ago did. Up to that point, the only foreign country I had been to was Canada. I had not truly seen the US from outside of its borders. The different news stations, accents, and points of view really challenged everything I had known up to that point in my life. I grew, changed, and matured (?), becoming a ‘citizen of the world’ instead of from one nation.

Having the luxury of graduating from college without loans afforded me the opportunity to essentially have an open ended ticket. (Well I pushed out my return date 3x whilst away.) I was able to travel by myself, with some really good friends from back home, and with new friends that I had met while on the road. I hiked through beautiful national parks, hitchhiked across the south island, bartended in Queenstown, flung myself out of a plane, and worked on a 20,000 hectare farm amongst hundreds of other experiences. (Including the infamous ‘A Spiders Tale‘)

At the heart of all these experiences was the places I would stay: hostels. I had the good fortune to stay at many different places: some good, some bad, and some down right amazing. Hanging out at these little houses away from home gave me a chance to sit back and look at what was occurring in these little slices of heaven along the road. People from all over the world, chatting, laughing, hanging out and having a good time. It didn’t matter where you were from, what you did or who you were in your home country…

Staying in hostels awoke in me a desire to share this experience with others by hopefully one day owning my own hostel. I think it would be so amazing to host guests for a few days or weeks while they are having adventures of their own and share in their experiences. The owners at a few hostels really made the difference between a good stay and a great one by sharing experiences of their lives thus far, the fun times they have had at their hostels etc.

When I picture the place I would want to own, images of what I WOULDN’T want stand out such as a sleek/polished establishment with a thumping club that is raging every night. Instead I see it as an un-assuming, laid back pad, with a bbq, deck, and nice cafe/lounge area. I would hope it is a place (and in a nice spot) where people would want to stick around for awhile  as those ones are the few which I have best memories at.

Change of Direction Part 2

In my previous post I spoke about how I was changing directions on this blog and in my career. I wanted to speak to each of the main areas that my career as a ‘Flash’ dev introduced me to. (The quotes are to denote that whilst my primary language was Flash/AS3, I did other dev work as well.)

Web Analytics – The interest in this area began when we custom built a method for split testing a fully flash with Site Catalyst. After this was built, we would run bi-weekly split tests to see which features would convert better. (Just a/b testing, no multi-variate yet) This lead me into research on site optimisation, a/b split testing methodologies, and user centric design. (In fact my wedding website was coded up with so much Google Analytics code that if you so much as sneezed on it, I would know) ;) Currently I am reading through Avinish’s book, working on GA certification, responsible for any SiteCatalyst tracking we do at work, and monitoring/testing my business & clients websites.

Javascript – As I stated earlier, my initial attraction to Flash was derived from the ability to animate with code. Well the same goes for Javascript and in particular, jQuery. It allows you to do things that were previously only possible with Flash. (Smooth transitions, ajax calls etc) Of course jQuery can do much more than animations (and I will soon be switching to Greensock v12 for any JS animations) but thats what initially piqued my interest. Add to that all the other cool js libraries and you have a very exciting time to be a developer.

Design Patterns in Programming – We had the good fortune to have David visit the team and do a training class on design patterns/tdd etc. All of this was in PHP as we were migrating to that at the time but the same patterns can be applied across (most) languages. I was able to take quite a few learnings from this class (Factory, Singleton, etc), do more research, and apply them to some large Flash/PHP projects. Once you know the patterns and what problems they are meant to solve, the rest is just syntax.

Usability – I dont want to argue over the various definitions and buzzwords that people use for this facet of our industry but just say that while working as a Flash developer I got to work very closely with a usability expert. Nicole helped me to FOCUS on usability in the things I designed and developed. Flash offered a unique way to present content and solve interesting usability problems that at the time, were not easily applied when using js/css. Through my experience working with her, further study, and reading I notice and can explain when things just don’t look/function as they should. As a side note, I get such a kick out of the fact that the book I read in college ‘Dont Make me Think‘, still applies today. (Although perhaps its sad that so many sites STILL need help?)

PHP – I first cut my teeth on development using vb.net and shortly after moved on to C#. I have even done development on the Lotus Notes Application stack (formula language, lotus script etc) and a ton of SQL query writing. Of all the languages I have used, my personal preference is PHP for web development.* One of the reasons I like the language is just the simplicity of being able to type into a code editor and have it run without needing to compile. (Strange for a guy coming from Flash?) :)  I also love that you can grow with the language; you dont need to start out having mastered runtimes, know the intricacies of IIS etc. As you learn design patterns you can apply them where they fit and know that not everything needs to be object orientated code. I also am a huge proponent of open source. While Flash wasn’t open source (another conversation I dont want to have), the community was very with their knowledge, frameworks, and code. This is quite similar to what I have found in PHP land.** With frameworks like Code Igniter, Cake PHP, etc there are lots of resources to help people learn and grow. I am also getting back into WordPress development and have been loving what I have found under the hood of that quite capable CMS system. It makes me excited to want to start on some website ideas I have been sitting on…

SCRUM – My project management class in college was all about doing a massive requirements gathering effort, building this huge timeline, identifying the ‘critical path’, and all sorts of other dated techniques. While I earned good grades in the class, the idea that software projects could be managed in a rigid system like that didn’t make sense. (The project success rate should have tipped me off…) When I was introduced to SCRUM a few years ago, thats when I knew that I had found what I was looking for in a PM methodology. Write requirements in a way that makes sense to everyone on the project (user stories), break work down into manageable chunks (sprints), and have regular checkins to track progress (sprint planning meetings). (Perhaps a horrible way to summarise but hopefully you get the point.)

Last but not least: Management/Leadership. (But that is another blog post) :)

These are just some of the things I was introduced to over the course of the past few years of my career. There are many others such as all the sweet CSS frameworks that are coming out but for me the highlights are listed above. Now that I have these two posts out of the way, look for more posts on the topics covered and hopefully we can both learn from them.

 

* Working with some fantastic .NET devs makes me wish I had spent more time learning C# as well. The language and asp.net platform itself have some awesome stuff such as LINQ, Razor, the new testing frameworks coming out to name a few. Not to mention I could somehow be related to Scott Guthrie. :)
** I know the .NET community is very friendly with code as well. I just have had more exposure to PHP…

Change of Direction Part 1

Let me start off by saying that this post is overdue by a few years as I have been doing development outside of Flash as well as other Digital activities for a few years now but felt the need to write about my experiences gained over my short time working with it. Maybe this is due to people looking at me like I have lost a loved one when I mention I have done lots of Flash development or just a time to look back at my career as a dev up to this point…

Anyway, as you can tell from the lack of posts and the subject matter of those that do get posted, I have been gradually moving away from specific Flash development. This marks a shift in my career as well as a shift in this blog to begin covering many of the topics that being a Flash developer has given me exposure to. This change is occurring for many reasons that have been written about at great lengths all over the web but I just wanted to share my two cents. First a brief history of my Flash development background.

I was introduced to Flash while working in my first job as a dev for a small Microsoft consultancy. The ‘project’ was to create a logo that had a gradient slide past in the background so it looked like it was ‘shiney’. (Hey it was 2005) Fast forward to 2008 and I was one of two developers working on a team whose job was to make a splash in the NGO space with a fully Flash homepage chock full of pictures, videos, and features. My dev skills in Flash took off like a rocket as I was constantly being pushed and the team was full of high caliber people. Now, the main reason I was interested in Flash was that I had always wished I could draw, but was never very good. Flash allowed me to animate with code, logic, math; things I understood and am good at.

Unfortunately I didn’t get pushed into techs outside of Flash for those few years so as the saying goes, Flash became my hammer and everything I saw was a nail. I got comfortable in it and didnt really want to expand on my css/html skills (and at the time, didn’t have to). However this didn’t last forever and during this time I was introduced to a few other cool techs/schools of thought:

  • Web Analytics
  • jQuery
  • Programming Design Patterns
  • The concept of ‘web usability’
  • PHP/MYSQL. (As we were using PHP web services and ZendAMF for communicating with the homepage CMS.)
  • SCRUM

My skills in Flash was one of the main reasons I was hired to move down to Melbourne; a move that I have loved! I dont consider it a ‘waste of time’ or regret any of it. It exposed me to many things (others beyond what was listed above) that will probably be the focus of my career for the next few years.

I guess the point of this blog post is essentially to mark a ‘major life event’ and perhaps it wasn’t necessary for you to read but I needed to write it. In the future expect more posts on web analytics, usability, and php/javascript development. I am sure there will still be the odd Flash post (especially in the realm of AIR) as I really do enjoy firing it up and animating an app or a game but I wont be strictly focused on Flash moving forward. My current path is to move more into project management/team leadership, site optimisation, and then I am hoping to eventually become a web analytics ninja… more on that to come. ;)

Details – Choosing the right element

Perhaps this shouldn’t be a blog post but rather an obligatory flame tweet about the injustice/mistreatment of the checkbox element. However, this really bothered me as it is such a silly mistake to make. (And on the home page no less?!)

I had the pleasure to work for a designer that was very much an artist. Pixels mattered. Details mattered. And for the love of the internetz, picking the right elements matter!

@TPG - Why do you have a checkbox when you can only select one option? I believe that his cousin the radio-button would be much more up to the task as he is more selective (#dadJoke) in the options you can pick.  (Yes the checkbox here only lets you pick one but its the thought that counts.)

FULL DISCLOSURE – TPG’s internet service is constantly going out on me, so this is probably a little over the top criticism of their ui choice.

Down Under Tips for Expats

Here is a short list of things that might be helpful to those who have moved or are going to move to AU/NZ. As I think of more I will add them…

Sports:

Lets face it, the only sport that you will miss while being overseas is the NFL. (Unless you become a rugby fan like myself.) If you are really craving the sport, the best thing in the world is nfl.com/gamepass. About $100 gets you a full season and you can watch any game live or on demand on a variety of devices. And you get “The Red Zone”!

I think when/if we move back to the states I will get a foxy proxy server (listed below) outside the US as it is cheaper than getting the sports package in the states!

TV:

The best (arguably legitimate?) way to get access to all of your shows in the US is to get the Firefox plugin, Foxy Proxy with a US server. This will let you have access to Hulu and all the other networks that only stream content to users in the US.

Foxtel (Australia)

Now unfortunately you have to get an australian xbox AND an australian xbox live account in order for this to work but this gets you access to foxtel for quite cheap ($20/month). I highly recommend the sports package (for an extra $10/month) so that you can be clued in to sport for the water cooler conversations.

Staying in Contact:

Whats App – This is a cross platform messaging application that will allow you to message your friends all over the world for FREE.

Google Voice – Get a US number and you can text anyone in the US from your Android phone whilst abroad.

Buying shoes:

The first time I went to buy shoes in a store here in Australia, I nearly had a heart attack. (250 for a pair of runners.) Enter eastbay. It is well worth the $20 or so you need to pay to get the shoes shipped down here. Pro Tip: Go into a store, try on a few pairs and write down which ones they are to order them later. The guy helping me out at a shoe store did this for me as he was well aware the prices are insane and doesn’t get paid on commission…

More to come…
As I stated above, I will probably be adding more to this post as I think of things but wanted to get it out there. So comment/subscribe below to stay informed of updates.

Lotus Notes Errors

For better or for worse I have had to use Lotus Notes 6.5 for email, calendaring etc. I thought it would be fun to post pictures of some of the wonderful error messages I have seen. (I only started this collection about 6 months ago so I have probably missed out on some doozies.)

In no particular order:

Trying to quit Notes

If you lose network connectivity:

Notes and WinXP:

 

I am sure there are many more out there so if you have any good ones, feel free to post in the comments.

 

NB: version 8.5 is not actually that bad and behaves/looks quite nicely…