Home Forums Weaver Xtreme Theme PHP and require_once Reply To: PHP and require_once

#71029
Weaver
Keymaster

Weaver does NOT have any special error codes.

Did you set WP_DEBUG to true?

Did you receive an email to your admin account?

Please read this page: https://www.ecommerceceo.com/wordpress-critical-error/

And if your first post had accurate info, then I stand by my first suggestion:

But the require_once ‘php/glob.php’; seems a bit questionable. The path to php/glob.php needs to be more complete. As it stands, it is dependent on the directory wp-content/plugins/weaver-xtreme-plus/includes, where weaver_xplus_shortcodes.php is located. So you should have a complete path to where the php/glob.php is found. And since the error output says the error was on line 1, that is the require_once.

If you don’t completely understand what that last paragraph said and means, then there was something else going on with the previous [insert_php] shortcode plugin that you are missing.

Actually, that whole set of code in the [include_php] does not look as if it will work. There seems to be something missing. In a standard WP page/post, there would not be access to php/glob.php, nor opendb, nor display_murphys. Where are the definitions of those files and functions supposed to be coming from? You must answer that question before anything else.

FOLLOW UP: I looked at the page source for the example with the code output of your old PHP short code, and there is absolutely no place that the PHP code in your example could possibly work with Weavers [php] short code. Perhaps the previous short code had some settings that automatically included the requierd PHP files. Like for example, just exactly is function display_murphys() defined? Has to be done somewhere. Where? How is it included? Do you have a child theme?

Trust me, this is your problem. You can’t arbitrarily call a PHP function such as display_murphys without somehow defining it and including the php source code.

That bad reauire_once could easily cause the php error, and if you don’t have the WP_DEBUG values set correctly as described in the above link, then we can’t get anywhere on this issue.