2. What WordPress Is and How It Works

Now that we know a little about domain names, how websites work, and how to pick a host for your site, let’s get into the real topic of the book—WordPress. This chapter gets into what WordPress is—and isn’t—and how WordPress works (in general, we’ll get to the details throughout the rest of the book). We’ll also work through one of the most confusing parts of the WordPress community: WordPress.org versus WordPress.com. Let’s kick things off with the most basic question of all: Just what is WordPress?

What Is WordPress?

The summer of 2013 was the 10th anniversary of the first public release of WordPress (WordPress 0.7). WordPress has come a long time since then (by the time you’re reading this book, WordPress will be at least version 3.8, probably 3.9) and has evolved from “just a tool for running a blog” to a powerful tool for creating blogs, websites, and all manner of web-based tools. So, is WordPress for blogs? Yes. Websites? Yes. Big websites? Certainly. Really huge websites? Is The New York Times big enough? Can I build an online shopping site on WordPress? Sure, lots of folks do. Is there anything WordPress can’t do? It can’t jump to warp speed or alter the space-time continuum, but they’re working on that.

In all seriousness, WordPress is a powerful, easy to use, free, open-source Content Management System, or CMS. Which means that WordPress is great at letting people publish words and pictures on the Internet and wrapping a great layout around it—for free. As open-source software, WordPress is free to download and use—and even modify yourself—by anyone. There is no charge for downloading and using WordPress, even for commercial groups. WordPress.com is a little different, and we’ll get to that in a moment.

Yes, there are some things that WordPress isn’t great at (like very complex websites with lots of rules about what users can see and do based on their roles), but there are tools like Drupal that pick up where WordPress leaves off (and are harder to use, too). Roughly 20% of the websites on the Internet run on WordPress (that’s more than 60 million sites, by the way), and the majority of major websites use WordPress as well. So, it’s safe to say that if you’re choosing WordPress for your blog or website, you’re not only in good company, but it’s a choice that millions of other people have made as well.

How WordPress Works

So how does WordPress make all this magic happen? It’s not magic—okay, it seems like magic sometimes—just a clever combination of code and a database that interactively pulls pieces and parts to get to make a “website” appear on the Internet. First, WordPress is a content management system, or CMS, which (generally) means that the content for a website and the settings are stored in a database, and the code to make the website appear and the look and feel of the site (called a theme or template) are stored separately as individual files on the server. What this means in practical terms is that your content is divorced from the look and feel of the website. So changing the website’s theme doesn’t break or alter the content (and generally, vice versa). This also means that if you change how the website looks, you don’t have to retype all the content or touch every page of the site for the change to take effect across the site. Changes to a site’s theme or template aren’t only global, but instantaneous as well.

In the case of WordPress, the database used is the open source database MySQL, and the “engine” that pulls information in the database together with other files to make the website is the scripting language PHP. For the scope of this book, you’re not going to have to worry too much about MySQL or PHP, but we’ll talk about them both a little bit throughout the book (just enough so you know what’s going on).

All the content and settings for a WordPress-based website are stored in a MySQL database that is created when you first install WordPress (we’ll cover this in Chapter 3, “Installing WordPress”). Your database is the most important part of your WordPress website, and one of the first things we’ll do after setting up the website is install tools to back up and maintain the database automatically. If your WordPress database becomes corrupted, you can conceivably lose your entire website. We don’t want this to happen, so we’ll make plans to avoid that situation.

All that information stored in the database is useless if you can’t get to it. That’s where PHP comes in. PHP is a scripting language like JavaScript that is great at pulling information from databases, combining it with templates that have both HTML and PHP code in them, and making a website appear. It’s really that simple. When you visit a WordPress-powered website, PHP scripts run to query the database for information (what content should I show here and how should it look) and then puts everything together to display the website. It happens really, really fast (milliseconds for some of the queries), and most people don’t even consider how amazing it is that the web page you’re looking at was just displayed nearly instantaneously for you just when you asked for it. The page doesn’t really exist until you want to see it. For efficiency’s sake, many sites use programs to cache or save the most popular pages as static files that change only if the content of the page is changed. This lets the server spend time serving the less-popular pages and allows the popular ones to appear faster to more users.

The same PHP-MySQL interaction goes on not just for the part of the website your visitors see, but the section of the website that you use to administer the site—and all at the same time. So while you’re administering the site, people can still visit and read your content without knowing that you’re working behind the scenes writing new content or making changes.

