WordPress Plugins as Frameworks

I noticed earlier today an interesting video in the WordPress.tv feed. Marc Lavallee & Wes Lindamood: Plugins are Blueprints talk about how they use plugins as a starting point to get to an end. I like what they had to say. It reminded me of what WordPress plugins are missing.

A few years ago, my thinking shifted in how WordPress plugins should be developed. Let me explain.

WordPress has evolved into a platform. You can build a site with just a blog or a project management system using the plugin API. The ways WordPress can be extended is the main reason I started using it and developing for it.

When a new feature gets added in WordPress, the core developers take into very careful consideration how both plugin developers and theme authors will want to extend it and then make it very easy to do so. They often add new hooks and filters for features that have already been in place. In short, they want the platform to be extended and make it easy to do so.

Even themes have been moving to a parent/child relationship. Many theme frameworks have been developed that at first glance are very plain. But after looking at code, you can see many hooks and filters added to make creating a child theme so much easier.

As a plugin developer, I think plugins could learn from this.

There are so many plugins for WordPress. Many are available for free download on the WordPress.org plugins site. A lot of these plugins were written by the author for a specific purpose. I think it is great that these people have released their plugins for others to use.

It is safe to say that most of these plugins were not written as a framework. Many of them shouldn’t be. Doing so would make WordPress an even more powerful framework.
legosInstead of blueprints, we should be providing ways to extend the plugins. We should provide ways to override the options panels. We should provide ways to change the behavior of a plugin. We should keep in mind that while developing plugins for a certain purpose, we can add a few more lines of code and let other developers change the plugin to do what they want.

There are various ways this can be done. Let me give some examples:

  • There are so many Twitter clients. How many of these clients have provided actions and hooks for plugin developers to quickly add custom functionality for a client?
  • I have used some plugins with many pages of options. Have you ever configured a plugin on a test site and then had to manually copy over the options to the production site? Wouldn’t it be so much easier to provide a way to disable to the options panels and configure in a ‘child’ plugin?

There are many more examples. Can you think of any?

Some plugins are doing a great job of this. Personally, I know I need to revisit some plugins and do better at this. More than anything, it requires a shift in how we are thinking of plugins.

Let’s make plugins frameworks instead of blueprints.

Posted in General, WordPress | Tagged | 2 Comments

Yahoo Boss Plugin Update 0.7

Last night I took some time to make some minor updates to my Yahoo Boss plugin. No features were added – just fixed a few bugs and cleaned it up some.

Here is a list of the changes:

  • Options page has been cleaned up with a sidebar for meta information with links for support, donations, etc. Any of these widgets can be hidden using the screen options found on most pages in wp-admin. Also, descriptions for each field have been added.
  • I was using only Curl to make the BOSS API call. This has been changed to use the WP_Http class instead which will use other means to make the call if Curl is not installed on the host.
  • Added a nonce on the form update for better security
  • Removed the deprecated level 10 when initializing the options page and replaced it the manage_options permission.
  • Added localization.

There are so many features to add to this plugin. But the project I created this for was put on hold no it hasn’t seen further development. I’m interested in knowing which features you would like added or have already added.

Posted in Plugin Development | Tagged , , , , | Leave a comment

My Own Freelance Switch

Last week, I began my career as a full-time freelance web developer. This is something that I have been wanting to do for quite sometime and I am really excited to get this portion of my career going.

You’re probably thinking that I am crazy. You’re not alone. My wife does. I think I’m crazy too. To be honest, I am scared as well. But there is only one way to find out if this will ever work – by doing it.

My primary focus will be seeking clients that need help with WordPress. Whether it be setting up clients with a brand new WordPress site or developing a plugin, I am confident that my skills with the WordPress code will be the most successful path with this switch.

As I continue to find work, I’ll also be working on some projects that I have wanted to do for quite some time. I’ll announce them once I get them further along. So between that and freelancing, I’ll be super busy over the next few months.

My next order of business is to develop business relationships, get my website updated to reflect these changes, and find new clients that want great results. I expect I’ll probably be blogging a lot more as well.

So to keep up with what is I am doing I suggest you subscribe to my feed. You can find out all of my social network stuff in the “Follow Me” widget found in the sidebar of this site.

Posted in Career | Tagged , | Leave a comment

Translators Needed for New User Approve Plugin

I just checked in some code changes for the New User Approve plugin. I tested it with WordPress 2.9 that was recently released.

Here is a list of the changes that were made:

  • add localization support – the admin pages to manage approving and denying users can now be localized. If you would like to work with me on getting it localized, let me know. Either leave a comment or contact me.
  • add a changelog to readme.txt – now you can see the changelog from the page on wordpress.org. Also a screenshot has been added and an FAQ finally started.
  • remove plugin constants that have been defined since 2.6 – constants that were defined to support older versions have been removed. If this breaks your site, please upgrade to the latest version of WordPress.
  • correct the use of db prepare statements/use prepare on all SQL statements – this should have been done in the first place. This improves the security of the plugin.
  • add wp_enqueue_style for the admin style sheet – a style sheet is required for the admin page. I thought it would be better to use the function provided by WordPress to include this stylesheet.

The next version I will be adding an options page to customize the messages. I will also make it possible to change the messages from a plugin or a customized theme.

Please let me know if you would like additional features added or if you have any problems with version 1.2.

Posted in WordPress | Tagged , | 10 Comments

wp-config Tips and Tricks

At WordCamp Seattle on September 26, I gave a presentation on wp-config Tips and Tricks. It was in an Ignite format. 20 slides. 15 seconds each.

When I came up with the topic for the presentation, I knew it would be a teaser. In 5 minutes, you cannot present a lot of details. The goal was, however, to give an idea of what can be done – to peak the curiosity of those who have dealt with the wp-config file.

