WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

Last modified 3 weeks ago

#41755 closed task (blessed) (fixed)

Remove the Flash and Silverlight options from Plupload

Reported by: azaozz Owned by: azaozz
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Upload Keywords: has-patch needs-testing 2nd-opinion
Focuses: Cc:

Description

Plupload includes Flash and Silverlight as fallbacks when the browser doesn't support HTML 5.0. Since we dropped support for old IE, all currently supported browsers use HTML 5.0. Even if Plupload is used in an old unsupported browser, it will revert to using "HTML 4" (a simple file field).

Attachments (3)

41755.patch (536.5 KB) - added by azaozz 3 months ago.
41755.2.patch (537.1 KB) - added by azaozz 3 months ago.
41755.3.patch (916 bytes) - added by gmariani405 3 months ago.
Enabled debugging of plupload and moxie

Download all attachments as: .zip

Change History (19)

@azaozz
3 months ago

#1 @azaozz
3 months ago

In 41755.patch:

  • Modify moxie.js and plupload.js: remove support for the Silverlight and Flash runtimes and hardcore html5,html4 for the runtimes setting.
  • Add the above non-minified files to wp-includes/js/plupload as they are different than the originals.
  • Delete the Flash and Silverlight executables.

Tested in latest Firefox, Edge, and Chrome, also in Edge emulation of IE11, 10, and 8 (just in case). All seems to be working properly.

@azaozz
3 months ago

#2 @azaozz
3 months ago

In 41755.2.patch: also add plupload.flash.swf and plupload.silverlight.xap to $_old_files to be deleted when upgrading.

The patch also includes the last GPLv2 version of Plupload.

#3 @azaozz
3 months ago

  • Keywords has-patch needs-testing added

#4 @azaozz
3 months ago

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

In 41328:

Plupload:

  • Update to 2.1.9.
  • Include the non-minified plupload.js and moxie.js.
  • Remove support for Flash and Silverlight, the available runtime options are html5 and html4.
  • Delete plupload.flash.swf and plupload.silverlight.xap.

Fixes #41755.

#5 @azaozz
3 months ago

Committed this to make it easier for testing, and also to be able to do other fixes for plupload.js and moxie.js. Feel free to reopen if any bugs/errors.

Last edited 3 months ago by azaozz (previous) (diff)

@gmariani405
3 months ago

Enabled debugging of plupload and moxie

#6 follow-up: @gmariani405
3 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Added a switch to be able to actually debug with the individual scripts when SCRIPT_DEBUG is enabled.

#7 in reply to: ↑ 6 @azaozz
3 months ago

  • Keywords 2nd-opinion added

Replying to gmariani405:

Thanks for the patch!

Was thinking about this too. If we want it, would probably be better to drop plupload.full.min.js and keep the 'plupload' dependency on moxie.js, something like:

$scripts->add( 'moxie', "/wp-includes/js/plupload/moxie$suffix.js", array(), '1.3.5' );
$scripts->add( 'plupload', "/wp-includes/js/plupload/plupload$suffix.js", array( 'moxie' ), '2.1.9' );

Not really sure if that's needed. Plupload is an external package/library. There are changes to the original files, so we added our versions as non-minified (readable) files, but we aren't going to "actively develop" it in core.

Last edited 3 months ago by azaozz (previous) (diff)

#8 follow-ups: @afercia
3 months ago

When running grunt precommit I get 1 test failure:

1) Tests_Admin_IncludesUpdateCore::test_new_files_are_not_in_old_files_array_compiled with data set #559 ('wp-includes/js/plupload/plupload.js')
Failed asserting that file "/ ... /wordpress-develop/public_html/build/wp-includes/js/plupload/plupload.js" does not exist.

I guess because this change re-introduces wp-includes/js/plupload/plupload.js which is listed in the $_old_files since WP 3.9 ? See [28085]

#9 in reply to: ↑ 8 @netweb
3 months ago

Replying to afercia:

When running grunt precommit I get 1 test failure:

1) Tests_Admin_IncludesUpdateCore::test_new_files_are_not_in_old_files_array_compiled with data set #559 ('wp-includes/js/plupload/plupload.js')
Failed asserting that file "/ ... /wordpress-develop/public_html/build/wp-includes/js/plupload/plupload.js" does not exist.

I guess because this change re-introduces wp-includes/js/plupload/plupload.js which is listed in the $_old_files since WP 3.9 ? See [28085]

Note the path @afercia of the file is in the build folder, removing your local /build folder via rm -rf build/ or running grunt will clean out the build folder and remove that file that is currently causes the test to fail. Tests should pass fine after that.

#10 follow-up: @afercia
3 months ago

@netweb thanks, I've tried that but grunt precommit builds the JS files and then runs the test, so it still fails :)

#11 in reply to: ↑ 10 @netweb
3 months ago

Replying to afercia:

@netweb thanks, I've tried that but grunt precommit builds the JS files and then runs the test, so it still fails :)

Right you are :+1: , I hadn't re-run grunt build myself after removing the the build/ folder ;)

#12 in reply to: ↑ 8 @azaozz
3 months ago

Replying to afercia:

I guess because this change re-introduces wp-includes/js/plupload/plupload.js which is listed in the $_old_files since WP 3.9 ? See [28085]

Good catch, thanks! Will remove that file from $_old_files.

grunt precommit throws weird errors here, will need to fix it somehow (it requires "global" svn to be installed, but many apps (IDEs, Tortoisesvn, etc.) have "local" copies, and sometimes the svn versions differ and... all gets really messy).

#13 @azaozz
3 months ago

In 41332:

Plupload: remove the reinstated plupload.js from the list of old files.

Props afercia.
See #41755.

#14 @azaozz
2 months ago

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

In 41570:

Plupload: minify and load plupload.js and moxie.js separately to make them easier to debug.

Props gmariani405, azaozz.
Fixes #41755.

#15 @azaozz
2 months ago

In 41571:

Plupload: also delete plupload.full.min.js when updating.

See #41755.

#16 @westonruter
3 weeks ago

In 42041:

Tests: Remove references to deleted JS files in QUnit tests.

Amends [41570], [40584].
See #41755, #40690.

Note: See TracTickets for help on using tickets.