ThemeForest

Tools & tips for WP authors

1203 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a File in an Envato Bundle
  • Envato Staff
  • Reviewer
  • Lead Reviewer
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Malaysia
  • Referred between 200 and 499 users
kailoon 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.

1 year ago
kailoon is an Envato staff member
36 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • Singapore
  • Referred between 10 and 49 users
nahid29 says

Wow this is cool.. Gonna try it now!

1 year ago
3624 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Interviewed on the Envato Notes blog
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 50 and 99 items
  • Venezuela
  • Referred between 1 and 9 users
Ivor 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 .

1 year ago
Ivor is a moderator
1203 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a File in an Envato Bundle
  • Envato Staff
  • Reviewer
  • Lead Reviewer
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Malaysia
  • Referred between 200 and 499 users
kailoon 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.

1 year ago
kailoon is an Envato staff member
1008 posts
  • Has been a member for 3-4 years
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • United States
  • Referred between 200 and 499 users
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.

1 year ago
2094 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Grew a moustache for the Envato Movember competition
  • Most Wanted Bounty Winner
  • Community Moderator
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 500 and 999 users
sevenspark 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!

1 year ago
sevenspark is a moderator
1841 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Referred between 100 and 199 users
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 :)

1 year ago
1374 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • Serbia
  • Referred between 10 and 49 users
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.

1 year ago
7 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Europe
DenB says

Thanks Kailoon for the tips…

1 year ago
2094 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Grew a moustache for the Envato Movember competition
  • Most Wanted Bounty Winner
  • Community Moderator
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 500 and 999 users
sevenspark 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.

1 year ago
sevenspark is a moderator
by
by
by
by
by