Posts Tagged ‘wordpress’

WordPress Plugin: Breadcrumb NavXT

June 19, 2009

I just finished installing the Breadcrumb NavXT WordPress Plugin on the church site.  I’d been half-heartedly been looking at what it would take to write the equivalent functionality into my template.  It wasn’t seeming to be too bad, but  when I ran across this plugin, I had to give it a try.  Why rewrite something already done and working?

Obviously, you’re situation may be different from mine, but after activation I changed exactly one value (use “Home” for the Home link title instead of “Blog”), and dropped the default code into my standard and wide page templates.  The result was precisely what I was looking for: standard breadcrumb navigation.  PHP5 is required, but I needed to enable it anyway for the DST support added in WordPress 2.8.

All-in-all, another good plugin and another demonstration of the positive value of WordPress.

Interesting Church Tech links for June 14, 2009

June 14, 2009

With WordPress 2.8 out, here’s some good WordPress links.

WordPress 2.8 And 10 Things That You Should Know Before/After You Upgrade
DST is finally supported if you’re running on PHP 5… unfortunately none of my sites are… time to ask for an upgrade…
Joomla to WordPress – Content Converter!
Seems like a good starting place for a Joomla migration.
10 Useful WordPress Loop Hacks
Somehow I’ve missed #4 and am doing it a much harder way… I have code to update now.
WordPress Theme Development Frameworks
When I do my next WP project I will be looking closely at these frameworks.
Simple WordPress Example Plugin
Having started building my own plugin this is a nice simple example.

WordPress 2.8 Upgrade

June 13, 2009

I finished upgrading three sites (including the church site) to WordPress 2.8 and had absoluely no problems at all.  I am so very pleased with this platform.  For about a year now I’ve been working seriously with it and its been rock solid all the way along.

Interesting Church Tech Links for May 17, 2009

May 17, 2009

Some more WordPress links today:

101 Techniques for a Powerful CMS using WordPress
A whole lot of interesting ways to make WordPress work more like a CMS. Some I’ve used, some I’ve not.
Broken Link Checker for WordPress
Been using this and it finally forced me to fix a few already known but broken image links
Analyze WordPress Performance – Plugin!
This plugin generates some interesting stats about the queries for generating a page. Not sure exactly what I’m going to do with the information right now but I’m glad to have another tool for when I will need it.
Change Admin Pagination on Posts, Pages and Comments
WordPress 2.8 looks like its going to have some nice upgrades, but for those who cannot wait, here’s some code to let you alter the number of comments, posts or pages listed in the admin module.

Interesting Church Tech Links for May 3, 2009

May 3, 2009

Some good articles for WordPress and Google Apps.

Syndicated WordPress Plugin Keeps Your Brand Intact
A WordPress plugin that does URL shortening so you don’t need TinyURL.com or such and you keep your domain name in the resulting URL – good for keeping your brand identity in the steam for Twitter and such.
Mt. Gilead’s Experience with Google Apps for Domains – Part I and Part II
Some interesting analysis and experience with Google Apps for Domains
Embed WordPress Functions Outside WordPress
Used this technique to integrate my error pages into the WordPress template.

Auto-Email Web Server Errors with WordPress

April 30, 2009

404/403 Website Error Pages with PHP Auto-Mailer from Nettuts+ scrolled through my RSS feeds the other day.  I was thinking that since I have WordPress installed it should be really easy to add some auto-emailing to the 404 template page.  While there are a few 404 WordPress plugins I didn’t see any that added the emailing.  So I added this to the bottom of my 404.php file:

<?php
$s_headers = "";
$s_to = "" ;
$s_subject = "404 Page Generated" ;
$s_message = "<ul>" ;
$s_message .= "<li>Request URL:" . $_SERVER['REQUEST_URI'] . "</li>";
$s_message .= "<li>Request Method:" . $_SERVER['REQUEST_METHOD'] . "</li>";
$s_message .= "<li>Referer:" . $_SERVER['HTTP_REFERER'] . "</li>";
$s_message .= "<li>Remote Address:" . $_SERVER['REMOTE_ADDR'] . "</li>";
$s_message .= "</ul>";
mail($s_to, $s_subject, $s_message, $s_headers ) ;
?>

So when a 404 gets generated I now am informed what failed, where it came from, who it came from and if it was a GET or POST.

What about other errors?

Ok, that was easy for the 404 because it was built into the WP template system.  But what about other errors like 500 (server error) and 403 (forbidden)?  WP doesn’t have templates for them.  Well, its pretty easy to take an arbitrary PHP script and include the entire WP environment.  I created a 500.php file that looks something like this:

<?php
define('WP_USE_THEMES', true);
require_once('wp-load.php');
?>
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<h2 class="center">Server Error - Pray For Us</h2>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php /* all that emailing code I just wrote in the 404.php file but used "500" instead of 404 */ ?>

The define() and require_once() functions pull in the WordPress environment.  You only need to watch out for the relative path to the wp-load.php file since it depends on where your PHP script is executing.  Now, duplicate code is a poor programming practice and I had access to all of WP; that means I had access to the functions.php file for the current template.  So, I took the original emailing code and wrote it into a function in the functions.php file.  Of course, if I change the theme I’ll have to make sure this function moves also.  The alternative is to put it into a separate PHP script and include it like the wp-load.php script.  The last line of the 404.php and 500.php files now look like:

<?php mail_request_info( "404 Page" ) ; ?>

and

<?php mail_request_info( "500 Page" ) ; ?>

Wrapping Up

You’ll want to follow their tutorial for how to update your Apache environment to reference the 500.php in the event of a server error.  I also wrote a 403.php file that worked the same way.  This effort paid immediate dividends for me as I found a couple of minor broken links on the site.  Nothing an HTML validator wouldn’t have found but I don’t run one against the site unless I’m redesigning it.  Between these scripts and the Redirection Plugin there are now very few broken pages since the major redesign on the site.  One note of caution, if you’re a high-volume site you might get flooded with emails.

Interesting Church Tech Links for April 19, 2009

April 19, 2009

Theme for today is “WordPress”.

WPSeek.com
I’ve been working on a new WordPress plugin and not being all that familiar with the details of the WP environment this site has been a valuable resource.
Removing Curly Quotes in WordPress
This has long been an annoyance and its a simple fix.
Embed WordPress Functions Outside WordPress
In case you’re writing some PHP outside of the WP environment and need to tie in, this is how you do it.
Top 50 WordPress Tutorials
There’s many “Top 1000” type posts out there – this is a good one from a good source.

A bit of security by obscurity

January 13, 2009

I’m writing this post in case you are not aware of  a couple of “features” of WordPress that concern me.  WordPress has decided to include in the HTML head tag:

  1. What version of WordPress is running, and
  2. Hooks for Windows Live Writer

The headers look something like this:

<link rel="EditURI" type="application/rsd+xml" title="RSD"
     href="http://www.yourblog.com/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml"
     href="http://www.yourblog.com/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 2.7" />

Sometimes I’m a bit paranoid, but I don’t see any reason to advertise what version of WordPress I’m using.  Why put information directly into peoples hands that can tell them what vulnerabilities are in your installation?  Its a simple task to go look up what’s vulnerable in a specific version.  Along with that, if you’re not using Windows Live Writer, why expose the manifest and EditURI?  Someone has even reported problems with anti-virus software interfering with access to their WordPress blog and potentially tied it back to the Windows Live Writer headers.

These three headers are injected as part of the wp_head() function call that’s typically in the header.php of a theme.  We have the choice of removing that function call which potentially interferes with other header hooks or we can find some plugins to help us.

I was able to find two nice plugins over at http://blog.taragana.com:

Two uploads and two activations later and my concerns are soothed.

Other thoughts on WordPress as a CMS

January 6, 2009

As a follow-up to my previous post WordPress as a CMS I ran across “WordPress as CMS: Plugins that will get you there” from Out:think.  Tim Grahl points out some real problems that people using WordPress as a CMS need to consider. His first two issues didn’t seem too relevant to me.  Since I build custom templates for my WordPress installs I feel free to rip out anything I don’t want.  But then I considered that not everyone is probably digging deep into the WordPress themes system and might want a simplier way of controlling these elements.

I don’t personally use these plugins but maybe you’ll find them useful.  Thanks Tim.

WordPress as a CMS

January 2, 2009

After years of maintaining web sites directly in HTML I made the leap to using WordPress as a CMS this past fall.   I had previously been using a SSI templating technique I developed and used successfully for many years in my professional duties. While its principally a blogging platform, I’ve been very happy with its ability to adapt to my rather exacting demands (the 190% software control freak that I am).  Even with my general dislike of PHP as a programming language I must admit to the excellence of the overall API and its flexibility to incorporate (and be incorporated into) other areas.

I’ve not yet written a plugin for WordPress but that I’ve not needed to is impressive to me.  I’ve not needed to because of the quality and diversity of the existing plugins as well as the simplicity of the templating system.  Its very easy to create and deploy a theme and I’ve easily wrapped my custom web forms in the active theme.  Actually, using WordPress.com is going to be an interesting experiment for me in not having complete control over the theme and configuration of WordPress.

I know many people are working with Drupal instead.  I have one friend say that he preferred Drupal because he couldn’t make WordPress do what he wanted.  I never followed up to understand what limits he ran into, but I’ve not found any.  As a church web master, what do you do for your content management and what limitations are there to your choices?

For me, using hand-coded HTML essentially required anyone else who might help me to be excellent with HTML and be able to deal with an FTP client.  Since there are only a few in my church that could handle it and they are involved in other ministries it then falls to me to handle every content update for the site.  This was fine when it was a small site.  But these days I’m trying to expand the volume of content and I’m not always in the right place at the right time to make some kinds of updates.  A system like this can let me delegate some of the content maintenance responsibilities without requiring coding skills… and I didn’t have to write the CMS myself (which I thought I was going to have to do).