- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Beta Tester
- Bought between 1 and 9 items
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Envato Staff
1) You can check your theme files using a theme check plugin – http://wordpress.org/extend/plugins/theme-check/
2) Make sure you are using the right way to enqueue external scripts.
3) Make sure you include the basic wp hook within your theme.
4) Do not use php short tags.
5) Before any release you should turn on WP_DEBUG in wp-config.php to fix PHP errors and to see deprecated function calls .
6) Load external scripts ONLY when needed for a page template.
If you have any other tips would like to share with us, feel free to drop me an email and I will add it here. There are so many can be included here but above are those I think is important.
Wow this is cool.. Gonna try it now!
- Envato Staff
- Reviewer
- Community Moderator
- Venezuela
- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Microlancer Beta Tester
- Sold between 10 000 and 50 000 dollars
- Exclusive Author
Another tip: Before any release you should turn on WP_DEBUG in wp-config.php to fix PHP errors and to see deprecated function calls .
- Attended a Community Meetup
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Beta Tester
- Bought between 1 and 9 items
- Contributed a Blog Post
- Contributed a Tutorial to a Tuts+ Site
- Envato Staff
Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional.
Normally, that will only return bunches of php ‘notice’ which is not important.
EDIT : Now, you will need to turn on the wp_debug to test run your theme. Make sure there is no warnings, notices or errors appear.
- Author had a File in an Envato Bundle
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 500 and 999 users
- Sold between 250 000 and 1 000 000 dollars
kailoon said
Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional. Normally, that will only return bunches of php ‘notice’ which is not important.
If you’re ever bored, it’s a fun game to play… Turn on wp_debug on one of your old WP themes, and see if you can bob all the notices on the head.
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
For compatibility purposes I think a tip on using jQuery, either with a noConflict() declaration or else only using the $ variable within a closure would be very helpful. i.e. jQuery should either be done like this:
$j = jQuery.noConflict();
$j('#mydiv').awesomeTrick();
or
(function($) {
//code goes here
})(jQuery);
or
jQuery(document).ready(function($){
//code goes here
});
More info: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers
I’ve been supporting my WordPress plugin and it’s amazing how many themes don’t use wp_enqueue_script, load their own jQuery libraries and don’t use noConflict, etc. These themes don’t play nicely with others 
Standards are good!
Thanks for starting this thread, Kailoon!
Being more of a buyer than a WP theme author, I would also add something from this point of view.
When naming your classes/ids, try to give them a unique name.
Example: if you’re using a jQuery tabs plugin, don’t just name your <ul class="tabs" />
I’ve had this recently and it interfered with a plugin that was using the same naming (=> plugin broken, theme broken)
I guess this would apply to more situations….
Also, please always properly name and document your functions – some of us like to dig in the code and it’ll help us understand it faster.
Thanks Kailoon for the topic 
kailoon said
Ah, no, you don’t have to turn on wp_debug, that’s for php checking. So, its optional. Normally, that will only return bunches of php ‘notice’ which is not important.
Actually deprecated functions are also shown when WP_DEBUG is on.
And my suggestions is not to turn it on when you’re done, but when you start developing, so you don’t have to clean up a mess at the end.
And + you improve your PHP skills.
- Europe
- Exclusive Author
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
Thanks Kailoon for the tips…
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
That’s another good point from @digitalimpact – namespacing in general – both CSS classes and functions. You don’t want collisions with plugins, etc.
Namespacing in shortcodes is another question. I think usually it is a good idea but it does render those tags useless if a user switches themes. Still I think the first objective is to write the best code for users that are currently using your themes. For example, if a plugin uses the [tabs] shortcode and so does my theme, one of those will be overwritten. Safer to use [namespace-tabs] in my opinion.
