WordPress Categories to the Body Class CSS Plugin

I needed to make CSS changes to a specific category on one of my WordPress sites, this plugin is the result. My WordPress side project started off as a simple review blog and then evolved into more than it was supposed to be. Because of this, I ended up with categories where I should have had custom post types. Rather than making the custom post types and converting the posts over I used this quick fix to make a certain category display much differently than the rest.

Download Plugin

To be fair and give credit where credit is due – the code came directly from this blog post by Philip Newcomer and I put it into a plugin rather than adding it to my theme’s functions.php file.

Here is Philip’s description of the code:

Here’s a little function that will add each of a post’s categories to the body class of the single post page (assuming your theme uses the body_class template tag)..

To see how to make plugins instead of editing your theme’s functions.php file check out this blog post by Brian Hogg.


Cox Enforcing Flat Data Limits on All Packages – Downgrade Speed to Save Bandwidth!

There are many articles and blog posts around the internet about people that had no idea Cox Communications limits their internet data usage until it was too late, and some were even lied to by Cox employees about data limits beforehand. A few years ago, I was no different.

I’ve been using Cox as my ISP for about six years on both the “Preferred” and then the “Premier” package. At first, I had no idea there were data limits, but since I didn’t have a lot of internet activity it was fine. Then one day I got a letter from Cox in the mail saying my limit had been increased from 400GB to 700GB, Hooray! Right? No…

The Cox Data Limit Problem

I was a bit annoyed that the Cox website’s pages for internet comparison/shopping did not ever mention a data limit back when I initially chose them for my internet service provider. When I set up an installation over the phone the representative never mentioned data limits, neither did the installation guy when he was going through my services with me after setting things up. Cox purposely avoided telling a potential customer and a new customer about data limits, while making information about data limits on their website hard to find as well. I could only find pages regarding data limits on Cox’s website by searching “Cox Data Limits” on Google!

Only recently have they added a mention of the data limits to the website, only instead of saying “1TB Data Limit”, they call it a “1024GB Data Plan”.

coxultimate1tb
Cox Ultimate Lowered to 1TB data – Ultimately SCREWED!

The BIG Cox Data Limit Problem

When I got the letter that my Cox data limit was increased to 700GB I went to the Cox site and found the “Data Usage Meter” for my services after a bit of searching. It turned out that my data limit was initially only 300GB, then was shortly raised to 400GB after I started service. I also noticed that three months before the raise to 700GB I was blowing past 400GB due to Netflix and Hulu streaming plus running a couple dozen online-game bots. I was barely under my new 700GB limit, but since Cox had never charged or contacted me about going over the old 400GB data limit I figured I was fine.

And I was fine, for about 4 years. Then recently I got a Cox email saying they were raising my limit to 1TB! Sweet, right?! Nope… I then read that ALL Cox packages were placed at a 1TB limit, including the crappiest packages who’s customers pay nowhere near what I pay for internet. The worst part is that customers using the highest Cox internet package, “Ultimate”, were downgraded from 1.2TB data limit down to 1TB. What?!? So now, whether you pay $30 or $100 for internet, you will have a 1TB data limit from Cox Communications. What a joke..

Plus, topping off the bad news from Cox, the email informed me that they would now be charging for data overages in my area. An additional $10 per 50GB. Now that may seem fine, but at the time I received the email from Cox I was heavily into game botting with my Sun Fire X4600 M2 server (32-core, 128GB Ram) and was using far more data than I should have been, an obscene amount… The highest I saw was about 4.2TB in a month. At that rate, had I not seen the email from Cox, my bill after their 2-bill grace period, my internet cost would have jumped from $65 up to $705. I think a letter in the mail would have been nice, perhaps even a telephone call?

cox-data-usage
Obscene Cox Data Usage, Even more Obscene Data Limit!

Nope, Cox was ready to send me that $700 bill!

The Cox Data Limit Solution

So what did I do?

First, I rented a root server from Hetzner for $50/mo and moved all my game botting stuff to that. With a monthly limit of 20TB, the Hetzner server should do fine for me… and I was paying $60 in electricity to run my big server, so Hetzner was already saving me money.

Now, I think I’m going to lower my Cox Internet package from 150MB/10MB Premier down to 50MB/5MB Preferred or even the 15MB/2MB Essential since they all have the same 1TB data limit. Essential’s 15MB Download speeds and 2MB Upload speeds are fine for Netflix and Hulu streaming, especially if no other devices are online hogging all the bandwidth.

