Changeset 5209
- Timestamp:
- 03/30/2017 08:27:56 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-status-transitions.php
r4474 r5209 88 88 public function approved( $post_id, $post ) { 89 89 $attachments = get_attached_media( 'application/zip', $post_id ); 90 91 // If there is no zip we have nothing to commit. Bail.92 if ( empty( $attachments ) ) {93 return;94 }95 96 $attachment = end( $attachments );97 90 $plugin_author = get_user_by( 'id', $post->post_author ); 98 91 99 92 // Create SVN repo. 100 93 $dir = Filesystem::temp_directory( $post->post_name ); 101 $dir = Filesystem::unzip( get_attached_file( $attachment->ID ), $dir );102 94 foreach ( array( 'assets', 'branches', 'tags', 'trunk' ) as $folder ) { 103 95 mkdir( "$dir/$folder", 0777 ); 104 96 } 105 97 106 $plugin_root = $this->get_plugin_root( $dir ); 107 // If there is no plugin file we have nothing to commit. Bail. 108 if ( empty( $plugin_root ) ) { 109 return; 110 } 111 rename( $plugin_root, "$dir/trunk" ); 98 if ( $attachments ) { 99 $attachment = end( $attachments ); 100 101 $unzip_dir = Filesystem::unzip( get_attached_file( $attachment->ID ) ); 102 103 $plugin_root = $this->get_plugin_root( $unzip_dir ); 104 105 if ( $plugin_root ) { 106 rename( $plugin_root, "$dir/trunk" ); 107 } 108 } 112 109 113 110 SVN::import( $dir, 'http://plugins.svn.wordpress.org/' . $post->post_name, sprintf( 'Adding %1$s by %2$s.', $post->post_title, $plugin_author->user_login ) ); … … 121 118 Tools::grant_plugin_committer( $post->post_name, $plugin_author ); 122 119 123 // Promote author if they don't have access yet.124 if ( ! user_can( $plugin_author, 'plugin_dashboard_access' ) ) {125 $plugin_author->add_role( 'plugin_committer' );126 }127 128 120 // Send email. 129 121 $subject = sprintf( __( '[WordPress Plugin Directory] %s has been approved!', 'wporg-plugins' ), $post->post_title ); … … 134 126 $content .= __( 'Within one hour you will have access to your SVN repository with the WordPress.org username and password you used to log in and submit your request. Your username is case sensitive.', 'wporg-plugins' ) . "\n\n"; 135 127 136 $content .= "http ://plugins.svn.wordpress.org/{$post->post_name}\n\n";128 $content .= "https://plugins.svn.wordpress.org/{$post->post_name}\n\n"; 137 129 138 130 $content .= __( 'Here are some handy links to help you get started.', 'wporg-plugins' ) . "\n\n"; … … 148 140 149 141 $content .= __( 'WordPress Plugin Directory readme.txt standard:', 'wporg-plugins' ) . "\n"; 150 $content .= "https://wordpress.org/plugins/ about/readme.txt\n\n";142 $content .= "https://wordpress.org/plugins/developers/#readme\n\n"; 151 143 152 144 $content .= __( 'A readme.txt validator:', 'wporg-plugins' ) . "\n"; 153 $content .= "https://wordpress.org/plugins/ about/validator/\n\n";145 $content .= "https://wordpress.org/plugins/developers/readme-validator/\n\n"; 154 146 155 147 $content .= __( 'Plugin Assets (header images etc):', 'wporg-plugins' ) . "\n";
Note: See TracChangeset
for help on using the changeset viewer.