Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes

on

  • 4,246 views

These slides accompany a presentation given at WordCamp Singapore 2011 ( http://2011.singapore.wordcamp.org/ ) on the breaking of fixing of WordPress themes. Important plugins to aid in theme testing ...

These slides accompany a presentation given at WordCamp Singapore 2011 ( http://2011.singapore.wordcamp.org/ ) on the breaking of fixing of WordPress themes. Important plugins to aid in theme testing are discussed, as well as vital unit tests to perform before the public release of a WordPress theme.

Statistics

Views

Total Views
4,246
Views on SlideShare
2,923
Embed Views
1,323

Actions

Likes
6
Downloads
35
Comments
0

5 Embeds 1,323

http://themeshaper.com 1104
http://feeds2.feedburner.com 177
http://feeds.feedburner.com 31
http://wpdojo.net 10
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes Presentation Transcript

  • 1. Best PracticesOn Making, Breaking, and Fixing WordPress Themes Philip Arthur Moore / Theme Wrangler at Automattic Inc.
  • 2. WP_DEBUG/** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */define( WP_DEBUG, true );/** * For developers: Logging WordPress errors. * * PHP errors and notices will be logged to the file /wp-content/debug.log */define( WP_DEBUG_LOG, true );define( WP_DEBUG_DISPLAY, false );/** * Find more default constants in /wp-includes/default-constants.php * Link: http://codex.wordpress.org/Editing_wp-config.php */
  • 3. SCRIPT_DEBUG/** * For developers: Load development versions of all scripts. * * Change this to true to load all non-minified scripts and CSS. When * SCRIPT_DEBUG is set to true compression and concatenation are disabled. */define( SCRIPT_DEBUG, true );/** * Find more script-related constants in /wp-includes/script-loader.php * Link: http://codex.wordpress.org/Editing_wp-config.php */
  • 4. Important Plugins for Theme DevelopmentDebug Bar: Adds a debug menu to the toolbar that shows query, cache, and otherhelpful debugging information.Debug Bar Console: Adds a PHP/MySQL console to the debug bar.Log Deprecated Notices: Logs the usage of deprecated files, functions, andfunction arguments, offers the alternative if available, and identifies where thedeprecated functionality is being used.Regenerate Thumbnails: Allows you to regenerate all thumbnails after changingthe thumbnail sizes.Reveal IDs: Show post, page, category, tag, and link IDs in the Dashboard.RTL Tester: Allows quick rtl.css testing by adding a switch to the toolbar.Theme-Check: Tests a WordPress theme against the latest WP standards.WordPress Importer: Bulk content migration from site to site.
  • 5. Debug Bar Provides Useful Query Information
  • 6. Debug Bar Reports PHP Notices and Warnings
  • 7. Debug Bar Console
  • 8. Log Deprecated Notices
  • 9. Regenerate Thumbnails
  • 10. Regenerate Thumbnails
  • 11. Regenerate Thumbnails
  • 12. Reveal IDs for Admin
  • 13. RTL Tester Quickly Checks rtl.css
  • 14. RTL Tester Activated
  • 15. Theme-Check
  • 16. Theme-Check Finds Theme Errors
  • 17. Unit Testing is Vital
  • 18. Your Theme Should Respond Well To:Long Site Titles: e.g. The point of using Lorem Ipsum isthat it has a more-or-less normal distribution of letters, asopposed to using Content here, content here, making itlook like readable English.Long Site Descriptions: e.g. Lorem Ipsum is simply dummytext of the printing and typesetting industry. Lorem Ipsumhas been the industrys standard dummy text ever since the1500s, when an unknown printer took a galley of type andscrambled it to make a type specimen book. It has survivednot only five centuries, but also the leap into electronictypesetting, remaining essentially unchanged. It waspopularised in the 1960s with the release of Letraset sheetscontaining Lorem Ipsum passages, and more recently withdesktop publishing software like Aldus PageMaker includingversions of Lorem Ipsum.
  • 19. Your Theme Should Respond Well To:Index and Archive Pagination i.e. paged=2 or page/2Threaded and Paginated CommentsSuper Large Images $content_width checkNon-Default Permalinks i.e. /%year%/%monthnum%/%day%/%postname%/Super-Short and Super-Long Menus custom and non-customCustom Front Page and Posts Page i.e. site.com/blog/Non-Titled Posts and Non-Content PostsPassword-Protected ContentWidgets i.e. 0, 1, or 20 widgets
  • 20. http://codex.wordpress.org/Theme_Unit_Test
  • 21. Test For Built-In WordPress Functionality
  • 22. add_theme_support( $feature );// Add default posts and comments RSS feed links to <head>.add_theme_support( automatic-feed-links );// This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header imagesadd_theme_support( post-thumbnails );// Add support for a variety of post formatsadd_theme_support( post-formats, array( aside, link, gallery,status, quote, image ) );/** * Link: http://codex.wordpress.org/Function_Reference/add_theme_support */ add_editor_style(); add_custom_background(); register_nav_menu(); add_custom_image_header();
  • 23. i18n
  • 24. // i18nload_theme_textdomain( autofocus, get_template_directory_uri() . /languages );$locale = get_locale();$locale_file = get_template_directory_uri() . "/languages/$locale.php";if ( is_readable( $locale_file ) ) require_once( $locale_file );/** * Link: http://codex.wordpress.org/I18n_for_WordPress_Developers */
  • 25. http://codex.wordpress.org/Theme_Review
  • 26. Thanks