Index: src/bp-groups/bp-groups-widgets.php
===================================================================
--- src/bp-groups/bp-groups-widgets.php	(revision 10439)
+++ src/bp-groups/bp-groups-widgets.php	(working copy)
@@ -26,7 +26,7 @@
 	/**
 	 * Working as a group, we get things done better.
 	 */
-	function __construct() {
+	public function __construct() {
 		$widget_ops = array(
 			'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ),
 			'classname' => 'widget_bp_groups_widget buddypress widget',
@@ -33,7 +33,7 @@
 		);
 		parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops );
 
-		if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) {
+		if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) {
 			$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
 			wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() );
 		}
@@ -40,21 +40,12 @@
 	}
 
 	/**
-	 * PHP4 constructor
-	 *
-	 * For backward compatibility only
-	 */
-	function bp_groups_widget() {
-		$this->_construct();
-	}
-
-	/**
 	 * Extends our frontend output method.
 	 *
 	 * @param array $args     Array of arguments for the widget.
 	 * @param array $instance Widget instance data.
 	 */
-	function widget( $args, $instance ) {
+	public function widget( $args, $instance ) {
 
 		/**
 		 * Filters the user ID to use with the widget instance.
@@ -67,12 +58,14 @@
 
 		extract( $args );
 
-		if ( empty( $instance['group_default'] ) )
+		if ( empty( $instance['group_default'] ) ) {
 			$instance['group_default'] = 'popular';
+		}
 
-		if ( empty( $instance['title'] ) )
+		if ( empty( $instance['title'] ) ) {
 			$instance['title'] = __( 'Groups', 'buddypress' );
-
+		}
+		
 		/**
 		 * Filters the title of the Groups widget.
 		 *
@@ -96,7 +89,7 @@
 
 		echo $before_widget;
 
-		$title = !empty( $instance['link_title'] ) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title;
+		$title = ! empty( $instance['link_title'] ) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title;
 
 		echo $before_title . $title . $after_title;
 
@@ -132,12 +125,13 @@
 							<div class="item-meta">
 								<span class="activity">
 								<?php
-									if ( 'newest' == $instance['group_default'] )
+									if ( 'newest' == $instance['group_default'] ) {
 										printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() );
-									if ( 'active' == $instance['group_default'] )
-										printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
-									elseif ( 'popular' == $instance['group_default'] )
+									} elseif ( 'active' == $instance['group_default'] ) {
+										printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); 
+									} elseif ( 'popular' == $instance['group_default'] ) {
 										bp_group_member_count();
+									}
 								?>
 								</span>
 							</div>
@@ -168,13 +162,13 @@
 	 * @param array $old_instance Original instance data.
 	 * @return array
 	 */
-	function update( $new_instance, $old_instance ) {
+	public function update( $new_instance, $old_instance ) {
 		$instance = $old_instance;
 
 		$instance['title']         = strip_tags( $new_instance['title'] );
 		$instance['max_groups']    = strip_tags( $new_instance['max_groups'] );
 		$instance['group_default'] = strip_tags( $new_instance['group_default'] );
-		$instance['link_title']    = (bool)$new_instance['link_title'];
+		$instance['link_title']    = (bool) $new_instance['link_title'];
 
 		return $instance;
 	}
@@ -185,7 +179,7 @@
 	 * @param array $instance Current instance.
 	 * @return mixed
 	 */
-	function form( $instance ) {
+	public function form( $instance ) {
 		$defaults = array(
 			'title'         => __( 'Groups', 'buddypress' ),
 			'max_groups'    => 5,
@@ -197,7 +191,7 @@
 		$title 	       = strip_tags( $instance['title'] );
 		$max_groups    = strip_tags( $instance['max_groups'] );
 		$group_default = strip_tags( $instance['group_default'] );
-		$link_title    = (bool)$instance['link_title'];
+		$link_title    = (bool) $instance['link_title'];
 		?>
 
 		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p>
@@ -209,9 +203,9 @@
 		<p>
 			<label for="<?php echo $this->get_field_id( 'group_default' ); ?>"><?php _e('Default groups to show:', 'buddypress'); ?></label>
 			<select name="<?php echo $this->get_field_name( 'group_default' ); ?>" id="<?php echo $this->get_field_id( 'group_default' ); ?>">
-				<option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option>
-				<option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option>
-				<option value="popular"  <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option>
+				<option value="newest" <?php selected( $group_default, 'newest' );?>><?php _e( 'Newest', 'buddypress' ) ?></option>
+				<option value="active" <?php selected( $group_default, 'active' );?>><?php _e( 'Active', 'buddypress' ) ?></option>
+				<option value="popular"  <?php selected( $group_default, 'popular' );?>><?php _e( 'Popular', 'buddypress' ) ?></option>
 			</select>
 		</p>
 	<?php
@@ -220,7 +214,7 @@
 
 function groups_ajax_widget_groups_list() {
 
-	check_ajax_referer('groups_widget_groups_list');
+	check_ajax_referer( 'groups_widget_groups_list' );
 
 	switch ( $_POST['filter'] ) {
 		case 'newest-groups':
@@ -275,7 +269,7 @@
 
 	<?php else: ?>
 
-		<?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?>
+		<?php echo "-1[[SPLIT]]<li>" . __( "No groups matched the current filter.", 'buddypress' ); ?>
 
 	<?php endif;
 
