Opened 2 months ago
Closed 2 months ago
#63907 closed defect (bug) (fixed)
Remove unused classes and CSS from forms.css
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 4.9.6 |
| Component: | General | Keywords: | has-patch commit |
| Focuses: | css | Cc: |
Description
While reviewing all extant uses of generated content for #40428, I came across three classes where I couldn't identify any usage.
Starting here: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/css/forms.css#L1469
The classes .email-personal-data, .email-personal-data--sending, and .email-personal-data--sent don't appear to be in use.
They were committed in https://github.com/WordPress/wordpress-develop/commit/33979450aca7de46e784eb2d422b8772b24ebda3, but I was unable to identify how they were used in that commit, either.
There are some similar classes that are in use: export-personal-data-success, for example, which makes me think that these are earlier versions of the implementation that were never removed.
That said, just because I can't find these doesn't mean they aren't there; and there may be additional CSS here that isn't in use.
Change History (10)
#2
follow-up:
↓ 3
@
2 months ago
Yes, these aren't generic classes that are likely to have been broadly applied; the only examples I found in a plugin search were in plugins that have a copy of forms.css in their own directory.
They seem pretty safe to remove, assuming I haven't missed something.
#3
in reply to:
↑ 2
@
2 months ago
Replying to joedolson:
Yes, these aren't generic classes that are likely to have been broadly applied; the only examples I found in a plugin search were in plugins that have a copy of
forms.cssin their own directory.
They seem pretty safe to remove, assuming I haven't missed something.
Thanks, I think it's good to do prior to a beta 1 release. That will trigger a scream test in the event a plugin is using them.
#4
@
2 months ago
- Milestone changed from Awaiting Review to 6.9
I think I'll go ahead and milestone this for 6.9. As you say, we should hear about it if anybody's depending on this.
And even if they are, it's just a handful of styles they can add to their own plugin in that case.
This ticket was mentioned in PR #9735 on WordPress/wordpress-develop by @joedolson.
2 months ago
#6
- Keywords has-patch added
These appear to have never been used.
Trac ticket: https://core.trac.wordpress.org/ticket/63907
@mukesh27 commented on PR #9735:
2 months ago
#7
- I didn’t find any themes using this class: https://wpdirectory.net/search/01K4A7M8VQAYSNHE0CND40W7P3
- 9 plugins reference the class, but only in CSS, so these changes shouldn’t affect them: https://wpdirectory.net/search/01K4A7K18Y8J6B4WT2CDWJB4NZ
@joedolson commented on PR #9735:
2 months ago
#8
Thanks for double-checking, @mukeshpanchal27! That's the same as what I found when I searched, so sounds promising.
I'm not sure if it's the case here but in the past I know obsolete CSS has been retained to ensure back-compat for any plugins making use of the styles.
In this case I think it's up for debate as to whether they can be safely removed: the classes are very specifically named and suggest a specific purpose.