I’ve forwarded that information now and I think it’s finally solved now with the new API code:
<!-- BEGIN MAIN WRAPPER (show only if Twitch channel name entered) -->
<?php if( get_theme_mod('sst_channel_name') != '') {
$channel=get_theme_mod('sst_channel_name');
$api_url="https://api.twitch.tv/helix/streams?first=1&user_login=".$channel;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: ls2awgx5gfg9m1q6iopdqb1b7d0y6a'
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$api_url);
$result=curl_exec($ch);
$twitch_array=json_decode($result, true);
$online_status=$twitch_array["data"][0]["type"];
curl_close($ch);
?>
<div class="sst-main-wrapper">
<?php include( plugin_dir_path( __FILE__ ) . 'include.php'); ?>
</div>
<?php } ?>
<!-- END MAIN WRAPPER (show only if Twitch channel name entered) -->
<script>
jQuery('.sst-twitch').each(function () {
var nickname = jQuery(this).data('nickname');
<?php
if ($online_status!="live") {
if( get_theme_mod('sst_offline_hide') != '') { ?><?php } else { ?>jQuery('.sst-main-wrapper, .sst-main-widget-wrapper').addClass('sst-main-wrapper-active');<?php } ?>
// animations
jQuery('.sst-status-text-offline').addClass('sst-current-status');
setTimeout(function() {
jQuery('.sst-status-text-offline').addClass('sst-current-status-active');
jQuery('.sst-status-wrapper').addClass('sst-status-wrapper-active');
}, 25);
<?php
} else {
?>
// show if online
jQuery('.sst-main-wrapper, .sst-main-widget-wrapper').addClass('sst-main-wrapper-active');
// animations
jQuery('.sst-status-text-live').addClass('sst-current-status');
setTimeout(function() {
jQuery('.sst-status-text-live').addClass('sst-current-status-active');
jQuery('.sst-status-wrapper').addClass('sst-status-wrapper-active');
}, 25);
<?php
}
?>
});
</script>