Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#27763 closed defect (bug) (fixed)

Plupload 2.x Compatibility

Reported by: kovshenin's profile kovshenin Owned by: kovshenin's profile kovshenin
Milestone: 3.9 Priority: highest omg bbq
Severity: major Version: 3.9
Component: External Libraries Keywords: has-patch
Focuses: Cc:


Three things we can do here to cause less plugin breakage:

  1. Rename Moxie.swf and .xap back to what they were in 3.8. Some plugins may be referencing these directly, because there's no easier way to get an array of core's default settings for Plupload.
  1. Make wp_plupload_default_settings() more generic, so developers can use it to get an array of default settings for Plupload. Currently you can call it only once and it adds a JS object to the wp-plupload handle. Doesn't return anything.
  1. Bring back the plupload-{runtime} script handles. Apparently some folks are using these in dependency arrays.

Anything else? Related: #25663 r27316

Attachments (3)

27763.diff (2.6 KB) - added by nacin 10 years ago.
27763.2.diff (3.0 KB) - added by azaozz 10 years ago.
27763.3.diff (4.8 KB) - added by azaozz 10 years ago.

Download all attachments as: .zip

Change History (14)

#1 @nacin
10 years ago

  • Priority changed from normal to high
  • Severity changed from normal to major

#2 @nacin
10 years ago

  • Owner set to kovshenin
  • Priority changed from high to highest omg bbq
  • Status changed from new to assigned

1 and 3 are easy wins. I'm for 2 as well, for sure.

#3 @azaozz
10 years ago

3 makes sense. 2 would be good too. Not so sure about renaming parts of an external library... A quick search shows about 120 plugins that contain 'plupload.flash.swf'. The only alternative seems to be to copy Moxie.swf and Moxie.xap and rename them to plupload.flash.swf and plupload.silverlight.xap, show deprecated notice somehow, and remove them in 4.0.

Last edited 10 years ago by azaozz (previous) (diff)

10 years ago

#4 @nacin
10 years ago

  • Keywords has-patch added; needs-patch removed

At this point, Plupload's new naming convention matters very little to me. 27763.diff moves them back, makes plupload the primary handle, and makes the rest of the old handles aliases.

I don't have an immediate solution to wp_plupload_default_settings(). It'd probably need a minimum of three arguments: $handle = 'wp-plupload', $js_variable = '_wpPluploadSettings', $args = array(). The args can then be merged into defaults. Or, a new wp_plupload_settings() function that abstracts this.

10 years ago

#5 @azaozz
10 years ago

Patch looks good. 27763.2.diff also changes back the names in the Plupload settings for the Media -> Add New screen.

+1 for wp_plupload_settings() that will be used in both wp_plupload_default_settings() in wp-includes/media.php and media_upload_form() in wp-admin/includes/media.php. Can probably add that in 4.0.

Last edited 10 years ago by azaozz (previous) (diff)

10 years ago

#6 @azaozz
10 years ago

27763.3.diff includes the actual file rename and svn props.

#7 @nacin
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 28108:

Plupload: Restore 3.8 handles and filenames to avoid breaking plugins.

fixes #27763.

#8 @nacin
10 years ago

We can introduce a better method for plugin developers in 4.0, but wp_plupload_default_settings() is not a simple function so I don't know if we can or should rush in an abstraction. [28108] restores backwards compatibility for 3.9, so anything anyone has been doing *should* just continue to work. (Rarst, please confirm?)

If we missed anything back-compat wise, please reopen this ticket. Otherwise, can someone make a new ticket for wp_plupload_settings()? Thanks!

#9 @azaozz
10 years ago

In 28110:

Plupload: restore the settings in media_upload_form(), see #27763

#10 @Rarst
10 years ago

Everything seems to work fine for me after patches.

This ticket was mentioned in Slack in #core by ocean90. View the logs.

9 years ago

Note: See TracTickets for help on using tickets.