QuestionsCategory: QuestionsNew Install Error: The site is experiencing technical difficulties. when attempting to see json link
podworx asked 9 months ago

Looks like this has been experienced elsewhere.

This is a brand-new WP install w/ only the WP Smart TV plugin running. When attempting to see this url:

http://pdwxroku.com/vvn/wp-json/tv/roku/

I get the error mentioned above. If I turn on debugging, I see these errors for the json link:

Fatal error: Uncaught Error: Call to undefined function is_plugin_active() in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/builders/class-wp-smart-tv-roku-dp.php:28

Stack trace:

0 /home/roku/public_html/vvn/wp-includes/rest-api/class-wp-rest-server.php(946): Wp_Smart_Tv_Roku_DP->roku_dp(Object(WP_REST_Request))

1 /home/roku/public_html/vvn/wp-includes/rest-api/class-wp-rest-server.php(329): WP_REST_Server->dispatch(Object(WP_REST_Request))

2 /home/roku/public_html/vvn/wp-includes/rest-api.php(309): WP_REST_Server->serve_request(‘/tv/roku’)

3 /home/roku/public_html/vvn/wp-includes/class-wp-hook.php(286): rest_api_loaded(Object(WP))

4 /home/roku/public_html/vvn/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)

5 /home/roku/public_html/vvn/wp-includes/plugin.php(531): WP_Hook->do_action(Array)

6 /home/roku/public_html/vvn/wp-includes/class-wp.php(387): do_action_ref_array(‘parse_request’, Array)

7 /home/roku/public_html/vvn/wp-includes/class-wp.php(737): WP->parse_request(”) in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/builders/class-wp-smart-tv-roku-dp.php on line 28

============================================================================================================================================================================================================

Now, w/ debugging on, when I go into the admin area of the WP site, I see all of this as well:

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 94

Warning: file_get_contents(https://rovidx.com/edd-api/products/): failed to open stream: no suitable wrapper could be found in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 94

Notice: Trying to get property ‘products’ of non-object in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 100

Warning: Invalid argument supplied for foreach() in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 100

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 78

Warning: file_get_contents(https://docs.rovidx.com/wp-json/wp/v2/document?_embed): failed to open stream: no suitable wrapper could be found in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 78

Warning: array_reverse() expects parameter 1 to be array, null given in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 79

Warning: Invalid argument supplied for foreach() in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 84

Warning: Cannot modify header information – headers already sent by (output started at /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php:94) in /home/roku/public_html/vvn/wp-admin/includes/misc.php on line 1196

podworx replied 9 months ago

Rolling back to version 1.8 removes the problem. Going to v2.0 brings the problem back.

7 Answers
Rob Staff answered 9 months ago

Hi Scott,
Looks like an issue with non-standard hosts. Who is your hosting company? It’s not seeing "is_plugin_active" which is usually an issue with the host loading WordPress in a way that the function is not available.
The second error you listed is being caused by your server configuration also.
"Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/roku/public_html/vvn/wp-content/plugins/wp-smart-tv/includes/class-wp-smart-tv-addons.php on line 78"
You will need to add it to your PHP.ini.
~Rob

Rob Staff answered 9 months ago

You can add this to your php.ini

allow_url_fopen=1

If you are using it on the same host with the same plugin version and it’s working it doesn’t sound like it’s a plugin issue. I’d double check with your hosting company and see if they can give you more information.

Rob Staff answered 9 months ago

Hey Scott,

Not sure, as I mentioned some hosts have weird configurations. It appears as your host isn’t loading the "is_plugin_active" routine. Not sure why, but we are looking into it more.

~Rob

podworx answered 9 months ago

We are using hostpapa.com as our host. We have another website on the exact same host (and account) running your plugin (2.0.5) and it works prefectly so it doesn’t seem like it would be a host issue.

podworx answered 9 months ago

Add what to my php.ini file?

podworx answered 9 months ago

allow_url_fopen=1 fixed the second group of errors. Not sure what the deal is w/ the first errors. I saw somebody else have this same problem when going from 1.8 to 2.x. Why would that be? If I use 1.8, all is good.

podworx answered 9 months ago

Our server techs found a fix. They added this code to the function.php file:

// ensure is_plugin_active() exists (not on frontend)

if( !function_exists(‘is_plugin_active’) ) {

        include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

}

Can somebody explain to me why this was needed?