Changeset 11364
- Timestamp:
- 12/13/2021 08:34:37 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/reports-page.php
r11362 r11364 182 182 case 'versions-contributed': 183 183 $details = $wpdb->get_results( 184 "SELECT prop_name, user_id, COUNT(*) as count, group_concat( version ORDER BY version ASC SEPARATOR ', ' ) as versions FROM ( 184 "SELECT prop_name, user_id, COUNT( distinct version ) as count, 185 group_concat( distinct version ORDER BY version ASC SEPARATOR ', ' ) as versions, 186 ifnull(user_id,prop_name) as _groupby 187 FROM ( 185 188 SELECT distinct LEFT(version, 3) as version, prop_name, p.user_id 186 189 FROM {$details['props_table']} p 187 190 JOIN {$details['rev_table']} r ON p.revision = r.id 188 group by prop_name, version 191 GROUP BY prop_name, version 192 UNION 193 SELECT distinct LEFT(version, 3) as version, r.author as prop_name, u.ID as user_id 194 FROM {$details['rev_table']} r 195 JOIN {$wpdb->users} u ON r.author = u.user_login 196 GROUP BY r.author, version 189 197 ) a 190 group by prop_name HAVING COUNT(*) > 2 191 ORDER BY COUNT(*) DESC" 198 WHERE version != '' 199 group by _groupby HAVING COUNT(*) > 1 200 ORDER BY `count` DESC" 192 201 ); 193 202 … … 210 219 211 220 printf( 212 '<tr><td>%s</td><td>%s</td><td >%s</td></tr>',221 '<tr><td>%s</td><td>%s</td><td title="%s">%s</td></tr>', 213 222 $profile, 214 223 $p->count, 224 esc_attr( $p->versions ), 215 225 $p->versions 216 226 ); 217 227 } 218 228 echo '</table>'; 229 230 break; 219 231 case 'typos': 220 232 $details = $wpdb->get_results( … … 258 270 case 'raw-contributors-and-committers': 259 271 $details = $wpdb->get_results( 260 "SELECT p.prop_name, u.user_nicename, u.display_name, u.ID, 261 IFNULL(p.user_id,p.prop_name) as _groupby 272 "SELECT prop_name, ID, user_nicename, display_name, _groupby, SUM(_count) as count FROM ( 273 SELECT p.prop_name, u.ID, u.user_nicename, u.display_name, 274 IFNULL(p.user_id,p.prop_name) as _groupby, COUNT(*) as _count 262 275 FROM {$details['props_table']} p 263 276 LEFT JOIN {$details['rev_table']} r ON p.revision = r.id 264 277 LEFT JOIN {$wpdb->users} u ON p.user_id = u.ID 265 WHERE $where 278 WHERE $where AND p.prop_name != r.author 266 279 GROUP BY _groupby 267 UNION 268 SELECT r.author as prop_name, u.user_nicename, u.display_name, u.ID, u.ID as _groupby 280 281 UNION 282 283 SELECT r.author as prop_name, u.ID, u.user_nicename, u.display_name, 284 u.ID as _groupby, COUNT(*) as _count 269 285 FROM {$details['rev_table']} r 270 286 LEFT JOIN {$wpdb->users} u ON r.author = u.user_login 271 287 WHERE $where 272 ORDER BY prop_name ASC" 273 ); 274 275 276 echo "<p>Props (Contributors + Committers bunched together) designed to be copy-pasted elsewhere. Set gravatar size via adding <a href='$url&size=96'>&size=96</a> to this URL.</p>"; 288 GROUP BY _groupby 289 ) results 290 GROUP BY _groupby 291 ORDER BY count DESC" 292 ); 293 294 295 echo "<p>Props (Contributors + Committers bunched together) designed to be copy-pasted elsewhere.<br> 296 Set gravatar size via adding <a href='$url&size=96'>&size=96</a> to this URL.<br> 297 Note: A committer prop'ing themselves only counts for 1 here.</p>"; 277 298 278 299 echo '<table class="widefat striped">'; 279 echo '<thead><tr><th>ID</th><th>Name</th><th>DisplayName</th><th> Profile URL</th><th>Gravatar</th><th>GravURL</th></tr></thead>';300 echo '<thead><tr><th>ID</th><th>Name</th><th>DisplayName</th><th>Count</th><th>Profile URL</th><th>Gravatar</th><th>GravURL</th></tr></thead>'; 280 301 foreach ( $details as $c ) { 281 302 $link = add_query_arg( … … 287 308 ); 288 309 printf( 289 '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>< /tr>',310 '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', 290 311 $c->ID, 291 312 $c->prop_name, 292 313 $c->display_name, 314 $c->count, 293 315 make_clickable( $c->user_nicename ? 'https://profile.wordpress.org/' . $c->user_nicename . '/' : '' ), 294 316 $c->ID ? get_avatar( $c->ID, min( 96, $_GET['size'] ?? 32 ) ) : '',
Note: See TracChangeset
for help on using the changeset viewer.