Making WordPress.org

Changeset 14712


Ignore:
Timestamp:
03/13/2026 05:27:24 PM (6 weeks ago)
Author:
obenland
Message:

WP.org Abilities: Fix PHPCS issues across all plugin files

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/class-autoloader.php

    r14703 r14712  
    5858     * Loads a class if it starts with `$this->prefix`.
    5959     *
    60      * @param string $class The class to be loaded.
     60     * @param string $class_name The class to be loaded.
    6161     */
    62     public function load( $class ) {
    63         if ( strpos( $class, $this->prefix . self::NS_SEPARATOR ) !== 0 ) {
     62    public function load( $class_name ) {
     63        if ( strpos( $class_name, $this->prefix . self::NS_SEPARATOR ) !== 0 ) {
    6464            return;
    6565        }
    6666
    6767        // Strip prefix from the start (ala PSR-4).
    68         $class = substr( $class, $this->prefix_length + 1 );
     68        $class = substr( $class_name, $this->prefix_length + 1 );
    6969        $class = strtolower( $class );
    7070        $file  = '';
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/plugins/plugin-directory/resources/class-plugin-check-guide.php

    r14703 r14712  
    108108- A clean PCP report speeds up the review process significantly
    109109- More info: https://wordpress.org/plugins/plugin-check/
    110 MD,
     110MD
     111                ,
    111112                'mimeType' => 'text/markdown',
    112113            ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/plugins/plugin-directory/resources/class-reserved-slugs.php

    r14709 r14712  
    55 * @package WordPressdotorg\Abilities\Plugins\Plugin_Directory\Resources
    66 */
     7
     8// phpcs:disable WordPress.WP.CapitalPDangit.MisspelledInText -- Lowercase "wordpress" is intentional (slugs).
    79
    810declare( strict_types = 1 );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/plugins/plugin-directory/tools/class-get-plugin-status.php

    r14710 r14712  
    3535                    'type'       => 'object',
    3636                    'properties' => array(
    37                         'plugin_slug'    => array(
     37                        'plugin_slug'  => array(
    3838                            'type'        => 'string',
    3939                            'description' => 'The plugin slug as assigned during submission.',
     
    109109                    'mcp'         => array( 'type' => 'tool' ),
    110110                    'annotations' => array(
    111                         'readonly'     => true,
    112                         'idempotent'   => true,
    113                         'destructive'  => false,
     111                        'readonly'    => true,
     112                        'idempotent'  => true,
     113                        'destructive' => false,
    114114                    ),
    115115                ),
     
    167167     */
    168168    private static function get_plugin_post( string $slug ): ?\WP_Post {
    169         $posts = get_posts( array(
    170             'post_type'   => 'plugin',
    171             'name'        => $slug,
    172             'post_status' => 'any',
    173             'author'      => get_current_user_id(),
    174             'numberposts' => 1,
    175         ) );
     169        $posts = get_posts(
     170            array(
     171                'post_type'   => 'plugin',
     172                'name'        => $slug,
     173                'post_status' => 'any',
     174                'author'      => get_current_user_id(),
     175                'numberposts' => 1,
     176            )
     177        );
    176178
    177179        return $posts[0] ?? null;
     
    213215            $reason = get_post_meta( $post->ID, '_rejection_reason', true );
    214216            if ( $reason ) {
    215                 $reasons      = class_exists( Template::class ) ? Template::get_rejection_reasons() : array();
     217                $reasons                  = class_exists( Template::class ) ? Template::get_rejection_reasons() : array();
    216218                $data['rejection_reason'] = $reasons[ $reason ] ?? $reason;
    217219            }
     
    292294                $feedback[] = array(
    293295                    'from' => 'customer' === $thread->type ? 'author' : 'reviewer',
     296                    // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- HelpScout API property.
    294297                    'date' => $thread->createdAt ?? '',
    295298                    'body' => $body,
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/plugins/plugin-directory/tools/class-validate-readme.php

    r14711 r14712  
    6868                    'mcp'         => array( 'type' => 'tool' ),
    6969                    'annotations' => array(
    70                         'readonly'     => true,
    71                         'idempotent'   => true,
    72                         'destructive'  => false,
     70                        'readonly'    => true,
     71                        'idempotent'  => true,
     72                        'destructive' => false,
    7373                    ),
    7474                ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-abilities/wporg-abilities.php

    r14703 r14712  
    3838McpAdapter::instance();
    3939
    40 $action = defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ? 'init' : 'rest_api_init';
     40$hook = defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ? 'init' : 'rest_api_init';
    4141
    42 add_action( $action, array( Registrar::class, 'init' ) );
     42add_action( $hook, array( Registrar::class, 'init' ) );
    4343add_action( 'mcp_adapter_init', array( MCP_Server::class, 'register' ) );
    4444add_filter( 'mcp_adapter_create_default_server', '__return_false' );
Note: See TracChangeset for help on using the changeset viewer.