Making WordPress.org

Opened 6 years ago

Closed 6 years ago

#3864 closed defect (bug) (fixed)

Plugin Directory: Submission check for existing slug needs improvement

Reported by: ipstenu's profile Ipstenu Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Priority: normal
Component: Plugin Directory Keywords: reporter-feedback
Cc:

Description

The submission form checks to see if a slug has been approved (so it will detect closed and disabled as well as approved and published). This prevents people from submitting Akismet over and over.

But it has some flaws. Like it doesn't check REJECTED slugs. Normally this wouldn't matter, as slugs are renamed to rejected-PLUGIN-rejected in order to NOT lock up a slug. The problem here is that we didn't always.

Example: Yoast SEO has the slug wordpress-seo, so logically it would get by with the slug yoast-seo (which doesn't exist http://wordpress.org/plugins/yoast-seo ). Except... They get in as yoast-seo-2 (yes, 2). That's because at one point we rejected a plugin with that slug in the period of time BEFORE we fixed the slugs.

So there's a rejected yoast-seo with that slug and now everyone gets yoast-seo-2

1) We should check rejected slugs too

2) The slugger needs to be smarter and STOP if it ends with a hyphen and number (-2, -3, etc)

I'm not worried about 'legit' plugins ending in a number like that as we don't generally accept those anyway, and we can fix the slug if we have to.

Change History (8)

#1 @SergeyBiryukov
6 years ago

In 7799:

Plugins: When checking if a plugin with the same slug has already been submitted, account for rejected plugins as well.

Props Ipstenu.
See #3864.

#2 in reply to: ↑ description @SergeyBiryukov
6 years ago

  • Keywords reporter-feedback added

Replying to Ipstenu:

The slugger needs to be smarter and STOP if it ends with a hyphen and number (-2, -3, etc)

  1. With the check for previously rejected plugins fixed, is there still a way for a slug to end up like that?
  2. What exactly should happen to the upload or be displayed to the author if a slug like that is detected?

#3 @SergeyBiryukov
6 years ago

With [7799], if a previously rejected plugin with the same slug exists, the uploader shows "The plugin has already been submitted" error.

Maybe it should instead rename the rejected plugin to rejected-PLUGIN-rejected to free up the slug, for consistency with the current rejecting behavior, and then proceed with the upload?

#4 @SergeyBiryukov
6 years ago

In 7800:

Plugins: On upload, if a previously rejected plugin with the same slug was found, free up the slug and proceed with the upload.

This brings parity between plugins rejected before and after [5460].

See #3864. See #2737.

#5 @SergeyBiryukov
6 years ago

I think that's it, let me know if any further adjustments are needed :)

#6 follow-up: @Ipstenu
6 years ago

With the check for previously rejected plugins fixed, is there still a way for a slug to end up like that?

As a hyphen-number? Only when they name a plugin that on purpose, which we change anyway since that's not an accepted name. Ending a plugin in a number is too confusing for users, and we make them rename it

What exactly should happen to the upload or be displayed to the author if a slug like that is detected?

Prevent the upload and tell them a plugin already exists with that slug.

Maybe it should instead rename the rejected plugin to rejected-PLUGIN-rejected to free up the slug, for consistency with the current rejecting behavior, and then proceed with the upload?

No. There are very few plugins this affects, and those are ones that shouldn't be used.

#7 in reply to: ↑ 6 @SergeyBiryukov
6 years ago

Replying to Ipstenu:

No. There are very few plugins this affects, and those are ones that shouldn't be used.

Gotcha, sounds like [7799] was correct then, and [7800] should be reverted.

#8 @SergeyBiryukov
6 years ago

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

In 7805:

Plugins: Revert [7800].

Plugins rejected before [5460] should keep their slugs reserved.

Fixes #3864.

Note: See TracTickets for help on using tickets.