<?php class newshit_Social_Media_Widget extends WP_Widget {
 
 public function __construct() {
    parent::__construct(
        'newshit_social_media_widget',
        esc_html__( 'NewsHit : Social Media','newshit'),
        array('description' => 'Display social media links')
    );
}

 public function widget( $args, $instance ) {
     // Retrieve the widget title
     $title = apply_filters( 'widget_title', $instance['title'] );
     // Widget output code
     $social_links = array(
         'facebook'    => array(
             'url'      => $instance['facebook_url'],
             'follower' => $instance['facebook_follower'],
         ),
         'twitter'     => array(
             'url'      => $instance['twitter_url'],
             'follower' => $instance['twitter_follower'],
         ),
         'linkedin'    => array(
             'url'      => $instance['linkedin_url'],
             'follower' => $instance['linkedin_follower'],
         ),
         'instagram'   => array(
             'url'      => $instance['instagram_url'],
             'follower' => $instance['instagram_follower'],
         ),
         'pinterest'   => array(
             'url'      => $instance['pinterest_url'],
             'follower' => $instance['pinterest_follower'],
         ),
         'youtube'     => array(
             'url'      => $instance['youtube_url'],
             'follower' => $instance['youtube_follower'],
         ),
         'vimeo'       => array(
             'url'      => $instance['vimeo_url'],
             'follower' => $instance['vimeo_follower'],
         ),
         'soundcloud'  => array(
             'url'      => $instance['soundcloud_url'],
             'follower' => $instance['soundcloud_follower'],
         ),
         'medium'      => array(
             'url'      => $instance['medium_url'],
             'follower' => $instance['medium_follower'],
         ),
         'tiktok'      => array(
             'url'      => $instance['tiktok_url'],
             'follower' => $instance['tiktok_follower'],
         ),
         'snapchat'    => array(
             'url'      => $instance['snapchat_url'],
             'follower' => $instance['snapchat_follower'],
         ),
         'whatsapp'    => array(
             'url'      => $instance['whatsapp_url'],
             'follower' => $instance['whatsapp_follower'],
         ),
         'wechat'      => array(
             'url'      => $instance['wechat_url'],
             'follower' => $instance['wechat_follower'],
         ),
         'qq'          => array(
             'url'      => $instance['qq_url'],
             'follower' => $instance['qq_follower'],
         ),
         'tumblr'      => array(
             'url'      => $instance['tumblr_url'],
             'follower' => $instance['tumblr_follower'],
         ),
         'reddit'      => array(
             'url'      => $instance['reddit_url'],
             'follower' => $instance['reddit_follower'],
         ),
         'telegram'    => array(
             'url'      => $instance['telegram_url'],
             'follower' => $instance['telegram_follower'],
         ),
         'line'        => array(
             'url'      => $instance['line_url'],
             'follower' => $instance['line_follower'],
         ),
     );


    echo wp_kses_post( $args['before_widget'] ); 
    if ( !empty( $instance['title'] ) ) {
        echo wp_kses_post( $args['before_title'] ) . apply_filters( 'widget_title', esc_html( $instance['title'] ) ) . wp_kses_post( $args['after_title'] );
    }
	
     
     echo '<ul class="newshit-social-media-widget">';
     
     foreach ( $social_links as $social => $data ) {
         $url = $data['url'];
         $follower = $data['follower'];
         if ( ! empty( $url ) ) {
            ?>
            <li>
                <div class="newshit-social-link">
                    <a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( esc_html( $social ) ); ?>" title="<?php echo esc_attr( esc_html( $social ) ); ?>"></a>
                </div>
                <?php if( !empty( $follower ) ) : ?>
                <div class="newshit-social-follower">
                    <label><?php esc_html_e( 'Followers', 'newshit' ); ?></label>
                    <span><?php echo esc_html( $follower ); ?></span>
                </div>
                <?php endif; ?>
            </li>
            <?php 
         }
     }
     
     echo '</ul>';
     echo wp_kses_post( $args['after_widget'] );
 }

 public function form( $instance ) {
    $title = !empty( $instance['title'] ) ? $instance['title'] : '';
     // Output the widget form fields
     $facebook_url = ! empty( $instance['facebook_url'] ) ? $instance['facebook_url'] : '';
     $facebook_follower = ! empty( $instance['facebook_follower'] ) ? $instance['facebook_follower'] : '';
     $twitter_url = ! empty( $instance['twitter_url'] ) ? $instance['twitter_url'] : '';
     $twitter_follower = ! empty( $instance['twitter_follower'] ) ? $instance['twitter_follower'] : '';
     $linkedin_url = ! empty( $instance['linkedin_url'] ) ? $instance['linkedin_url'] : '';
     $linkedin_follower = ! empty( $instance['linkedin_follower'] ) ? $instance['linkedin_follower'] : '';
     $instagram_url = ! empty( $instance['instagram_url'] ) ? $instance['instagram_url'] : '';
     $instagram_follower = ! empty( $instance['instagram_follower'] ) ? $instance['instagram_follower'] : '';
     $pinterest_url = ! empty( $instance['pinterest_url'] ) ? $instance['pinterest_url'] : '';
     $pinterest_follower = ! empty( $instance['pinterest_follower'] ) ? $instance['pinterest_follower'] : '';
     $youtube_url = ! empty( $instance['youtube_url'] ) ? $instance['youtube_url'] : '';
     $youtube_follower = ! empty( $instance['youtube_follower'] ) ? $instance['youtube_follower'] : '';
     $vimeo_url = ! empty( $instance['vimeo_url'] ) ? $instance['vimeo_url'] : '';
     $vimeo_follower = ! empty( $instance['vimeo_follower'] ) ? $instance['vimeo_follower'] : '';
     $soundcloud_url = ! empty( $instance['soundcloud_url'] ) ? $instance['soundcloud_url'] : '';
     $soundcloud_follower = ! empty( $instance['soundcloud_follower'] ) ? $instance['soundcloud_follower'] : '';
     $medium_url = ! empty( $instance['medium_url'] ) ? $instance['medium_url'] : '';
     $medium_follower = ! empty( $instance['medium_follower'] ) ? $instance['medium_follower'] : '';
     $tiktok_url = ! empty( $instance['tiktok_url'] ) ? $instance['tiktok_url'] : '';
     $tiktok_follower = ! empty( $instance['tiktok_follower'] ) ? $instance['tiktok_follower'] : '';
     $snapchat_url = ! empty( $instance['snapchat_url'] ) ? $instance['snapchat_url'] : '';
     $snapchat_follower = ! empty( $instance['snapchat_follower'] ) ? $instance['snapchat_follower'] : '';
     $whatsapp_url = ! empty( $instance['whatsapp_url'] ) ? $instance['whatsapp_url'] : '';
     $whatsapp_follower = ! empty( $instance['whatsapp_follower'] ) ? $instance['whatsapp_follower'] : '';
     $wechat_url = ! empty( $instance['wechat_url'] ) ? $instance['wechat_url'] : '';
     $wechat_follower = ! empty( $instance['wechat_follower'] ) ? $instance['wechat_follower'] : '';
     $qq_url = ! empty( $instance['qq_url'] ) ? $instance['qq_url'] : '';
     $qq_follower = ! empty( $instance['qq_follower'] ) ? $instance['qq_follower'] : '';
     $tumblr_url = ! empty( $instance['tumblr_url'] ) ? $instance['tumblr_url'] : '';
     $tumblr_follower = ! empty( $instance['tumblr_follower'] ) ? $instance['tumblr_follower'] : '';
     $reddit_url = ! empty( $instance['reddit_url'] ) ? $instance['reddit_url'] : '';
     $reddit_follower = ! empty( $instance['reddit_follower'] ) ? $instance['reddit_follower'] : '';
     $telegram_url = ! empty( $instance['telegram_url'] ) ? $instance['telegram_url'] : '';
     $telegram_follower = ! empty( $instance['telegram_follower'] ) ? $instance['telegram_follower'] : '';
     $line_url = ! empty( $instance['line_url'] ) ? $instance['line_url'] : '';
     $line_follower = ! empty( $instance['line_follower'] ) ? $instance['line_follower'] : '';
     ?>
     <p>
        <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo esc_html__( 'Title :', 'newshit' ) ?></label>
        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
	</p>
     <p>
         <label for="<?php echo $this->get_field_id( 'facebook_url' ); ?>">Facebook URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'facebook_url' ); ?>" name="<?php echo $this->get_field_name( 'facebook_url' ); ?>" value="<?php echo esc_attr( $facebook_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'facebook_follower' ); ?>">Facebook Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'facebook_follower' ); ?>" name="<?php echo $this->get_field_name( 'facebook_follower' ); ?>" value="<?php echo esc_attr( $facebook_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'twitter_url' ); ?>">Twitter URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'twitter_url' ); ?>" name="<?php echo $this->get_field_name( 'twitter_url' ); ?>" value="<?php echo esc_attr( $twitter_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'twitter_follower' ); ?>">Twitter Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'twitter_follower' ); ?>" name="<?php echo $this->get_field_name( 'twitter_follower' ); ?>" value="<?php echo esc_attr( $twitter_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'linkedin_url' ); ?>">LinkedIn URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'linkedin_url' ); ?>" name="<?php echo $this->get_field_name( 'linkedin_url' ); ?>" value="<?php echo esc_attr( $linkedin_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'linkedin_follower' ); ?>">LinkedIn Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'linkedin_follower' ); ?>" name="<?php echo $this->get_field_name( 'linkedin_follower' ); ?>" value="<?php echo esc_attr( $linkedin_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'instagram_url' ); ?>">Instagram URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'instagram_url' ); ?>" name="<?php echo $this->get_field_name( 'instagram_url' ); ?>" value="<?php echo esc_attr( $instagram_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'instagram_follower' ); ?>">Instagram Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'instagram_follower' ); ?>" name="<?php echo $this->get_field_name( 'instagram_follower' ); ?>" value="<?php echo esc_attr( $instagram_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'pinterest_url' ); ?>">Pinterest URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'pinterest_url' ); ?>" name="<?php echo $this->get_field_name( 'pinterest_url' ); ?>" value="<?php echo esc_attr( $pinterest_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'pinterest_follower' ); ?>">Pinterest Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'pinterest_follower' ); ?>" name="<?php echo $this->get_field_name( 'pinterest_follower' ); ?>" value="<?php echo esc_attr( $pinterest_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'youtube_url' ); ?>">YouTube URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'youtube_url' ); ?>" name="<?php echo $this->get_field_name( 'youtube_url' ); ?>" value="<?php echo esc_attr( $youtube_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'youtube_follower' ); ?>">YouTube Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'youtube_follower' ); ?>" name="<?php echo $this->get_field_name( 'youtube_follower' ); ?>" value="<?php echo esc_attr( $youtube_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'vimeo_url' ); ?>">Vimeo URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'vimeo_url' ); ?>" name="<?php echo $this->get_field_name( 'vimeo_url' ); ?>" value="<?php echo esc_attr( $vimeo_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'vimeo_follower' ); ?>">Vimeo Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'vimeo_follower' ); ?>" name="<?php echo $this->get_field_name( 'vimeo_follower' ); ?>" value="<?php echo esc_attr( $vimeo_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'soundcloud_url' ); ?>">SoundCloud URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'soundcloud_url' ); ?>" name="<?php echo $this->get_field_name( 'soundcloud_url' ); ?>" value="<?php echo esc_attr( $soundcloud_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'soundcloud_follower' ); ?>">SoundCloud Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'soundcloud_follower' ); ?>" name="<?php echo $this->get_field_name( 'soundcloud_follower' ); ?>" value="<?php echo esc_attr( $soundcloud_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'medium_url' ); ?>">Medium URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'medium_url' ); ?>" name="<?php echo $this->get_field_name( 'medium_url' ); ?>" value="<?php echo esc_attr( $medium_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'medium_follower' ); ?>">Medium Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'medium_follower' ); ?>" name="<?php echo $this->get_field_name( 'medium_follower' ); ?>" value="<?php echo esc_attr( $medium_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'tiktok_url' ); ?>">TikTok URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'tiktok_url' ); ?>" name="<?php echo $this->get_field_name( 'tiktok_url' ); ?>" value="<?php echo esc_attr( $tiktok_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'tiktok_follower' ); ?>">TikTok Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'tiktok_follower' ); ?>" name="<?php echo $this->get_field_name( 'tiktok_follower' ); ?>" value="<?php echo esc_attr( $tiktok_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'snapchat_url' ); ?>">Snapchat URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'snapchat_url' ); ?>" name="<?php echo $this->get_field_name( 'snapchat_url' ); ?>" value="<?php echo esc_attr( $snapchat_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'snapchat_follower' ); ?>">Snapchat Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'snapchat_follower' ); ?>" name="<?php echo $this->get_field_name( 'snapchat_follower' ); ?>" value="<?php echo esc_attr( $snapchat_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'whatsapp_url' ); ?>">WhatsApp URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'whatsapp_url' ); ?>" name="<?php echo $this->get_field_name( 'whatsapp_url' ); ?>" value="<?php echo esc_attr( $whatsapp_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'whatsapp_follower' ); ?>">WhatsApp Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'whatsapp_follower' ); ?>" name="<?php echo $this->get_field_name( 'whatsapp_follower' ); ?>" value="<?php echo esc_attr( $whatsapp_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'wechat_url' ); ?>">WeChat URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'wechat_url' ); ?>" name="<?php echo $this->get_field_name( 'wechat_url' ); ?>" value="<?php echo esc_attr( $wechat_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'wechat_follower' ); ?>">WeChat Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'wechat_follower' ); ?>" name="<?php echo $this->get_field_name( 'wechat_follower' ); ?>" value="<?php echo esc_attr( $wechat_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'qq_url' ); ?>">QQ URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'qq_url' ); ?>" name="<?php echo $this->get_field_name( 'qq_url' ); ?>" value="<?php echo esc_attr( $qq_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'qq_follower' ); ?>">QQ Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'qq_follower' ); ?>" name="<?php echo $this->get_field_name( 'qq_follower' ); ?>" value="<?php echo esc_attr( $qq_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'tumblr_url' ); ?>">Tumblr URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'tumblr_url' ); ?>" name="<?php echo $this->get_field_name( 'tumblr_url' ); ?>" value="<?php echo esc_attr( $tumblr_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'tumblr_follower' ); ?>">Tumblr Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'tumblr_follower' ); ?>" name="<?php echo $this->get_field_name( 'tumblr_follower' ); ?>" value="<?php echo esc_attr( $tumblr_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'reddit_url' ); ?>">Reddit URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'reddit_url' ); ?>" name="<?php echo $this->get_field_name( 'reddit_url' ); ?>" value="<?php echo esc_attr( $reddit_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'reddit_follower' ); ?>">Reddit Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'reddit_follower' ); ?>" name="<?php echo $this->get_field_name( 'reddit_follower' ); ?>" value="<?php echo esc_attr( $reddit_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'telegram_url' ); ?>">Telegram URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'telegram_url' ); ?>" name="<?php echo $this->get_field_name( 'telegram_url' ); ?>" value="<?php echo esc_attr( $telegram_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'telegram_follower' ); ?>">Telegram Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'telegram_follower' ); ?>" name="<?php echo $this->get_field_name( 'telegram_follower' ); ?>" value="<?php echo esc_attr( $telegram_follower ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'line_url' ); ?>">LINE URL:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'line_url' ); ?>" name="<?php echo $this->get_field_name( 'line_url' ); ?>" value="<?php echo esc_attr( $line_url ); ?>">
     </p>
     <p>
         <label for="<?php echo $this->get_field_id( 'line_follower' ); ?>">LINE Follower:</label>
         <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'line_follower' ); ?>" name="<?php echo $this->get_field_name( 'line_follower' ); ?>" value="<?php echo esc_attr( $line_follower ); ?>">
     </p>
     <?php
 }

 /**
  * Update the widget settings.
  *
  * @param array $new_instance The new instance settings.
  * @param array $old_instance The previous instance settings.
  * @return array The updated instance settings.
  */
 public function update( $new_instance, $old_instance ) {
     $instance = $old_instance;
     $instance['title'] = ( !empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
     $instance['facebook_url'] = ! empty( $new_instance['facebook_url'] ) ? sanitize_text_field( $new_instance['facebook_url'] ) : '';
     $instance['facebook_follower'] = ! empty( $new_instance['facebook_follower'] ) ? sanitize_text_field( $new_instance['facebook_follower'] ) : '';
     $instance['twitter_url'] = ! empty( $new_instance['twitter_url'] ) ? sanitize_text_field( $new_instance['twitter_url'] ) : '';
     $instance['twitter_follower'] = ! empty( $new_instance['twitter_follower'] ) ? sanitize_text_field( $new_instance['twitter_follower'] ) : '';
     $instance['linkedin_url'] = ! empty( $new_instance['linkedin_url'] ) ? sanitize_text_field( $new_instance['linkedin_url'] ) : '';
     $instance['linkedin_follower'] = ! empty( $new_instance['linkedin_follower'] ) ? sanitize_text_field( $new_instance['linkedin_follower'] ) : '';
     $instance['instagram_url'] = ! empty( $new_instance['instagram_url'] ) ? sanitize_text_field( $new_instance['instagram_url'] ) : '';
     $instance['instagram_follower'] = ! empty( $new_instance['instagram_follower'] ) ? sanitize_text_field( $new_instance['instagram_follower'] ) : '';
     $instance['pinterest_url'] = ! empty( $new_instance['pinterest_url'] ) ? sanitize_text_field( $new_instance['pinterest_url'] ) : '';
     $instance['pinterest_follower'] = ! empty( $new_instance['pinterest_follower'] ) ? sanitize_text_field( $new_instance['pinterest_follower'] ) : '';
     $instance['youtube_url'] = ! empty( $new_instance['youtube_url'] ) ? sanitize_text_field( $new_instance['youtube_url'] ) : '';
     $instance['youtube_follower'] = ! empty( $new_instance['youtube_follower'] ) ? sanitize_text_field( $new_instance['youtube_follower'] ) : '';
     $instance['vimeo_url'] = ! empty( $new_instance['vimeo_url'] ) ? sanitize_text_field( $new_instance['vimeo_url'] ) : '';
     $instance['vimeo_follower'] = ! empty( $new_instance['vimeo_follower'] ) ? sanitize_text_field( $new_instance['vimeo_follower'] ) : '';
     $instance['soundcloud_url'] = ! empty( $new_instance['soundcloud_url'] ) ? sanitize_text_field( $new_instance['soundcloud_url'] ) : '';
     $instance['soundcloud_follower'] = ! empty( $new_instance['soundcloud_follower'] ) ? sanitize_text_field( $new_instance['soundcloud_follower'] ) : '';
     $instance['medium_url'] = ! empty( $new_instance['medium_url'] ) ? sanitize_text_field( $new_instance['medium_url'] ) : '';
     $instance['medium_follower'] = ! empty( $new_instance['medium_follower'] ) ? sanitize_text_field( $new_instance['medium_follower'] ) : '';
     $instance['tiktok_url'] = ! empty( $new_instance['tiktok_url'] ) ? sanitize_text_field( $new_instance['tiktok_url'] ) : '';
     $instance['tiktok_follower'] = ! empty( $new_instance['tiktok_follower'] ) ? sanitize_text_field( $new_instance['tiktok_follower'] ) : '';
     $instance['snapchat_url'] = ! empty( $new_instance['snapchat_url'] ) ? sanitize_text_field( $new_instance['snapchat_url'] ) : '';
     $instance['snapchat_follower'] = ! empty( $new_instance['snapchat_follower'] ) ? sanitize_text_field( $new_instance['snapchat_follower'] ) : '';
     $instance['whatsapp_url'] = ! empty( $new_instance['whatsapp_url'] ) ? sanitize_text_field( $new_instance['whatsapp_url'] ) : '';
     $instance['whatsapp_follower'] = ! empty( $new_instance['whatsapp_follower'] ) ? sanitize_text_field( $new_instance['whatsapp_follower'] ) : '';
     $instance['wechat_url'] = ! empty( $new_instance['wechat_url'] ) ? sanitize_text_field( $new_instance['wechat_url'] ) : '';
     $instance['wechat_follower'] = ! empty( $new_instance['wechat_follower'] ) ? sanitize_text_field( $new_instance['wechat_follower'] ) : '';
     $instance['qq_url'] = ! empty( $new_instance['qq_url'] ) ? sanitize_text_field( $new_instance['qq_url'] ) : '';
     $instance['qq_follower'] = ! empty( $new_instance['qq_follower'] ) ? sanitize_text_field( $new_instance['qq_follower'] ) : '';
     $instance['tumblr_url'] = ! empty( $new_instance['tumblr_url'] ) ? sanitize_text_field( $new_instance['tumblr_url'] ) : '';
     $instance['tumblr_follower'] = ! empty( $new_instance['tumblr_follower'] ) ? sanitize_text_field( $new_instance['tumblr_follower'] ) : '';
     $instance['reddit_url'] = ! empty( $new_instance['reddit_url'] ) ? sanitize_text_field( $new_instance['reddit_url'] ) : '';
     $instance['reddit_follower'] = ! empty( $new_instance['reddit_follower'] ) ? sanitize_text_field( $new_instance['reddit_follower'] ) : '';
     $instance['telegram_url'] = ! empty( $new_instance['telegram_url'] ) ? sanitize_text_field( $new_instance['telegram_url'] ) : '';
     $instance['telegram_follower'] = ! empty( $new_instance['telegram_follower'] ) ? sanitize_text_field( $new_instance['telegram_follower'] ) : '';
     $instance['line_url'] = ! empty( $new_instance['line_url'] ) ? sanitize_text_field( $new_instance['line_url'] ) : '';
     $instance['line_follower'] = ! empty( $new_instance['line_follower'] ) ? sanitize_text_field( $new_instance['line_follower'] ) : '';

     return $instance;
 }
}

?>