Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28930 closed defect (bug) (fixed)

Remove unused dashboard-widget-* CSS classes

Reported by: michalzuber's profile michalzuber Owned by: ocean90's profile ocean90
Milestone: 4.0 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: has-patch
Focuses: ui, administration Cc:

Description

I was researching /* @todo: are these actually used anywhere? no non-CSS results in plugin search */
and for me the result is that .dashboard-widget-title, .dashboard-widget-notice, .dashboard-widget-error
are not used. Am I missing here something?

wordpress-svn$ grep -ir 'dashboard-widget-error' src
src/wp-admin/css/dashboard.css:305:div.dashboard-widget-error {
wordpress-svn$ grep -ir 'dashboard-widget-notice' src
src/wp-admin/css/dashboard.css:309:div.dashboard-widget-notice {
wordpress-svn$ grep -ir 'dashboard-widget-' src
src/wp-admin/css/colors/_admin.scss:24:div.dashboard-widget-submit input:hover,
src/wp-admin/css/common.css:711:h3.dashboard-widget-title,
src/wp-admin/css/common.css:712:h3.dashboard-widget-title span,
src/wp-admin/css/common.css:713:h3.dashboard-widget-title small,
src/wp-admin/css/dashboard.css:77:h3.dashboard-widget-title,
src/wp-admin/css/dashboard.css:78:h3.dashboard-widget-title span,
src/wp-admin/css/dashboard.css:79:h3.dashboard-widget-title small {
src/wp-admin/css/dashboard.css:83:h3.dashboard-widget-title small a {
src/wp-admin/css/dashboard.css:87:h3.dashboard-widget-title small a:hover {
src/wp-admin/css/dashboard.css:288:#dashboard_primary .dashboard-widget-control-form {
src/wp-admin/css/dashboard.css:296:.dashboard-widget-control-form {
src/wp-admin/css/dashboard.css:300:.dashboard-widget-control-form p {
src/wp-admin/css/dashboard.css:305:div.dashboard-widget-error {
src/wp-admin/css/dashboard.css:309:div.dashboard-widget-notice {
src/wp-admin/includes/dashboard.php:113:  check_admin_referer( 'edit-dashboard-widget_' . 
    $_POST['widget_id'], 'dashboard-widget-nonce' );
src/wp-admin/includes/dashboard.php:158:  echo '<form action="" method="post" class="dashboard-
    widget-control-form">';
src/wp-admin/includes/dashboard.php:160: wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'],
    'dashboard-widget-nonce' );

Attachments (6)

28930.diff (940 bytes) - added by michalzuber 10 years ago.
Removed CSS classes .dashboard-widget-title, .dashboard-widget-notice, .dashboard-widget-error
dashboard-widget-title.txt (39.3 KB) - added by DrewAPicture 10 years ago.
.dashboard-widget-title in plugins
dashboard-widget-notice.txt (5.3 KB) - added by DrewAPicture 10 years ago.
.dashboard-widget-notice in plugins
dashboard-widget-error.txt (5.7 KB) - added by DrewAPicture 10 years ago.
.dashboard-widget-error in plugins
28930.png (6.9 KB) - added by SergeyBiryukov 10 years ago.
28930.2.diff (486 bytes) - added by michalzuber 10 years ago.
Added ticket number to the @todo comment

Download all attachments as: .zip

Change History (16)

@michalzuber
10 years ago

Removed CSS classes .dashboard-widget-title, .dashboard-widget-notice, .dashboard-widget-error

#1 @michalzuber
10 years ago

  • Keywords has-patch added

#2 @helen
10 years ago

They're not used in core - my concern was plugins/custom development. Hence the note that I had searched the plugin repo.

#3 @SergeyBiryukov
10 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.0
  • Version set to 2.7

Unused since [9103]. Looks like they can be safely removed.

#4 @DrewAPicture
10 years ago

  • Keywords commit removed

I think we need to take a step back here. A quick ack shows many plugins leveraging these classes for styling or even for their own meta boxes, including bbpress.

#5 @SergeyBiryukov
10 years ago

Looking at bbPress, they only appear as unused legacy styles there. Let me see if I can find legitimate usage in other plugins.

@DrewAPicture
10 years ago

.dashboard-widget-title in plugins

#6 @DrewAPicture
10 years ago

dashboard-widget-title.txt has plugin usages of .dashboard-widget-title. I stripped out the minified CSS/other for brevity. Running the others now.

@DrewAPicture
10 years ago

.dashboard-widget-notice in plugins

@DrewAPicture
10 years ago

.dashboard-widget-error in plugins

@SergeyBiryukov
10 years ago

#8 @SergeyBiryukov
10 years ago

To clarify, these styles apply to pre-2.7 dashboard widgets: 28930.png.

Most of the plugins in question just copied the admin styles, and haven't been updated in several years.

Keep in mind that we're just removing font colors here, which doesn't break anything. We did much more significant redesign in 2.7 and 3.8.

I'm OK with not pushing this change, but I also don't see a strong reason to punt or wontfix it.

@michalzuber
10 years ago

Added ticket number to the @todo comment

#9 @michalzuber
10 years ago

Should the TODO line stay or this ticket number added to it 28930.2.diff ?

#10 @ocean90
10 years ago

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

In 29361:

Remove some unused dashboard-widget-* CSS classes. Unused since [9103].

props michalzuber.
fixes #28930.

Note: See TracTickets for help on using tickets.