Extending WordPress with Plugins

You've probably seen pocketknives with interchangeable blades or other tools (saws, forks, corkscrews, you name it). Plugins are the WordPress equivalent of those. You just choose the ones you want to install. Plugins can simply provide new features or they can change the way that WordPress works. Whether you choose a plugin to jazz up your WordPress blog or to hot-rod your whole Web site, you can do it without having to know anything about the underlying software code.

For example, if you have a WordPress blog and you want to add complex, fancy content (such as video), you can install a plugin to handle that content. If you have a WordPress Web site for your business and you want to create a form for visitors to use when they contact you, multiple plugins can do that job.

Identifying core plugins

Core plugins (or canonical plugins) are new to WordPress. Each one delivers a set of features approved by the contributing developers at WordPress who wrote the main WordPress software. They're intended to provide the most requested features that would be useful to the majority of WordPress users. Core plugins seek to keep those features closely integrated with WordPress, resulting in a streamlined integration that makes them easy to use. Currently, only two core plugins are included in the WordPress software by default:

  • Akismet: This plugin is essential for combating comment spam on your site. Akismet is the answer to comment and trackback spam. Matt Mullenweg of Automattic says Akismet is a “collaborative effort to make comment and trackback spam a non-issue and restore innocence to blogging, so you never have to worry about spam again” (from the Akismet Web site at http://akismet.com). In Book III, Chapter 5 we take you through the steps of activating and setting up Akismet on your site.
  • Hello Dolly: This plugin isn't necessary to make your blog run smoothly, but it adds some extra fun. Activate the Hello Dolly plugin on the Manage Plugins page in your WordPress Dashboard. When you activate it, your WordPress blog greets you with a different lyric from the song “Hello, Dolly!” each time. The Hello Dolly plugin is primarily included as a teaching tool to give budding plugin developers a framework for a simple plugin to help them launch their own plugin development efforts.

What makes core plugins different from the thousands of independently contributed plugins available within the WordPress Plugin Directory? Core plugins are included with the WordPress software that you download from the WordPress Web site. Therefore, every WordPress user gets these plugins without having to download them separately. You can choose whether to use the plugins by turning them on or off the way that you would any other plugin.

Core plugins have been around since the origin of WordPress. The very first core plugin was Hello Dolly by Matt Mullenweg, the founder of WordPress. This core plugin is still included with every download of WordPress. Matt describes the Hello Dolly plugin as “not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: “Hello, Dolly”. When activated, Hello Dolly randomly displays a lyric from the song “Hello, Dolly!” in the upper-right corner of your WordPress administration screen. This may not seem very useful to you and, in fact, it may not be useful to the majority of WordPress users, but the purpose behind the plugin is to provide WordPress plugin developers a simple example of how to write a plugin. This is Matt's method of providing WordPress users an example of a simple plugin.

Hello Dolly has been undeniably successful, spawning more than 40 similar plugins that take the concept and elaborate on it. Some of those plugin developers have gone on to write other successful, more complex plugins.

The Hello Dolly plugin is not the only core plugin in WordPress. Every copy of WordPress includes the Akismet plugin, also by Matt Mullenweg. Akismet is a spam-filtering solution that checks every comment made on your WordPress blog to determine whether the comment is spam. Akismet is only one of two plugins that require a WordPress.com API key, obtained free by signing up for a WordPress.com account.

image An API key is a special numeric code that is unique to you (similar to a license code or a password) and used by software to identify you as an authorized user.

Figure 1-1 shows the core plugins installed with WordPress version 3.0.

Figure 1-1: Core plugins installed with WordPress version 3.0.

image

Additional WordPress core plugins are still in development, but expect to see them included with a future version of WordPress; so currently, there are only the two: Akismet and Hello Dolly.

Distinguishing between themes and plugins

Software developers often use themes (collections of visual features, such as fonts, colors, and layout specifications) when they customize software to establish a consistent look and feel. Some developers argue about themes and plugins — what they are, whether they're the same thing, and what they're for. To us, a theme governs the look and feel of your WordPress blog or Web site; a plugin makes the site work the way you want.

Here's a quick look at the differences between a WordPress theme and a plugin:

  • A theme is a collection of template files that allow you to change the appearance of your WordPress blog or Web site. These files govern the layout, design, and presentation without affecting the underlying WordPress software. You can change your theme at any time without changing the WordPress software or any of the features you applied through WordPress plugins.
  • A plugin is a collection of files that creates a program or tool to extend the features and behavior of WordPress. Any plugin can be downloaded from the WordPress Plugin Directory to provide some new feature for the administrator or users of your WordPress site. Changing a theme should not affect features of applied plugins and, similarly, changing a plugin should not affect the look and feel of your site applied by your chosen theme.

Here are some good things to remember when using plugins or themes:

  • You may want to change your blog's theme but keep its functionality as is. If you added all your blog's features by using plugins, no problem. If you tweaked a theme to achieve some of the features (say, the tracking of statistics on visitors to your blog), those features will disappear when you change the theme.
  • If you want to use themes to provide features for your blog, then you can only choose themes that do what you have in mind. If you use plugins to take care of the blog's chores, you can select any theme you want. The look and feel you're trying to achieve becomes a separate issue.

image When themes get fancier to deliver knockout visual features, they stray into the range of tasks that plugins do best. Stick with themes for the visual appeal and plugins for the working features.

Finding free plugins to use on your site

Okay (you may be asking), where do I find all these mind-bogglingly useful plugins? Good news: The geniuses at WordPress have made plugins really easy to find by putting them all in one place. Every plugin that is approved for use with WordPress is located in one central directory. You can access the plugins two ways:

  • Online: The WordPress Plugin Directory is located at http://wordpress.org/extend/plugins. To install a free plugin, follow these steps:
    1. 1. Navigate to http://wordpress.org/extend/plugins in your browser.

      You see the searchable Plugin Directory, as shown in Figure 1-2.

    2. 2. Enter the name of the plugin (or a search term relevant to the plugin or a feature you're looking for) in the search box and then click the Search Plugins button.

      The directory lists all plugins that match your query. You can also sort your search query by selecting one of the radio buttons underneath the search box: Relevance (default), Newest, Recently Updated, Most Popular or Highest Rated. Additionally, WordPress.Org lists plugins on the right side of the page by: Most Popular, Newest Plugins and Recently Updated to help you find plugins that may interest you.

Figure 1-2: WordPress Plugin Directory.

image

image The Most Popular plugins have the greatest number of users and have been downloaded most often by users. In the Plugin Directory, they're grouped because the majority of WordPress users want to find them easily.

All plugins are tagged with keywords; the most popular tags are listed along the left side, as shown in Figure 1-3.

Figure 1-3: Plugin Directory showing popular tags.

image

  • Finding Plugins within the WordPress Dashboard: To do this, follow these steps:
    1. 1. Click the Add New link under the Plugins menu in your Dashboard.

      This loads the Install Plugins page where you can search for plugins, as shown in Figure 1-4.

      image When searching for, and finding, plugins in the Dashboard, you use the same method you used at the WordPress web site in their Plugin Directory. Ever since WordPress provided the plugin search in the Dashboard, most users don't use the WordPress Web site anymore. We provide it here as a method you can use, however, in case you find yourself in a situation where you cannot access your WordPress Dashboard (if your Web site is down, for example).

    2. 2. On the Install Plugins page, click the Upload link at the top.

      The Install Plugins page reloads with a form that allows you to browse your computer for a plugin .zip file that you previously downloaded from the WordPress Plugin Directory; upload it and WordPress installs it for you, automatically.

      Figure 1-4: Installing plugins within the WordPress Dashboard.

      image

    3. 3. Choose PluginsimageAdd New to access the WordPress.org Plugin Directory from the Install Plugins page.

      Every plugin on the WordPress site is searchable from the Install Plugins page. Plugins are also listed by Featured, Popular, Newest, and Recently Updated categories. Popular Tags gives you shortcuts to the most-used tags for particular plugins with just a click of the links that are displayed at the top of the page.

    4. 4. When you find a plugin you're looking for, click its link to view its details.

      A description of the plugin appears in a pop-up window with a number of tabs at the top. These tabs can vary with each plugin and could include Installation, FAQ (Frequently Asked Questions), Screenshots, Stats, and Notes. Each tab provides important information about the plugin, as shown in Figure 1-5.

    Figure 1-5: Plugin Description page with tabs within the WordPress Plugin Directory.

    image

    The FYI box on the right provides useful information, such as the version of the plugin, when the plugin was updated, what versions of WordPress are compatible with the plugin, and links to the author's Web site, as shown in Figure 1-6.

    Figure 1-6: FYI box on the plugin page within the WordPress Plugin Directory.

    image

    The rating section below the FYI box displays the average rating the plugin has received from its users, as shown in Figure 1-7. (For more on finding plugins via the WordPress Dashboard, see Chapter 2 of this minibook.)

image If you don't have a WordPress.org account, we highly recommend that you get one. It's free, very useful, and gives you access to the WordPress.org support forums (where you can post support questions) and other resources (some of which we introduce in the next section). Sign up at http://wordpress.org/support/register.php.

Figure 1-7: Rating section on the plugin page within the WordPress Plugin Directory.

image

Comparing free and premium plugins

Everybody loves free stuff. Users love WordPress not only because it's a great program for Web publishing, but also because it's free and support is free. If everyone loves free plugins that enhance WordPress blogs and Web sites, why offer premium plugins? Why aren't all plugins free? The answer is complicated and undoubtedly contentious.

WordPress developers like to contribute code and plugins that help the WordPress community and contribute new capabilities to a great project. However, WordPress developers have to make a living and pay their bills. Professional developers contribute a lot to WordPress and make a living from WordPress by creating many of the best themes and plugins. As a WordPress user, you want the best. Why not pay a few bucks for something that is really good and (often) includes updates and support?

Plugins are available two ways:

  • Free plugin/premium plugin: You get a certain set of features free and additional features for a price. Many of the best-known software companies follow this model.
  • Premium support: Open source software companies realize that an issue with WordPress and similar software is access to good support and, therefore, develop premium support programs to offer access to good technical support for a price. Many plugin and theme developers use this model to benefit the community. With this model, many developers provide a membership program where the user pays a set fee upfront for support for a specified time frame (for example, $50 for one year of support, requiring you to renew your membership to continue obtaining support for another year, and so on).

image Open source software can be copied, modified, and redistributed by anyone without having to pay to do so. Think of it as being similar to buying a CD, copying the disc, making changes to the music, and then reselling the music to your friends without having to pay any fees to the original artist. Check out Book I, Chapter 2 for a rundown about open source software, along with the GPL licensing of WordPress and how it applies to the work that plugin and theme developers do.

The great news is that you can choose between free plugins and premium plugins that don't cost much, and the choices will only grow as the community grows. Consider premium plugins when you need extra support or additional features, and reward your plugin developers for the job they do and their contribution to the WordPress community.

Evaluating plugins on the fly

How do you know that a plugin does what it's supposed to do? You can evaluate a plugin several ways but, unfortunately, none is foolproof. The most reliable way to tell whether a plugin is good is to examine the source code, but not everyone has that kind of programming knowledge. If you're a stranger to programming and short on time, however, you can still evaluate a plugin by other means. Here are some simple methods to help you determine whether WordPress users are using a plugin successfully:

  • Look at the popularity of the plugin. Every plugin in the WordPress Plugin Directory shows the plugin's number of downloads (see Figure 1-8). The number might not equate to the number of satisfied users, but it's not a bad rough measure.

    image If the downloads are less than a thousand, exercise caution, especially if the plugin has been in the repository a long time. However, a plugin in the repository for a year and downloaded only 30 times might not be a bad plugin; the plugin might be a niche feature that's not popular.

    Figure 1-8: Downloads for a plugin within the Plugin Directory.

    image

  • Look at when the plugin was updated. This number shows in the plugin directory, too (refer to Figure 1-8). If the plugin hasn't been updated in several years, it might no longer be maintained, or the developer stopped supporting it. Good plugin developers should release regular updates to their plugins because WordPress isn't a static application; it's ever changing. Plugin developers should update their plugins when major changes to WordPress occur.
  • Look at the plugin version. If it shows Alpha or Beta in the version, the plugin is being tested and may have bugs that could affect your site; you may want to wait until the plugin has been thoroughly tested and released as a full version.

    The WordPress community has no standard for numbering plugin versions but, generally, the higher the version number, the more mature (that is, tested and stable) the plugin is. Figure 1-9 shows a plugin within the repository with Beta in the version.

    Figure 1-9: Version number for a plugin within the Plugin Directory.

    image

  • Look at the number of downloads per day. Shown on the Stats tab of the plugin's page (see Figure 1-10). Again, this is not a foolproof method, but the Downloads Per Day graph may indicate that people are using the plugin with some success.

    Figure 1-10: Download history for a plugin within the Plugin Directory.

    image

  • Use the ratings on the plugin's page. Can be used as a (partial) guide to what people think of the plugin. If the plugin's average is five stars but is rated by only two people, this approach may not help. However, if 200 people give the plugin five stars, you have a better indication that users like the plugin.

    image If you have a free WordPress.org account, you can log in and rate the plugin. Although subjective, if used correctly, the ratings are a great guide for whether the plugin is good.

  • Use the “See what others are saying” section. Posts from a plugin's Forums page appear on the right side of the plugin's page, as shown in Figure 1-11. Both good and bad (but hopefully not ugly) comments appear. This is probably the best feedback you're going to find on whether the plugin does its job well.

Figure 1-11: Comments section for a plugin within the Plugin Directory.

image

Combining the methods is a good way to determine whether the plugin works as advertised.

image The methods described here for evaluating plugins are no substitute for thoroughly testing a plugin. (Remember to test plugins on a development copy, not the online version of your blog or Web site.) Additionally, testing the plugin is good practice, unless you're familiar enough with the code and the developers that bugs or security issues seem unlikely.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.44.174