As an aid to plugin developers, we will be frequently posting code snippets or tutorials about best practices. Today we will be dealing with the simplest and most essential part of a WordPress plugin, the comments found in the plugin’s main PHP file, aka the header. We’ve gone through some of the top plugins and seen how they format their header. The format below is the one which we liked most, following the syntax employed by Alex Mills (Viper007Bond) in his plugins. We recommend that we use it for your plugins too, because it is very neatly laid out.
[php]
<?php /*
**************************************************************************
Plugin Name: WP Google Adsense Dashboard
Plugin URI: http://www.jeangalea.com/wordpress/wwp-google-adsense-dashboard/
Description: Displays graphical reports on your Google Adsense earnings in the WP dashboard.
Version: 1.0
Author: Jean Galea
Author URI: http://www.jeangalea.com/
License: GPLv3
**************************************************************************
Copyright (C) 2012 Jean Galea
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
?>
[/php]
If you enjoyed this post, make sure to subscribe to WPMayor’s RSS feed.