Opened 4 weeks ago
Closed 3 weeks ago
#66061 closed enhancement (fixed)
Remove no longer used list-revisions.js file
| Reported by: | afercia | Owned by: | afercia |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Revisions | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | javascript |
Description
While reviewing JS files in the context of #66033, I noticed the file src/js/_enqueues/lib/list-revisions.js which appears to not be used any longer.
It was introduced in [12500] / #11088 'to hide the radio buttons to stop you selecting reverse comparisions' for the post revisions.
That was in WordPress 3.0 where the revisions screen used a table with radio buttons. See attached screenshot.
That UI isn't used since ages and I believe the list-revisions.js can be safely removed.
Cc @adamsilverstein
Attachments (1)
Change History (13)
This ticket was mentioned in PR #13428 on WordPress/wordpress-develop by @sainathpoojary.
4 weeks ago
#2
- Keywords has-patch added
This PR removes list-revisions.js and its related references, as it is no longer used in core.
As noted in the ticket, the script targets a #post-revisions ID containing radio inputs for the old WordPress 3.0 table based revisions screen. That UI was replaced in 3.6, and the ID no longer exists in the DOM. The script is also currently registered in script-loader.php but never enqueued anywhere.
This PR:
- Deletes the
src/js/_enqueues/lib/list-revisions.jsfile. - Removes the script registration from
src/wp-includes/script-loader.php. - Cleans up the relevant build entries in
Gruntfile.js.
Trac ticket: https://core.trac.wordpress.org/ticket/66061
#4
@
4 weeks ago
- Keywords changes-requested added
I searched Veloria for the script handle, and it surfaced one plugin in particular which appears to be using this: BuddyPress Docs.
This ticket was mentioned in PR #13502 on WordPress/wordpress-develop by @micahele.
4 weeks ago
#5
## Summary
- Remove the obsolete
list-revisions.jssource file. - Remove its two Grunt build mappings.
- Remove the unused
list-revisionsscript registration.
The legacy wp-list-revisions.dev.js entry in src/wp-admin/includes/update-core.php is retained because it is part of the historical upgrade cleanup list, not the current build or registration path.
## Testing
php -l src/wp-includes/script-loader.phpnode --check Gruntfile.jsnpm run grunt -- jshint:gruntgit diff --check
@westonruter commented on PR #13502:
4 weeks ago
#6
@MicahelE Before opening a PR, please look to see if there is one already created. In this case, there was: https://github.com/WordPress/wordpress-develop/pull/13428
#8
@
3 weeks ago
- Keywords 2nd-opinion added; close removed
Usage from third parties seems to be very limited. On the other hand, keeping this file in Core doesn't harm anything.
Is there any established practice to actually deprecate an entire JS file? I would like this file to be at least deprecated.
At the very least, an inline comment in script-loader should be added, as done for other files.
#10
@
3 weeks ago
Thanks everyone for the feedbacks! Based on our discussion, I've updated PR #13428 to retain the list-revisions script, its build mappings, and its registration to ensure we maintain backward compatibility.
The PR now just adds an inline comment in script-loader.php to clarify that the script is no longer used in Core. Let me know how this looks to you all!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Great find @afercia! I took a quick look and completely agree, this looks safe to remove.
Even though
list-revisionsis still registered inscript-loader.php, it’s not actually enqueued or used as a dependency anywhere. Plus, the#post-revisionsID it targets is long gone from the DOM.I'd be happy to put together a quick PR to drop the JS files and clean up the leftover references in
script-loader.phpandGruntfile.js.