WordPress uses themes to make your site look how you like it. Themes are a collection of PHP, HTML, images, and style sheet (CSS) files that come together to define the layout of the site and how content is presented. WordPress also uses little sets of mini scripts called plugins (which we’ll cover in more depth in Chapter 4, “Installing WordPress Plugins”) that add additional features to a website. Features like contact forms, slideshows, security, search engine optimization (SEO) tools, and more. It’s the combination of plugins and themes that really makes WordPress a powerful CMS that can meet almost any website need.

Over the past 10 years, WordPress has gotten more powerful, easier to use (which is rare in software), faster, and more feature rich. Although many of the pieces and parts of WordPress use newer and newer technologies to work better (like HTML 5 and advanced JavaScript code for special features), at its core, it’s still PHP and MySQL that are doing a lot of the work to make your website appear to the world.

WordPress.org Versus WordPress.com

If there is one thing about WordPress that is confusing, it’s the relationship between WordPress.org (Figure 2.1) and WordPress.com (Figure 2.2). It can get a little confusing, especially when you need to talk about both of them at the same time. The bottom line is that they are very similar, but also different. They serve different needs and niches, but also run on (nearly) the same code. Learning WordPress on a website running on WordPress.com is a great way to start, and you can make the transition to WordPress.org in no time. So, what are the differences? Here we go.

Image

FIGURE 2.1 The WordPress.org home page.

Image

FIGURE 2.2 WordPress.com home page.

Essentially, WordPress comes in two “flavors”—the install-it-yourself version found at WordPress.org and a hosted solution run by Automattic (the company that also supports the WordPress community) at WordPress.com. The install-it-yourself (do-it-yourself/DIY) flavor is how WordPress was originally released 10 years ago, and WordPress.org is the heart and soul of the WordPress community. Most of us within the WordPress community started using WordPress by installing through WordPress.org. WordPress.com is a freemium, hosted blog service (like Google’s Blogger or Tumblr). WordPress.com runs a nearly identical version of WordPress as you can download from WordPress.org. In fact, you can start your own hosted service running on WordPress starting with the version you download from WordPress.org (just like WordPress.com). Automattic is the company that owns and runs WordPress.com (and many other website tools). Matt Mullenweg, one of the original creators of WordPress, started Automattic so there could be a business of WordPress (first WordPress.com and then many other solutions and services as well). Automattic doesn’t own WordPress.org, but it supports the nonprofit WordPress Foundation, which holds the master copyright to the code, logo, and intellectual property of WordPress.


Image NOTE

A freemium is a service that is free but also allows you the option of paying for extra features.


When we talk about the DIY version of WordPress from WordPress.org, and we talk about “installing” it yourself, we’re not talking about installing a program on your computer at home—WordPress isn’t that kind of application. To work, WordPress needs a web server, database server, and other applications normally only found on servers. WordPress is something you install on a server. In this case, we’re talking about a web server run by your web host, as we discussed in Chapter 1, “How Websites Work.” When WordPress is installed on a web host, you have a lot of control over WordPress, and a lot of responsibility, too. Out-of-the-box WordPress comes with three basic (but very nice) themes and can be a very serviceable website just like that. However, the reason people install WordPress themselves is for control and flexibility. Using WordPress.org, you can install any theme you’d like so that you can make your site look exactly how you want it; you can add features such as newsletters, social media tools, and slideshows using plugins (which we’ll talk about more in Chapter 4). However, it’s also your responsibility to keep WordPress and all the other components of your site (such as the plugins and themes you install) updated with the latest versions and releases. Updates to WordPress, plugins, and themes aren’t just to add new features—these updates also fix bugs and close security holes. It’s essential that you keep your installation of WordPress up to date to reduce the chances that your site will be vulnerable to hackers. How much of this updating is automatic? Starting with WordPress 3.7, you can choose how much of WordPress you’d like to have updated automatically. The most essential part of WordPress to keep up to date is WordPress itself. Between major releases (like 3.6, 3.7, and 3.8), there are “point releases,” such as 3.6.1, which primarily fix bugs and security holes. Major WordPress releases (like 3.6, 3.7, and 3.8) fix bugs and tend to introduce new features and improvements (such as automatic updates for point releases coming in WordPress 3.7).

Why all the fuss about updating? Because WordPress is open source, the source code for the entire system is freely available to download and peruse yourself. So, when an update to WordPress is released, especially if it’s deemed an urgent security fix, all the bad guys have to do is compare the code between the two versions to understand how to hack any site still running the older versions of WordPress. Get it? Good.

