WordPress Visual Editor Changes My HTML Code

I have a love/hate relationship with WordPress’ Visual editor. The editor can be great sometimes. Other times it can be a pain. I already disable “WordPress should correct invalidly nested XHTML automatically” as their definition of nested XHTML doesn’t really cover everything XHTML supports.

So if you noticed, I’ve began to recently embed flash videos into my blog posts, something I’ve avoided doing for some time since it doesn’t really fit well with my theme, which I’m in the market of changing. Still searching for one that I’d like. I recently switched to the Green Light theme for my HD-Trailers.net Blog, but I’m not sure if I want to have that here at Krunk4Ever!

I love the fact that when you try to add an image, it’ll automatically fill in the height/width and allows me to set alignments and etc. However, for everything else, I usually use the HTML editor which allows me to put in code directly.

Anyway, today’s blog post is how frustrating the Visual Editor can be some times. The main problem started because I started embedding flash videos into my blog post. I like my webpages to be XHTML valid, and for those who have this gene, you’ll know that most flash code websites provide are XHTML invalid. I found out how to modify it. Basically the <embed>...</embed> is invalid and I have to add a few attributes to the <object> tag.

For example for this video on YouTube (Lime in the Coconut), the embed code they provide is:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

To make it XHTML compliant, you covert it to:

<object width="425" height="344" type="application/x-shockwave-flash" data="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1"><param name="movie" value="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

Resulting in:

<object width="425" height="344" type="application/x-shockwave-flash" data="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1"><param name="movie" value="http://www.youtube.com/v/BUG8A8e8KC0&amp;hl=en&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param></object>

Just for kicks, here’s the video:

If you watch House, M.D., you’d recognize this song, which was hilarious!

However, if you switch to the Visual editor and back to the HTML editor, WordPress decides that your flash code should look like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/BUG8A8e8KC0&hl=en&fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/BUG8A8e8KC0&hl=en&fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object>

It removed my type and data attributes, stuck in the classid and codebase attributes, and then re-added the embed block back in. WordPress strives to create XHTML compliant code (hence the check to correct any invalid nested XHTML), but why re-add the embed block which is XHTML non-compliant?!?!? I found it annoying and basically the flash video would have to be the last thing I add or else the code gets “corrupted”.

I tested the newest version of WordPress (2.6.5) and this issue still exists. I found the following threads where people have been complaining about this issue:

It appears the WordPress folks have no plans on fixing this issue as they’re suggesting to use one or the other completely and don’t switch between editors. I’m generally okay with that approach, but on my HD-Trailers.net site, I have multiple people editing posts and can’t really enforce one editor for everyone. I have a SQL script I run every few days to fix some stuff that “disappears” after a post gets edited.

Others have suggested using a different visual editor, but it doesn’t seem that any is that great…

I have a hunch that the embed code is needed for flash to work on IE6, but if you’re surfing the web and still using IE6, you don’t deserve to see the flash content on my site. ;p

Update: Another common thing I do is insert <div align="center">...</div>, so stuff are aligned in the center, but switching between between the Visual and HTML editor removes the divs. It’s actually quite annoying.

Comcast Blast Speed Tier

So Tekman IMs me today about this new Comcast Blast Tier (16Mbps down / 2Mbps up) and says that the D-Link DCM-202 cable modem (which I recommended) wasn’t compatible with it and it maxed out at ~8Mbps.

So I started digging around the internet for this and apparently many users were having problems getting the higher speeds from Comcast with this D-Link cable modem. Some people claimed that Comcast uses some proprietary “Burst” technology which wasn’t compatible with all cable modems. According to their FAQ, if you’re renting a modem from them, you can always ask for an upgrade to a newer model which is compatible. Others were saying that even though the Burst technology required DOCSIS 1.1 and the D-Link cable modem was DOCSIS 2.0 compatible, there was some header configuration screw up, where Comcast would only detect the cable modem as DOCSIS 1.0, which capped the transfer speeds to 8Mbps/768Kbps. Apparently if you call in and keep on escalating to a knowledgeable tech support, they would be able to manually set your DOCSIS to 1.1 and you’ll be able to get the higher speeds.

So first thing I go check is what tier I am on. Apparently I’m on the 8Mbps/768Kbps tier and Tekman said he was able to get the 16/2 Burst Tier for $42/mo. A bit bummed, I decided I could live with 8/768 for $30/mo.

However when I got home today, I received a letter from Comcast stating:

RE: 16 Mbps download and 2 Mbps upload High-Speed Internet for no additional charge

I didn’t even bother reading the rest of the letter till later and went ahead decided to try flashing my modem. Apparently there’s a Comcast specific firmware you’re suppose to use. You can find the firmware on D-Link’s website: Product Support Resources for DCM-202. I thought it was a bit weird that the Comcast firmware was 2004 while the newest one was 2007, but I decided to go with the 2.0.1 Comcast firmware anyway.

The included PDF documentation was pretty straight forward, though they only included instructions for Windows XP. There was one missing instruction and that was the fact you should connect your computer directly to the cable modem’s ethernet port. When I was first trying to connect over the switch, it wouldn’t see the cable modem. Once I was able to ping it, the flashing was pretty painless. They did screw up the login information. The web login information remains dlink/dlink and not admin/hitron.

My newly flashed cable modem shows:

  • Class ID: 2
  • Max Downstream Rate (bps): 17600000
  • Max Upstream Rate (bps): 2200000
  • Upstream Channel Priority: 1
  • Guaranteed Min Upstream Data Rate (bps): 0
  • Max Upstream Transmit Burst (bytes): 0
  • Privacy Enable: 1

Unfortunately, I don’t have what it showed beforehand as I was too excited to get the newer speeds.

So I went and did a speed test and the results are:
comcast burst tier speed test

Sweet! 16/2 Burst Speed Tier for $30/month! I guess that might be ending soon, since it was only a 6 month promo. At 16/2, this matches Verizon FiOS’ $52.99 plan. Did I mention how sweet this is?!

UPDATE: Apparently it wasn’t the fact that Tekman wasn’t getting the higher speeds with the D-Link DCM-202 cable modem, but they weren’t as high as when he had tested the connection with a Motorola cable modem. He was getting 12000-16000Kbps down / 1000-1500Kbps up with the D-Link DCM-202, while with the Motorola cable modem, he was consistently getting 18000-20000Kbps down / 2000Kbps up. I did notice my upload speed was a bit on the weak side for 2Mbps. Looks like the cheapest Motorola cable modem on Amazon is ~$55.

Flash Portal

So I was going through The ten most addictive online flash games ever made posted earlier on /. Most of them I’ve played and agree are indeed addictive. There were a few that I haven’t heard of that were mildly fun, but then there was Portal: The Flash Version. I was just telling Xyon earlier today that one of the new games I wanted to play was Portal (which comes as part of The Orange Box) and showed him the trailer.

The flash version is a 2D version with basically the same idea. I got up to about level 30 before it was dinner time.

Enjoy!