Changeset 11588
- Timestamp:
- 02/21/2022 08:18:07 AM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r11511 r11588 53 53 * @var string 54 54 */ 55 p rotected$tmp_dir = '';55 public $tmp_dir = ''; 56 56 57 57 /** … … 60 60 * @var string 61 61 */ 62 p rotected$tmp_svn_dir = '';62 public $tmp_svn_dir = ''; 63 63 64 64 /** … … 67 67 * @var string 68 68 */ 69 p rotected$theme_dir = '';69 public $theme_dir = ''; 70 70 71 71 /** … … 74 74 * @var WP_Theme 75 75 */ 76 p rotected$theme;76 public $theme; 77 77 78 78 /** … … 81 81 * @var string 82 82 */ 83 p rotected$theme_slug = '';83 public $theme_slug = ''; 84 84 85 85 /** … … 88 88 * @var WP_Post 89 89 */ 90 p rotected$theme_post;90 public $theme_post; 91 91 92 92 /** … … 95 95 * @var WP_User 96 96 */ 97 p rotected$author;97 public $author; 98 98 99 99 /** … … 102 102 * @var array 103 103 */ 104 p rotected$readme = array();104 public $readme = array(); 105 105 106 106 /** … … 109 109 * @var object 110 110 */ 111 p rotected$trac_ticket;111 public $trac_ticket; 112 112 113 113 /** … … 116 116 * @var int 117 117 */ 118 p rotected$trac_changeset = 0;118 public $trac_changeset = 0; 119 119 120 120 /** … … 123 123 * @var Trac 124 124 */ 125 p rotected$trac;125 public $trac; 126 126 127 127 /** … … 144 144 * @var string 145 145 */ 146 p rotected$commit_msg = '';146 public $commit_msg = ''; 147 147 148 148 /** … … 1761 1761 // When importing from SVN, include a 'Compare' link as the Changeset likely won't show a Diff unless the author did a `svn cp`. 1762 1762 'svn' === $this->importing_from && ! empty( $this->theme_post->max_version ) ? 1763 "<https://themes.trac.wordpress.org/changeset?old_path={$this->theme_slug}/{$this->theme_post-> max_version}&new_path={$this->theme_slug}/{$this->theme->display( 'Version' )}|Compare>" :1763 "<https://themes.trac.wordpress.org/changeset?old_path={$this->theme_slug}/{$this->theme_post->_last_live_version}&new_path={$this->theme_slug}/{$this->theme->display( 'Version' )}|Compare>" : 1764 1764 '' 1765 1765 ), -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/jobs/class-svn-import.php
r11305 r11588 106 106 107 107 if ( empty( $args['slug'] ) || empty( $args['version'] ) ) { 108 trigger_error( 'Theme Import aborted, invalid input provided: ' . json_ Encode( $args ), E_USER_WARNING );108 trigger_error( 'Theme Import aborted, invalid input provided: ' . json_encode( $args ), E_USER_WARNING ); 109 109 return; 110 110 } … … 115 115 $args['slug'], 116 116 $args['version'], 117 $args['changeset'] ?? false,118 $args['author'] ?? false,119 $args['msg'] ?? ''117 $args['changeset'], 118 $args['author'], 119 $args['msg'] 120 120 ); 121 121 122 // TODO: Look at error result code, maybq re-queue in event of system issue, else email author with concerns (Theme Check, etc) 123 // CC emails to themes team in event of having to contact the author? 122 if ( is_wp_error( $return ) ) { 124 123 125 if ( is_wp_error( $return ) ) { 126 throw new Exception( "Theme Import Failure: " . $return->get_error_code . ' ' . $return->get_error_message() ); 124 // Retry once in the event of a WordPress.org issue exporting from themes.svn.wordpress.org. 125 if ( 'svn_error' === $return->get_error_code() ) { 126 if ( empty( $args['retry'] ) ) { 127 $args['retry'] = $return; 128 wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'theme_directory_svn_import', $args ); 129 return; 130 } else { 131 throw new Exception( 'Theme Import Failure: ' . $return->get_error_code() . ' ' . $return->get_error_message() ); 132 } 133 } 134 135 // Otherwise email the author about this problem. 136 wp_mail( 137 // $uploader->author->user_email, 138 get_user_by( 'login', 'dd32' )->user_email, // TODO, DEBUG for now. 139 sprintf( 140 'Theme Import Failure: %s [%d] %s', 141 $uploader->theme_post->post_title, 142 $args['changeset'], 143 $args['msg'] 144 ), 145 sprintf( 146 "Hi %s,\n\nYour theme update for %s %s has failed some checks. Please see the below errors.\n\n%s\n\n----\nWordPress Theme Directory", 147 $uploader->author->user_email . ' ' . 148 ( $uploader->author->display_name ?: $uploader->author->user_login ), 149 $uploader->theme->display('Title'), 150 $uploader->theme->display('Version'), 151 $return->get_error_message(), 152 ), 153 [ 154 'From: "WordPress Theme Directory" <themes@wordpress.org>' 155 ] 156 ); 127 157 } 128 158 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r11248 r11588 532 532 $post = get_post( $post_id ); 533 533 } 534 535 // Keep track of the last live version. 536 update_post_meta( $post_id, '_last_live_version', get_post_meta( $post_id, '_live_version', true ) ); 534 537 535 538 // Update current version. Used to prioritize localized themes.
Note: See TracChangeset
for help on using the changeset viewer.