Changeset 6164 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
- Timestamp:
- 11/23/2017 11:46:23 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php
r6162 r6164 58 58 <?php 59 59 $author_links = array( 60 '<a href="//make.wordpress.org/pluginrepo/?s=' . urlencode( esc_attr( $author->user_nicename ) ) . '" title="Click to search Pluginrepo P2 for mention of this author">P2</a>', 61 '<a href="https://supportpress.wordpress.org/plugins/?q=' . urlencode( esc_attr( $author->user_nicename ) ) . '&status=&todo=Search+%C2%BB" title="Click to search Pluginrepo SupportPress for mention of this author">SP</a>', 60 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 61 urlencode( esc_attr( $author->user_nicename ) ), 62 esc_attr__( 'Click to search Pluginrepo P2 for mentions of this author', 'wporg-plugins' ) 63 ), 64 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 65 urlencode( esc_attr( $author->user_nicename ) ), 66 esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this author', 'wporg-plugins' ) 67 ), 62 68 ); 63 69 vprintf( '<span class="profile-sp-link">[ %s | %s ]</span>', $author_links ); … … 65 71 66 72 <span class="profile-links"> 67 <a href="//profiles.wordpress.org/<?php echo $author->user_nicename; ?>"> profile</a> |68 <a href="//wordpress.org/support/users/<?php echo $author->user_nicename; ?>"> support</a>73 <a href="//profiles.wordpress.org/<?php echo $author->user_nicename; ?>"><?php _e( 'profile', 'wporg-plugins' ); ?></a> | 74 <a href="//wordpress.org/support/users/<?php echo $author->user_nicename; ?>"><?php _e( 'support', 'wporg-plugins' ); ?></a> 69 75 </span> 70 76 <div class="profile-email"> 71 77 <<?php echo $author->user_email; ?>> 72 <span class="profile-sp-link">[ <a href="https://supportpress.wordpress.org/plugins/?sender=<?php echo esc_attr( $author->user_email ); ?>&status=&todo=Search" title="Click to search Pluginrepo SupportPress for emails sent to/from this email address">SP</a> ]</span> 78 <span class="profile-sp-link"><?php 79 printf( '[ <a href="https://supportpress.wordpress.org/plugins/?sender=%s&status=&todo=Search" title="%s">SP</a> ]', 80 esc_attr( $author->user_email ), 81 esc_attr__( 'Click to search Pluginrepo SupportPress for emails sent to/from this email address', 'wporg-plugins' ) 82 ); 83 ?></span> 73 84 </div> 74 <div class="profile-join"> 75 Joined <?php echo human_time_diff( strtotime( $author->user_registered ) ); ?> ago (<?php echo date( 'Y-M-d', strtotime( $author->user_registered ) ); ?>) 76 </div> 85 <div class="profile-join"><?php 86 /* translators: 1: time ago, 2: registration date */ 87 printf( __( 'Joined %1$s ago (%2$s)', 'wporg-plugins' ), 88 human_time_diff( strtotime( $author->user_registered ) ), 89 date( 'Y-M-d', strtotime( $author->user_registered ) ) 90 ); 91 ?></div> 77 92 </div> 78 93 </div> 94 79 95 <?php if ( ! empty( $author->user_url ) ) : ?> 80 96 <p class="profile-url"> 81 Author URL: <a href="http://href.li?<?php echo esc_url( $author->user_url ); ?>"><?php echo esc_html( $author->user_url ); ?></a> 97 <?php _e( 'Author URL:', 'wporg-plugins' ); ?> 98 <a href="http://href.li?<?php echo esc_url( $author->user_url ); ?>"><?php echo esc_html( $author->user_url ); ?></a> 82 99 </p> 100 <?php endif; ?> 101 83 102 <?php 84 endif;85 86 103 if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 87 104 $user = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID ); … … 89 106 90 107 if ( ! empty( $user->allcaps['bbp_blocked'] ) ) { 91 $statuses['banned'] = __( 'User is banned from logging into WordPress.org', 'wporg-plugins' ); 108 $statuses[] = array( 109 'text' => __( 'banned', 'wporg-plugins' ), 110 'desc' => __( 'User is banned from logging into WordPress.org', 'wporg-plugins' ), 111 ); 92 112 } 93 113 94 114 if ( (bool) get_user_meta( $user->ID, 'is_bozo', true ) ) { 95 $statuses['flagged'] = __( 'User is flagged in the support forums', 'wporg-plugins' ); 115 $statuses[] = array( 116 'text' => __( 'flagged', 'wporg-plugins' ), 117 'desc' => __( 'User is flagged in the support forums', 'wporg-plugins' ), 118 ); 96 119 } 97 120 98 121 if ( $statuses ) { 99 122 $labels = array(); 100 foreach ( $statuses as $status => $desc ) { 101 $labels[] = sprintf( '<strong><span title="%s">%s</span></strong>', esc_attr( $desc ), $status ); 123 foreach ( $statuses as $status ) { 124 $labels[] = sprintf( '<strong><span title="%s">%s</span></strong>', 125 esc_attr( $status['desc'] ), 126 $status['text'] 127 ); 102 128 } 103 /* translators: %s: Comma-separated list of negative user status labels */129 /* translators: %s: comma-separated list of negative user status labels */ 104 130 echo '<p>' . sprintf( __( 'This user is: %s', 'wporg-plugins' ), implode( ', ', $labels ) ) . '</p>'; 105 131 } … … 122 148 sort( $user_ips, SORT_NUMERIC ); 123 149 124 printf( '<p>IPs : %s</p>', implode( ', ', array_map( array( __NAMESPACE__ . '\Author_Card', 'link_ip' ), $user_ips ) ) ); 150 /* translators: %s: comma-separated list of plugin author's IP addresses */ 151 printf( '<p>' . __( 'IPs : %s', 'wporg-plugins' ) . '</p>', 152 implode( ', ', array_map( array( __NAMESPACE__ . '\Author_Card', 'link_ip' ), $user_ips ) ) 153 ); 125 154 endif; 126 127 if ( $author->user_pass == '~~~' ) : ?> 128 <p><strong>Has not logged in since we reset passwords in June 2011</strong></p> 155 ?> 156 157 <?php if ( $author->user_pass == '~~~' ) : ?> 158 <p><strong><?php _e( 'Has not logged in since we reset passwords in June 2011', 'wporg-plugins' ); ?></strong></p> 129 159 <?php endif; ?> 160 130 161 <div class="profile-plugins"> 131 162 <?php 132 163 if ( empty( $author_commit ) && empty( $author_plugins ) ) { 133 echo 'Not a developer on any plugin.';164 _e( 'Not a developer on any plugin.', 'wporg-plugins' ); 134 165 } else { 135 166 echo '<strong>' . sprintf( _n( '%d plugin:', '%d plugins:', count( $all_plugins ), 'wporg-plugins' ), count( $all_plugins ) ) . '</strong>'; … … 144 175 145 176 if ( in_array( $plugin->post_name, wp_list_pluck( $author_plugins, 'post_name' ) ) ) { 146 $tooltips[] = 'This user submitted this plugin.';177 $tooltips[] = __( 'This user submitted this plugin.', 'wporg-plugins ' ); 147 178 $classes[] = 'plugin-owner'; 148 179 if ( ! in_array( $plugin->post_name, $author_commit ) ) { 149 180 $note = true; 150 $tooltips[] = 'The user is not a current committer.';181 $tooltips[] = __( 'The user is not a current committer.', 'wporg-plugins' ); 151 182 } 152 183 } … … 154 185 $plugin_slug = $plugin->post_name; 155 186 if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) { 156 $extra .= sprintf( '(requested %s ago)', human_time_diff( strtotime( $last_updated ) ) ); 157 $tooltips[] = 'Requested, remains unapproved.'; 187 /* translators: %s: time ago */ 188 $extra .= sprintf( __( '(requested %s ago)', 'wporg-plugins' ), 189 human_time_diff( strtotime( $last_updated ) ) 190 ); 191 $tooltips[] = __( 'Requested, remains unapproved.', 'wporg-plugins' ); 158 192 $classes[] = 'profile-plugin-requested'; 159 193 160 194 } elseif ( 'rejected' === $plugin->post_status ) { 161 $tooltips[] = 'Plugin was rejected.';195 $tooltips[] = __( 'Plugin was rejected.', 'wporg-plugins' ); 162 196 $classes[] = 'profile-plugin-rejected'; 163 197 $plugin_slug = substr( $plugin_slug, 9, - 9 ); 164 198 165 199 } elseif ( 'closed' === $plugin->post_status ) { 166 $extra .= sprintf( '(closed: %s)', Template::get_close_reason( $plugin ) ); 167 $tooltips[] = 'Plugin is closed.'; 200 /* translators: %s: close/disable reason */ 201 $extra .= sprintf( __( '(closed: %s)', 'wporg-plugins' ), 202 Template::get_close_reason( $plugin ) 203 ); 204 $tooltips[] = __( 'Plugin is closed.', 'wporg-plugins' ); 168 205 $classes[] = 'profile-plugin-closed'; 169 206 170 207 } elseif ( 'disabled' === $plugin->post_status ) { 171 $extra .= sprintf( '(disabled: %s)', Template::get_close_reason( $plugin ) ); 172 $tooltips[] = 'Plugin is disabled (updates are active).'; 208 /* translators: %s: close/disable reason */ 209 $extra .= sprintf( __( '(disabled: %s)', 'wporg-plugins' ), 210 Template::get_close_reason( $plugin ) 211 ); 212 $tooltips[] = __( 'Plugin is disabled (updates are active).', 'wporg-plugins' ); 173 213 $classes[] = 'profile-plugin-closed'; 174 214 $note = true; … … 178 218 if ( 'approved' === $plugin->post_status ) { 179 219 $note = true; 180 $tooltips[] = 'Plugin is approved, but has no data.';220 $tooltips[] = __( 'Plugin is approved, but has no data.', 'wporg-plugins' ); 181 221 } elseif ( strtotime( '-2 years' ) > strtotime( $last_updated ) ) { 182 $tooltips[] = 'Plugin is open but has not been updated in more than two years.';222 $tooltips[] = __( 'Plugin is open but has not been updated in more than two years.', 'wporg-plugins' ); 183 223 $classes[] = 'profile-plugin-open-old'; 184 224 } else { 185 $tooltips[] = 'Plugin is open.';225 $tooltips[] = __( 'Plugin is open.', 'wporg-plugins' ); 186 226 } 187 227 $classes[] = 'profile-plugin-open'; … … 202 242 203 243 $plugin_links = array( 204 '<a href="' . esc_url( get_edit_post_link( $plugin->ID, '' ) ) . '" title="Edit this plugin">Edit</a>', 205 '<a href="//make.wordpress.org/pluginrepo/?s=' . urlencode( esc_attr( $plugin_slug ) ) . '" title="Click to search Pluginrepo P2 for mention of this plugin">P2</a>', 206 '<a href="https://supportpress.wordpress.org/plugins/?q=' . urlencode( esc_attr( $plugin_slug ) ) . '&status=&todo=Search+%C2%BB" title="Click to search Pluginrepo SupportPress for mention of this plugin">SP</a>', 244 sprintf( '<a href="%s" title="%s">%s</a>', 245 esc_url( get_edit_post_link( $plugin->ID, '' ) ), 246 esc_attr__( 'Edit this plugin', 'wporg-plugins' ), 247 __( 'Edit', 'wporg-plugins' ) 248 ), 249 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>', 250 urlencode( esc_attr( $plugin_slug ) ), 251 esc_attr__( 'Click to search Pluginrepo P2 for mentions of this plugin', 'wporg-plugins' ) 252 ), 253 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>', 254 urlencode( esc_attr( $plugin_slug ) ), 255 esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this plugin', 'wporg-plugins' ) 256 ), 207 257 ); 208 258 vprintf( '<span class="profile-sp-link">[ %s | %s | %s ]</span>', $plugin_links ); … … 218 268 ?> 219 269 </div> 270 220 271 <?php 221 222 272 /** 223 273 * Fires at the end of a plugin's author card.
Note: See TracChangeset
for help on using the changeset viewer.