If you have used my WordPress readme generator you would have noticed that I have a “Save As” button, which when pressed allows you to download the file which was just generated by the PHP code. (In most browsers this opens the save file as dialog box)
Recently one of the readers of my blog asked me how to do this in PHP and I was about to send him the code snippet. But then I thought of writing a blog article so that it will be useful for others as well.
So here we go.
The code is mostly self explanatory. The important part in the above code snippet is the “content Disposition” header.
Also since we are sending headers to the browser, we should not have started the output before this code executes. Otherwise we might get a “header already sent” error.
One of the most missed features in the official WordPress Plugin repository is the ability to specify the change log for your Plugins. There was no unified way for the Plugin developers to specify the changes that were made to the Plugin in each version.
Thanks to some great work done by Peter Westwood and Mdawaffe, we now have support for changelogs in the WordPress Plugin Readme standard. The information specified in the changelog will be displayed in a separate tab in the WordPress extend pages like shown in the below screenshot from WTC.
After writing some WordPressPlugins recently, I found that it takes a lot of effort to generate the Readme file for each of them.
For the uninitiated, readme file is a text file which has meta information about the Plugin and is usually bundled with the Plugin. Readme files for WordPress Plugins are very important, especially if you are planning to upload them to the official repository. WordPress follows a standard for the readme file so that the official repository can parse the meta information present in the file and render it like shown in the below screenshot.
The official Plugin repository has a sample readme file and also a validator. The readme file should have some tags and the text should be specified in the markdown format.
I was looking for ways to automate the process of generating these readme files and didn’t find a solution. So I created my own 🙂