Making WordPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 8 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:
Cc:

Description

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
9 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
9 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
8 years ago

  • Milestone Plugin Directory v3 - M3 deleted

Milestone Plugin Directory v3 - M3 deleted

Note: See TracTickets for help on using tickets.