Making WordPress.org

Changeset 13672


Ignore:
Timestamp:
05/08/2024 04:49:14 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: Add a plugin reviewer link to plugin-check on playground to the review tools.

Fixes #7380.

File:
1 edited

Legend:

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

    r13606 r13672  
    305305                                        <li><a href='https://plugins.trac.wordpress.org/browser/<?php echo esc_attr( $post->post_name ); ?>/'>Browse in Trac</a></li>
    306306                                        <li><a href='<?php echo esc_url( Template::download_link() ); ?>'>Download Current Version</a></li>
    307                                         <li><a href='<?php echo esc_url( 'https://playground.wordpress.net/?plugin=' . $post->post_name ); ?>'>Run in playground</a></li>
     307
     308                                        <?php
     309                                        // PCP Blueprint.
     310                                        $pcp_blueprint = [
     311                                                'landingPage'         => '/wp-admin/admin.php?page=plugin-check',
     312                                                'phpExtensionBundles' => [
     313                                                        'kitchen-sink'
     314                                                ],
     315                                                'steps'               => [
     316                                                        [
     317                                                                'step'     => 'login',
     318                                                                'username' => 'admin',
     319                                                                'password' => 'password',
     320                                                        ],
     321                                                        [
     322                                                                'step'          => 'installPlugin',
     323                                                                'options'       => [
     324                                                                        'activate' => false,
     325                                                                ],
     326                                                                'pluginZipFile' => [
     327                                                                        'resource' => 'wordpress.org/plugins',
     328                                                                        'slug'     => $post->post_name,
     329                                                                ],
     330                                                        ],
     331                                                        [
     332                                                                'step'          => 'installPlugin',
     333                                                                'pluginZipFile' => [
     334                                                                        'resource' => 'wordpress.org/plugins',
     335                                                                        'slug'     => 'plugin-check',
     336                                                                ],
     337                                                        ],
     338                                                ]
     339                                        ];
     340                                        // NOTE: Must be escaped with `esc_attr()` not `esc_url()` as the blueprint is not encoded.
     341                                        $playground_with_pcp = 'https://playground.wordpress.net/#' . json_encode( $pcp_blueprint, JSON_UNESCAPED_SLASHES );
     342                                        ?>
     343                                        <li><a href='<?php echo esc_url( 'https://playground.wordpress.net/?plugin=' . $post->post_name ); ?>' target='_blank'>Run in playground</a> (<a href='<?php echo esc_attr( $playground_with_pcp ); ?>' target='_blank'>PCP</a>)</li>
    308344
    309345                                        <?php if ( has_term( 'block', 'plugin_section', $post ) ) : ?>
Note: See TracChangeset for help on using the changeset viewer.