[wp-meta] [Making WordPress.org] #5873: Meaningless query

Making WordPress.org noreply at wordpress.org
Sat Aug 21 13:11:17 UTC 2021


#5873: Meaningless query
--------------------------------+--------------------
 Reporter:  sunxiyuan           |      Owner:  (none)
     Type:  defect              |     Status:  new
 Priority:  normal              |  Milestone:
Component:  WordPress.org Site  |   Keywords:
--------------------------------+--------------------
 file:

 wordpress.org/public_html/wp-content/plugins/wporg-gp-
 customizations/inc/cli/class-language-pack.php(line: 85)

 code:

 {{{
 $gp_project = GP::$project->by_path( "wp-plugins/$slug" );
 if ( ! $gp_project ) {
     WP_CLI::error( 'Invalid plugin slug.' );
 }

 $stable_tag = $this->get_plugin_stable_tag( $slug );
 $branch = ( 'trunk' !== $stable_tag ) ? 'stable' : 'dev';

 $gp_project = GP::$project->by_path( "wp-plugins/$slug/$branch" );
 if ( ! $gp_project ) {
     WP_CLI::error( 'Invalid plugin branch.' );
 }
 }}}

 The value of the first $gp_project is overwritten by the second query, so
 I think the first query is meaningless

 Or we should only execute the second query when the value is not obtained
 the first time

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5873>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list