Contents
Introduction
Releasing your plugin on WordPress.org opens your work to millions of users, granting visibility, community feedback, and seamless updates. This guide walks you step-by-step through planning, preparing, and publishing your plugin according to the official WordPress Plugin Handbook guidelines.
1. Prerequisites
- WordPress.org account: Register at wordpress.org.
- SVN client: Install a Subversion client such as TortoiseSVN (Windows) or command-line SVN (Apache Subversion).
- Plugin code: Fully tested on a development WordPress install.
- Readme.txt: Prepared according to readme.txt standards.
2. Planning Your Plugin
A strong foundation ensures maintainability and compliance:
- Unique slug: Confirm the plugin slug (directory name) is unused via the plugin directory search.
- Namespace/Prefixes: Avoid conflicts by prefixing functions, classes, and constants (e.g.,
myplugin_
). - Internationalization (i18n): Wrap strings in
__()
or_e()
and load a .pot file. - Security practices: Sanitize (
sanitize_text_field()
), validate, and escape (esc_html()
) all input/output.
3. Directory Structure File Requirements
At minimum, your plugin folder should contain:
File/Folder | Description |
---|---|
myplugin.php |
Main plugin file with header metadata. |
readme.txt |
Plugin description for WordPress.org. |
/assets/ |
Optional: banners, icons following assets guidelines. |
4. Crafting Your readme.txt
The readme.txt
file powers your plugin page, support tab, and FAQ. Required sections:
- === Plugin Name === (followed by a one-line description)
- == Description == Detailed overview and features.
- == Installation == Step-by-step instructions.
- == Frequently Asked Questions == Use
==
and=
headings. - == Changelog == Document releases.
- == Upgrade Notice == (optional) Changes between versions.
Validate with the official readme validator.
5. Licensing
WordPress plugins must be GPL-compatible. Include a license header in every PHP file:
/ Plugin Name: My Plugin ... License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html /
6. Submitting to the Repository
Follow these steps to upload your plugin:
- Log in to wordpress.org and go to Plugins gt Add New Plugin. Enter your plugin slug and description.
- Agree to the guidelines and click Submit. You will receive an approval email within 1–2 business days.
Note: Do not make changes until you receive SVN access. - After approval, youll get a link to your SVN repository:
https://plugins.svn.wordpress.org/your-plugin-slug/
.
7. Working with SVN
SVN organizes your plugin in three directories:
Directory | Purpose |
---|---|
trunk | Development version—contains latest code. |
tags | Tagged releases (e.g., /tags/1.0.0/ ). |
branches | Optional experimental branches. |
Basic SVN workflow:
svn checkout https://plugins.svn.wordpress.org/your-plugin-slug # Copy your files into trunk/ svn add trunk/ svn commit -m Initial commit of My Plugin v1.0.0 # Create a tag svn copy trunk tags/1.0.0 -m Tagging version 1.0.0
8. Managing Assets
Place banners and icons inside the /assets/
directory in SVN root (not in trunk):
- banner-1544×500.png: Plugin banner.
- icon-256×256.png: Admin icon.
- Refer to official asset sizes.
9. Post-Launch Checklist
- Verify plugin page: Check description, screenshots, FAQ, and assets.
- Support tab: Enable and monitor user support on WordPress.org.
- Continuous updates: Tag each release and commit changelogs.
- Security reviews: Respond promptly to vulnerability reports.
10. Best Practices Resources
Maintain quality and compliance by consulting:
Conclusion
Publishing your plugin to WordPress.org is a rewarding process that expands your reach and helps the community. By following these guidelines—proper planning, adhering to coding standards, crafting a solid readme.txt
, and mastering SVN—you’ll ensure a smooth launch and ongoing success. Happy coding!
|
Acepto donaciones de BAT's mediante el navegador Brave 🙂 |