Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#63907 closed defect (bug) (fixed)

Remove unused classes and CSS from forms.css

Reported by: joedolson's profile joedolson Owned by: joedolson's profile joedolson
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)

#1 @peterwilsoncc
2 months ago

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.

#2 follow-up: @joedolson
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 @peterwilsoncc
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.css in 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 @joedolson
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.

#5 @joedolson
2 months ago

  • Owner set to joedolson
  • Status changed from new to accepted

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

@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.

#9 @joedolson
2 months ago

  • Keywords commit added

Essentially, there's nothing to test here. There's no evidence these have been used, so if they *are* used, we'll only find it out by committing and, as @peterwilsoncc says, using the "scream test".

Marking for commit.

#10 @joedolson
2 months ago

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

In 60710:

Administration: Remove unused CSS in forms.css.

Remove some CSS that doesn't appear to have ever been used. See [42967].

Props joedolson, peterwilsoncc, mukesh27.
Fixes #63907.

Note: See TracTickets for help on using tickets.