The following security measures should be observed when creating new folders or files in WordPress:
- Every folder should have an index.php file to prevent accidental access to the folder files. By default, this file contains just 2 lines:
<?php
// Silence is golden.
- Every php file should have the following line of code at the top to prevent someone directly accessing the file.
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
