Skip to content

Integrating Payments into WordPress, Part 1: Features and Getting Started

April 25, 2011

I’ve explored a number of ways to integrate the power of the PayPal X Platform into your applications in my DevZone articles over the last few months. Recent installments have shown you how to accelerate your Adaptive Payments development using the Apigee PayPal API Console and how to buy and sell digital goods in data markets using PayPal Embedded Payments and micropayments.

Now I’d like to explore how to use PayPal payment solutions in the world’s most popular blog and content management system (CMS) software: WordPress.

In this article I’ll introduce WordPress (commonly abbreviated as “WP” by WordPress developers and power users, aka “Pressers“), then take you on a whirlwind tour through installing and using it. Future articles will introduce the WordPress plugin model through which you can greatly extend the capabilities of your WP-powered system. They will also discuss PayPal-based WP plugins and how to write your own payments plugins.

What is WordPress?

WordPress.org, the central WP development and Presser community hub, describes it thusly:

WordPress is web software you can use to create a beautiful website or blog

In essence, WordPress is a freely available, open source, PHP and MySQL based web publishing system. It’s very customizable out of the box, and can be further extended as needed through a little PHP hackery. The WP homepage goes on to note:

The core software is built by hundreds of community volunteers, and when you’re ready for more there are thousands of plugins and themes available to transform your site into almost anything you can imagine. Over 25 million people have chosen WordPress to power the place on the web they call “home”

You can get a feel for what’s possible by visiting the WordPress Showcase page and looking through a few of the thousands of sites powered by the software. Click here to check out the Showcase. Go ahead, I’ll wait.

Pretty impressive, right? Now that you have a feel for what’s possible, let’s examine how to implement a site using WP.

WordPress documentation

The first thing you should do is to visit the WordPress Codex, source of official documentation for the software, its installation and usage, and how to develop WP add-ons such as plugins and themes. The Codex contains the following sections:

  • Getting Started with WordPress – where to start, how to install the software, how to publish your first posts, file and plugin management, a “New to WordPress” FAQ, and a section on the latest release family
  • Working with WordPress – contains a lot of useful information on WP features and how to use them, theme and plugin administration, creating backups, fighting comment spam, and much more; plan to spend some time here if you’re serious about getting the most out of WP
  • Design and Layout – dives into blog design and layout issues with a lot of focus paid to CSS, themes, and templates (all used extensively by WP)
  • Advanced Topics – information on multiuser WP, deeper details on important WP concepts such as “The Loop” that displays each post, and tips for optimizing your installation
  • Troubleshooting – FAQs galore and how to find answers when you’re having problems
  • Developer Documentation – database details, discussion of the plugin API, WP cookies and coding standards, and how to use PHP to bend WP to your will; we’ll be discussing this information in more detail throughout this series
  • About WordPress – WP contributor acknowledgements, version information, WP community terminology, how to contribute to WP, documentation and Codex information, etc.

There are a couple of pages linked to from the sections above that I want to specifically call to your attention now, before we dive into installation, usage, and plugin extensions.

The first is the list of WP features (click here to access). If you have a question about whether or not WP can do something, this is a good place to start your search for the answer. The features page also lists the currently required prerequisite software including release numbers (as of this writing, PHP 4.3 or newer and MySQL 4.1.2 or newer, but these are shifting targets as new releases are made). Note that you’ll also need a web server that supports PHP and MySQL (I prefer Apache and will use it for the rest of this series).

In addition to the features and prerequisites, you might also want to spend a little bit of time at this point reading up on WP terminology and jargon (click here to access). Grounding yourself in the language used by Pressers will help to accelerate your learning process and remove unnecessary barriers as you move along.

Installing WordPress

Enough talk, let’s install! WP is famous for its easy installation. In fact, many web hosting companies have easy installation processes that will automatically install WP for you with minimal muss. If your host offers this, I’d suggest trying it.

If your host doesn’t provide a WordPress auto-installer, then you can follow the steps in the “Installing WordPress” Codex page. In brief, you need to:

  1. Download and unzip the WordPress package (click here for the latest stable release)
  2. Create a MySQL user and database for use by your WP installation
  3. Rename the WP configuration file, wp-config-sample.php, to wp-config.php so you can begin editing it (you might even want to copy it to the new filename rather than renaming it, that way you can reference the initial contents of the file after you make changes to the copied one)
  4. Edit wp-config.php in a text editor to configure the database access information you created in the second step above
  5. Place the WP files where you want them on your web server (putting them in the root of your domain has its advantages, but there may be reasons for putting them in a subirectory of your site; whichever you choose, note down the location now as you’ll need it later)
  6. Remember how I told you that you needed to know where you put your WP files? You’ll use that here. You need to execute the WP installation script by accessing wp-admin/install.php in a web browser. If you installed WP in a subdirectory on the example.com domain, for instance, you could access the script at http://example.com/subdirectory/wp-admin/install.php; if you installed WP to the example.com domain root, the script would be at http://example.com/wp-admin/install.php

Additional installation details are available from the “Installing WordPress” page.

First steps after installation

Once you’ve installed WP, you’re ready to take it for a spin. The Codex provides a great tutorial for your first time, aptly named “First Steps with WordPress“.

This tutorial will walk you through the basics of logging in to the WP administration interface and performing various admin actions. This includes a look at the WP dashboard which summarizes key information when you first login. For instance, here’s my own site’s dashboard (note that I use several plugins such as the Google Analytics plugin displaying key metrics in my dashboard as pictured here; I’ll discuss these plugins in the next article in this series).

The tutorial goes on to illustrate how to change the look of your content using themes (click here to dive deeper into themes and here for more on WP’s use of CSS for styling). It also details how to write and publish posts, how to manage comments that your site visitors (readers) make on those posts, and much more.

I strongly encourage you to spend some time working your way through “First Steps with WordPress“.

Click here to read the complete post on the PayPal X Developer Network including a bit more about the PayPal WP plugins to be discussed in the next article in the series.

From → Uncategorized

Comments are closed.