Opened 6 years ago
Closed 6 years ago
#45645 closed defect (bug) (fixed)
Retire wp-tinymce.php
Reported by: | azaozz | Owned by: | azaozz |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
The method of loading TinyMCE was added many years ago. All TinyMCE scripts are concatenated and pre-compressed, then we point the script tag src to wp-tinymce.php
where we determine if the browser supports compression, add the appropriate headers and output the actual wp-tinymce.js.gz
.
This, indeed, is the fastest way to load a lot of JS without relying on the server to compress it. However lately been seeing more and more reports of that file being blocked by some security measures. Also, nearly all servers compress .js and .css files now.
Attachments (2)
Change History (11)
#3
@
6 years ago
In 45645.diff:
- Remove compression of wp-tinymce.js at build time from Gruntfile.js.
- Remove the
grunt-contrib-compress
dependency. - Edit and keep wp-tinymce.php for back-compat in case "something" is accessing it directly.
Note that package-lock.json was generated on Windows and seems to have a lot of red.
#4
follow-up:
↓ 5
@
6 years ago
Should add a _deprecated_file()
call in wp-tinymce.php
, too.
Otherwise, I'm fine with this going in if you can shepherd it, @azaozz.
#5
in reply to:
↑ 4
@
6 years ago
Replying to pento:
Should add a
_deprecated_file()
call inwp-tinymce.php
, too.
Yeah, was thinking about adding something like it but wp-tinymce.php
outputs (previously compressed) js, shouldn't have any other output or it will break it.
Thinking package-lock.json may need another look/redoing on non-Windows to keep it compatible. Will try to review and commit today.
#6
@
6 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 44651:
#7
@
6 years ago
- Keywords needs-patch added
- Resolution fixed deleted
- Status changed from closed to reopened
wp-tinymce.js
needs to be removed from $_old_files
. At the same time wp-tinymce.js.gz
should be added.
#8
@
6 years ago
- Keywords has-patch added; needs-patch removed
@azaozz the build issue appears to be caused by this line which lists the new build location for wp-tinymce.js in the $_old_files array found in update-core.php as @ocean90 mentioned.
I've uploaded a patch with the changes mentioned and reference this ticket in the inline comment.
Thinking we can still concatenate all of TinyMCE's scripts when building, but not compress them so we don't depend on specific headers that need to be set in PHP. Will also need to keep
wp-tinymce.php
for a while in case something is accessing it directly (can try adding some form of "doing-it-wrong" there too). It will output the non-compressedwp-tinymce.js
too.