WordPress.org

Making WordPress.org


Ignore:
Timestamp:
12/18/2017 05:42:35 PM (3 years ago)
Author:
obenland
Message:

Plugins: Conform to WPCS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r6252 r6284  
    99
    1010namespace WordPressdotorg\Plugin_Directory\Theme;
     11
    1112use WordPressdotorg\Plugin_Directory\Plugin_Directory;
    1213use WordPressdotorg\Plugin_Directory\Template;
     
    1516
    1617$content   = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() );
    17 $is_closed = in_array( get_post_status(), ['closed', 'disabled'], true );
     18$is_closed = in_array( get_post_status(), [ 'closed', 'disabled' ], true );
    1819?>
    1920
     
    2526
    2627        <div class="entry-thumbnail">
    27             <?php echo Template::get_plugin_icon( $post, 'html' ); ?>
     28            <?php
     29            // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
     30            echo Template::get_plugin_icon( $post, 'html' );
     31            ?>
    2832        </div>
    2933
     
    3236
    3337            <?php if ( 'publish' === get_post_status() || current_user_can( 'plugin_admin_view', $post ) ) : ?>
    34                 <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::download_link() ); ?>"><?php _e( 'Download', 'wporg-plugins' ); ?></a>
     38                <a class="plugin-download button download-button button-large" href="<?php echo esc_url( Template::download_link() ); ?>"><?php esc_html_e( 'Download', 'wporg-plugins' ); ?></a>
    3539            <?php endif; ?>
    3640        </div>
    3741
    3842        <?php $plugin_title = $is_closed ? $post->post_name : get_the_title(); ?>
    39         <h1 class="plugin-title"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php echo $plugin_title; ?></a></h1>
     43        <h1 class="plugin-title"><a href="<?php echo esc_url( get_permalink() ); ?>"><?php echo wp_kses_post( $plugin_title ); ?></a></h1>
    4044
    4145        <span class="byline"><?php the_author_byline(); ?></span>
     
    4852        <span id="developers"></span>
    4953        <ul class="tabs clear">
    50             <li id="tablink-description"><a href="#description"><?php _e( 'Details', 'wporg-plugins' ); ?></a></li>
    51             <li id="tablink-reviews"><a href="#reviews"><?php _e( 'Reviews', 'wporg-plugins' ); ?></a></li>
     54            <li id="tablink-description"><a href="#description"><?php esc_html_e( 'Details', 'wporg-plugins' ); ?></a></li>
     55            <li id="tablink-reviews"><a href="#reviews"><?php esc_html_e( 'Reviews', 'wporg-plugins' ); ?></a></li>
    5256            <?php if ( isset( $content['installation'] ) && ! $is_closed ) : ?>
    5357                <li id="tablink-installation">
    54                     <a href="#installation"><?php _e( 'Installation', 'wporg-plugins' ); ?></a>
     58                    <a href="#installation"><?php esc_html_e( 'Installation', 'wporg-plugins' ); ?></a>
    5559                </li>
    5660            <?php endif; ?>
    5761            <li id="tablink-support">
    58                 <a href="<?php echo esc_url( Template::get_support_url() ); ?>"><?php _e( 'Support', 'wporg-plugins' ); ?></a>
     62                <a href="<?php echo esc_url( Template::get_support_url() ); ?>"><?php esc_html_e( 'Support', 'wporg-plugins' ); ?></a>
    5963            </li>
    60             <li id="tablink-developers"><a href="#developers"><?php _e( 'Development', 'wporg-plugins' ); ?></a></li>
     64            <li id="tablink-developers"><a href="#developers"><?php esc_html_e( 'Development', 'wporg-plugins' ); ?></a></li>
    6165        </ul>
    6266    <?php endif; ?>
     
    8084                    $section_content = get_closed_plugin_notice();
    8185
    82                 } else if ( ! in_array( $section_slug, ['screenshots', 'installation', 'faq', 'changelog'], true ) || ! $is_closed ) {
     86                } elseif ( ! in_array( $section_slug, [ 'screenshots', 'installation', 'faq', 'changelog' ], true ) || ! $is_closed ) {
    8387                    $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) );
    8488                }
     
    97101                }
    98102
    99                 $section_read_more = ! in_array( $section_slug, $section_no_read_mores );
     103                $section_read_more = ! in_array( $section_slug, $section_no_read_mores, true );
    100104
    101105                get_template_part( 'template-parts/section' );
    102106            endforeach;
    103         endif; // plugin_advanced
     107        endif; // plugin_advanced.
    104108        ?>
    105109    </div><!-- .entry-content -->
Note: See TracChangeset for help on using the changeset viewer.