Wordpress Sidebar Stats Widget

I wrote a Wordpress plugin tonight that displays a small collection of site stats in a sidebar widget. Here is a screen shot of sample output:

Site Stats

The widget includes a control panel to change the title and format the HTML that is inserted before and after each numerical stat and the output as a whole.

Installation Instructions

  1. Download sidebar-stats-widget.zip
  2. Decompress the file contents
  3. Upload the sidebar-stats-widget folder to a Wordpress plugins directory (/wp-content/plugins)
  4. Activate the plugin from the Administration Dashboard
  5. Open the Widgets page under the Appearance section
  6. Drag the Sidebar Stats Widget to the active sidebar
  7. Configure the widget options to suit your needs and click Save

This plugin is also available for download from the official Wordpress Plugin Directory here.

3 Comments so far

  1. Sheta on February 20th, 2010

    Plugin won’t accept a div tag in the “Before everything” box. It won’t insert itself into my standard sidebar div, either. So I voted it broken. Hope to see an improvement!

  2. Wordsmoker on February 20th, 2010

    Hi Corey

    My sidebar is a hacked and kludged mess, so complex it’s almost beautiful. Because of this, dragging widgets doesn’t work properly, so I normally call a plugin via coding – is the function to be called “sidebar_stats_widget”?

    Thanks in advance

    VwS

  3. Corey on February 20th, 2010

    @sheta i just sent you an email. i think the problem is quotes, not the div tag itself. if you can help me locate the problem i can surely update the code.

     

    @wordsmoker yes, the function is called sidebar_stats_widget. bravo on destroying your wp to the point that widgets cower in fear. the function begins by pulling the saved settings from an option that you may also want to manipulate:

     

    $saved_options = array( );
    $saved_options = get_option("widget_sidebar_stats");
    if( !$saved_options ){
    // set defaults
    $default_options = array( );
    $default_options['title'] = 'Sidebar Stats Plugin';
    $default_options['beforeStat'] = '<b>';
    $default_options['afterStat'] = '</b>';
    $default_options['prefix'] = '';
    $default_options['suffix'] = '';
    update_option( "widget_sidebar_stats",$default_options );
    $saved_options = $default_options;
    }

Leave a reply

 

Thanks for reading!

You like? Subscribe to my rss feed
or

Sign up for email updates:

Some Recent Updates