Updated for Joomla 3.x plugin