Make WordPress Core

Opened 18 years ago

Closed 13 years ago

#7395 closed enhancement (worksforme)

Plugins within a folder (in SVN) should be moved up a level in our plugin upgrader

Reported by: markjaquith Owned by:
Priority: high Milestone:
Component: Upgrade/Install Version: 2.6
Severity: normal Keywords: needs-patch
Cc: Focuses:

Description

The Paged Comments plugin exists in SVN under a 'paged-comments' directory. Since the auto-upgrader puts plugins into a directory based on their slug, this results in the plugin being under two 'paged-comments' directories. We should be able to identify when a plugin's trunk (or current branch) directory contains only another directory, and move the whole plugin up a level.

Attachments (2)

7395.diff​ (4.8 KB ) - added by DD32 18 years ago.
7395.2.diff​ (8.3 KB ) - added by DD32 18 years ago.

Download all attachments as: .zip

Change History (22)

#1 follow-up: @DD32
18 years ago

I have a feeling this should be done server side during the zip creation stage, However, adding a functionality like that to the WordPress code seems like a good idea as well.

There has been a previous ticket/discussion on this, From memory the outcome was along the lines of "Then you're using the SVN repo wrong"

#2 in reply to: ↑ 1 @Otto42
18 years ago

Replying to DD32:

There has been a previous ticket/discussion on this, From memory the outcome was along the lines of "Then you're using the SVN repo wrong"

Seems like the right answer to me. I mean, you could make the ZIP creator smarter, or you could kick the plugin author around a bit until he does it correctly. Either way. :)

#3 @ryan
18 years ago

  • Milestone 2.7 → 2.8

Moving enhancements to 2.8.

#4 @DD32
18 years ago

This is rather needed by the plugin uploader; Unless the .zip file is exactly alike the wordpress.org archives, it'll get installed, but potentially in the wrong locations, and the end result will be files exist on the server which do not appear on the plugins list.

While its not a problem for plugins downloaded from wordpress.org, it is a problem for all the plugin archives out there which do not fit.

My solution for this ticket is along the lines of:

* Search for all .php files in the unpacked archive
* check for plugin details in all files
* find the plugin file thats lowest in the directory structure
* copy the folder based on dirname($plugin_file) from previous step
* if dirname($plugin_file) == '.', Set it to copy from a directory lower than the contents of the zip (it'll be a folder based on the wordpress.org slug, or the uploaded zip filename)

But i havnt implemented that yet. It depends on if its felt that leaving the plugin uploader as it is for 2.7 is ok, or if this really needs to be implemented for it. (My vote is that it needs implementing, but not too sure on the timeframe on my behalf, so someone else doing it would be nice for sure :))

@DD32
18 years ago

#5 @DD32
18 years ago

  • Keywords has-patch added
  • Milestone 2.8 → 2.7

attachment 7395.diff added.

  • Locates the best plugin directory to copy the plugin from
  • prefixes an extra directory to the unzip process if the zip does not contain a folder which the plugin is in

Its an enhancement/defect, But its needed for the plugin zip uploader, So i'm going to push for it in 2.7?

There is a issue with the functionality at present however; If you attempt it with a plugin which does not use the correct SVN layout (eg: ​http://wordpress.org/extend/plugins/micromint/ ), then extra files end up in the wp-content/plugins/ folder, in this case, the screen shots and readme. But it should be noted, that the plugin doesnt work with the upgrader or installer at present anyway.

I'll look into that problem tomorrow, see if i can work around it by ignoring files not in the plugins folder perhaps.

#6 @ryan
18 years ago

  • Priority normal → high

@DD32
18 years ago

#7 @DD32
18 years ago

attachment 7395.2.diff added.

Working patch. The problem of files in the parent directory of the plugin has been fixed, along with the activation links being incorrect.

#8 @DD32
18 years ago

  • Keywords commit added

#9 @ryan
18 years ago

  • Resolution → fixed
  • Status new → closed

(In [9523]) Support installation of plugins living in a subdir in svn. Props DD32. fixes #7395

#10 @ryan
18 years ago

(In [9524]) Set perms when making plugin dirs. see #7395

#11 @ryan
18 years ago

(In [9664]) Revert [9523]. fixes #8195 see #7395

#12 @ryan
18 years ago

Got several reports of this breaking things (#8195 for example) so I reverted since we're so close to release.

#13 @ryan
18 years ago

  • Resolution fixed
  • Status closed → reopened

#14 @jacobsantos
18 years ago

  • Keywords needs-patch added; has-patch commit removed
  • Milestone 2.7 → 2.8

#16 @DD32
17 years ago

  • Milestone 2.8 → 2.9
  • Owner changed from anonymous to DD32
  • Status reopened → new

Since we're once again close to release, Bumping this again for 2.9.

I've included a filter in #7875 (Source_selection or similar, i cant remember right now) which should make this relatively easy to achieve.

Get it in store for early 2.9 with the possibility for backport to 2.8.1 IMO.

#17 @westi
17 years ago

  • Milestone 2.9 → 3.0

This needs a new patch I suspect and some testing.

I think it has missed the boat for 2.9 due to feature freeze.

Moving to 3.0

#18 @dd32
17 years ago

  • Milestone 3.0 → Future Release

Setting to Future release due to impending Feature freeze and no new patch.

#19 @dd32
13 years ago

  • Component Administration → Upgrade/Install
  • Owner DD32 removed
  • Status new → assigned

#20 @nacin
13 years ago

  • Milestone Future Release
  • Resolution → worksforme
  • Status assigned → closed

"Stable tag:" supports specifying a subdirectory for the zips. Think this is worksforme; it should be handled on the WP.org side. (Also, clearly no one has been clamoring for it.)

Note: See TracTickets for help on using tickets.