Changeset 11588 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/jobs/class-svn-import.php
- Timestamp:
- 02/21/2022 08:18:07 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)