The only reason I ever even considered upgrading to Cox Ultimate Internet was for the 1.2TB limit. Once I got this latest email from Cox I would have paid up to $150 to have the same speeds I currently have but with unlimited data usage. That means I was willing to pay over double what I pay just for unlimited data, rather than the hassle of having to rent a dedicated server that actually saves me money.. But no, that’s not an option with Cox.

Cox Data Limit Conclusion

So basically.. Cox is charging people extra for faster speeds to hit the same 1TB limit that all plans have, just so they can then charge people even more for every 50GB data you use over the limit! Get slower internet, that 1TB will last longer. 😉

Enable Lightbox and Extra Media Functionality to WooCommerce 3.0 Themes

I upgraded a WooCommerce site using the theme Wp Portfolio and all my products started opening images in new tabs rather than a lightbox.

First I made sure my theme was updated, but it made no difference. So, naturally I started searching Google for answers. It turns out that WooCommerce 3.0 added new/different media functionality which removed the old lightbox and most WooCommerce geared themes haven’t been updated to use the new functionality.

In order to enable the new media functionality on my WP Portfolio theme I edited the functions.php file by finding the add_action(‘after_setup_theme’, ‘wp_portfolio_setup’); line and add the following three lines below it. (Your line will have wp_portfolio replaced with your themes slug instead.)

and the functions.php will look like this:

giving your WooCommerce store functionality like this:

Enjoy your newly working Zoom features and fixed Lightbox functionality! Don’t forget to bug your theme developer to update their theme release with the new WooCommerce 3.0+ media functionality!

Default Windows IIS WordPress web.config XML

Recently I was migrating a test site from a Linux/cPanel based web-host over to a Windows Server running IIS. After migration, none of the site’s pages or posts worked and all returned 404 errors.

I’m familiar with .htaccess files causing 404 problems so I knew that was probably the issue, and since this was now on a Windows server I knew it had to be the IIS equivelant file “web.config” causing problems. Upon further investigation I realized there was no web.config file at all even though I was used to it always being there after setting WordPress up through IIS. Since I’m using Server 2016 for the first time, perhaps things are different and web.config files aren’t created automatically any longer.

Either way, my problem was solved by adding this XML to a newly created web.config file in the site’s root folder:

Now pages and posts are working properly and pretty permalinks are functioning as they should! Note: If “URL Rewrite” is not installed then it will need to be first in order for this to work.

eBay-STW-5-inch-USB-3-Card-Reader-JSnowCreations

STW Internal 5.25″ USB 3.0 CF/XD/MS/M2/TF Card Reader Review

I ordered a multi-card reader from eBay a few months back when I was moving my workstation’s internals to a new ATX case. I wanted a new case so I could use the old case to fix up my media-server pc that was in a very old case that was missing it’s side panels! 😛

The new case I ordered was black ZALMAN Z11 Plus ATX Mid Tower computer case with a mesh front panel so I wanted a 5.25″ card reader that was at least black, but mesh would be even better. At first I found this NZXT 5.25″ multi-card reader at Amazon for $80 but that was a bit out of my price range. Plus, I saw many other card readers for far less so the price seemed pretty ridiculous to be honest.

Then I was on eBay and found this listing for a STW 5.25″ USB 3.0 Port CF/XD/MS/M2/TF Smart Internal Card Reader PC Front Panel U3B6 from Hong Kong for $12 and it looked almost exactly the same as the same as the expensive NZXT on Amazon except for smaller card slot labels, a different logo, and only one USB 3.0 port instead of two. Since my case already had 2x front USB 3.0 ports I was perfectly fine missing a port and going with the eBay knock-off because a SD card reader is all I was really looking for.

eBay-STW-5-inch-USB-3-Card-Reader-JSnowCreations
STW 5.25″ USB 3.0 Multi-Card Reader

Here we are months later and I’ve successfully read and wrote to many SD and XD cards without a problem using the STW Card Reader. I regularly use the USB 3.0 port to quick charge my Galaxy S5 as well as transfer files back and forth – it works as fast as it should be so I can’t complain there either! I’ve also used both a Memory Stick PRO and a Memory Stick PRO DUO without any problems, but mainly just because I had some laying around from old digital cameras and wanted to check if my knock-off NZXT card reader would actually read/write them.

eBay-STW-5-inch-USB-3-Card-Reader-box-JSnowCreations
STW 5.25″ USB 3.0 Card-Reader Box

The plastic sides where you screw the STW Internal 5.25″ USB 3.0 CF/XD/MS/M2/TF Card Reader to the case are probably lower quality than the NZXT reader, but it works and looks good so I’d definitely recommend it to other people wanting a 5.25″ multi-card reader, especially if your case is black mesh like my Zalman Z11 Plus!