Dashboard Widget (Without Controls) Sample Plugin

WordPress 2.5 has the ability to customize your administration dashboard with the help of widgets.

After poking around WordPress 2.5 codes, I have come out with this Dashboard Widget Sample Plugin. BUT do note that this plugin does not include Dashboard Widget Controls. If I have the time, I will add that in or perhaps I will create another plugin called “Dashboard Widget (With Controls) Sample Plugin”.

To get a clearer picture of what this sample plugin does, here is a screenshot of the Dashboard Widget (Without Controls) Sample in action.

Here comes the code:

 'Full URL For "See All" link', // Example: 'index.php?page=wp-useronline/wp-useronline.php'
		'feed_link' => 'Full URL For "RSS" link', // Example: 'index.php?page=wp-useronline/wp-useronline-rss.php'
		'width' => 'half', // OR 'fourth', 'third', 'half', 'full' (Default: 'half')
		'height' => 'single', // OR 'single', 'double' (Default: 'single')
		)
	);
}

### Function: Add Dashboard Widget
add_filter('wp_dashboard_widgets', 'PLUGINNAME_add_dashboard_widget');
function PLUGINNAME_add_dashboard_widget($widgets) {
	global $wp_registered_widgets;
	if (!isset($wp_registered_widgets['dashboard_PLUGINNAME'])) {
		return $widgets;
	}
	array_splice($widgets, sizeof($widgets)-1, 0, 'dashboard_PLUGINNAME');
	return $widgets;
}

### Function: Print Dashboard Widget
function dashboard_PLUGINNAME($sidebar_args) {
	global $wpdb;
	extract($sidebar_args, EXTR_SKIP);
	echo $before_widget;
	echo $before_title;
	echo $widget_name;
	echo $after_title;
	echo 'YOUR CONTENT GOES IN HERE';
	echo $after_widget;
}
?>

Hope this helps some of you guys. =)

1 Star2 Stars3 Stars4 Stars5 Stars (37 votes, average: 3.59 out of 5)

Counterize II & Fire Stats

I just uninstalled Counterize II and FireStats from this site and I will track the hits via DreamHost Stats panel.

The reason being FireStats is taking too much database space. My whole database (without gzip) is about 35MB and now it is backed to 3.2MB, notice the great difference?

So I went to try out Counterize II hoping that it will be smaller, as it says on the website it has a new database structure which saves on the space, but after installing it, my sql queries went from 41 queries per page to 60+ queries per page.

I ended up not using both.

1 Star2 Stars3 Stars4 Stars5 Stars (33 votes, average: 3.58 out of 5)

WP-Sticky 1.00 Beta 2

WP-Sticky 1.00 Beta 2 is out. This is the start of an actual WP-Sticky Plugin because I have re-written the code.

You can configure WP-Sticky options in ‘WP-Admin -> Options -> Sticky‘.

You can find the post’s ‘Sticky‘ Option under ‘Post Sticky Status‘ Options in the ‘Write/Edit Post Screen‘.

Need support, post it in here, WP-Sticky Support Forums.

Last but not least, read the readme.html file and NOTE the tabs.

*UPDATE* WP-Sticky is now out of beta, download WP-Sticky 1.00.

1 Star2 Stars3 Stars4 Stars5 Stars (81 votes, average: 3.57 out of 5)