index.php // Silence is golden in every folder?
Should I include a index.php with //silence is golden to every folder in my plugin? even css, js and images folders? Or is it just folders that contain code/ php files that should have the index.php file in it?
This article from InMotion explains why such file exists: Silence is Golden.
Quoting here the relevant parts in case the link goes down in the future:
The entire file is a placeholder. Whenever someone visits a web page, the server attempts to run index.php or index.html. If you take a look at your site directory’s index.php, you’ll see the code that generates a WordPress site.
Without index.php, anyone could just visit your site’s /wp-content folder and see all of the media, files, and directories it contains.
The index.php file functions like a privacy screen: it blocks visitors from directly accessing your directories.
Or you can use below code in your .htaccess file to prevent directory listings even if that index.php file is not present: