Opened 8 years ago
Closed 8 years ago
#2787 closed defect (bug) (fixed)
Plugin Directory: Reject plugin on duplicate slugs
Reported by: | Ipstenu | Owned by: | tellyworth |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Plugin Directory | Keywords: | has-patch |
Cc: |
Description
Related to #2386
No one wants 'my-cool-plugin-2' so all plugins with existing slugs should be hard punted and asked to rename.
This should cover all plugins in the queue as well as approved ones (which currently aren't checking for concurrent submissions and some people like to double-click on submit...)
Attachments (2)
Change History (12)
This ticket was mentioned in Slack in #meta by ipstenu. View the logs.
8 years ago
#3
@
8 years ago
Line 111:
return sprintf( __( 'There is already a plugin called %1$s. Please change the %2$s line in your main plugin file and upload it again.', 'wporg-plugins' ),
That would be better as:
return sprintf( __( 'You have already submitted the plugin called %1$s. Please be patient and wait for a review. Make sure to whitelist plugins@wordpress.org in your email.', 'wporg-plugins' ),
#4
@
8 years ago
- Owner set to tellyworth
- Resolution set to fixed
- Status changed from new to closed
In 5416:
#5
follow-up:
↓ 6
@
8 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening because it's not working.
Someone decided to keep resubmitting when the name was 'wrong' (I need to change THAT error message too...) and we got the same plugin with a -2 appending.
#6
in reply to:
↑ 5
@
8 years ago
Replying to Ipstenu:
Someone decided to keep resubmitting when the name was 'wrong' (I need to change THAT error message too...) and we got the same plugin with a -2 appending.
Just tested on a local install, and [5416] appears to work as expected.
Could it be that it was not deployed yet at the time when that happened?
#7
@
8 years ago
Nevermind, reproduced with a newly submitted plugin (previously tried with a published one).
It's the same issue that was mentioned in comment:4:ticket:2594.
Plugin_Directory::get_plugin_post() includes a list of 7 plugin statuses to query: 'publish', 'pending', 'disabled', 'closed', 'new', 'draft', 'approved'
, but Plugin_Directory::pre_get_posts() overrides that list and limits the query to 4 statuses 'approved', 'publish', 'closed', 'disabled'
(note the lack of 'new'
), so the check for duplicate slug is bypassed.
Adding ! $wp_query->is_main_query()
to Plugin_Directory::pre_get_posts()
, as in
attachment:2594.3.patch:ticket:2594, fixes the issue.
This ticket was mentioned in Slack in #meta by sergey. View the logs.
8 years ago
#9
@
8 years ago
Added the relevant part of attachment:2594.patch:ticket:2594 here, just in case: 2787.2.patch.
We already check if the plugin with the same slug exists, but the error is not thrown if the duplicate plugin has a
new
orpending
status.I think we can just remove the status check there, 2787.patch does that.