Making WordPress.org

Ticket #1560: 1560.combo.diff

File 1560.combo.diff, 6.1 KB (added by Ipstenu, 5 years ago)

Updates for sanity

  • trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php

     
    1717<div id="admin" class="section">
    1818        <?php the_closed_plugin_notice(); ?>
    1919
    20         <h2><?php esc_html_e( 'Plugin Stats', 'wporg-plugins' ); ?></h2>
     20        <h2><?php esc_html_e( 'Statistics', 'wporg-plugins' ); ?></h2>
    2121
    2222        <h4><?php esc_html_e( 'Active versions', 'wporg-plugins' ); ?></h4>
    2323        <div id="plugin-version-stats" class="chart version-stats"></div>
     
    2828        <h4><?php esc_html_e( 'Active Install Growth', 'wporg-plugins' ); ?></h4>
    2929        <div id="plugin-growth-stats" class="chart download-stats"></div>
    3030
    31         <h5><?php esc_html_e( 'Downloads history', 'wporg-plugins' ); ?></h5>
     31        <h4><?php esc_html_e( 'Downloads history', 'wporg-plugins' ); ?></h4>
    3232        <table id="plugin-download-history-stats" class="download-history-stats">
    3333                <tbody></tbody>
    3434        </table>
    3535
     36        <hr>
     37
     38        <h2><?php esc_html_e( 'Advanced Options', 'wporg-plugins' ); ?></h2>
     39
     40        <p><?php esc_html_e( 'This section is intended for advanced users and developers only. They are presented here for testing and educational purposes.', 'wporg-plugins' ); ?></p>
     41
    3642        <?php the_previous_version_download(); ?>
    3743
     44        <hr>
     45
     46        <h2><?php esc_html_e( 'The Danger Zone', 'wporg-plugins' ); ?></h2>
     47
     48        <p><?php esc_html_e( 'The following features are restricted to plugin committers only. They exist to allow plugin developers more control over their work.', 'wporg-plugins' ); ?></p>
     49
     50        <div class="plugin-notice notice notice-error notice-alt"><p><?php esc_html_e( 'These features often cannot be undone without intervention. Please do not attempt to use them unless you are absolutely certain. When in doubt, contact the plugins team for assistance.', 'wporg-plugins' ); ?><p></div>
     51
    3852        <?php the_plugin_self_close_button(); ?>
    3953</div>
  • trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

     
    283283        // List Trunk, followed by the most recent non-stable release.
    284284        $tags = array_reverse( $tags );
    285285
    286         echo '<h5>' . esc_html__( 'Previous Versions', 'wporg-plugins' ) . '</h5>';
    287         echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . esc_html__( 'Previous versions of this plugin may not be secure or stable and are available for testing purposes only.', 'wporg-plugins' ) . '</p></div>';
     286        echo '<h4>' . esc_html__( 'Previous Versions', 'wporg-plugins' ) . '</h4>';
    288287
     288        echo '<p>' . esc_html__( 'Please select a specific version to download.', 'wporg-plugins' ) . '</p>';
     289
     290        echo '<div class="plugin-notice notice notice-info notice-alt"><p>' . esc_html__( 'Previous versions of plugins may not be secure or stable. They are not recommended for use on production websites.', 'wporg-plugins' ) . '</p></div>';
     291
    289292        echo '<select class="previous-versions" onchange="getElementById(\'download-previous-link\').href=this.value;">';
    290293        foreach ( $tags as $version ) {
    291294                $text = ( 'trunk' === $version ? esc_html__( 'Development Version', 'wporg-plugins' ) : $version );
     
    302305
    303306/**
    304307 * Displays a form for plugin committers to self-close a plugin. Permanently.
     308 * It is disabled for plugins with 20,000+ users.
    305309 */
    306310function the_plugin_self_close_button() {
    307         $post = get_post();
     311        $post            = get_post();
     312        $active_installs = (int) get_post_meta( $post->ID, 'active_installs', true );
    308313
    309314        if ( ! current_user_can( 'plugin_admin_edit', $post ) || 'publish' != $post->post_status ) {
    310315                return;
    311316        }
    312317
    313         $close_link = Template::get_self_close_link( $post );
     318        echo '<h4>' . esc_html__( 'Close This Plugin', 'wporg-plugins' ) . '</h4>';
     319        echo '<p>' . esc_html__( 'This plugin is currently open. All developers have the ability to close their own plugins at any time.', 'wporg-plugins' ) . '</p>';
    314320
    315         ?>
    316         <h5><?php esc_html_e( 'Close This Plugin', 'wporg-plugins' ); ?></h5>
    317         <div class="plugin-notice notice notice-warning notice-alt"><p><?php _e( '<strong>Warning:</strong> Closing your plugin is intended to be a permanent action. You will not be able to reopen it without contacting the plugins team.', 'wporg-plugins' ); ?></p></div>
     321        echo '<div class="plugin-notice notice notice-warning notice-alt"><p>';
     322        if ( $active_installs >= '20000' ) {
     323                // Translators: %s is the plugin team email address.
     324                echo sprintf( esc_html__( '<strong>Notice:</strong> Due to the high volume of users for this plugin it cannot be closed without speaking directly to the plugins team. Please contact <a href="mailto:%1$s">%1$s</a> with a link to the plugin and explanation as to why it should be closed.', 'wporg-plugins' ), 'plugins@wordpress.org' );
     325        } else {
     326                $close_link    = Template::get_self_close_link( $post );
     327                echo esc_html__( '<strong>Warning:</strong> Closing a plugin is intended to be a <em>permanent</em> action. There is no way to reopen a plugin without contacting the plugins team.', 'wporg-plugins' );
     328        }
     329        echo '</p></div>';
    318330
    319         <form method="POST" action="<?php echo esc_url( $close_link ); ?>">
    320         <p>
    321                 <input class="button" type="submit" value="<?php echo esc_attr( sprintf( __( 'I understand, please close %s.', 'wporg-plugins' ), get_the_title() ) ); ?>" />
    322         </p>
    323         </form>
    324 <?php
    325 }
    326  No newline at end of file
     331        if ( isset( $close_link ) ) {
     332                echo '<form method="POST" action="' . esc_url( $close_link ) . '">"';
     333                // Translators: $s is the plugin name, as defined by the plugin itself.
     334                echo '<p><input class="button" type="submit" value="' . esc_attr( sprintf( __( 'I understand, please close %s.', 'wporg-plugins' ), get_the_title() ) ) . '" /></p>';
     335                echo '</form>';
     336        }
     337}