WordPress.org

Making WordPress.org

Changeset 3450


Ignore:
Timestamp:
06/19/2016 08:52:20 AM (4 years ago)
Author:
obenland
Message:

Plugin Directory: Show readme notices underneath the header.

See #1584.

File:
1 edited

Legend:

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

    r3448 r3450  
    3737        <div class="wrap">
    3838            <h2><?php _e( 'WordPress Plugin readme.txt Validator', 'wporg-plugins' ); ?></h2>
     39            <?php settings_errors( 'wporg-plugins-readme' ); ?>
    3940            <form method="post" action="<?php echo esc_url( add_query_arg( array( 'post_type' => 'plugin', 'page' => 'readme_validator' ), admin_url( 'edit.php' ) ) ); ?>">
    4041                <?php
     
    7576        $warnings  = array();
    7677        $notes     = array();
    77 
    7878        if ( ! empty( $_REQUEST['readme_url'] ) ) {
    7979            $url = esc_url_raw( $_REQUEST['readme_url'] );
     
    8181            if ( strtolower( substr( $url, -10 ) ) != 'readme.txt' ) {
    8282                /* Translators: File name; */
    83                 add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( 'URL must end in %s!', 'wporg-plugins' ), '<code>readme.txt</code>' ) );
     83                add_settings_error( 'wporg-plugins-readme', 'readme-validator', sprintf( __( 'URL must end in %s!', 'wporg-plugins' ), '<code>readme.txt</code>' ) );
    8484                return;
    8585            }
    8686
    8787            if ( ! $readme = @file_get_contents( $url ) ) {
    88                 add_settings_error( 'wporg-plugins', 'readme-validator', __( 'Invalid readme.txt URL.', 'wporg-plugins' ) );
     88                add_settings_error( 'wporg-plugins-readme', 'readme-validator', __( 'Invalid readme.txt URL.', 'wporg-plugins' ) );
    8989                return;
    9090            }
     
    104104        if ( empty( $readme->name ) ) {
    105105            /* Translators: Plugin header tag; */
    106             add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( "Fatal Error:\nNo plugin name detected. Plugin names look like: %s", 'wporg-plugins' ), '<code>=== Plugin Name ===</code>' ) );
     106            add_settings_error( 'wporg-plugins-readme', 'readme-validator', sprintf( __( "Fatal Error:\nNo plugin name detected. Plugin names look like: %s", 'wporg-plugins' ), '<code>=== Plugin Name ===</code>' ) );
    107107            return;
    108108        }
     
    144144            $message .= "</ul>\n</div>";
    145145
    146             add_settings_error( 'wporg-plugins', 'readme-validator', $message, 'notice-warning' );
     146            add_settings_error( 'wporg-plugins-readme', 'readme-validator', $message, 'notice-warning' );
    147147            return;
    148148        }
     
    184184            $message .= "</ul>\n</div>";
    185185
    186             add_settings_error( 'wporg-plugins', 'readme-validator', $message, 'notice-info' );
     186            add_settings_error( 'wporg-plugins-readme', 'readme-validator', $message, 'notice-info' );
    187187            return;
    188188        }
    189189
    190190        /* Translators: File name; */
    191         add_settings_error( 'wporg-plugins', 'readme-validator', sprintf( __( 'Your %s rocks.  Seriously.  Flying colors.', 'wporg-plugins' ), '<code>readme.txt</code>' ), 'updated' );
     191        add_settings_error( 'wporg-plugins-readme', 'readme-validator', sprintf( __( 'Your %s rocks.  Seriously.  Flying colors.', 'wporg-plugins' ), '<code>readme.txt</code>' ), 'updated' );
    192192    }
    193193
Note: See TracChangeset for help on using the changeset viewer.