On the other hand, WordPress.com is a hosted version of WordPress very much like Google’s Blogger. The folks at Automattic have many servers all around the world running WordPress.com. Although WordPress.com and WordPress.org essentially are the same code, because WordPress.com is a hosted service, there are limits placed on the things you can do within WordPress.com. You can still do all the basic things on WordPress.com that you can with WordPress.org (posting content, uploading images, quickly changing themes, and other personal touches), but you are limited to the number of themes available (roughly 290 themes), and you can’t install a plugin to add a feature that you need (if it isn’t available on WordPress.com). This means that the features and themes you see offered on WordPress.com are what you get; you can’t add more for love or money. But with roughly 290 themes available (most are free, but there are a few paid ones) and enough features to satisfy all but power WordPress users, it’s hard to argue with the price—free. Yes, on WordPress.com, you can have a blog or website for free. If you want to pay extra, you can use your own domain name with your site as well as pay for other add-ons that do give you more flexibility with your site. The other thing about WordPress.com that you should know is that it almost never goes down. Like all most hosted website services, Automattic puts a huge priority on ensuring that WordPress.com and all the sites on it are available 99.99% of the time.

These are the top-line differences between DIY and WordPress.com, so the question you’re probably asking yourself is how you choose between one and the other. Let me help you with that decision.

Which WordPress Is Right for You?

I often liken DIY to living in a condo and WordPress.com to living in a dorm. In a condo, you own the property and are responsible for a lot of things; however, often there are rules you have to follow, and the condo association takes care of some maintenance for you. This is what a web host is like. You’re responsible for the upkeep of your site, and you have to play by some rules, but the host will make sure the servers stay running and connected to the Internet. On the other hand, WordPress.com—and just about all other hosted systems—is like a dorm room. You get some space and you can do a lot within that space, but there are more rules and less flexibility. In a dorm room, you can put up posters, but not install a bay window. In a condo, you can install the bay window yourself, but if it falls out and damages the building, you’re in trouble.

One potential gotcha with WordPress.com is that it does not allow third-party ads of any sort. So if you’d like your website to be supported with Adsense or other advertising, that’s a no go from the start. If you make things (for example, for sale on Etsy) or write books (like me!), you can link to the places for people to buy your stuff. The problems come when you have ads for other people and other people’s stuff (pretty much all the ads you see online). The next decision sits entirely with you: Do you need a custom look or custom features in your site? If you are creating a website that needs to match a certain look and feel and branding, chances are WordPress.com isn’t for you.

Here’s what it comes down to:

• WordPress.org gives control and flexibility.

• WordPress.com gives simplicity and reliability.

Using WordPress.org, you have complete control and flexibility over your site. You can do pretty much whatever you’d like with WordPress (including modifying how WordPress itself works), the theme, and the features. This option always means you will need a web hosting account of some kind (as well as a domain name).

Using WordPress.com, you have a simple and fast way to launch a website for free. We’ll talk about the paid add-ons in WordPress.com in Chapter 14, “All About WordPress.com”—go ahead and jump forward if you’d like—as well as ways you can make WordPress.com your own. However, the simplicity of just clicking and launching a website with no fuss or muss comes at a cost of being able to control every aspect of the site. You do get a very reliable host, but the three web hosts that are recommended by WordPress.org are also very reliable as well.


Image NOTE

Automattic is offering more and more “business and enterprise” plans that do allow some custom themes and additional features not found on “regular” WordPress.com. However, these business and enterprise plans run from hundreds of dollars a year to hundreds of dollars a month.


My advice? Tinker with WordPress.com a bit. A WordPress.com account is pretty handy for many features of WordPress.org-based sites as well, so it can’t hurt. Kick the tires and see if WordPress.com will do the trick for you. Throughout the remainder of the book, we’ll be using a WordPress.org-based site for examples and reference, but if there is something that is different under WordPress.com, I’ll point you to Chapter 14 for the details.

Conclusion

If you started thinking WordPress was just a simple tool for running a blog, I hope you now see that it’s much, much more than that. WordPress is a powerful tool for building websites that is supported by thousands of people around the world. The WordPress community is one of the best things about using WordPress. There are people in just about every place in the world who can help you with your WordPress website—and they are more than happy to do it. Now it’s time to dig into WordPress and get that new site of yours ready.

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

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