file_exists() acting weird

You are using get_template_directory_uri(), that’s URL, not PATH.

Instead use get_template_directory(), that’ll return PATH. Like:

$csv = get_template_directory() . '/report/report.csv';

Leave a Comment