Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1706 closed defect (bug) (fixed)

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

Reported by: chopinbach's profile ChopinBach Owned by: obenland's profile 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
8 years 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
8 years 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
7 years ago

  • Milestone Plugin Directory v3 - M3 deleted

Milestone Plugin Directory v3 - M3 deleted

Note: See TracTickets for help on using tickets.