Introducing WP Basis

Back in April I spoke at WordCamp Sheffield about Creating a Better WordPress Admin for Clients. The talk was mainly about customising the dashboard to make the experience better for clients, when editing and adding content. Since then I have managed to put into practice much of what I spoke about in to a new WordPress plugin – WP Basis.

WP Basis is a WordPress utility plugin that makes a number of changes to the WordPress dashboard (for your clients only) as well as providing a number of functions available for you to use when developing themes.

I thought the best way to break down what the plugin does was to put the main functions below and provide a link to the Github repository so that people can take a look at the plugin code itself.

WordPress Admin/Dashboard Modifications

As I have spoken about at WordCamps the WordPress dashboard can be a very complex environment for non-WordPress professionals. The WP Basis plugin attempts to simplify the admin screens for clients only, whilst keep the admin the same for experienced WordPress users.

The plugin adds a checkbox on the users profile page where the user can set themselves as a WP Basis Super User. This means the changes the plugin makes to the dashboard are not applied to these users. None WP Basis Super users get a simplified dashboard in the following ways:

  • Removal of a number of the WordPress menus to prevent clients from clicking or setting things that will effect the site. The Settings, Tools, Dashboard Page (see below), Plugins and Comments menus are removed.
  • Removal of some of the WordPress post meta boxes to clean up the post editing screen and prevent clients from adding meta boxes that could cause problems in the theme/site setup
  • Addition of a Site Options menu at the bottom of the admin menus. This site options page contains social media links, contact email for use on the site, telephone number of a WYSIWYG box to add footer content.

WordPress Custom Meta Boxes Framework

Included in the plugin is the Human Made WordPress Custom Meta Boxes plugin which allows developers to easily add custom meta boxes to the post editing screens in order to make adding custom fields much more user friendly.

Counter Functions

Styling posts can be made much easier with counter functions such as adding a “last class” CSS class to the last post within the WordPress loop. It also adds additional counting classes to widgets as well as WordPress menus.

Customised Dashboard Home Page

When a normal WordPress user logs in the plugin changes the admin landing page to include a more customised one. This is a great place for adding help, and additional adverts for your companies services. This page is split into tabs initially with just a welcome tab but the plugin is built (in many places) to be extensible and therefore you can easily add additional tabs to this screen using the filters and hooks available.

Post Type Descriptions

Having seen and used the excellent Post Type Descriptions Plugin from @stomptheweb I decided that it would be a good idea to include this in the plugin. It adds a description box to each post type which can then be outputted on the post type archive page.

Template Tags to Use in Your Themes

The plugin tries to give you the availability of a number of WordPress template tags which you can use in your sites themes and plugins. A few examples of the options are below:

  • wpbasis_content_nav() – this show the next and previous post links in a numbered format rather than just next/previous.
  • wpbasis_featured_img_url() – gets the post thumbnail or featured image url for a given featured image size.
  • wpbasis_get_blog_permalink() – return the page ID of at the page used for the sites blog posts or false it no page is being used.
  • wpbasis_get_current_url() – return the URL from the address bar of the current page
  • wpbasis_var_dump() – a more formatted version of the php var_dump() function

Amended Updating Capabilities

User which are not WP Basis super users have the capabilities for updating and adding plugins to WordPress removed, even if they are an administrator. This means that your clients cannot update WordPress with the potential to break something.

There are other things in the plugin but above is just a flavour of what the plugin does. Most of all I have tried to make this plugin as extensible as possible, outputting content using apply_filters to allow other plugins to change this content as well as allowing other plugins to add various content in places such as adding tabs to the dashboard screen or removing additional meta boxes using a filter.

The plugin is in the early stages and will no doubt evolve a lot more from here but any feedback is welcome. You can follow the evolution of the WP Basis plugin on Github. I am going to be making a beta release in the next week or so as there are only a few issues to fix. Watch this space!

Update – the plugin is not live on the WordPress plugin repository – http://wordpress.org/plugins/wpbasis/

WordCamp Bournemouth 2014 Talk Proposal

Today I submitted my talk proposal for WordCamp Bournemouth 2014. I have titled the proposed talk as “From Local to Staging to Live Using Version Control and Deployment”. I intend to present my development environment and how I develop sites on my local machine first, all the way through to how the site ends up live. Below are some of the things I will touch on:

  • Setting up a local development environment using MAMP
  • Using Github to store your code and provide version control for your project
  • Tips and tricks for using Github with WordPress
  • Making the most of a staging environment, where to host this and when to use it
  • Integrating a deployment system so you can push versions of your project from your Git repository to staging or live sites.

This talk was something that I suggested back in 2013 at WordCamp Lancaster in the hope that someone would be able to present on this, as back then I didn’t have a clue. Thankfully Rob Miller delivered the talk, but as luck would have it I was busy being a site doctor in the other track!

Having spent the last 12 months learning about the best way forward here, I intend to share some of the things that I have learnt.

Allow WordPress Editors Access to Widgets & Menus

This is something that I have been pondering for a while now and that is how to allow WordPress users that are the editor role to be able to manage widgets and menus. Sometimes although you don’t want these users to have admin rights on the site they may need to edit the sites widgets and menus. Having watched Andrew Nacin’s talk on WordPress.tv titled “Current User Can Watch This Talk” he gave an excellent example of a really easy way to do this. Just pop the code below into your themes functions.php file or better still into a plugin.

WordCamp Sheffield 2014

Last weekend was WordCamp Sheffield, a special WordCamp for many reasons if not just for the fact that is was the first WordCamp of the year in the UK. It was also a little different for me as I was speaking for the first time on a topic which I have worked on for a while, customising the WordPress admin screens.

The journey over to Sheffield was a good one and was much quicker than I thought. It really is all that far away! Driving over Snake Pass in the Fog was fantastic, if a little scary at some places, but dropping down the valley at the other side gave some tremendous views.

Arriving just before 0900 at the venue (Mappin Hall) which was part of the University I grabbed a coffee before registration. Lanyards and T-Shirts were given out. The WordCamp Sheffield T-Shirt was a lovely design incorporating a map of Sheffield and the WordPress logo of course. White and blue T-Shirts were seen worn and it turns out that the white T-Shirts were for attendees and the blue for speakers – I got the wrong one, but to be honest I haven’t got many white T-Shirts so I was not too disappointed!

Then started the range of different speakers throughout the day. With two tracks in a large hall and smaller lecture theatre there was plenty to choose from. I started out in the lecture theatre.

Dependancy Management with Composer and WordPress – Tom J Nowell

Tom gave an interesting talk about code dependancies. The overview being that many of the frameworks used in WordPress development end up loading a lot of code that is never actually used – something I have agreed with for a while.

Tom suggested using a code dependancy tool named composer. This is something which I would like to look into in the future and it sounds promising, if not a little complicated.

APIness – Robert O’Rourke

The second talk, again on the developer track in the lecture theatre was all about utilising WordPress’ APIs. Recently I have worked on a number of sites where this has needed to be done and therefore I was interested to see what tips and ticks Robert had to share.

The talk concentrated on the WordPress HTTP API which I was pleased about as I have used this and wanted to check that I was using it in the right way. I am happy to say that I am.

Robert did give a great tip in that if you are using the wp_oembed_get() function in WordPress you need to cache the results as WordPress does not do this for you like it does with oEmbed items in the post content. I will be implementing this fix to one of the sites I was using this on soon.

The Challenges of Running a Multi-Author Blog – Samantha Deakin

Samantha introduced some top tips that she had learned about getting authors on her award winning blog to contribute including having it in their contract that they must contribute to the site at least once a week.

Samantha also outlined some of the useful plugins she had used on the blog over the years, which are outlined in the slides (link below).

View the Slides

Wow Plugins, Awesome Plugins for Your Site – Kimb Jones

Kimb delivered his customary informal talk on the latest and greatest plugins out there at the moment.  Apart from some live demos going wrong, the talk did outline some new plugins that I had not heard of that could be useful.

A Simpler WordPress Admin For Clients – Me!

Next was time for my talk on the developer track. This was my first conference talk and I was a little nervous. I was surprised at how many delegates attended as I was along side Graham Armfield’s talk on WordPress accessibility, a topic which is growing in necessity by the month.

My talk went well and I had some interesting questions at the end – thanks to all those who listened!

Rules for a Teenage WordPress Community

As a teacher I was interested to hear Michelle Dillon’s talk on her experience of creating Rockhaq. It was refreshing to hear that some of the things Michelle learnt when creating the site, were the same barriers and experiences that I have had in the past creating online sites for teenagers in schools.

Hitchhikers Guide to Custom Post Types

Jenny Wong gave the final talk of the day before the Keynote all about Custom Post Types in WordPress, which are the basis of what makes WordPress such a good CMS to use. Jenny talked through what Custom Post Types are, how to add them and use them alongside custom taxonomies.

The final Keynote sessions was a Q&A with the WordPress co-founder Mike Little. Unfortunately I only caught the first 10 minutes of this as I had to leave to head back across the Penninies for home.

WordCamp Sheffield was an excellent event at an excellent venue. It was my first WordCamp where I was a speaker, something that I definitely want to do again soon. But most of all, as always with WordCamp, what makes they so special is the fantastic people that attend. It was great to catch up with everyone again and nice to see some new faces too. See you all in Manchester at the end of June!