Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Think Before You Submit Themes on WordPress dot Org

This slide is prepared based on WordPress dot org standard not for other marketplaces and shops. Details in Video:

  • Login to see the comments

  • Be the first to like this

Think Before You Submit Themes on WordPress dot Org

  1. 1. HELLO! Ganga Kafle Co-Founder / Partner of Acme Themes Co-Owner of Template Sell
  2. 2. Think Before You Submit Themes on WordPress.Org
  3. 3. Should my theme be based on standards?
  4. 4. 1. Setup Theme Development Environment
  5. 5. Before beginning to theme development, do the following things: 1. define('WP_DEBUG', true); in wp-config.php file 2. Import theme unit test data (https://wpcom- test-data.xml ) 3. Install and activate Developer Plugin 4. Check your theme with Theme Check and Theme Sniffer Plugin
  6. 6. 2. What are the Theme Standards? What your theme should have?
  7. 7. Your theme must have the following things 1. GPL compatible. 2. Secure. 3. Free of PHP or JS notices, warnings and errors. 4. Should not be in conflict with plugins e.g. prefixing. 5. Translation ready. 6. Use WordPress functions, hooks, filters and libraries. 7. Away from anything illegal, dishonest, or morally offensive.
  8. 8. 3. style.css Components
  9. 9. Check the below given things on your theme style.css file. /* Theme Name: Japan Tokyo Theme URI: Recommended Author: Required Author URI: Recommended Description: Required Version: 1.0.0 ( Required ) License: GNU General Public License v2 or later License URI: Text Domain: japan-tokyo ( Required ) Tags: Required */
  10. 10. 4. The GPL License
  11. 11. GPL (General Public License) 1. Declare License of any external resources used 2. Only resources bundled with the theme need to be declared. 3. Ensure your theme is GPL licensed or GPL Compatible 4. Mentioned on style.css 5. Include copyright notice for the theme
  12. 12. Mention License of external resources (if used any) 1. Google Font License 2. Font awesome license 3. External JS and CSS license 4. External Library license 5. Screenshot image/images
  13. 13. License declared on readme.txt file
  14. 14. 5. Style & Scripts
  15. 15. Requirements for Style and Scripts 1. Hardcoded style and script is not allowed. 2. Properly enqueue style, script and font. 3. No minification of scripts or files unless you provide original files. 4. By default, WordPress installation includes many popular scripts. Example:- jquery.js No need to enqueuer this.
  16. 16. 6. Prefixing
  17. 17. Prefix everything with theme slug. 1. PHP function names. 2.PHP class names. 3.PHP global variables. 4. Action/Filter hooks. 5. Script handles. 6.Style handles. 7. Image size names.
  18. 18. “If your theme name is Japan Tokyo, your theme slug must be “japan-tokyo”
  19. 19. Prefix Exception Not necessary to prefix third party resources handle while enqueue style and scripts.
  20. 20. 7. Security
  21. 21. Validation, Sanitization and Escaping 1. Validate and/or sanitize untrusted data before entering into the database. All untrusted data should be escaped before output. 2. Example: sanitize_email, esc_attr, esc_url, esc_html, absint etc.
  22. 22. Users Input sanitize_email() Use to sanitize email before inserting data in database. sanitize_text_field() Use to sanitize text field before entering the database. absint Use to sanitize the absolute integer. esc_url_raw() Use to sanitize URL value before intering the database. sanitize_hex_color() Use to sanitize the color code before entering on database. sanitize_key() Uppercase characters will be converted to lowercase.
  23. 23. User Input Example: $wp_customize->add_setting( 'footer-copyright', array( 'capability' => 'edit_theme_options', 'default' => __('All Right Reserved 2017', 'text-domain'), 'sanitize_callback' => ‘sanitize_text_field' ) ); $wp_customize->add_control( 'footer-copyright', array( 'label' => __( 'Copyright Text', ‘text-domain' ), 'description' => __('Your Own Copyright Text', 'text-domain'), 'section' => 'footer-option', 'settings' => 'footer-copyright', 'type' => 'text', ) );
  24. 24. Securing Output esc_html() Securing output for HTML blocks. esc_textarea() Escaping for textarea values before output. esc_attr() Escaping for HTML attributes. esc_url() Use to escape URL while output. absint() This is use for both input and output for absolute integer. esc_js() Use this function for inline Javascript.
  25. 25. Secure Output Example For escaping HTML, <?php echo esc_html( get_theme_mod('footer-copyright')); ?> For escaping url, <?php echo esc_url( get_theme_mod(‘setting_id')); ?> For escaping absolute integer, <?php echo absint( get_theme_mod(‘setting_id')); ?>
  26. 26. 8. Language
  27. 27. Make your theme Translation ready. 1. All theme text strings are to be translatable. 2. Example: __( ‘ WordCamp Tokyo 2017‘, ‘text-domain‘ ); 3._e( ‘ WordCamp Tokyo 2017‘, ‘text- domain‘ );
  28. 28. 9. Content Creation
  29. 29. Content must remain as it is even theme switch 1. Content Creation like text area is not allowed. 2.Maximum repeater text field on customizer is not allowed. 3.Meta field is allowed only for design purpose.
  30. 30. 10. Theme Options
  31. 31. Setting API vs Customizer API 1. Settings API is not allowed on theme for Theme Options. Use Customizer API to implement theme options. 2. Only one subpage is allowed under Appearance menu. It should contain relevant information about theme like documentation, user guide, etc. 3. Removing the core settings outside the customizer is not allowed. 4. You can reposition the options of the customizer.
  32. 32. 11. Post Type
  33. 33. Custom Post types and taxonomies are not allowed.
  34. 34. 12. Plugins
  35. 35. Plugin Territory 1. You are not allowed to bundle plugins in the theme. 2. Theme can recommend plugins and those plugins must be in dot org repository. 3.Theme should work good without any plugin. 4. You can recommend plugin with the help of library. ( Example: TGM Plugin Activation )
  36. 36. 13. Shortcode
  37. 37. No shortcodes are allowed on theme.
  38. 38. 14. Theme Codes
  39. 39. Check your every lines of code 1. Add a call to ‘wp_head()’ before the closing ‘</head>’ tag. 2.‘body_class()’must be inside the opening body tag. 3.Use the ‘wp_footer()’ call, to appear just before closing body tag. 4. Use WordPress function to call templates. Example: get_header(), get_footer(), get_sidebar(), get_search_form() etc
  40. 40. 15. Screenshot
  41. 41. 1.No logo or mockup, actual layout of your theme is required. 2.Required size 4:3 aspect ratio. 3. Recommended size is 1200*900
  42. 42. 16. Child Theme
  43. 43. Child Theme is also treated as a new theme and needs to follow the same queue. 1. Child theme name must not include parent theme name unless you are the author of the parent theme. 2. Theme must be child theme ready.
  44. 44. 17. Other things you need to care about
  45. 45. 1. W and P of WordPress always in uppercase. 2. Remove unnecessary commented code. 3. No customization in WordPress admin. 4. Redirection is not allowed after theme activated. 5. It’s not allowed to remove the default functionality of core. 6. Don’t include development files. 7. Premium Theme Shop should be GPL. 8. Don’t include backup files on theme folder. 9. No analytics or tracking. 10. No Sharing API is allowed. ( Facebook, twitter etc ) 11. Save options on single array. 12. Not overriding admin bars.
  46. 46. 13. No URL shorteners used in the theme. 14. All code and design should be your own or legally yours. 15. Use WordPress functionality and features first, if available. 16. You are not allowed to duplicate existing features. 17. Custom favicon is not allowed. It’s core functionality. 18. Check name collision. 19. Submit one theme at a time.
  47. 47. Are you still looking for best tips ?
  48. 48. Helpful tips for both author and reviewers. Check Other Live Ticket Follow Theme guidelines Use #themereview Channel Slack Start Reviewing Other Themes Attend Channel Meeting Contact with Mods and Admins
  49. 49. Check these things before theme submission. PHP, JS and Browser Console warnings Check with Theme check plugins Check your theme code yourself once Check changelog and theme version Submit your theme from here:
  50. 50. How theme review process works? Wait Queue for Review Rejected/ Approved /Live Submit your Theme Review/Comm unication with reviewers
  51. 51. Credit 1. 2. iew/required/ 3. 4. sanitization-and-validation-with-wordpress--wp- 25536 5. ew 6.
  52. 52. “This is Where My Presentation Ends And, Quality WordPress Theme Development Begins !
  53. 53. THANKS! Any questions? Lets connect, Twitter: @sandilyakafle Google Plus: +SandilyaKafle Slack: kafleg Email: Blog: