wpzoom / instagram-widget-by-wpzoom

The easiest way to add a nice Instagram widget on your WordPress site. It just works!
https://wordpress.org/plugins/instagram-widget-by-wpzoom/
GNU General Public License v2.0
21 stars 6 forks source link

Missing 'body' when rendering a feed #46

Open polskais1 opened 1 year ago

polskais1 commented 1 year ago

I'm running into an issue where the WP Zoom preview is not able to populate a feed for my Instagram account in Wordpress Admin. Steps I've gone through:

  1. Install WP Zoom (I've tried using the WP plugin store, extracting the WP Zoom Instagram zip file into wp-content/plugins, and using Composer)
  2. Connect the Instagram account and wait for a success using an Access Token (I've done this using a personal Instagram account and a business Instagram account)
  3. Go to Add a New Feed and select the Instagram account

From there, the preview window's spinner icon just keeps rotating. The network call to https://pratt.ups.dock/?wpz-insta-widget-preview=true&_wpz-insta_user-id=26326&_wpz-insta_user-token=... never resolves (presumably) due to the following error:

PHP Fatal error:  Uncaught Error: Call to a member function prependChild() on null in /var/www/html/wp-content/plugins/instagram-widget-by-wpzoom/class-wpzoom-instagram-widget-settings.php:1878
Stack trace:
#0 /var/www/html/wp-includes/class-wp-hook.php(308): WPZOOM_Instagram_Widget_Settings->replace_preview_content('')
#1 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters('', Array)
#2 /var/www/html/wp-content/plugins/instagram-widget-by-wpzoom/class-wpzoom-instagram-widget-settings.php(394): apply_filters('final_output', '')
#3 /var/www/html/wp-includes/class-wp-hook.php(308): WPZOOM_Instagram_Widget_Settings->{closure}('')
#4 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#5 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /var/www/html/wp-includes/load.php(1124): do_action('shutdown')
#7 [internal function]: shutdown_action_hook()
#8 {main}
  thrown in /var/www/html/wp-content/plugins/instagram-widget-by-wpzoom/class-wpzoom-instagram-widget-settings.php on line 1878

It seems like the body in this case is undefined and I'm not sure why the catch isn't catching. I don't see the log from that block in my console. https://github.com/wpzoom/instagram-widget-by-wpzoom/blob/b53ff14c4c3b2fc777a0f75bf5ccac1d76b8bf71/class-wpzoom-instagram-widget-settings.php#LL1878C21-L1878C21

Any help is greatly appreciated!

ciorici commented 1 year ago

@polskais1 Do you have any posts uploaded to your Instagram account?

Maybe there are some restrictions for external connections in your local environment?

What PHP version are you using?

What theme are you using? Can you try switching to a default theme?

polskais1 commented 1 year ago

Hi @ciorici

Posts are uploaded and public on both accounts I've tried.

I don't seem to have any restrictions between the two. Generally network traffic and routing resolves correctly on both environments and I haven't had discrepancies with third party APIs so far.

PHP version 7.4.27

I'm not currently using a WP Zoom theme - just a custom theme that's extending the default WordPress Theme

polskais1 commented 1 year ago

Just a little update: I'm able to still place a feed in a page using the provided short code for that feed, however the Gutenberg block is not available.