| @@ -60,8 +60,23 @@ | ||
| 60 | 60 | return $connections; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | + * Expired rows count until their user's screen prunes them. | |
| 65 | + * | |
| 66 | + * @return integer | |
| 67 | + */ | |
| 68 | + public static function count() | |
| 69 | + { | |
| 70 | + $wpdb = $GLOBALS['wpdb']; | |
| 71 | + | |
| 72 | + return (int) $wpdb->get_var($wpdb->prepare( | |
| 73 | + "SELECT COUNT(*) FROM {$wpdb->usermeta} WHERE meta_key LIKE %s", | |
| 74 | + $wpdb->esc_like(self::prefix()) . '%' | |
| 75 | + )); | |
| 76 | + } | |
| 77 | + | |
| 78 | + /** | |
| 64 | 79 | * @param integer $userId - The user whose connections to describe. |
| 65 | 80 | * @return array - What a screen would have to redraw for: how many, and the newest. |
| 66 | 81 | */ |
| 67 | 82 | public static function state($userId) |