doing_it_right() with WordPress
Upcoming SlideShare
Loading in...5
×
 

doing_it_right() with WordPress

on

  • 415 views

WordPress development best practices. Presented at CPOSC 2012 10/27/2012

WordPress development best practices. Presented at CPOSC 2012 10/27/2012

Statistics

Views

Total Views
415
Views on SlideShare
383
Embed Views
32

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 32

http://fusionized.com 32

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

doing_it_right() with WordPress doing_it_right() with WordPress Presentation Transcript

  • DOING_IT_RIGHT() WITH WORDPRESS Ryan Duff Fusionized Technology
  • WHO AM I• Using WordPress since 2004 (version 1.2)• WordPress Professional for hire
  • WHY DO IT RIGHT• Save yourself time• Save others time• Save your clients money• Save everybody from headaches
  • WAYS TO DO IT RIGHT• Learn to organize your code• ... document your code• ... optimize your code• Don’t reinvent the wheel• Action Hooks and Filters• Other very bad things to avoid
  • FIRST THINGS FIRST• Use the debug bar plugin define(‘WP_DEBUG’, true); define(‘WP_DEBUG_DISPLAY, false); define(‘SAVEQUERIES’, true);
  • ORGANIZE YOUR CODE• What goes in a plugin?• What goes in a theme?• Utilize mu-plugins/
  • ORGANIZE YOUR CODEhttp://codex.wordpress.org/Template_Hierarchy
  • DOCUMENT YOUR CODE/** * Simple and uniform HTTP request API. * * Standardizes the HTTP requests for WordPress. Handles cookies, gzipencoding and decoding, chunk * decoding, if HTTP 1.1 and various other difficult HTTP protocolimplementations. * * @link http://trac.wordpress.org/ticket/4779 HTTP API Proposal * * @package WordPress * @subpackage HTTP * @since 2.7.0 */
  • OPTIMIZE YOUR CODE• Cache• Get rid of rotten database queries
  • OPTIMIZE YOUR CODEset_transient( $transient, $value, $expiration );get_transient( $transient );delete_transient( $transient );
  • OPTIMIZE YOUR CODE• Make sure the code you’re expecting matches• Use $wpdb class in the correct cases, WP_Query otherwise• Sanitize everything http://codex.wordpress.org/Data_Validation
  • DON’T REINVENT THE WHEEL• Clever code is not clever.• Use built in APIs and methods
  • WORDPRESS APIS• Dashboard widgets • Plugin• Database • Rewrite• HTTP • Settings• File Header • Shortcode• Filesystem • Theme modification• Metadata • Transients• Options • Widgets
  • ACTION HOOKS AND FILTERS• Hooks are places to DO things• Filters are ways to CHANGE things
  • MORE THINGS NOT TO DO• Don’t downgrade jQuery• Don’t create unnecessary settings• Don’t forget to update
  • SECURE CODE• esc_html()• esc_attr()• esc_url()• $wpdb->prepare() http://codex.wordpress.org/Data_Validation
  • HOW TO LEARN MORE• Read the code and contribute http://core.trac.wordpress.org• Ask questions in #wordpress on freenode
  • QUESTIONS? Ryan DuffFusionized Technology http://fusionized.com @ryancduff