There are 2 problems:
include( get_template_directory() . '/audiounity/result.php' );
The result of this is likely:
/srv/www/example.com/public_html/wp-content/themes/audiounity/audiounity/result.php
The first line of the Codex entry for that function is:
Retrieves the absolute path to the directory of the current theme.
If it’s a child theme, then you need to use get_stylesheet_directory
. *_template_*
functions always refer to the parent theme, *_stylesheet_*
functions refer to the active theme
A Bigger Problem You’ve Missed
$data_file = unserialize(base64_decode(file_get_contents(' get_template_directory() . "/audiounity/website_setting.conf"')));
- .conf files will be readable to all, anybody can download your themes
.conf
file, would it not make more sense to store it inside a PHP file as a PHP array? unserialize
will unserialize a PHP structure, which exposes you to a PHP object injection attack. Avoid serialising and deserialising PHP
If you want to store a configuration, you have 2 options:
- use JSON,
json_encode
andjson_decode
- use a PHP array in a file
If you need to modify these files, don’t, use them as defaults and store the changes in the database as options