Making WordPress.org

Ticket #5177: 5177.diff

File 5177.diff, 5.4 KB (added by Ipstenu, 5 years ago)
  • trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php

     
    3333                <tbody></tbody>
    3434        </table>
    3535
    36         <hr>
     36        <?php
     37                // Display the advanced controls (only seen if the plugin is open).
     38                the_plugin_advanced_zone();
    3739
    38         <h2><?php esc_html_e( 'Advanced Options', 'wporg-plugins' ); ?></h2>
     40                // Display the danger zone (only shown to committers of the plugin).
     41                the_plugin_danger_zone();
     42        ?>
    3943
    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 
    42         <?php the_previous_version_download(); ?>
    43 
    44         <?php if ( current_user_can( 'plugin_admin_edit', $post ) && 'publish' == $post->post_status ) : ?>
    45                 <hr>
    46 
    47                 <h2><?php esc_html_e( 'The Danger Zone', 'wporg-plugins' ); ?></h2>
    48 
    49                 <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>
    50 
    51                 <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>
    52 
    53                 <?php the_plugin_self_transfer_form(); ?>
    54 
    55                 <?php the_plugin_self_close_button(); ?>
    56         <?php endif; // current_user_can ?>
    5744</div>
  • trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

     
    257257}
    258258
    259259/**
     260 * Display the ADVANCED Zone.
     261 */
     262function the_plugin_advanced_zone() {
     263        $post = get_post();
     264
     265        // If the post is closed, this all goes away.
     266        if ( 'publish' !== $post->post_status ) {
     267                return;
     268        }
     269
     270        echo '<hr>';
     271
     272        echo '<h2>' . esc_html__( 'Advanced Options', 'wporg-plugins' ) . '</h2>';
     273
     274        echo '<p>' . esc_html__( 'This section is intended for advanced users and developers only. They are presented here for testing and educational purposes.', 'wporg-plugins' ) . '</p>';
     275
     276        // Output previous version download.
     277        the_previous_version_download();
     278
     279}
     280
     281/**
    260282 * Displays a select element with links to previous plugin version to download.
    261283 *
    262284 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.
     
    304326}
    305327
    306328/**
     329 * Display the Danger Zone.
     330 */
     331function the_plugin_danger_zone() {
     332        $post = get_post();
     333
     334        if ( ! current_user_can( 'plugin_admin_edit', $post ) ) {
     335                return;
     336        }
     337
     338        echo '<hr>';
     339
     340        echo '<h2>' . esc_html__( 'The Danger Zone', 'wporg-plugins' ) . '</h2>';
     341
     342        echo '<p>' . esc_html__( 'The following features are restricted to plugin committers only. They exist to allow plugin developers more control over their work.', 'wporg-plugins' ) . '</p>';
     343
     344        echo '<div class="plugin-notice notice notice-error notice-alt"><p>' . esc_html__( '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>';
     345
     346        // Output the transfer form.
     347        the_plugin_self_transfer_form();
     348
     349        if ( 'publish' != $post->post_status ) {
     350                // A reminder of the closed status.
     351                the_active_plugin_notice();
     352        } else {
     353                // Output the self close button.
     354                the_plugin_self_close_button();
     355        }
     356
     357}
     358
     359/**
    307360 * Displays a form for plugin committers to self-close a plugin. Permanently.
    308361 * It is disabled for plugins with 20,000+ users.
    309362 */
     
    363416                return;
    364417        }
    365418
    366         echo '<p>' . esc_html__( 'You are the current owner of this plugin, but you can transfer those rights to another person at any time. The new owner must be added as a committer first.', 'wporg-plugins' ) . '</p>';
     419        echo '<p>' . esc_html__( 'You are the current owner of this plugin. You may transfer those rights to another person at any time, provided they have commit access to this plugin.', 'wporg-plugins' ) . '</p>';
    367420
    368         echo '<div class="plugin-notice notice notice-warning notice-alt"><p>' . __( '<strong>Warning:</strong> Transferring a plugin is intended to be <em>permanent</em>. There is no way to get plugin ownership back unless it has been done maliciously.', 'wporg-plugins' ) . '</p></div>';
     421        echo '<div class="plugin-notice notice notice-warning notice-alt"><p>' . __( '<strong>Warning:</strong> Transferring a plugin is intended to be <em>permanent</em>. There is no way to get plugin ownership back without contacting the plugin team.', 'wporg-plugins' ) . '</p></div>';
    369422
    370423        $users = [];
    371424        foreach ( Tools::get_plugin_committers( $post->post_name ) as $user_login ) {
     
    395448        echo '<p><input class="button" type="submit" value="' . esc_attr( sprintf( __( 'Please transfer %s.', 'wporg-plugins' ), get_the_title() ) ) . '" /></p>';
    396449        echo '</form>';
    397450
    398 }
    399  No newline at end of file
     451}