Well – perhaps not so much rules as goals. These are mine for starters as I am sure there will be more. All need a discussion before adopting so feel free to shout, sigh, groan, improve upon, add to or vote to throw out etc.
- All database queries, without exception, to go through a central processor. This to contain proper error trapping and reporting. Syntax and routines to be defined.
- Clean up and make consistent the returning format of data. We currently converted much to be returned in arrays but not all of it. Propose ALL data is returned in arrays.
- All filtering should be carried out in the database layer. Select queries should filter the presentation data before returning with Insert and Update queries filtering data pre-save. If we can get filter calls out of the rest of the code it makes that code easier, cleaner and more efficient.
- Cache anything and everything that can be cached whether in-line (such as we are currently doing with avatars and signatures) or in transient storage (WP’s or our own). A good example would be the entire $sfglobals array and even the $current_user array. We would need to check carefully but in principle none of this data should change during a users session so why keep loading it every page. This is, of course, subject to permissions.
- Additionally to 4 – we should store forum settings and options in transient storage as well. We currently look them up as needed which often results in repeated checks and calls.
- Consider combining $sfvars and $sfglobals – do we really need both?
- Display as we go. Time to stop building entire pages as a variable and outputting as we build in chunks. Might not speed up page loading but will make it feel faster and more responsive.
- Keep the current admin methodology intact. We have invested a lot of effort in it and it works well.
- Add action and filter hooks everywhere.
- Document ALL functions.
Actually forgot to add a couple of things but these are not 'rules'.
(1) Let's define a new set of default admin panel colours for 5 – Steve – that's for you. (2) Let's create a new 'upgrade' and 'install' script for 5 instead of just adding stuff to the current files. We can work out later how to weave ot together. And… i would like to suggest that ALL database changes go in one place at the top.
I appreciate you willinigness to offer help, but I'm concious of taking up your time when it could be better spent focused in other areas rather than giving me the PHP for dummies treatment.
