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



12th
Sep 11

Artiss Content Reveal 2 released


Artiss Content Reveal (formally Simple Content Reveal) has had a major revamp to version 2.

Apart from being extensively re-coded with various administration improvements (there’s an editor button for it, extra meta data in the Plugins menu, etc), there’s a lot of big improvements…

  1. Cookies now store the state of each hidden/revealed section for each user – so if you collapse a section when you return to the page later it will still be like that! In addition, there are lots of options to override the default cookie settings.
  2. Force all Content Reveal sections on the screen to do a single thing via the URL – e.g. make all content reveal in preparation for printing
  3. The title which you click on to hide/show sections can be separated from the actual content, allowing you to place these elsewhere
  4. Separate text can be specified for the title, allowing different things to appear depending on the state of the content

And much, much more!

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