This post is part of the ClassicPress Plugin Development series in which I am going to look at both best practice for developing plugins and how I approach some requirements as well as some of the functions I commonly use.
Putting an index.php in every folder is technically required and websites should be configured to disallow directory browsing anyway, but as plugins will e used by many different people, I would generally call putting one into every folder best practice as your plugin could be installed on a website which is allowing directory browsing and this will stop people seeing a list of the files.
Classicpress itself uses an index.php file to stop directory browsing:
<?php
// Silence is golden.
There is no requirement for the file to include any code or text, but in all of my plugins I use a file similar to the above in every folder.
Click to show/hide the ClassicPress Plugin Development Series Index
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.