Considering how regularly new versions of Firefox now come along, that's quite some bug fix list in version 10! http://t.co/K3I2vLpW 1 week ago


16th
Nov 11

Bandwidth Problems



So, I’m into day 11 of this month but my hosting bandwidth (which was only recently doubled) is now at 75% used. What’s going on?

Thankfully, Memset provide cPanel and a host of data analysis tools. As you can see from this graph it’s rocketed since mid-October.

I’d love to say it’s because visitors have gone up as much, but that’s not the case. Looking at the biggest bandwidth hogging files, it’s exactly as normal – in fact nothing in particular is causing it.

What did happen mid-October though is that I started looking and changing the site’s caching. I’d been using PHP Speedy with all options switched on (except for GZIP, which I had in my .htaccess file along with a few other tweaks) but was finding that was breaking Debug Bar and jQuery Lightbox For Native Galleries. You can exclude certain scripts from PHP Speedy but that didn’t seem to fix the problem.

I therefore decided to try an alternative method. After some testing I settled on WP Super Cache (to cache the pages – this improved speed but not bandwidth as the same size results are delivered) and WP Minify (this combines and minifies the scripts – something that PHP Speedy did, but I could get WP Minify to work with the aforementioned Debug Bar and Lightbox scripts). I also retained my .htaccess changes.

And that’s how it’s been since. The site’s very quick BUT it looks like the size of the pages being delivered are horrendous.

The cause? Right now, I have no idea and I’m still tinkering – expect to see some site problems over the next few days as I try and resolve it.

What I’ve immediately done is switch off WP Minify and put PHP Speedy back on. Oddly, it’s working with GZIP switched on – if the .htaccess changes are working, this shouldn’t work. I therefore need to check my .htaccess further. Maybe the changes made to this file by WP Super Cache have affected it.

Certainly something has to be done with some urgency and if I have to I’ll abort all changes and had back to PHP Speedy solely (and break those other scripts). My hunch – GZIP isn’t working. Testing tools indicate otherwise.

I’ll update this post, as it may be of use to other developers. And, of course, if you have any ideas please comment and let me know your thoughts.

Update, 16th November.

Sorted. Although online testing tools reported that GZIP was working, it wasn’t. Activating that has put my bandwidth back to normal…

Through some further testing I’ve settled on using WP Minify rather than PHP Speedy. I’m also using WP Super Cache but note that this doesn’t affect bandwidth, only speed.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



25th
Oct 11

Copying to clipboard in WordPress


I was recently asked, as a commercial request, to create a WordPress plugin that would allow users to click a button and copy text the clipboard. It seemed an easy enough thing to do – 2 weeks later, though, and I’ve thrown in the towel.

Using JavaScript to capture contents is the easy bit – adding it to the clipboard is a lot more difficult. IE has a JavaScript command built in, other browsers vary. Unfortunately, other browsers (e.g. Firefox) also restrict this ability for security reasons. This is because the ability to write to the clipboard also comes with the ability to read from it as well – quite why this functionality can’t be detached and restrict just the reading I don’t know.

So, using JavaScript is problematic.

Thankfully I’m not the first to come across this problem and a third party script named ZeroClipboard is available. This uses Flash to update the clipboard, which doesn’t have the same security limitations. Of course if you’re viewing from a device that doesn’t support Flash (cough, splutter, iPad, iPhone, cough) then you’re still out of luck. None-the-less this seemed a perfect solution.

Unfortunately, my limited JavaScript skills failed me – I found the program to be over-complex for what I needed and failed to be able to get it to work.

At this point I found an alternative – ZClip uses ZeroClipboard but is controlled via JQuery (which is built into WordPress) and provide a much easier and friendly method of access.

I was now in a position where I had a working plugin. Until I used Admin Bar. That seemed to affect the positioning of the Flash overlay so you had to click slightly above the “Copy to clipboard” button to get it to work.

The customer, though, didn’t have an issue with this and I could only hope that they didn’t have anything else within their theme or plugins that could affect it in this way (I did try contacting the developer of Zclip but got no response).

What really ended it all though was the limited way of capturing text in zclip, which I hadn’t appreciated earlier on. ZClip can capture in 2 ways – from static fields (e.g. the text between a SPAN) or dynamic (e.g. from a field). The first doesn’t capture any formatting, even paragraph breaks – returning everything as one long line of text. The second did, but by capturing the HTML.

The customer wanted the customer to be able to copy to the clipboard long paragraphs of text – neither offered a neat solution to this.

Then I gave up. One day I may return to it – certainly ZeroClipboard will probably allow me to do what I need it to, but I’ll have to get my head around how to first.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



23rd
Sep 11

Making money from WordPress


If you’ve come to this post thinking I’m sharing some amazing strategies on making money from WordPress, you’ll probably be disappointed.

WordPress, and a result themes and plugins produced for it, are licensed under the GPL. What this means is that although you can product commercials versions, people are free to use and copy your results. Additionally, WordPress doesn’t integrate well with, for example, commercial plugins as there is no place for them on their site and, hence, no automatic updates.

Paid support is another option for plugin and theme authors but even they don’t seem to very popular, with one company who provides such support recently shutting down.

I’ve had a few requests to make changes to or write new plugins, but they usually don’t pan out particularly well – with so many plugins already available there’s usually a reason why one doesn’t exist ;)

I get money from the advertising on this site but that barely covers the spiralling hosting costs. There are also various promotional methods further, but these are more to do with having a website rather than WordPress in particular.

So, getting rich is probably best left to the entrepreneur and those coming up with “the next big thing”.  But that’s fine with me – WordPress is GPL for a reason and it’s all about sharing. If I was in it for the money I’d have done something else instead!

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly