Why is it necessary to prevent direct access to included files? For example:
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Note: I notice many plugins do this but I don't see it in WordPress core files (such as capabilities.php for example).