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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

doing_it_right() with WordPress

293
views

Published on

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

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


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
293
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. DOING_IT_RIGHT() WITH WORDPRESS Ryan Duff Fusionized Technology
    • 2. WHO AM I• Using WordPress since 2004 (version 1.2)• WordPress Professional for hire
    • 3. WHY DO IT RIGHT• Save yourself time• Save others time• Save your clients money• Save everybody from headaches
    • 4. 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
    • 5. FIRST THINGS FIRST• Use the debug bar plugin define(‘WP_DEBUG’, true); define(‘WP_DEBUG_DISPLAY, false); define(‘SAVEQUERIES’, true);
    • 6. ORGANIZE YOUR CODE• What goes in a plugin?• What goes in a theme?• Utilize mu-plugins/
    • 7. ORGANIZE YOUR CODEhttp://codex.wordpress.org/Template_Hierarchy
    • 8. 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 */
    • 9. OPTIMIZE YOUR CODE• Cache• Get rid of rotten database queries
    • 10. OPTIMIZE YOUR CODEset_transient( $transient, $value, $expiration );get_transient( $transient );delete_transient( $transient );
    • 11. 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
    • 12. DON’T REINVENT THE WHEEL• Clever code is not clever.• Use built in APIs and methods
    • 13. WORDPRESS APIS• Dashboard widgets • Plugin• Database • Rewrite• HTTP • Settings• File Header • Shortcode• Filesystem • Theme modification• Metadata • Transients• Options • Widgets
    • 14. ACTION HOOKS AND FILTERS• Hooks are places to DO things• Filters are ways to CHANGE things
    • 15. MORE THINGS NOT TO DO• Don’t downgrade jQuery• Don’t create unnecessary settings• Don’t forget to update
    • 16. SECURE CODE• esc_html()• esc_attr()• esc_url()• $wpdb->prepare() http://codex.wordpress.org/Data_Validation
    • 17. HOW TO LEARN MORE• Read the code and contribute http://core.trac.wordpress.org• Ask questions in #wordpress on freenode
    • 18. QUESTIONS? Ryan DuffFusionized Technology http://fusionized.com @ryancduff