Introduction to WordPress plugins


Welcome to the Profitable Plugin Developer Course. Regardless of whether you're composing your first plugin or your tenth, we trust this course will help you to create the most ideal plugins as a result. 

What is WordPress?

WordPress is a Content Management System

A Content Management System helps you organize your online content, allowing you to effectively harness the power of the web without having to use or know any programming. Whether or not you understand or even know programming languages (HTML, JavaScript, and PHP), a content management system allows you to create beautiful and powerful websites. WordPress is the most popular CMS today, this brings tons of support, themes, plugins, and a massive community to help you build your web presence.

Here’s what the creators of WordPress have to say about their platform:

WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.
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 60 million people have chosen WordPress to power the place on the web they call “home” — we’d love you to join the family.

Abundance is a double edged sword however. You have so many choices! But how do you decide which one to go with? There are hundreds of plugins out there dedicated to just Search Engine Optimization, picking one above the rest can be difficult. You have to factor in what you want to get out of it, how you plan on using it, your expertise with web development, and a number of other things specific to the kind of plugin you’re looking at. That’s where we come in.

We spend a lot of time working with WordPress and finding the best plugins, themes, and addons for our clients. Why not share that knowledge with everyone? We want to help you build the best website you can using the most powerful tools. That’s why we decided to make The WordPress Tutorial! To share our knowledge and experience with you in a way to enable you to create a more powerful site for your or your business.

In the basics, we try to cover a wide range of topics — everything from what you must (or should) include in the module header, to security best practices, to instruments you can use to manufacture your plugin.

You must know that there are three main parts in WordPress: 

  1. core
  2. themes
  3. plugins

In this tutorial, we will go through the process of creating a plugin for WordPress. A WordPress plugin extends the WordPress core and is intended to be reusable code or functionality across multiple projects. This is one of the most interesting things about it - you can share your code or functionality on the web.

I am sure many, if not all of you, have already searched for a plugin in the WordPress repository or any of the available market places. This is one of the reasons why WordPress is so widely used. It's extremely extensible and has a huge community of developers around it. As of today, there are more than 39,000 publicly available free plugins on the WordPress repository.

This lecture is about plugins and how they connect with WordPress. It will enable you to see how they function and how to make your own.

Besides learning how to create plugins, you have to also learn:

  • what kind of plugins to create so they will sell well
  • how to promote them
  • how to generate profit from them

So, let's begin!

What is a Plugin?

Plugins are packages of code that extend the core functionality of WordPress. WordPress plugins are made up of PHP code and other assets such as images, CSS, and JavaScript.

By making your own plugin you are extending WordPress, i.e. building additional functionality on top of what WordPress already offers. For example, you could write a plugin that displays links to the ten most recent posts on your site.

Or, using WordPress’ custom post types, you could write a plugin that creates a full-featured support ticketing system with email notifications, custom ticket statuses, and a client-facing portal. The possibilities are endless!

Most WordPress plugins are composed of many files, but a plugin really only needs one main file with a specifically formatted DocBlock in the header.

Why We Make Plugins?

If there’s one cardinal rule in WordPress development, it’s this: Don’t touch WordPress core. This means that you don’t edit core WordPress files to add functionality to your site. This is because, when WordPress updates to a new version, it overwrites all the core files. Any functionality you want to add should therefore be added through plugins using approved WordPress APIs.

WordPress plugins can be as simple or as complicated as you need them to be, depending on what you want to do. The simplest plugin is a single PHP file. The Hello Dolly plugin is an example of such a plugin. The plugin PHP file just needs a Plugin Header, a couple of PHP functions, and some hooks to attach your functions to.

Plugins allow you to greatly extend the functionality of WordPress without touching WordPress core itself.

If you're like I was, you've probably been adding functionality to your theme instead of creating a plugin. There are plenty of cases where doing so is fine, but there are also cases where custom functionality is better off being added to a plugin. Why might you ask?

Consider this scenario.

You've added functionality to your theme that changes the default gravatar to your own custom gravatar. The only issue is, you've just changed themes and now that's gone. If you had added that code to a plugin it would still be there when you decided to switch themes.

Should You Create Plugins from Scratch?

I think the answer should be no, in situations where you can find a free plugin to implement the required features. WordPress plugin repository is full of plugins with wide range of capabilities. It’s much easier to find a plugin from the repository rather than creating from scratch.

Even though the repository contains around 20,000 plugins, there is no guarantee that there will be plugins to suit each and every requirement in your projects. In such cases you will have to either modify an existing plugin or write your own plugin from scratch.

What You’ll Need

  • Text editor
  • FTP access to your hosting account
  • A working WordPress installation