Doing Things Wrong

Web Stuff (4/5)

Notes on WordPress, php, html, css, search engines, and anything else that I think is worth remarking on.

 1 2 3 4 5  


image

I coded up a pretty spiffy popup menu system for small displays like phones and tablets. If you're on a small device, you get it automatically. You can force it on a large display by making the window narrow.


Here is a screen capture of this site running in a phone-sized Android virtual machine on my laptop. The site adapts perfectly to every screen size and every device, from a dinky smartphone all the way up to the biggest PC, with no loss of usability. Yet the code behind it is bit-for-bit exactly the same on every display. That's pretty incredible.


... consistency is the hobgoblin of little minds ...

-- Ralph Waldo Emerson

I re-worked the default WordPress TwentySixteen theme into something far better. Not only is the display much more streamlined and compact, but the code behind it as well. The people who design these things overkill them into an unmanageable mess. Most of what I did was simply deleting miles and miles of repetitive unnecessary css spaghetti code and replacing it with just a few new lines. Most developers seem to think that more code is better. That is so wrong.


I set the site up earlier this year, using one of the default WordPress themes - TwentySixteen - and some code I wrote myself. The big push then was to get all the old content into the new system and somewhat organized. It was a huge amount of work just to get everything 'good enough', and then I let it lie.


WordPress 5.5 just dropped, and once again they have made a complete mess of image handling. Now every image is smeared out in the vertical direction.


WordPress 5.9 just dropped. A 0.1 release like this always makes me nervous, but you can't hold back the tide, so I tested it on another site, and nothing broke. At least I haven't found anything yet. So I updated this site, and everything still works, at least at a glance.


It seems the WordPress team has been busy adding "features" to the new versions. Features that raise html errors. Otherwise known as bugs. I added some code to defeat the new "functionality". WordPress really needs to get some good product testers. Testing is just as important as writing buggy code in the first place.

This is a very useful tool:

https://validator.w3.org/


WordPress suffers from misguided ideology, bad programming, and arrogance, usually all at the same time. Case in point: image handling.

Image handling in WordPress is pure insanity. Left to its own devices, WordPress will create multiple copies of every image at many sizes. This creates a pile of garbage on the server, roughly doubling the disk space used, sometimes worse. And they are so sure they are right about this that there is no way to turn it off - not by settings, not by filters or hooks - no way.


Getting back in the saddle - I wrote the PHP code for the sidebar navigation, as nothing very good seems to exist in the WordPress world.

The main navigation node at the upper-right shows the path to where you're at with a breadcrumb trail, the page you're on, and any siblings and children. It also incorporates the Blog.


Web Stuff

 1 2 3 4 5  

Audiovox Gibson-style Bass
Audiovox 736 Replica Bass
Audiovox Gibson-style Guitar
Audiovox Danelectro-style Bass
Audiovox Fretless Bass
Audiovox Electric Upright Bass
Audiovox Strat-style Guitar
Audiovox 12-string Guitar
Audiovox Ukulele Bass
Audiovox Mandolin
BC Rich "Osprey" Bass
Brownsville Violin Bass
Cowbell Bass
Danelectro Pro-1 Bass
Danelectro "Super-63" Guitar
Danelectro Silvertone 1457 Rescue Guitar
Danelectro Longhorn Guitar
Danelectro Silvertone U-1 Guitar
Danelectro Companion Guitar
Danelectro Silvertone 1443 Bass
Danelectro '67 Hornet Guitar
Fender Jazzmaster Bass 1
Fender Jazzmaster Bass 2
Fender Jazzmaster Bass 3
Fender Stratocaster Bass 1
Fender Stratocaster Bass 2
Fender Stratocaster Micro Bass 1
Fender Stratocaster Micro Bass 2
Fender Stratocaster Fretless Bass
Fender Stratocaster Bass VI
Fender Stratocaster Bass IV
Fender Stratocaster 12-string Guitar
Fender Stratocaster Uke Bass
Fender Squier Stratocaster Guitar
Fender Telecaster Bass
SX Precision Bass
Gibson Fenderbird Bass 1
Gibson Fenderbird Bass 2
Gibson Reverse Fenderbird Bass
Kubicki Bass
Schwinn Stingray Bass
Mosrite Bass
Rickenbacker 325 Guitar
Rickenbacker 325 Bass 1
Rickenbacker 325 Bass 2
Rickenbacker 325 Bass 3
Rickenbacker 4001 Bass 1
Samick SG450 Guitar
Danelectro Pro-1 Guitar
Danelectro Silvertone 1448 Guitar
Danelectro '63 Guitar
Danelectro Silvertone 1457 Guitar
Harmony H617 Bobkat
Danelectro Silvertone 1450 Guitar
Harmony Silvertone 1478
Danelectro Silvertone 1472 Amplifier
Danelectro Longhorn Bass

I've been working on another website lately, but it uses the same code base as this one, so all of the improvements get carried over. The latest thing I've done is a complete rework of the slideshow plugin.

First, I stripped out a lot of fat - unused features, ugly themes, 'call-homes', etc. I hardwired some stupid options, added some new ones, fixed a few major problems, and made it much faster. Finally, I put the whole thing through the wringer and got rid of anything that was not strictly needed, everywhere - PHP, JS, CSS. My version is less than half the size of the original.

The result is a yuge improvement, both on the front end, and especially on the back end: