Thumbnail

In my previous post we created a new WordPress plugin which simplified the administration panels for your clients. If you haven’t read it, please do so first. In this article, we’ll use the same plugin file for deeper configuration changes.

Remove the WordPress Update Notification

WordPress informs you when an update is available. Unfortunately, it tells everyone — including your clients. That could lead to unnecessary concern or tempt them call you every half an hour until it’s upgraded.

Append the following code to easy-admin.php to remove the notification for everyone except for WordPress administrators:


function no_update_notification() {
	if (!current_user_can('activate_plugins')) remove_action('admin_notices', 'update_nag', 3);
}
add_action('admin_notices', 'no_update_notification', 1);

Remove Unnecessary Dashboard Widgets

You can remove dashboard widgets for a user by logging in as them and un-checking items in the “Screen Options” pull-down panel. However, that may not be practical and there’s nothing to prevent your client re-enabling them.

Append the following function to easy-admin.php to remove unnecessary dashboard widgets. You may need to add, remove or modify unset commands as required. For example, the first section (lines 5-7) removes “Right Now” for everyone but WordPress administrators. The second section (lines 9-13) removes widgets regardless of the user’s rights.

The dashboard widget’s ID is assigned to its box div element — use Firebug or inspect the source to find that value.


// remove unnecessary dashboard widgets
function remove_dashboard_widgets(){
	global $wp_meta_boxes;
	// do not remove "Right Now" for administrators
	if (!current_user_can('activate_plugins')) {
		unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
	}
	// remove widgets for everyone
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

Remove Unnecessary Page and Post Meta Boxes

Few developers use all the features WordPress has to offer. For example, if all posts are assigned to a single default category, you don’t require the Categories box. Or perhaps you’re not permitting comments and can remove associated boxes.

Append the following function to easy-admin.php to remove unnecessary meta boxes from the posts and pages panels. You may have to add or remove remove_meta_box() calls in this function. The first argument is the ID assigned to the box’s div element — again, this can be discovered in the source or with Firebug.


// remove unnecessary page/post meta boxes
function remove_meta_boxes() {
	// posts
	remove_meta_box('postcustom','post','normal');
	remove_meta_box('trackbacksdiv','post','normal');
	remove_meta_box('commentstatusdiv','post','normal');
	remove_meta_box('commentsdiv','post','normal');
	remove_meta_box('categorydiv','post','normal');
	remove_meta_box('tagsdiv-post_tag','post','normal');
	remove_meta_box('slugdiv','post','normal');
	remove_meta_box('authordiv','post','normal');
	// pages
	remove_meta_box('postcustom','page','normal');
	remove_meta_box('commentstatusdiv','page','normal');
	remove_meta_box('trackbacksdiv','page','normal');
	remove_meta_box('commentsdiv','page','normal');
	remove_meta_box('slugdiv','page','normal');
	remove_meta_box('authordiv','page','normal');
}
add_action('admin_init','remove_meta_boxes');

Remove Favorite Actions

The favorite actions button resides in the WordPress header next to the “Howdy” message. It normally provides quick links to New Post, Drafts, New Page, Upload and perhaps a few plugin-specific options such as “Empty Cache”. Let’s remove the options we don’t require by appending the following code to easy-admin.php:


// remove favorite actions
function remove_favorite_actions($actions) {
	if (!current_user_can('activate_plugins')) {
		unset($actions['edit-comments.php']);
	}
	return $actions;
}
add_filter('favorite_actions', 'remove_favorite_actions');

In this example, we’ve removed the Comments link for everyone except administrators. To remove other items, you need to find the action’s URL in the page source. Locate the element with the ID “favorite-actions” and, within that, an element with the ID “favorite-inside”. The child divs contain links to URLs such as “media-new.php”. To remove that option, simply add unset($actions['media-new.php']); to the function.

Phew. In my next WordPress post, we’ll address the WordPress menu and remove all the dangerous options you want to hide from clients.

286-easier-wordpress-1-thumb

WordPress’s popularity owes much to it’s easy administration panels. Unfortunately, it can still be daunting for non-technical users such as your clients. At best they’ll require a little training, hand-holding and support. At worst, they’ll play around with plugin installation, edit some theme code, then expect you to clear up the mess.

I’ve written a number of “Make WordPress Easier for Clients” articles (see part 1 and part 2). In those examples, code was placed in the theme’s functions.php file. That’s still a viable solution if you have one WordPress installation per client or each is configured differently.

In this article, however, we’ll create a plugin. Plugins have a couple of advantages:

  1. Your code resides in one file which can make maintenance easier.
  2. If you’re running a WordPress network with multiple sites (previously known as WordPress MU), you can activate a single plugin across the network so it’s applied to every site.

WordPress Plugin Basics

Our plugin will be contained in a single PHP file. We’ll name it easy-admin.php and place it in the WordPress plugin folder (wp-content/plugins/). Ideally, the file should be UTF-8 encoded. If your text editor doesn’t permit UTF-8, well, use a better editor! That said, those using English are unlikely to experience issues with ANSI-encoded files.

A PHP tag and header comments are required at the top of the file, e.g.


<?php
/*
Plugin Name: Easy Administration
Plugin URI: http://www.sitepoint.com/wordpress-easy-administration-plugin-1
Description: Simplifies WordPress administration panels.
Version: 1.0
Author: Craig Buckler
Author URI: http://optimalworks.net/
License: GPL2
*/

You can change the header details, but ensure the definition tags remain — WordPress uses them to recognize your plugin.

You can now install your plugin by activating it in the “Plugins” section of the WordPress administration panels. Those with a WordPress network can activate it for all sites in the “Network Admin” section. It won’t do anything yet, but you can now add whichever features you require…

Change the WordPress Login Page Logo

The WordPress logo is lovely but few clients will care what CMS they’re using. It might be more helpful to show their site name. Append the following code to easy-admin.php; it replaces the login page logo with the name and uses a pleasing CSS3-letterpress text:


// login page logo
function custom_login_logo() {
	echo '<style>h1 a, h1 a:hover, h1 a:focus { font-size: 1.4em; font-weight: normal; text-align: center; text-indent: 0; line-height: 1.1em; text-decoration: none; color: #dadada; text-shadow: 0 -1px 1px #666, 0 1px 1px #fff; background-image: none !important; }</style>';
}
add_action('login_head', 'custom_login_logo');

WordPress alternative login page logo

Remove the WordPress Icon From the Administration Panel Header

The WordPress icon is shown next to the site name in the header. There’s nothing wrong with it but some clients will question why there’s a ‘W’ next to their site. To remove it, append the following code to easy-admin.php:


// remove administration page header logo
function remove_admin_logo() {
	echo '<style>img#header-logo { display: none; }</style>';
}
add_action('admin_head', 'remove_admin_logo');

Change the WordPress Administration Panel Footer Text

The footer provides links to WordPress, documentation and feedback. Few clients are likely to find it useful so you can replace it with your own support details. Append the following code to easy-admin.php and change the echo statement to output to a suitable message:


// change administration panel footer
function change_footer_admin() {
	echo 'For support, please call 123456 or email <a href="mailto:support@mysite.net">mailto:support@mysite.net</a>';
}
add_filter('admin_footer_text', 'change_footer_admin');

Remove the WordPress Admin Bar

The dark-gray Admin Bar was introduced in WordPress 3.1. Personally, I don’t find it particularly useful. It can also confuse clients; they may think all visitors can see the bar or use it to access dangerous features such as ‘Appearance’. Fortunately, we can remove it with one line in easy-admin.php:


// remove admin bar
add_filter('show_admin_bar', '__return_false');

That’s enough configuration for today. In my next WordPress post, we’ll add further functions to simplify the dashboard, post and page panels.

The Web Development Series is supported by Rackspace, the better way to do hosting. Learn more about Rackspace’s hosting solutions here.

The community behind the open source content management system Joomla released version 1.6 earlier this week.

Along with WordPress and Drupal, Joomla helps make up the group of “big three” open source CMS applications. According to statistics from W3Techs, Joomla powers 2% of the web and holds 11% of the CMS market.

Joomla is used for front facing and internal sites for companies like eBay, Citibank, General Electric, IHOP and more. With Joomla 1.6, the goal was to make the package more user-friendly and powerful.

Joomla 1.5 was released almost three years ago and a lot of work has gone into this most recent release. In the future, the Joomla team will be adopting a six-month release strategy, meaning users won’t have to wait as long between updates.

We’ve spent some time playing with Joomla 1.6 and exploring some of the new features and improvements offered with this version.

Here are some of the big new features of Joomla 1.6:

  • New Access Control System — The user manager from older versions of Joomla has been replaced with a new Access Control List (ACL) that will let administrators have more granular control when creating user groups and offering user permissions to various aspects of a site. This is a big deal, especially since Joomla is so frequently used in intranet environments.

    The fact that Joomla now builds a solid ACL into the system, rather than relying on third-party extensions, is a great step for the platform.

  • One-Click Extension Updates — Just as WordPress has a built-in plugin manager and auto-update tool, Joomla now does, too. This is great for administrators who have multiple sites with lots of extensions to manage.
  • Template Styles — This is one of my favorite new features of Joomla 1.6. In the past, making changes to a template for just one aspect of a site meant basically creating a new template and changing the options you wanted to change manually. That works, of course, but it presents a lot of problems when trying to update a template or design as a whole. With template styles, designers can make variations of the same template that can be applied to specific sections or pages of a site.
  • Template and Layout Overrides –Like template styles, I really like the ability to do layout overrides to change very minute aspects of a site — for things like menus or modules.
  • Better Media Manager — For end users, the content manager is better than before, now supporting multiple-file uploads.
  • Package Installation Feature — For developers who offer a number of different extensions or solutions that are interconnected, this is extremely cool. Basically this lets a developer create a single package that will install multiple extensions at the same time.
  • Sections Be Gone — Say goodbye to sections and hello to categories! You can create unlimited sub-categories (with unlimited depth) for ultimate hierarchy and taxonomy control.

Joomla still hasn’t caught up with WordPress in the ease-of-use department, but as a CMS, it can be considerably more powerful. The new ACL feature is great for large scale sites with lots of users. For designers, we think the addition of template styles and layout overrides will make customizing and changing smaller aspects of a page or site faster.

For end users, there aren’t a lot of dramatic differences, but on our localhost, the software seemed faster and snappier than an identical Joomla 1.5 instance.

Have you ever used Joomla when designing or developing a website? What do you think of this CMS? Let us know in the comments.


Series supported by Rackspace


rackspace

The Web Development Series is supported by Rackspace, the better way to do hosting. No more worrying about web hosting uptime. No more spending your time, energy and resources trying to stay on top of things like patching, updating, monitoring, backing up data and the like. Learn why.


More Dev & Design Resources from Mashable:


Hacker Web Design: Words of Wisdom for Building Great Apps
5 Better Ways to Read “Hacker News”
A Beginner’s Guide to Integrated Development Environments
10 Chrome Web Apps to Check Out
HOW TO: Make Your WordPress Blog More Like Tumblr

More About: CMS, content management systems, drupal, joomla, web designers, web dev, web development series, WordPress

For more Dev & Design coverage:




After nearly three years of development, Drupal 7.0 is officially available. The latest release of the open source content management system that powers high profile websites like WhiteHouse.gov features a revamped admin interface, more flexibility options for content and more optimized code.

Drupal founder and project leader Dries Buytaert estimates that approximately 1,000 people contributed to Drupal 7. The Drupal community at large will be holding worldwide “release parties” in 88 countries on Friday, January 7, 2011.

Mashable recently named Drupal one of the 10 websites to watch in 2011, in large part because of the improvements promised by Drupal 7. The CMS already powers approximately 1% of all the websites in world and we expect to see that figure only increase.

Drupal has always been well regarded in terms of its power and abilities; it’s just actually learning and using the system that can take more effort. That’s why one of the big undertakings with Drupal 7 (and something that will continue to be a focus in Drupal 8) is in usability, especially from an administration perspective.

The installation process has also received an overhaul — and Drupal might not quite match WordPress’s famous “five-minute install” on live hosting environments — but on a local host, the process is just as simple.

The default installation includes built-in modules for things like OpenID support, forums and contact forms that you can enable or disable at will.

Check out this video the Drupal team put together showing off all of the hard work that has gone into Drupal 7.0.

Have you ever used Drupal to build a website? What are your thoughts? Let us know in the comments.

More About: CMS, drupal, drupal 7.0, open source

For more Dev & Design coverage:

This post is part of Mashable’s Spark of Genius series, which highlights a unique feature of startups. The series is made possible by Microsoft BizSpark.. If you would like to have your startup considered for inclusion, please see the details here.Name: PagelimeQuick Pitch: PageLime is a hosted CMS for designers. It allows you to manage assets on your site by logging in to a web app that’s hosted on its servers.Genius Idea: Pagelime is a simple CMS with a graphical interface that can easily hook into websites created with PHP, Java, Ruby, ASP or just straight XHTML/CSS. The system makes it easy for designers to create sites, while making content regions editable by clients. The new iPhone app lets designers and clients access many of the Pagelime backend features on the go.As we’ve noted in the past, a lightweight CMS can be a great fit for small business users who want a simple website, without necessarily needing the hassle or complexity of a more extensive content management tool.This is exactly the market segment that Pagelime is targeting. To be more specific, Pagelime targets the website designers who are asked to build these more simple client sites. Pagelime is a hosted CMS and it works by connecting to an existing domain and web server. By adding in CSS classes to designated elements of your site’s pages, you can make those blocks editable in a WYSIWYG editor hosted on Pagelime. Likewise, you can also enable features like image galleries, manage the SEO settings on a page and add server-side includes.

This ends up being a very nice tool for web designers who want to deliver a solution to a customer, without having to worry about either customizing or building a CMS. Pagelime has a variety of pricing options — starting with a free plan that lets you create three different sites. For $19 per month, users can create up to 50 sites and use Pagelime more as a white label service, with their own logo, colors, domain and various reselling tools. For $69 per month, a user can create unlimited sites and designate an unlimited number of administrators.Pagelime recently released its first mobile app, Pagelime CMS for iPhone [iTunes link]. Pagelime’s iPhone app isn’t intended as a replacement for the web app, but it does allow designers and their clients to extend the Pagelime platform. Users can add and edit pages or templates, make changes to editable areas, preview and publish changes, all from the app.
We think Pagelime has an interesting approach to content management, especially for smaller sites and for designers who don’t want to spend too much time dealing with backend code. If you’re looking at an alternative solution for maintaining or creating smaller websites, Pagelime is worth a try.What are your favorite lightweight content management tools? Let us know.


Sponsored by Microsoft BizSpark


BizSpark is a startup program that gives you three-year access to the latest Microsoft development tools, as well as connecting you to a nationwide network of investors and incubators. There are no upfront costs, so if your business is privately owned, less than three years old, and generates less than U.S.$1 million in annual revenue, you can sign up today.


Reviews: PHP

For more Dev & Design coverage: