Making WordPress.org


Ignore:
Timestamp:
09/10/2026 07:34:24 PM (2 months ago)
Author:
obenland
Message:

Escape translated strings on output

Closes ​https://github.com/WordPress/wordpress.org/pull/895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

    r14979 r15179  
    179179                                        // If the queue is currently beyond 10 days, display a warning to that effect.
    180180                                        if ( $queue_length_in_days >= 10 ) {
    181                                                 echo ' ' . __( 'The review queue is currently longer than normal, we apologize for the delays and ask for patience.', 'wporg-plugins' );
     181                                                echo ' ' . esc_html__( 'The review queue is currently longer than normal, we apologize for the delays and ask for patience.', 'wporg-plugins' );
    182182                                        }
    183183                                }
    … …  
    230230
    231231                                        <p>
    232                                                 <?php _e( 'Please review the Plugin Check results for your plugin, and fix any significant problems. This will help streamline the preview process and reduce delays by ensuring your plugin already meets the required standards when the Plugins Team examines it.', 'wporg-plugins' ); ?>
     232                                                <?php esc_html_e( 'Please review the Plugin Check results for your plugin, and fix any significant problems. This will help streamline the preview process and reduce delays by ensuring your plugin already meets the required standards when the Plugins Team examines it.', 'wporg-plugins' ); ?>
    233233                                        </p>
    234234
    … …  
    245245                                                                '<div class="plugin-submission-submited-date">%s</div>',
    246246                                                                sprintf(
    247                                                                         __( 'Submitted on: %s', 'wporg-plugins' ),
     247                                                                        /* translators: %s: Submission date. */
     248                                                                        esc_html__( 'Submitted on: %s', 'wporg-plugins' ),
    248249                                                                        esc_html( wp_date( get_option( 'date_format' ), strtotime( $plugin->post_date_gmt ) ) )
    249250                                                                )
    … …  
    252253                                                                '<div class="plugin-submission-status">%s</div>',
    253254                                                                sprintf(
    254                                                                         __( 'Review status: %s', 'wporg-plugins' ),
     255                                                                        /* translators: %s: Review status. */
     256                                                                        esc_html__( 'Review status: %s', 'wporg-plugins' ),
    255257                                                                        $plugin->status
    256258                                                                )
    … …  
    265267                                                                        '<div class="plugin-submission-email">✉️✔️ %s</div>',
    266268                                                                        sprintf(
    267                                                                                 __( 'Our team emailed you on <strong>%s</strong> regarding your submission. The subject line is: "<strong>%s</strong>".', 'wporg-plugins' ),
     269                                                                                /* translators: 1: Email date, 2: Email subject. */
     270                                                                                wp_kses_post( __( 'Our team emailed you on <strong>%1$s</strong> regarding your submission. The subject line is: "<strong>%2$s</strong>".', 'wporg-plugins' ) ),
    268271                                                                                esc_html( wp_date( get_option( 'date_format' ), strtotime( $plugin->review_email->created ) ) ),
    269272                                                                                esc_html( $plugin->review_email->subject )
    … …  
    278281                                                                        '<div class="plugin-submission-email">✉️⏳ %s</div>',
    279282                                                                        sprintf(
    280                                                                                 __( 'Please be patient and wait for the review email. It will be sent to your email address, <strong>%s</strong>, with the subject line: "<strong>%s</strong>".', 'wporg-plugins' ),
     283                                                                                /* translators: 1: Email address, 2: Email subject. */
     284                                                                                wp_kses_post( __( 'Please be patient and wait for the review email. It will be sent to your email address, <strong>%1$s</strong>, with the subject line: "<strong>%2$s</strong>".', 'wporg-plugins' ) ),
    281285                                                                                esc_html( get_userdata( $plugin->post_author )->user_email ),
    282                                                                                 '[WordPress Plugin Directory] Review in Progress: ' . $plugin->post_title
     286                                                                                '[WordPress Plugin Directory] Review in Progress: ' . esc_html( $plugin->post_title )
    283287                                                                        )
    284288                                                                );
    … …  
    289293                                                        echo '<div class="plugin-submission-assigned-slug">';
    290294                                                        printf(
    291                                                                 __( 'Current assigned slug: %s', 'wporg-plugins' ),
     295                                                                /* translators: %s: Plugin slug. */
     296                                                                esc_html__( 'Current assigned slug: %s', 'wporg-plugins' ),
    292297                                                                '<code>' . esc_html( $plugin->post_name ) . '</code>'
    293298                                                        );
    294299                                                        ?>
    295300                                                        <?php if ( $can_change_slug ) : ?>
    296                                                                 <a href="#" class="hide-if-no-js" onclick="event.preventDefault(); this.nextElementSibling.showModal()"><?php _e( 'change', 'wporg-plugins' ); ?></a>
     301                                                                <a href="#" class="hide-if-no-js" onclick="event.preventDefault(); this.nextElementSibling.showModal()"><?php esc_html_e( 'change', 'wporg-plugins' ); ?></a>
    297302                                                                <dialog class="slug-change hide-if-no-js">
    298303                                                                        <a onclick="this.parentNode.close()" class="close dashicons dashicons-no-alt"></a>
    299                                                                         <strong><?php _e( 'Request to change your plugin slug', 'wporg-plugins' ); ?></strong>
     304                                                                        <strong><?php esc_html_e( 'Request to change your plugin slug', 'wporg-plugins' ); ?></strong>
    300305                                                                        <form>
    301306                                                                                <input type="hidden" name="action" value="request-slug-change" />
    … …  
    303308
    304309                                                                                <div class="notice notice-info notice-alt">
    305                                                                                         <p><?php _e( 'Your chosen slug cannot be guaranteed, and is subject to change based on the results of your review.', 'wporg-plugins' ); ?></p>
     310                                                                                        <p><?php esc_html_e( 'Your chosen slug cannot be guaranteed, and is subject to change based on the results of your review.', 'wporg-plugins' ); ?></p>
    306311                                                                                        <p><?php
    307312                                                                                                printf(
    308313                                                                                                        /* Translators: URL */
    309                                                                                                         __( "Your slug is used to generate your plugins URL. Currently it's %s", 'wporg-plugins' ),
     314                                                                                                        esc_html__( 'Your slug is used to generate your plugins URL. Currently it&#8217;s %s', 'wporg-plugins' ),
    310315                                                                                                        '<code>' . esc_url( home_url( $plugin->post_name ) . '/' ) . '</code>'
    311316                                                                                                );
    312317                                                                                        ?></p>
    313                                                                                         <p><?php _e( 'Your slug (aka permalink) cannot be changed once your review is completed. Please choose carefully.', 'wporg-plugins' ); ?></p>
     318                                                                                        <p><?php esc_html_e( 'Your slug (aka permalink) cannot be changed once your review is completed. Please choose carefully.', 'wporg-plugins' ); ?></p>
    314319                                                                                </div>
    315320                                                                                <div class="notice notice-error notice-alt hidden"><p></p></div>
    316321                                                                                <p>
    317322                                                                                        <label>
    318                                                                                                 <strong><?php _e( 'Plugin Name', 'wporg-plugins' ); ?></strong><br>
     323                                                                                                <strong><?php esc_html_e( 'Plugin Name', 'wporg-plugins' ); ?></strong><br>
    319324                                                                                                <?php echo esc_html( $plugin->post_title ); ?>
    320325                                                                                        </label>
    … …  
    322327                                                                                <p>
    323328                                                                                        <label>
    324                                                                                                 <strong><?php _e( 'Desired Slug', 'wporg-plugins' ); ?></strong><br>
     329                                                                                                <strong><?php esc_html_e( 'Desired Slug', 'wporg-plugins' ); ?></strong><br>
    325330                                                                                                <input type="text" name="post_name" required maxlength="200" pattern="[a-z0-9-]*" value="<?php echo esc_attr( $plugin->post_name ); ?>" />
    326331                                                                                        </label>
    … …  
    333338                                                                                                        printf(
    334339                                                                                                                /* Translators: URL to plugin guidelines */
    335                                                                                                                 __( 'I confirm that my slug choice <a href="%s">meets the guidelines for plugin slugs</a>.', 'wporg-plugins' ),
     340                                                                                                                wp_kses_post( __( 'I confirm that my slug choice <a href="%s">meets the guidelines for plugin slugs</a>.', 'wporg-plugins' ) ),
    336341                                                                                                                'https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#17-plugins-must-respect-trademarks-copyrights-and-project-names'
    337342                                                                                                        );
    … …  
    361366                                                        if ( $can_upload_extras ) {
    362367                                                                echo '<div class="plugin-submission-update-code wp-block-button is-small">';
    363                                                                 echo '<a href="#" class="show-upload-additional hide-if-no-js wp-block-button__link">' . sprintf( __( 'Upload updated "%s" plugin for review.', 'wporg-plugins' ), esc_html( $plugin->post_title ) ) . '</a>';
     368                                                                /* translators: %s: Plugin name. */
     369                                                                echo '<a href="#" class="show-upload-additional hide-if-no-js wp-block-button__link">' . sprintf( esc_html__( 'Upload updated "%s" plugin for review.', 'wporg-plugins' ), esc_html( $plugin->post_title ) ) . '</a>';
    364370
    365371                                                                ?>
    … …  
    370376
    371377                                                                        <label>
    372                                                                                 <?php _e( 'Additional Information', 'wporg-plugins' ); ?><br>
     378                                                                <?php esc_html_e( 'Additional Information', 'wporg-plugins' ); ?><br>
    373379                                                                                <textarea name="comment" rows="3" cols="80"></textarea>
    374380                                                                        </label>
    … …  
    377383                                                                        <label class="wp-block-button__link zip-file">
    378384                                                                                <input type="file" class="plugin-file" name="zip_file" size="25" accept=".zip" required data-maxbytes="<?php echo esc_attr( wp_max_upload_size() ); ?>" />
    379                                                                                 <span><?php _e( 'Select File', 'wporg-plugins' ); ?></span>
     385                                                                                <span><?php esc_html_e( 'Select File', 'wporg-plugins' ); ?></span>
    380386                                                                        </label>
    381387
    … …  
    387393
    388394                                                        echo '<div class="plugin-submission-submitted-files">';
    389                                                         echo '<strong>' . __( 'Submitted files:', 'wporg-plugins' ) . '</strong>';
     395                                                        echo '<strong>' . esc_html__( 'Submitted files:', 'wporg-plugins' ) . '</strong>';
    390396                                                        foreach ( $attached_media as $attachment_post_id => $upload ) {
    391397                                                                echo '<div class="plugin-submission-file">';
    … …  
    420426                                                                                esc_url( Template::preview_link_zip( $plugin->post_name, $upload->ID, 'pcp' ) ),
    421427                                                                                'wp-block-button__link',
    422                                                                                 __( 'Check with Plugin Check', 'wporg-plugins' )
     428                                                                                esc_html__( 'Check with Plugin Check', 'wporg-plugins' )
    423429                                                                        );
    424430                                                                }
    … …  
    441447                                '<div class="notice notice-error notice-alt"><p>%s</p></div>',
    442448                                sprintf(
    443                                         __( 'New plugin submissions are currently disabled. Please check back after the <a href="%s">holiday break.</a>', 'wporg-plugins' ),
     449                                        /* translators: %s: Holiday break announcement URL. */
     450                                        wp_kses_post( __( 'New plugin submissions are currently disabled. Please check back after the <a href="%s">holiday break.</a>', 'wporg-plugins' ) ),
    444451                                        'https://wordpress.org/news/2024/12/holiday-break/'
    445452                                )
    … …  
    449456                                sprintf(
    450457                                        /* translators: %s: Profile edit url. */
    451                                         __( 'Your email host has email deliverability problems. Please <a href="%s">Update your email address</a> first.', 'wporg-plugins'),
     458                                        wp_kses_post( __( 'Your email host has email deliverability problems. Please <a href="%s">Update your email address</a> first.', 'wporg-plugins' ) ),
    452459                                        esc_url( 'https://wordpress.org/support/users/' . wp_get_current_user()->user_nicename . '/edit' )
    453460                                        ) .
    … …  
    615622                                <label class="wp-block-button__link zip-file">
    616623                                        <input type="file" class="plugin-file" name="zip_file" size="25" accept=".zip" required data-maxbytes="<?php echo esc_attr( wp_max_upload_size() ); ?>" />
    617                                         <span><?php _e( 'Select File', 'wporg-plugins' ); ?></span>
     624                                        <span><?php esc_html_e( 'Select File', 'wporg-plugins' ); ?></span>
    618625                                </label>
    619626
    … …  
    632639                                <p>
    633640                                        <label>
    634                                                 <?php _e( 'Additional Information', 'wporg-plugins' ); ?><br>
     641                                                <?php esc_html_e( 'Additional Information', 'wporg-plugins' ); ?><br>
    635642                                                <textarea name="comment" rows="3" cols="80"><?php
    636643                                                        if ( ! empty( $_REQUEST['comment'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.