Changeset 11371
- Timestamp:
- 12/15/2021 02:47:05 AM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/list-table.php
r11370 r11371 125 125 ORDER BY user_id IS NULL DESC, LENGTH(prop_name) DESC" 126 126 ); 127 128 // Fill user caches, some commits have a lot of props, yay! :) 129 $unique_user_ids = array_map( 'intval', array_filter( array_unique( wp_list_pluck( $props_list, 'user_id' ) ) ) ); 130 if ( $unique_user_ids ) { 131 cache_users( $unique_user_ids ); 132 } 127 133 128 134 foreach ( $this->items as $i => $details ) { -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/reports-page.php
r11370 r11371 13 13 // Default to the latest version for core. 14 14 if ( $is_core && is_null( $version ) ) { 15 $version = sprintf( '%.1f', WP_CORE_LATEST_RELEASE+ 0.1 );15 $version = sprintf( '%.1f', floatval( WP_CORE_LATEST_RELEASE ) + 0.1 ); 16 16 } 17 17 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/ui.php
r11369 r11371 22 22 23 23 foreach ( $svns as $slug => $details ) { 24 // No point showing this UI if we're not importing Props. 25 if ( empty( $details['props_table'] ) ) { 26 continue; 27 } 28 24 29 $name = sprintf( "%s Props", $details['name'] ); 25 30 $hook = add_menu_page( … … 36 41 $hook = add_submenu_page( 37 42 'props-edit-' . $slug, 38 'Reports', 'Reports', 43 'Reports', 44 'Reports', 39 45 'edit_posts', 40 46 'props-reports-' . $slug, … … 58 64 59 65 // Run the import upon loading the page if it hasn't run recently. 60 if ( wp_next_scheduled( 'import_revisions_from_svn' ) < time() + 5*MINUTE_IN_SECONDS ) { 61 ob_start(); 66 if ( get_site_transient( 'import_revisions_from_svn' ) < time() - 5*MINUTE_IN_SECONDS ) { 62 67 do_action( 'import_revisions_from_svn' ); 63 ob_end_clean();64 68 } 65 69 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/svn.php
r11363 r11371 7 7 8 8 add_action( 'import_revisions_from_svn', function() { 9 set_site_transient( 'import_revisions_from_svn', time() ); 10 9 11 foreach ( get_svns() as $svn ) { 10 12 import_revisions( $svn ); … … 38 40 $svn_url = $svn['url']; 39 41 $slug = $svn['slug']; 40 $db_table = $svn['rev_table'] ;42 $db_table = $svn['rev_table'] ?? false; 41 43 $props_table = $svn['props_table'] ?? false; 44 45 // If this SVN doesn't have a rev_table defined, it's not being imported currently. 46 if ( ! $db_table ) { 47 return false; 48 } 42 49 43 50 $last_revision = $wpdb->get_var( "SELECT max(id) FROM {$db_table}" ); … … 74 81 continue; 75 82 } 76 77 echo "Importing {$id} \n";78 83 79 84 $paths = (array) $change->paths->path; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac-watch.php
r11362 r11371 3 3 /** 4 4 * Plugin Name: WordPress.org Trac & SVN Watcher. 5 * Description: This plugin imports Trac activity & SVN activity into WordPress.org databases. Trac actions for Profiles, and SVN activity for reporting, profiles, and make.w.org/* reporting. 6 * Version: 1.0 7 * Author: Dion Hulse 5 8 */ 6 9 … … 60 63 KEY `category` (`category`), 61 64 KEY `username` (`username`) 62 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; 65 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; // UTF8, but treated as latin1, due to historical profiles reasons. 63 66 64 67 $revisions_table = "CREATE TABLE IF NOT EXISTS `%s` ( … … 86 89 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;"; 87 90 88 return; // TODO89 91 foreach ( SVN\get_svns() as $prefix => $info ) { 90 92 $wpdb->query( sprintf( $trac_table, 'trac_' . $prefix ) ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac.php
r11362 r11371 8 8 function format_trac_markup( $message ) { 9 9 $message = esc_html( $message ); 10 11 // Convert some Trac markdown to HTML. 10 12 $message = preg_replace( '!`(.*?)`!i', '<code>$1</code>', $message ); 11 13 $message = preg_replace( '!{{{(.*?)}}}!sm', '<code>$1</code>', $message ); 12 13 14 $message = preg_replace( '!\[([^] ]+) ([^]]+)\]!i', '<a href="$1">$2</a>', $message ); 14 15 15 // Escape shortcodes, but that takes out changesets.. 16 // $message = str_replace( [ '[', ']'], [ '[[', ']]' ], $message ); 16 // Mark up the text, using functions we want, rather than `the_content` as it has many filters that don't strictly apply. 17 $message = wptexturize( $message ); 18 $message = wpautop( $message ); 19 $message = make_clickable( $message ); 17 20 18 // Might need to disable this, or escape more things prior to it. 19 $message = apply_filters( 'the_content', $message ); 20 $message = make_clickable( $message ); 21 // Link tickets and changesets. 22 if ( function_exists( 'markup_wporg_links' ) ) { 23 $message = markup_wporg_links( $message ); 24 } 25 26 // Ensure nothing funny is in the output. 27 $message = wp_kses_post( $message ); 21 28 22 29 return $message;
Note: See TracChangeset
for help on using the changeset viewer.