Making WordPress.org

Opened 21 months ago

Closed 21 months ago

Last modified 10 months ago

#1706 closed defect (fixed)

Uploaded plugins with `draft` status will appear in the repository.

Reported by: ChopinBach Owned by: obenland
Milestone: Priority: normal
Component: Plugin Directory Keywords:


If you use the [wporg-plugin-upload] to handle a plugin upload. The plugin post will default to draft status. Posts with draft status should not be public facing, even though it would be difficult to stumble across the plugin. If you were to go to plugins/my-slug (on meta environment plugins-wp/my-slug ) then you will find that freshly uploaded plugin sitting on its own page. pending and approved statuses do not share this problem.

Change History (3)

#1 @roccotripaldi
21 months ago

Around line 340 of class-plugin-directory.php, you can add a post_status of publish to query:

if ( empty( $wp_query->query_vars['pagename'] ) && ( empty( $wp_query->query_vars['post_type'] ) || 'post' == $wp_query->query_vars['post_type'] ) ) {
			$wp_query->query_vars['post_type'] = array( 'plugin' );
			$wp_query->query_vars['post_status'] = array( 'publish' );

That should ensure that only published plugins will be visible on the front end.

#2 @obenland
21 months ago

  • Owner set to obenland
  • Resolution set to fixed
  • Status changed from new to closed

In 3134:

Plugin Directory: Only have published plugins appear in the directory.

Props roccotripaldi.
Fixes #1706.

#3 @samuelsidler
10 months ago

  • Milestone Plugin Directory v3 - M3 deleted

Milestone Plugin Directory v3 - M3 deleted

Note: See TracTickets for help on using tickets.