本文档为WordPress开发者提供了从插件开发到发布和维护的完整指南,涵盖测试、命名、文档编写、提交流程、开源协作和用户反馈等关键环节,旨在帮助开发者成功管理插件生命周期。
You’ve written the next Hello Dolly and you want the world to use it. What should you do?
With any luck, your plugin will be used by lots of people in many different situations and hosting environments. You’ll want to make sure you’ve tested your plugin to make sure it works in any situation and doesn’t frustrate your users.
A plugin name should reflect the uniqueness of you and your work. When you pick a name, make sure you’re not violating trademarks or stomping on someone else’s product names. If you’re not working for FaceRange (a fake company), you shouldn’t name your plugin ‘FaceRange’s Dancing Squirrels’ after all. A much better name would be ‘Dancing Squirrels for FaceRange’ for example. It can be hard to come up with a good name, so take your time. Your plugin URL cannot be changed after you submit it, but the display name can change a thousand times.
Display names are generated from the headers in the main plugin file so mind your Ps and Qs.
A README.txt file is the best place to start, as it’s a standard reference point for all plugins. You’ll want to make sure you include:
In order to submit a plugin, there are three steps:
plugins@wordpress.org in your email client to ensure you receive email communications.Once a plugin is queued for review, we will review the code for any issues within 14 business days. Most of the issues can be avoided by following the guidelines. If we do find issues, we will contact the developer(s), and work towards a resolution. Once approved, you’ll receive an email with details as to how to access to a Subversion Repository where you’ll store your plugin.
After you upload your plugin (and a readme file) in that repository via SVN, it will appear on the plugin directory.
The WordPress.org plugins directory is the easiest way for potential users to download and install your plugin. WordPress’ integration with the plugin directory means your plugin can be updated by the user in a couple of clicks.
When you’re ready to release your first version, you’ll want to sign up. After a review process is completed successfully, you’ll be granted a Subversion Repository for your code. We have documentation about using SVN on WordPress.org, which is a slightly different workflow than you may be familiar with if you use GIT.
Open source is one of the most powerful ideas of our time because it empowers collaboration across borders. By encouraging contributions, you’re allowing others to love your code as much as you do. There are several options to open source your code:
You’ll often find that your users put your code through many more test cases than you could’ve imagined. This can be tremendously valuable feedback.
Releasing your code through WordPress.org means your plugin automatically has a support forum. Use it! You can subscribe to receive new posts by email and respond to your users in a timely manner. They just want to love your plugin as much as you do.
Jetpack has a post you can point to about writing great bug reports.
The best plugins are the ones that keep iterating over time, pushing small changes along the way. Don’t let your hard work go stale by waiting too long to update. Keep in mind, constant upgrades can cause ‘Update Fatigue’ and users will stop upgrading. Keeping a balance between too few updates and too many updates is important.
Like in other parts of life, the best things come from patience and hard work.