- WordPress Plugin Development Beginner's Guide
- Vladimir Prelovac
- 521字
- 2025-03-31 06:47:52
The main concepts behind the Wall plugin
Before we start with our plugin, let's take a moment and create a design outline covering the main areas of the plugin.
- Widget: Obviously, the first thing on our list is to create a sidebar area for the wall. We will use WordPress widget API to do that.
- Wall Comments: We will store the user comments in the WordPress database.
- Comment Management: The administrator needs to be able to access comments, and approve, disapprove, or delete them.
- Security and Spam protection: Being on the front page and on most other pages of our site, the wall is exposed to various threats. We need to think of a way to protect our blog from unwanted spam.
- Options and Styling: Last but not least, we want to be able to customize the look of the widget. Since the wall will be constrained within a relatively small area (the sidebar), we need to carefully plan the look and the functionality of the widget.
The main development concerns here are the management of comments, and spam protection.
A typical PHP approach to address these concerns would be:
- Create a database to store the comments in.
- Create an administrative backend with comment management functionality.
- Implement a set of rules for combating spam, such as black lists, user IP bans, and so on.
It is obvious that this approach needs a long development time. On the other hand, this is a book about WordPress, which is arguably the best blogging platform in the world today. Blogging includes a lot of commenting, and WordPress already features one of the most advanced commenting engines available. So why just not take advantage of it?
The main principle behind our idea is to dedicate a WordPress page as a place holder for all user comments. This allows us to use the WordPress commenting engine to take care of most of the hard work, such as adding the comments, administrative management and best of all—spam protection.
WordPress already comes with built-in comment spam and flood protection.

There are also a number of popular anti-spam plugins such as Akismet that deal with the problem of spam in the comments. So instead of reinventing the wheel, we will leave these dedicated plugins to do the job.
By using built-in WordPress functionalities whenever we can, we also provide the opportunity for the plugin to develop itself automatically with the development of WordPress. For example, if the next version of WordPress brings comment editing in a super cool 3D way, all comments for our widget will become editable in the same way automatically.
This will allow us to spend more time focusing on other areas of the widget—like deciding which jQuery effects we can use to make it more attractive.
Tip
Use built-in WordPress functionalities whenever you can. Try to think outside of the box and find features of WordPress that can help you with your plugin. Always try to find fresh ways to re-use the code that a large community of WordPress developers has already contributed. It saves time and gets you free upgrades.