What to do to have access to WordPress functions

never access theme or plugin files directly in their directory, this is a non secure way to develop code which will be blocked on any server with hardened security.

If you need to get information from the site you can either add an ajax access, or json end point in your code for that.