WordPress Expert » XHTML http://johnlamansky.com/wordpress Wed, 01 Jun 2011 18:58:49 +0000 en hourly 1 http://wordpress.org/?v=3.3 The WordPress Plugin XHTML Hall of Shame http://johnlamansky.com/wordpress/plugin-xhtml-hall-of-shame/?utm_source=rss&utm_medium=rss&utm_campaign=plugin-xhtml-hall-of-shame http://johnlamansky.com/wordpress/plugin-xhtml-hall-of-shame/#comments Tue, 08 Apr 2008 17:44:44 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/plugins/xhtml-hall-of-shame/ Just because the developers of WordPress itself put such attention onto XHTML standards compliance doesn’t necessarily mean plugin authors do the same. Even if the author of the theme you use put substantial effort into total compliance, your installed plugins nevertheless have the potential to mess things up.

To raise awareness that there are some plugins out there neglect to follow these established coding practices (“programming grammar,” if you will), I’m publishing a list of plugins that I know of that produce invalid XHTML. (We still like you plugin authors, just fix them please!)

  • PDF24 WordPress Plugin — Apparently the authors of this plugin didn’t realize that WordPress is XHTML-based, because this plugin’s old-school HTML output will add literally hundreds of errors to your blog’s homepage alone.

  • BloggingZoom Vote Button — Whenever you use this plugin to include a BloggingZoom button in a post, the plugin will output a block-level <div> element that gets enclosed in a inline-content <p> element, effectively invalidating the source code of the post in question.

  • Ultimate Tag Warrior — This once-popular (pre-2.3) plugin puts your tags into an inline <span> element instead of in a block-level element like <p> or <div>.

For the record, basically all browsers can display invalid XHTML just fine, although more serious mistakes can result in hard-to-track-down rendering issues. Complying with web coding standards also helps future-proof your blog, and gives a good impression to tech-savvy visitors who might check up on your site using the W3C validator. (For more reasons to maintain validation, refer to the World Wide Web Consortium’s Why Validate? article.)

Do you know of other standards-noncompliant WordPress plugins? Let me know in the comments so I can add them to the list.

]]>
http://johnlamansky.com/wordpress/plugin-xhtml-hall-of-shame/feed/ 0
How to Embed XHTML-Compliant Flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/?utm_source=rss&utm_medium=rss&utm_campaign=embed-xhtml-compliant-flash http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/#comments Mon, 18 Feb 2008 17:15:52 +0000 John Lamansky http://wordpress.jdwebdev.com/blog/tips/embed-xhtml-compliant-flash/ According to Macromedia, the typical method of embedding Flash on a website is using the following HTML, replacing “myFlashMovie.swf” with the filename:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="myFlashMovie.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>

Not only is this messy-looking, it’s invalid XHTML, since the <embed> element isn’t part of the XHTML specification.

Often this wouldn’t be a problem, but since WordPress uses the stricter XHTML standard instead of the loosey-goosey HTML specification, using such code in your posts, pages, or template will likely cause your blog to not validate.

Thankfully, the same Flash video can be included in the following manner:

<object type="application/x-shockwave-flash" data="myFlashMovie.swf" height="250" width="800"><param name="movie" value="myFlashMovie.swf" /></object>

Not only is this much cleaner and shorter, it also avoids the <embed> element, ensuring XHTML compliance.

]]>
http://johnlamansky.com/wordpress/embed-xhtml-compliant-flash/feed/ 3