Plugin code requirements

Just as there were requirements for a theme, there are requirements for a plugin. At the very least, your plugin must satisfy the following:

Then, of course, you must have some functions or processing code; but WordPress will recognize any file that meets these requirements as a plugin.

If your plugin is a simple one, then you can just place a unique PHP file straight in your wp-content/plugins directory, so it can sit next to the default Hello Dolly plugin that WordPress comes with. However, a much better practice is to create a subdirectory (again, with a unique name) and place your PHP file there. It makes the wp-content/plugins directory seem much more organized. Plus, you never know when your plugin is going to need some additional files (it's always easier to simply add new files to a previously existing plugin directory, than to restructure the plugin from scratch).