macbookandrew / wp-youtube-live

Displays the current YouTube live video from a specified channel
20 stars 12 forks source link

Fix error message showing even when debugging is set to false #25

Closed hosungs closed 7 months ago

hosungs commented 8 months ago

First of all, thanks a lot for the great plugin! I tried this on a Wordpress site I help with, and it works great when the live streaming is in session, but I noticed that the plugin shows the red error message when the live streaming is not in session, even if the debugging setting is set to false. I looked around and It appears that this was addressed at https://wordpress.org/support/topic/needs-an-update-27/#post-16487899 and likely fixed, but it looks to me the issue is still present, thus proposing this fix.

Being a php novice, I'm not sure if this is the right/desirable fix, but apparently the existing get_option('youtube_live_settings', 'debugging') seems always true (according to the Wordpress get_option() doc https://developer.wordpress.org/reference/functions/get_option/ and the PHP semantics about the truthiness of a non-empty string), and displays the error message always even when the debugging is set to false in the plugin settings. Please do comment with a better fix, and I'll add another commit to reflect your feedback. Thanks again!

Fixes #23.

macbookandrew commented 8 months ago

Note: this should fix #23