SyntaxFix
Write A Post
Hire A Developer
Questions
Earlier mentioned solution with PHP version check added:
$max_includes = version_compare(PHP_VERSION, '5', '<') ? 0 : 1; if (count(get_included_files()) <= $max_includes) { exit('Direct access is not allowed.'); }