1426 posts
  • Envato Staff
  • Has been a member for 5-6 years
  • Senior Reviewer
  • Sold between 10 000 and 50 000 dollars
  • Attended a Community Meetup
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
+10 more
kailoon Reviewer says

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.

47 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Singapore
  • Sold between 100 and 1 000 dollars
nahid29 says

Wow this is cool.. Gonna try it now!

4311 posts ThemeForest Reviewer
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Venezuela
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
+9 more
Ivor Reviewer says

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 .

1426 posts
  • Envato Staff
  • Has been a member for 5-6 years
  • Senior Reviewer
  • Sold between 10 000 and 50 000 dollars
  • Attended a Community Meetup
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
+10 more
kailoon Reviewer says

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.

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 more
ThemeBlvd says

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.

3418 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

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!

2440 posts
  • Has been a member for 5-6 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Envato Studio (Microlancer) Beta Tester
digitalimpact says

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 :)

1383 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says

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.

7 posts
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
DenB says

Thanks Kailoon for the tips…

3418 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

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.

by
by
by
by
by
by