https://notesontech.com/preventing-direct-access-to-php-files-in-wordpress/
Preventing direct access to PHP files in a WordPress site