/**
  * Widget.
  */
 function widget($args = array())
 {
     if (is_array($args)) {
         extract($args, EXTR_SKIP);
     }
     echo $before_widget . $before_title . $widget_name . $after_title;
     $form = new WPSDAdminConfigForm();
     if ($form->getWpsdWidgetOverview()) {
         $result = wpsd_read_cache();
         echo '<!-- WP-Stats-Dashboard - START General Stats -->';
         if (defined('WPSD_PLUGIN_URL')) {
             echo '<div align="center" id="wpsd-loading"> <img src="' . WPSD_PLUGIN_URL . '/resources/images/ajax-loader.gif" alt="' . __('loading', 'wpsd') . '" width="24" height="24" /></div>';
             echo '<div id="wpsd-stats-ranking"></div>';
         } else {
             _e('WPSD_PLUGIN_URL not defined', 'wpsd');
         }
         // Get domain.
         $domain_url = get_bloginfo('url');
         // Get shortened url.
         $s = get_option('wpsd_bitly_s');
         if ('' != $s) {
             $domain_url = $s;
         }
         echo '<br/><input type="button" value="' . __('Reload', 'wpsd') . '" class="button-primary" id="btn_wpsd_reload_2" />';
         echo '<!-- WP-Stats-Dashboard - STOP General Stats-->';
     } else {
         _e('Widget disabled check', 'wpsd');
         echo ' <a href="' . wpsd_get_settings_url() . '" title="wp-stats-dashboard settings" target="_self">' . __('settings', 'wpsd') . '</a>';
     }
     echo $after_widget;
 }