Questions tagged [best-practices]

This tag should only be used when a key objective in the question relates to any combination of: efficient processes, sustainable architecture, Joomla! Coding Standards, general web security, direct/purposeful actions, and other such foci where optimisation is valuable. This tag is most appropriate when a basic solution is already realised, but refinement is sought.

Filter by
Sorted by
Tagged with
3
votes
1answer
27 views

How is onContentAfterSave working in the Front End?

I have created a plugin that works using onContentAfterSave to fire off some other processing once a record is saved. This works as expected in the Back End but nothing gets triggered when I save a ...
0
votes
0answers
16 views

Best practices for staging Joomla based custom web-application?

I develop a Jooma based custom web application. I work on the "dev" subdomain (adding new modules and also content), test the app on the dev subdomain then clone the whole site to the live domain. The ...
2
votes
1answer
54 views

Issues to be aware of when calling `concatenate()`, `regexp()`, `rand()`, and `castAsChar()` in sql queries

I'm taking it upon myself to become aware of some of the lesser known/used query methods because I like toying with MySQL and I want to implement Joomla calls when possible/sensible -- because they ...
4
votes
2answers
484 views

Can I safely disable the core components I don't use

I don't really use: Contacts Banners Search Newsfeeds So my question is: Are they safe to disable? Are they safe to uninstall? Ideally, I'd like to make my installation as lightweight as ...
3
votes
1answer
272 views

Where to call for CSS/JS in custom component for frontend views

I've created a custom component with a dashboard that needs styling with CSS. I've created the CSS file and I'm looking at calling for it in the frontend view. Working with J! 3.6.5 and a MVC ...
0
votes
2answers
4k views

What is the best way of using PHP code in Joomla's articles or modules?

Let's say I need to create a simple page and for my links I want to use JRoute::_() in order to make them SEF or display ID of the current user. What would be the best way to achieve this? Joomla by ...
4
votes
1answer
730 views

How to add a composer package without modifying the core composer.json file

I am trying to add a Composer Package and make it globally available but I do not want to modify core composer.json for obvious reasons. Is the only way to do this having a composer.json either on ...
2
votes
1answer
618 views

Can we create different configuration.php file for multiple environment?

We have a project setup which has three different git branches (development, staging and production). We are trying to find the best way to setup (if possible) the configuration.php for each branch. ...
1
vote
1answer
926 views

Site gets hacked and everytime a new user is created with Admin rights

We are facing a weird problem. We have a site set-up in Joomla. The site is getting hacked on a regular basis and specifically during the weekends. The strange thing is, we see that a new user is ...
0
votes
1answer
42 views

What steps shoud I include in a health check on an existing Joomla website I am being asked to look after?

I am sometimes asked to adopt orphaned Joomla websites when the original service provider is no longer able or available to do so. What steps should I include in a health check before agreeing to ...
4
votes
2answers
2k views

What is the best way to require_once?

METHOD 1 Hard coding the directory separator require_once JPATH_COMPONENT.'/models/fields/courselist.php'; METHOD 2 Soft code the directory separator if(!defined('DS')){ define('DS',...
1
vote
2answers
684 views

Proper way to call/use plugin parameters

I know this could be interpreted as a minor or a newbie question but I would like to improve my code. So, in a best coding practice perspective how to call/use plugin parameters? My two code examples ...
8
votes
2answers
355 views

Where to place code in Joomla modules

When developing a Joomla extension, are there any best practices, guidelines or recommendations regarding where to place the different parts of my code (PHP and HTML)? I'm mostly thinking about the ...