Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (9 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php

    r6170 r6287  
    2424                add_action( 'wporg_usercards_after_content', array(
    2525                        __NAMESPACE__ . '\Author_Card',
    26                         'show_warning_flags'
     26                        'show_warning_flags',
    2727                ), 10, 6 );
    2828
    … …  
    3939                }
    4040
    41                 $author_commit  = Tools::get_users_write_access_plugins( $author );
     41                $author_commit    = Tools::get_users_write_access_plugins( $author );
    4242                $author_plugins_q = array(
    4343                        'author'         => $author->ID,
    … …  
    5050                }
    5151                $author_plugins = get_posts( $author_plugins_q );
    52                 $all_plugins = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_name IN ('" . implode( "', '", array_merge( $author_commit, wp_list_pluck( $author_plugins, 'post_name' ) ) ) . "')" );
     52                $all_plugins    = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_name IN ('" . implode( "', '", array_merge( $author_commit, wp_list_pluck( $author_plugins, 'post_name' ) ) ) . "')" );
    5353                ?>
    5454                <div class="profile">
    … …  
    5959                                <?php
    6060                                        $author_links = array(
    61                                                 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>',
     61                                                sprintf(
     62                                                        '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>',
    6263                                                        urlencode( esc_attr( $author->user_nicename ) ),
    6364                                                        esc_attr__( 'Click to search Pluginrepo P2 for mentions of this author', 'wporg-plugins' )
    6465                                                ),
    65                                                 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>',
     66                                                sprintf(
     67                                                        '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>',
    6668                                                        urlencode( esc_attr( $author->user_nicename ) ),
    6769                                                        esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this author', 'wporg-plugins' )
    … …  
    7779                                <div class="profile-email">
    7880                                        &lt;<?php echo $author->user_email; ?>&gt;
    79                                         <span class="profile-sp-link"><?php
    80                                                 printf( '[ <a href="https://supportpress.wordpress.org/plugins/?sender=%s&status=&todo=Search" title="%s">SP</a> ]',
     81                                        <span class="profile-sp-link">
     82                                        <?php
     83                                                printf(
     84                                                        '[ <a href="https://supportpress.wordpress.org/plugins/?sender=%s&status=&todo=Search" title="%s">SP</a> ]',
    8185                                                        esc_attr( $author->user_email ),
    8286                                                        esc_attr__( 'Click to search Pluginrepo SupportPress for emails sent to/from this email address', 'wporg-plugins' )
    8387                                                );
    84                                         ?></span>
     88                                        ?>
     89                                        </span>
    8590                                </div>
    86                                 <div class="profile-join"><?php
     91                                <div class="profile-join">
     92                                <?php
    8793                                        /* translators: 1: time ago, 2: registration date */
    88                                         printf( __( 'Joined %1$s ago (%2$s)', 'wporg-plugins' ),
     94                                        printf(
     95                                                __( 'Joined %1$s ago (%2$s)', 'wporg-plugins' ),
    8996                                                human_time_diff( strtotime( $author->user_registered ) ),
    9097                                                date( 'Y-M-d', strtotime( $author->user_registered ) )
    9198                                        );
    92                                 ?></div>
     99                                ?>
     100                                </div>
    93101                        </div>
    94102                </div>
    … …  
    103111                <?php
    104112                if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) {
    105                         $user = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID );
     113                        $user     = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID );
    106114                        $statuses = array();
    107115
    … …  
    123131                                $labels = array();
    124132                                foreach ( $statuses as $status ) {
    125                                         $labels[] = sprintf( '<strong><span title="%s">%s</span></strong>',
     133                                        $labels[] = sprintf(
     134                                                '<strong><span title="%s">%s</span></strong>',
    126135                                                esc_attr( $status['desc'] ),
    127136                                                $status['text']
    … …  
    150159
    151160                        /* translators: %s: comma-separated list of plugin author's IP addresses */
    152                         printf( '<p>' . __( 'IPs : %s', 'wporg-plugins' ) . '</p>',
     161                        printf(
     162                                '<p>' . __( 'IPs : %s', 'wporg-plugins' ) . '</p>',
    153163                                implode( ', ', array_map( array( __NAMESPACE__ . '\Author_Card', 'link_ip' ), $user_ips ) )
    154164                        );
    … …  
    170180                                foreach ( $all_plugins as $plugin ) {
    171181                                        echo '<li>';
    172                                         $note    = false;
    173                                         $extra   = '';
    174                                         $classes = $tooltips = array();
     182                                        $note         = false;
     183                                        $extra        = '';
     184                                        $classes      = $tooltips = array();
    175185                                        $last_updated = get_post_meta( $plugin->ID, 'last_updated', true );
    176186
    … …  
    187197                                        if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) {
    188198                                                /* translators: %s: time ago */
    189                                                 $extra .= sprintf( __( '(requested %s ago)', 'wporg-plugins' ),
     199                                                $extra     .= sprintf(
     200                                                        __( '(requested %s ago)', 'wporg-plugins' ),
    190201                                                        human_time_diff( strtotime( $last_updated ) )
    191202                                                );
    … …  
    200211                                        } elseif ( 'closed' === $plugin->post_status ) {
    201212                                                /* translators: %s: close/disable reason */
    202                                                 $extra .= sprintf( __( '(closed: %s)', 'wporg-plugins' ),
     213                                                $extra     .= sprintf(
     214                                                        __( '(closed: %s)', 'wporg-plugins' ),
    203215                                                        Template::get_close_reason( $plugin )
    204216                                                );
    … …  
    208220                                        } elseif ( 'disabled' === $plugin->post_status ) {
    209221                                                /* translators: %s: close/disable reason */
    210                                                 $extra .= sprintf( __( '(disabled: %s)', 'wporg-plugins' ),
     222                                                $extra     .= sprintf(
     223                                                        __( '(disabled: %s)', 'wporg-plugins' ),
    211224                                                        Template::get_close_reason( $plugin )
    212225                                                );
    213226                                                $tooltips[] = __( 'Plugin is disabled (updates are active).', 'wporg-plugins' );
    214227                                                $classes[]  = 'profile-plugin-closed';
    215                                                 $note = true;
     228                                                $note       = true;
    216229
    217230                                        } else {
    … …  
    226239                                                        $tooltips[] = __( 'Plugin is open.', 'wporg-plugins' );
    227240                                                }
    228                                                 $classes[]      = 'profile-plugin-open';
     241                                                $classes[] = 'profile-plugin-open';
    229242                                        }
    230243
    231244                                        echo '<span>';
    232245
    233                                         printf( '<a class="%1$s" title="%2$s" href="%3$s">%4$s</a>',
     246                                        printf(
     247                                                '<a class="%1$s" title="%2$s" href="%3$s">%4$s</a>',
    234248                                                esc_attr( implode( ' ', $classes ) ),
    235249                                                esc_attr( implode( ' ', $tooltips ) ),
    … …  
    243257
    244258                                        $plugin_links = array(
    245                                                 sprintf( '<a href="%s" title="%s">%s</a>',
     259                                                sprintf(
     260                                                        '<a href="%s" title="%s">%s</a>',
    246261                                                        esc_url( get_edit_post_link( $plugin->ID, '' ) ),
    247262                                                        esc_attr__( 'Edit this plugin', 'wporg-plugins' ),
    248263                                                        __( 'Edit', 'wporg-plugins' )
    249264                                                ),
    250                                                 sprintf( '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>',
     265                                                sprintf(
     266                                                        '<a href="//make.wordpress.org/pluginrepo/?s=%s" title="%s">P2</a>',
    251267                                                        urlencode( esc_attr( $plugin_slug ) ),
    252268                                                        esc_attr__( 'Click to search Pluginrepo P2 for mentions of this plugin', 'wporg-plugins' )
    253269                                                ),
    254                                                 sprintf( '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>',
     270                                                sprintf(
     271                                                        '<a href="https://supportpress.wordpress.org/plugins/?q=%s&status=&todo=Search+%%C2%%BB" title="%s">SP</a>',
    255272                                                        urlencode( esc_attr( $plugin_slug ) ),
    256273                                                        esc_attr__( 'Click to search Pluginrepo SupportPress for mentions of this plugin', 'wporg-plugins' )
    … …  
    290307         */
    291308        protected static function link_ip( $ip ) {
    292                 return sprintf( '<a href="%1$s">%2$s</a>', esc_url( add_query_arg( array(
    293                         'post_type' => 'plugin',
    294                         's'         => $ip,
    295                 ), admin_url( 'edit.php' ) ) ), $ip );
     309                return sprintf(
     310                        '<a href="%1$s">%2$s</a>',
     311                        esc_url( add_query_arg( array(
     312                                'post_type' => 'plugin',
     313                                's'         => $ip,
     314                        ), admin_url( 'edit.php' ) ) ),
     315                        $ip
     316                );
    296317        }
    297318}
Note: See TracChangeset for help on using the changeset viewer.