olidueggelin, try
https://wordpress.org/plugins/insert-php/
Much more stable. Declare global every variable you use in page text.
There is one issue: single quotes don’t work. For example:
[insert_php]
echo ‘Programmers ask, “Why can\’t I include PHP code in my pages?”‘;
[/insert_php]`
will throw an error. Instead, use:
[insert_php]
echo “Programmers ask, \”Why can’t I include PHP code in my pages?\””;
[/insert_php]