First Wordpress plugin

I released my first WordPress plugin today. I have have been trawling through custom code I have coded over years, and found some that are ideal to turn into plugins. The first is a simple on that adds an address field on the post form, and allows user to add a googlemap identifying location, with a customisable widget. Will be adding a proximity search and multiple map marker display in future releases.  Will also be creating a user guide to demontsrate how to create plugins, and how this particular one was made. Continue reading

Control Post Excerpt Length using Filters

By default, excerpt length of a WordPress post is set to 55 words.  To change excerpt length using excerpt_length filter, add the following code to functions.php file in your theme folder:

function custom_excerpt_length( $length )
{
return 20;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

The new word count setting is highlighted in red – leave the rest of the code as-is.

Wordpress and georss

How to create georss from your wordpress site feed. Firstly, you will need to ensure that your posts have post meta values for latitude and longitude. Geonames provide extensive amount of worldwide geolocation data http://www.geonames.org/export/. Plugins can do this work, but this is an exercise to remove dependncy from googlemaps wordpress plugins (which add overhead and sometimes unecessary complaication with wordpress and/or theme upgrades. I was using geo-mashup plugin which was excellent, but I realised quickly I was only using about 5% of the functionality it offered – overkill!
Continue reading

Generating coordinates from location (Wordpress)

Though you can manually add in post meta values for coordinates, or use plugins such as geopress or geo-mashup, it is not that complicated to automatically generate these yourself, using mathematics to work out coordinates. First of all, lets create the file that will do that work of generating coordinates (save as class.googleHelper.php, and save somewhere)

Continue reading

Autologin using javascript

I was struggling to find CURL solution to an automatic login (silent login), specifically for a dynamic login form. e.g. http://autologin.com/admin.php?action=login.  Seems to be a struggle with CURL, and so tried a javascript based solution instead. Below is a kinda a “dirty” solution I guess, though easily implemented for https URL’s also, which will make it more secure.  And more importantly – it works.

Continue reading

on-the-fly javascript

Just a good demonstration of things you can do with web pages, on-the-fly with javascript.   Example – Go to Google, clear address bar, copy and paste the text below into the address bar, then <ENTER>.  Make it a link on your toolbar, then click it again and again to change speed.

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName(“img”); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=’absolute’; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+”px”; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+”px”}R++}setInterval(‘A()’,50); void(0);

A Testers Mental Life

Beizer’s Phases in a Tester’s Mental Life

From 1998, but still hold true for any tester – we start off full o’ beans and anxious to prove things are OK, and our brain can onyl function in a class-oriented way (that’s programming class!). Then we quickly realise there is more value in finding weaknesses. Then once the obsessive behaviour finding errors comes to end, due to realisation that chase for perfection is a fruitless one, we end up prioritising problems we find. This issue needs resolving now, but this one can be done some time in the future. The final phase is most valuable of tester – testing is a discipline, its an approach, its a way to integrate QA into a project and moving beyond simply being someone who reports a bug. As a discipline a tester should not only be rasing bugs, they should be reporting improvements, possible requirements errors, and becoming a focal point of information for what does work and what doesnt work, and what needs fixing when.

  • Phase 0 = There’s no difference between testing and debugging. Other than in support of debugging, testing has no purpose.
  • Phase 1 = The purpose of testing is to show that the software works.
  • Phase 2 = The purpose of testing is to show that the software doesn’t works.
  • Phase 3 = The purpose of testing is not to prove anything, but to reduce the perceived risk of not working to an acceptable value.
  • Phase 4 = Testing is not an act. It is a mental discipline that result in low-risk software without much testing effort.