archive: February 2010

01
FEB
2010

Q: A Woopra Plugin Update? Will it work? Does it use fopen? A: Yes! Yes! No!

It’s been a while that I been able to get the the Woopra Plugin to get it back up and working like it has been envisioned. I had a good chunk of time over the past two days to work on it and it’s back and working perfectly — including some enhancements and some major code restructure.

Backend Analytics

One of the main problems that lies with the current 1.4.x series and even though the 1.3.x series is that it uses PHP4 fopen. So after a long thinking process I decided to use PHP native support for S.O.A.P. connection for the Woopra API calls. (Click on SOAP if you don’t know what SOAP is. :)) I could have used the old way, but SOAP is much more powerful and dynamic. No more long queries or potential query mistakes or even security problems when it comes to hijacking the data stream as well. A big plus for large sites!

Your server/host must have SOAP compiled in and/or enabled. This should be good for 99% of you. There are some servers which do not have SOAP complied and/or enabled by default. You will have to talk to your host to get this enabled. SOAP is only needed for looking at the Analytics within your WordPress Admin Panel. Not tracking!

All the javascript has been reduced significantly by using  jQuery code. jQuery also now handles the primary Ajax calls to the rendering file (the file that outputs all the pretty charts) which works throughout all different browsers. This way errors are reduced. Both the tracking and analytics jQuery code will even come in a minimized format once released to reduce the size even further. If you are a developer and you need the raw version for debugging purposes, enabling WP_DEBUG will force the plugin to use the raw version.

Tracking/Event Code

The tracking code has been reduced greatly. Thanks to Pranshu’s Woopra jQuery Code I was able to tailor it directly for the WordPress Plugin. This also allows event managing to be better executed. One of the problems that the previous versions had was that it had to relay on hooking onto data from WordPress.

The steps went as follows:

  • Event Fired – Store “something” to identity it.
  • Process the “session” to find said “stored” data
  • Read the “stored” data and try to get the data needed.
  • Return the correct value before we outputting the Javascript

99.999999% of the time this did not work and it caused more breakage than anything. So the event code is now handled via jQuery which is fast and on every WordPress installation.

This is the only line now for tracking users:

jQuery.trackWoopra({ name : 'Shane', email : 'example@example.com', avatar : 'http://example.com/blah....' } );

I love it when a plan comes together.

Where can I find these lovely things?

You can right now only download the ‘alpha’ version here. This keeps the WordPress version of the script at 1.4.3.2 however it will be the 1.5.x alpha version. (Note: I make no promises that this is going to work… right now, but it does on mine.)

A few things not working at the moment:

  • Flash Charts
  • Referrers Section – API had an error and I found it! It’s being updated.. no ETA, but it should be soon!
  • WP_Error – I havn’t tested using WordPress’s default error class yet with this plugin. If anyone can report if it works or not that would be great!

Localization – How can I help?

Woopra is used all over the world. So it begs to differ why I haven’t released a localization file because it’s never been in a state where it’s stable. Once this hits “beta” which is string freeze for this plugin, I will publish the POT file for you to translate all the strings needed. There is a lot of strings.

That about wraps it up! Post any errors here on my blog. It’s very hard for me to track the Woopra forums, but I will do my best if you do post there. Please label your posts ‘1.5.0-alpha’ in the topic so I can search through them.

Enjoy!

Comments 9

Commenting is now closed

The new plug-in works great!

I was one of those who was getting a bug with the old code and decided to roll the dice with the new one, and I must say it really fixed my problem well! I did lose the flash charts (and I know you are working hard at restoring them) but previously I had already lost it all anyway, so I won’t fret over that one.

All I can ask for now is some more visitors, but I know your plug-in isn’t capable of that one. For that, the onus falls on me. :)

Many thanks!

Ken
Alcwi.com
http://alcwi.com/wordpress

I wonder if the autotag-feature (for comments) is really working?
Just looked to the woopra-client, the only “tagged visitors”:
Myself and one guy I tagged by my own, with the client.
Can’t finf my commentators – and yes, I get new comments daily 😉