Ever since I learned what can be done with the wp-config file it has simplified how I deal with WordPress significantly. Combining these tips and tricks with things such as SVN and the .htaccess files will simplify it even more.

Currently, I am planning a series of posts that will get into more detail of what can be done with the wp-config file. There are some great sites out there that have already written on the topic. To be fair, this topic could be better covered in an hour presentation, with better code samples and demos.

Please let me know if you have any questions or which topics I should go into more detail.


Posted in Podcasts, Speaking, WordCamp | Tagged , , , , , | Leave a comment

WordCamp Seattle

For the past few months, me with a group of other volunteers have been trying to get the groundwork laid for WordCamp Seattle. Up to this point, it has been a great experience. I have met some great people and am excited to meet many more.

Last month, after calling what seemed like hundreds of venues, we found a place to have WordCamp Seattle. Adobe has offered to let us use their campus in Fremont. I have been there one time before and it should be a great venue.

Anyway, I wanted to write this post to say that organizing the conference is one thing I’ll be working hard at over the next few months. The event will take place on September 26. I expect a log of hard work and long hours. I don’t think I really knew what I was getting myself into.

Please let me know if you are interested in helping out. We need more volunteers.

Posted in WordCamp, WordPress | Tagged | 2 Comments

New User Approve Plugin Updates

Last September I release a WordPress plugin that allows an administrator to approve new users after they register for your site. I built the plugin for a private blog that I have and I wanted control over each member of the site. Since I thought others would be interested in using the plugin I decided to release it.

I didn’t realize the amount of work it would create to maintain it.

The thing is, there are many plugin developers donating their time for plugins that I am using. So I don’t mind doing it.

In fact, releasing the plugin was actually the best thing I could do. A few users found bugs and even sent a patch to fix the bug. That’s how it should be.

Anyway, the first update to the New User Approve Plugin was released last night. No new features. Just some bug fixes and code cleanup. Here are the details.

  • correctly display error message if registration is empty
  • clean up code
  • style updates
  • if a user is created through the admin interface, set the status as approved instead of pending
  • add avatars to user management admin page
  • improvements to SQL
  • verify the user does not already exist before the process is started
  • add nonces to approve and deny actions
  • temporary fix for pagination bug if more the 50 users are present in the WP database

If you are a user of the plugin, please let me know if you find any more issues or your thoughts in general on the plugin. And don’t forget to donate if you find this plugin useful.

Update: No more comments will be allowed. If you are having issues with the New User Approve plugin, please post in the New User Approve forums on WordPress.org.

Posted in WordPress | Tagged , , | 25 Comments

Building a Quick Search Engine

For a while I’ve been wanting to create a specialized search engine for a project I have been working on. Given the limited amount of time I have, I clearly had to piggyback on current technologies. Search engines today do an awesome job of indexing the web to find what you need when you need it. I wanted a specialized search engine to limit the results to relevant web content given a specific subject.

Here were my requirements going into this:

  1. Limit the search to the sites I want. I give them a list and it only searches those sites. The list would need to be updated dynamically or via an API.
  2. Allows me to modify the search results in any order I want or mixing it with other data.
  3. Allows me to format the search results how I please.
  4. I want the results in a multiple formats to allow for flexibility when and where the results are displayed.
  5. I would love to try to monetize the search engine however I want.

Searching for what I needed led me to discover many cool technologies.

I first looked at possibly the most obvious: Google Custom Search Engine. Google CSE is a cool product but it didn’t suit my needs at all. The terms of service don’t allow you to modify the results. I also looked at Google AJAX Search API. Again, doesn’t fit the requirements. I may find a need for the AJAX Search API in the near future though.

Other technologies deserved some attention as well. Products such as CouchDB and Lucene required too much so I didn’t spend much time looking into these.

I had looked at Yahoo BOSS (build your own search service). Initially, it didn’t look like it would suit my needs. After revisiting BOSS, looking at code samples and the API, it was exactly what I was looking for. Easy, fast, reliable. Fits exactly my requirements. Awesome.

Since the site I am building was based on WordPress (like all my sites), I decided to put my work it into a WordPress plugin to allow a WordPress site to easily add a real search engine to the site just by defining some simple options. The first version will be very limited in what can be done but I have a lot of features that I will be adding to it very soon.

I just need to get it ready to release. Soon I hope.

Posted in Search, WordPress | Tagged , , , , | 4 Comments

Upgrading WordPress the Easy Way

I have finally discovered the best/easiest way to upgrade your WordPress install, especially if you have multiple installations of the blogging software.

You must use SVN to make this happen. To upgrade all you have to do is change the version number. If you want to run trunk, all you have to do is update the library by running a simple command. You can also add your plugins and themes to update using SVN.

I actually had been trying to do this for a few months. The part I was missing was putting the WordPress software in it’s own directory. The detailed instructions can be found on Joseph Scott’s blog.

Posted in WordPress | Tagged , | Leave a comment

Twitter And Picklewagon

For those of you who are subscribed to my blog or visit it on occasion, you have more than likely noticed that I have my Twitter updates posting to my blog. This is being done automatically using the Twitter Tools plugin by Alex King. He has created some great plugins and Twitter Tools is no exception.

I decided to add the Twitter archive posts as a way to archive what I put on Twitter. And to make it searchable by me or whoever else cares what I have to say.

I was also thinking about having my Tweets go to my Facebook account. But I don’t want all that information to go to Facebook. I don’t like Facebook very much. I disagree with a lot of what they do. But I do like connecting with people on Facebook. So I am compromising by having this blog update my Facebook feed when posts are published.

Despite the popularity of Facebook, I still think I should be able to control my social circle from my own blog. We are getting closer and closer every day.

Posted in Twitter | Tagged , , | 1 Comment