Remove unnecessary type="text/javascript" attributes from <script> tags (W3C validation warning)#805
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
georgestephanis
left a comment
There was a problem hiding this comment.
It's optional in html5 by my understanding, and if omitted is the fallback to text/javascript mime type. Probably safe to drop, but there's also no real harm in having it. I'm fine with either.
|
@georgestephanis tried to be inline with WP 7.0 where this will get dropped as well :) https://core.trac.wordpress.org/changeset/61440 |
Step to achieve #63
What?
This PR removes redundant
type="text/javascript"attributes from inline<script>tags across the Two-Factor plugin to resolve W3C validation warnings.Why?
Under HTML5,
text/javascriptis the default value for<script>elements. Explicitly defining it is unnecessary and produces validation warnings such as:Removing the attribute improves standards compliance and eliminates avoidable validation noise without changing behavior.
How?
All instances of:
were replaced with:
Updated files:
class-two-factor-core.phpproviders/class-two-factor-backup-codes.phpproviders/class-two-factor-email.phpproviders/class-two-factor-totp.phpNo JavaScript logic or execution flow was modified. Only the redundant attribute was removed.
Testing Instructions
"The type attribute is unnecessary for JavaScript resources warning."
Screenshots or screencast
Not applicable (markup-only standards compliance update).
Changelog Entry