Opened 6 months ago
Last modified 4 months ago
#22712 new defect (bug)
Admin using deprecated valign attribute
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Validation | Version: | 3.4.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | mdhansen@…, bpetty, mail@… |
Description
Hi,
I noticed when I validated one of my plugins' admin pages, I received approx. 40 error messages regarding the use of "v-align:top;" within the css structure. (Please see attached screenshot)
Is there a way to use a different css to target these elements instead of the deprecated v-align usage?
Thanks!
Attachments (6)
Change History (30)
comment:1
SergeyBiryukov — 6 months ago
- Component changed from Warnings/Notices to Validation
Sorry, just wanted to clarify (can't seem to find an edit button).
The initial usage resulting in the notices is v-align="top", displayed in the HTML structure of the rendered page.
comment:3
MikeHansenMe — 6 months ago
- Cc mdhansen@… added
@josh401 did you call a function in your plugin that produced this invalid code? If so what one. This code can be found throughout the admin core code. Just to clarify because I first thought this was a problem with your plugin based on the screenshot.
Also related: #16135
@MikeHansenMe,
I don't think so. I'm not very fond of tables... and I think I'd remember if I used that particular invalid HTML. I just went back through my admin panel code... and no traces of any usage of v-align="top".
I'll try and find another plugin which is using the same code as me for displaying admin panel options... and see if the same thing happens there.
I don't think it's my plugin. I think it's how the core code produces the tables when using the callback functions I use. But, I could be wrong.. (and would hate to be). So, I'll seek out another plugin which behaves the same... and report back.
comment:5
in reply to:
↑ 4
;
follow-up:
↓ 7
SergeyBiryukov — 6 months ago
Replying to josh401:
I just went back through my admin panel code... and no traces of any usage of v-align="top".
Note that it's valign, not v-align.
Replying to MikeHansenMe:
This code can be found throughout the admin core code.
Core indeed uses <tr valign="top"> in 12 files. In HTML5, the valign attribute on the tr element is obsolete. W3C recommends to use CSS instead: http://www.w3.org/TR/html-markup/tr.html
@SergeyBiryukov,
Thanks for the clarification. Just checked.. no traces of valign either.
Searching for another plugin to replicate now...
- Cc bpetty added
- Milestone changed from Awaiting Review to Future Release
Replying to SergeyBiryukov:
Core indeed uses <tr valign="top"> in 12 files. In HTML5, the valign attribute on the tr element is obsolete. W3C recommends to use CSS instead: http://www.w3.org/TR/html-markup/tr.html
It's actually also used with table cells (td) and table headers (th), so I see 96 matches across 18 PHP files, as well as in the wp-includes/js/tinymce/plugins/wpeditimage/editimage.html template file.
Here is another plugin which doesn't seem to have the valign in the source code of the plugin. This is "scripts and styles".
http://wordpress.org/extend/plugins/scripts-n-styles/
(Screenshot attached) (trac2-validation-error-valign.png)
MikeHansenMe — 6 months ago
remove valign="top" from do_settings_fields called by do_settings_sections
comment:9
MikeHansenMe — 6 months ago
- Keywords has-patch added
That patch should solve the problem but as mentioned above there are about 95 other instances throughout core that also need to be fixed.
comment:10
josh401 — 6 months ago
@MikeHansenMe,
Thanks. Will test now and post back a new screenshot.
comment:11
josh401 — 6 months ago
It was line 1149 for me? Not sure why? Did you use WP 3.5? This screenshot is using WP 3.4.2.
Brilliant!! It worked. All I'm left with are these 'nonce' errors (Screenshot attached). Should I begin a new trac ticket... or am I doing something wrong?
Thank you for your immediate attention and solution!
comment:12
bpetty — 6 months ago
- Summary changed from Plugins admin pages options using v-align top to Admin using deprecated valign attribute
It would be best if each of these types of issues (specifically referring to validation errors) were handled individually on new tickets.
comment:13
neoxx — 4 months ago
- Cc mail@… added
In addition to the current patch I'd suggest we also remove the deprecated code for all occurrences of valign="top" in wp-admin:
./wp-admin/comment.php (in this file the usage is inconsistent) ./wp-admin/custom-background.php ./wp-admin/custom-header.php ./wp-admin/edit-form-comment.php ./wp-admin/edit-tag-form.php ./wp-admin/includes/class-wp-media-list-table.php ./wp-admin/includes/class-wp-ms-sites-list-table.php ./wp-admin/includes/class-wp-posts-list-table.php ./wp-admin/includes/file.php ./wp-admin/includes/media.php ./wp-admin/includes/template.php ./wp-admin/my-sites.php ./wp-admin/network/settings.php ./wp-admin/options-discussion.php ./wp-admin/options-general.php ./wp-admin/options-media.php ./wp-admin/options-privacy.php ./wp-admin/options-reading.php ./wp-admin/options-writing.php
comment:14
bpetty — 4 months ago
- Keywords needs-patch added; has-patch removed
Right, this does need an extensive patch removing all occurrences of the valign attribute and adding the equivalent CSS styles to those same locations.
comment:15
follow-up:
↓ 16
josh401 — 4 months ago
I have no experience with core development... but, I'm fairly educated with code and plugin development. If I can help in any way whatsoever, please let me know.
Thank you.
comment:16
in reply to:
↑ 15
azaozz — 4 months ago
Looking at the places where valign is used, seems all are left over from long ago. Also about half are overwritten with css already.
Replying to josh401:
I have no experience with core development...
All that's needed here is to remove the attributes and then check the affected screens and add a little of css to keep the table cells aligned to the top (most valign attributes are on <tr>).
Thinking such patch would be a good way to "get your feet wet" :)
comment:17
follow-up:
↓ 18
josh401 — 4 months ago
Thinking such patch would be a good way to "get your feet wet" :)
Thanks Andrew. Do you have any links you can point me to on how to get started?
comment:18
in reply to:
↑ 17
SergeyBiryukov — 4 months ago
Replying to josh401:
Do you have any links you can point me to on how to get started?
Take a look at http://make.wordpress.org/core/handbook/submitting-a-patch/.
comment:19
josh401 — 4 months ago
Thanks, Sergey.
Please allow me 24 to 48 hours to familiarize myself with the process, and I'll be back with a patch.
MikeHansenMe — 4 months ago
this removes all the markup pages need to be checked to see if any additional css is needed
comment:20
follow-up:
↓ 21
Marventus — 4 months ago
- Keywords has-patch added; needs-patch removed
Hello. I am working with Josh in the Ultimate Tinymce plugin project.
Here's a diff that takes care of the styles issue. Basically, I replaced all instances of valign ("top", "middle", and "bottom" -- no "baseline" values used) with corresponding css classes ("aligntop", "alignmiddle", "alignbottom") and added these classes to the wp-admin/css/admin.css and wp-admin/css/admin.min.css files. I think this should resolve the problem but additional testing would be great.
Cheers!
comment:21
in reply to:
↑ 20
SergeyBiryukov — 4 months ago
Replying to Marventus:
There's no need to patch minified files, a post-commit bot takes care of that.
comment:22
josh401 — 4 months ago
Thank you, everyone! @Marventus... thanks for the help! @MikeHansenMe.. thank you very much! I thoroughly love and appreciate everything here. It is so nice to work with professionals!
comment:23
MikeHansenMe — 4 months ago
After taking a quick check around the admin, I could not see anywhere that the alignment was off. It may be worth going through more to determine if we need to add aligntop, alignmiddle, or alignbottom classes or if it is adding unnecessary code.
comment:24
Marventus — 4 months ago
@Josh, no pb!<br/>@Mike, I noticed the exact same thing, but to be honest, I was afraid of just not leaving anything in case there's something I was missing. That's why I submitted another diff (I hope you don't mind, ;-) ).

Screenshot of deprecated v-align validation errors