3. 2. Closing php files
<?php
$my = Jfactory::getUser();
?>
Avoid adding a closing php tags at the end of the file. You can
corrupt json output or other headers
<?php
$my = Jfactory::getUser();
?>
<?
$db = Jfactory::getDBO();
// no closing PHP tag
4. 3. testing without debug & sef
Otherwise you might have nightmare when you
turn these on!
●
No warnings/notices
●
No database query issues
●
Custom components work with sef urls
5. 4. hacking core files
Obvious.. duh ? Override!
I know it's obvious but sometimes the temptation
to hack is just too much and needs to be
avoided.
6. 5. directly using get / post
Use jinput. Period.
<?php
$input = JFactory::getApplication()>input;
$option = $input>get('option');
7. 6. directly editing language
overrides
there's an overrides manager for that in the
joomla admin!
8. 7. not adding cache, suffix and other
module params
They're there for a reason!
Cache - suffix – bootstrap size – alternate layout
and there's a few more
9. 8. multiple jquery
8. multiple jquery
I hope this was clear enough ?
8. multiple jquery
10. 9. Writing sql queries directly
$query = “SELECT id, name FROM #__users”;
If ($username) {
$query .= ' username='.$db>Quote($username);
This is how dummies do it -
Smart kids do it smart -
$query = $db>query();
$query>select('id,name');
$query>from('#__users');
If ($username) {
$query>where('username='.$db>Quote($username));
11. 10. large js & css
●
Write efficient javascript
●
Use a single minified, compressed js
●
Write efficient css
●
Use a single minified, compressed css
●
Use smaller components of 3rd
party js plugins
Add/edit/delete/trash articles
Common category manager
Menu containers & menu types & menu options
Templates
Modules & module config options, template positions
Assigning template to menus
Plugins – built-in types & configuration