- WordPress Plugin Development Beginner's Guide
- Vladimir Prelovac
- 521字
- 2021-05-21 20:12:22
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.
- Painter 現(xiàn)代服裝效果圖表現(xiàn)技法
- Animate 2022動畫制作:團體操隊形
- Microsoft SharePoint 2010 Administration Cookbook
- iPhone JavaScript Cookbook
- 綁定的藝術(shù):Maya高級角色骨骼綁定技法(第2版)
- AutoCAD 2024建筑設(shè)計從入門到精通(升級版)
- Service Oriented Java Business Integration
- iPad Procreate風(fēng)格繪畫之美
- CorelDRAW X6平面設(shè)計與制作案例教程
- Premiere Pro CC 2015中文版基礎(chǔ)與實例教程(第4版)
- 玩轉(zhuǎn)微信5.0
- Photoshop-CorelDRAW 基礎(chǔ)培訓(xùn)教程
- Moodle 2.0 for Business Beginner's Guide
- OpenVPN 2 Cookbook
- 中文版Photoshop CS6基礎(chǔ)教程