Wednesday, 4 December 2013

New Look Homepage

New Region List Accordion

Our homepage has recently had a new addition of a town list accordion allowing users to get direct access to care, nursing homes and care and nursing agency information, by doing this we have effectively pulled our main content up a level.

We hope this will allow our visitors to get to the content on our website quicker, allowing a more seamless visit and also removing a step that they would have to take to drill down to the town page.

For the accordion we used jQuery UI to provide the functionality this made sense due to the fact our rotation panels use this library and it also provides cross browser support. Our town lists are grouped by region rather than county.

As always we will be reviewing our new addition soon to see if we can improve upon the current offering. We hope you enjoy our new addition.


A screen shot of the new homepage with town accordion
New Look Homepage

Sunday, 1 December 2013

Debugging and Profiling PHP Scripts

Using xDebug with PHP

This article discusses installing and using xDebug for debugging and profiling PHP scripts we also touch on using kcachgrind to help interpret the results of our profiling.

Recently we profiled the most commonly used sections of our website to see if we could improve upon our wait time and generally improve our code base.


xDebug

Setting Up xDebug

Our first task we need to setup our alpha test bed to use xDebug we like to use pear when installing packages like this as it sets the system up for us. Simply running the following command as root will install all that is needed.
root@chic:~# pecl install xdebug

Once you have issued this command you need to configure PHP to use the extension

/etc/php5/apache2/conf.d/xdebug.ini

You need to add the following to the above file remembering to change the value of profiler_output_dir and trace_output_dir to reflect your own directory structure. Also your module location could vary if so use find or locate to find xdebug.so

zend_extension=/usr/lib/php5/20090626/xdebug.so
[xdebug]
xdebug.profiler_enable=on
xdebug.profiler_output_dir=/home/chic/cachegrind
xdebug.trace_output_dir=/home/chic/traces
xdebug.auto_trace=on
xdebug.profiler_output_name=callgrind.out.%t-%s
xdebug.collect_assignments=on
xdebug.collect_return=on
xdebug.collect_vars=on

Once you have done this you need to reload Apache so the module is loaded and the configuration changes are read.

/etc/init.d/apache2 reload

You will want to create the directories for profile output files and give it the appropriate file permissions you may want to use something other than 777 but our alpha machines are single user so we can be a bit more relaxed.


mkdir /home/chic/cachegrind && chmod 777 /home/chic/cachegrind

We now need to do the same but for the stack trace file output.


mkdir /home/chris/traces && chmod 777 /home/chris/traces

Now the system should be ready to start generating debugging data although you should remember that quite a few files can be generated while debugging especially if you are throwing a lot of requests at your server. You should also never install xDebug on your production server as it is bad form.


Setting Up Kcachegrind

The last thing we need to install is kcachegrind which is the program we will use to interpret and visualise the generated profiler reports.


root@chic:~# apt-get install kcachegrind

You should now be able to run kcachegrind either using the shell or maybe your distribution has added a nice menu item for it. On Mint Linux it is located under programming in the main menu.


Start Profiling

To start the profiling of your scripts simply accesses the web address of the page you want to profile or run it via the command line if it is a cli application.

This will create a new file under the directory you specified in the configuration file for us its called callgrind.out.%t-%s where %t is the time stamp and %s is the script name.

At this point you will need to open kcachegrind to help interpret the results from the profiling we like to use the Callee tab in the right window panel which allows you to visualise the amount of time each action is taking.

Using this helps us to check which parts of our script are taking up the biggest percentage in total execution time.

We used the information we gained from using this tool to improve one of our scripts by removing an unneeded function call which we more than likely would have missed if we did not profile the calling script.

By using this approach we managed to knock 40% of the execution time of our script which is a huge saving in execution time.


Debugging

We use xDebug on our development workstations to improve the output when something goes wrong it also adds some more information to var_dump() such as the type of the variable etc..

xDebug should not be used on live servers for the reasons mentioned above and we would also advise not to use it on production machines.


Conclusion

Hopefully this article has given you an insight into debugging and profiling PHP scripts using xDebug and kcachegrind. Using these tools can help decide which parts of your script need the most attention.

Being able to visualise the execution of a script is a good way to see what exactly is going on during run time.

Friday, 29 November 2013

New Feature Release: Galleries

Improved Image Gallery

We have been working hard recently improving our current enhanced listings image support by adding a new gallery page and tab to all enhanced listings allowing home owners to upload five 1Mb images from their browser.

Currently the feature list is as follows,

  • Support for main image which is displayed on all enhanced listings tabs.
  • Upload five images of your home
  • High resolution 1Mb images
  • Dedicated gallery page for displaying gallery images
  • Spotlight image support for displaying large versions (provided by lighter)
  • Aspect ratio preservation on all images

Gallery and Editor

We plan to add support for converting assets into high resolution, medium resolution and thumbnail by using the ImageMagick PHP module.


Gallery Page

You can sign up for one year enhanced listings which costs £50+vat by completing the short form and making payment using Google Wallet all major credit and debit cards are accepted.


Image Spotlight

On a closing note our integration of Double Click for Publishers is progressing well and we hope to be releasing it in the new year, we feel our website has some good placements to offer advertisers and by using DFP we can offer these direct to potential customers.

Saturday, 16 November 2013

Dropping Support for Internet Explorer 7

Browser Support Changes

Recently we decided to stop supporting Internet Explorer 7 due to it displaying our markup incorrectly and constantly needing work arounds. This applies to Enhanced Listings users and more recent features although the main directory still displays fine.

One thing that lead us to stop support was implementing a pure CSS drop down navigation which works in every other browser apart from IE7 so the decision was made to stop doing work arounds.

With Internet Explorer 7 having 4.47% of world browser usage, according to this page, we feel this would be an even smaller number for UK only visitors so it makes business sense to end support as well as technical.

If you still use IE7 you should really consider upgrading it to a newer version which supports modern web standards better and please remember IE7 was release in January 2006 which is a very long time in our industry and the most recent Internet Explorer is 11 which you can get here.

No IE7 image
Internet Explorer 7

Thursday, 14 November 2013

New Feature Release: Modify Provider via Panel

Change Your Directory Entry

Enhanced Listings users are now able to modify their listing in the main directory directly from their browser giving them full control over their profile on our website.

You can now add even more data because now we have added support for displaying your social media icons, home activities, care specialisms and more.

Edit Listing Form