Extending WordPress beyond!
Upcoming SlideShare
Loading in...5
×
 

Extending WordPress beyond!

on

  • 2,233 views

 

Statistics

Views

Total Views
2,233
Views on SlideShare
2,182
Embed Views
51

Actions

Likes
2
Downloads
13
Comments
1

2 Embeds 51

http://davidakennedy.com 28
http://www.scoop.it 23

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • was a good slide until you got to Abstractions... then it was a great slide deck :) Hope everybody reads this
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Extending WordPress beyond! Extending WordPress beyond! Presentation Transcript

    • CC-BY-NC flickr.com/photos/28634332@N05/ExtendingWordPressbeyond! mitcho (Michael 貴 Erlewine) http://mitcho.com, @themitchoD.C. WordPress Meetup, March 18, 2011
    • follow slides onhttp://slideshare.net/mitcho
    • Today: extend WordPress...
    • Today: extend WordPress... beyond the blog
    • Today: extend WordPress... beyond the blog beyond the hack
    • Today: extend WordPress... beyond the blog beyond the hack beyond your site
    • Introduction
    • Introduction• Hi, I’m mitcho.
    • Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.
    • Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho
    • Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho• Linguistics PhD student at MIT
    • Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho• Linguistics PhD student at MIT• Mozilla, Automattic, MIT
    • Yet Another RelatedPosts Plugin (YARPP)
    • Yet Another RelatedPosts Plugin (YARPP)• smart “related posts” listings with lots of customization
    • Yet Another RelatedPosts Plugin (YARPP)• smart “related posts” listings with lots of customization• mitcho.com/code/yarpp or search for “YARPP”; @yarpp
    • Yet Another RelatedPosts Plugin (YARPP)• smart “related posts” listings with lots of customization• mitcho.com/code/yarpp or search for “YARPP”; @yarpp• over 850k downloads
    • HookPress
    • HookPress• opens up the WordPress hook system to remote scripts
    • HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages
    • HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages• now on WordPress.com!
    • HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages• now on WordPress.com!• mitcho.com/code/hookpress; @hookpress
    • ShrimpTest
    • ShrimpTest• A/B testing, built right into WP
    • ShrimpTest• A/B testing, built right into WP• joint project with Automattic
    • ShrimpTest• A/B testing, built right into WP• joint project with Automattic• currently in perpetual beta:
    • ShrimpTest• A/B testing, built right into WP• joint project with Automattic• currently in perpetual beta: • shrimptest.com; @shrimptest
    • ShrimpTest• A/B testing, built right into WP• joint project with Automattic• currently in perpetual beta: • shrimptest.com; @shrimptest• video of talk up on wordpress.tv
    • CC-BY-NC-SA flickr.com/photos/13382424@N00/5216424459/
    • WordPress at MIT
    • WordPress at MIT• Becoming the platform of choice
    • WordPress at MIT• Becoming the platform of choice• Free, flexible, easy, well-known
    • WordPress at MIT• Becoming the platform of choice• Free, flexible, easy, well-known• Academic to administrative; public and private
    • WordPress at MIT• Becoming the platform of choice• Free, flexible, easy, well-known• Academic to administrative; public and private• But... is it more than just a blog?
    • take WordPressbeyond the blog
    • three examples from MIT
    • Edgerton Digital CollectionsMIT Museum and MIT Edgerton Centerhttp://edgerton-digital-collections.org
    • 12000 photos, 8000 notebook pages Dynamic custom UI and search
    • Transcriptions and commentsMetadata direct from museum data store
    • Global Shakespeares MIT Shakespeare Projecthttp://globalshakespeares.org
    • Rich custom metadataAll managed through WordPress
    • Dynamic search Calls WordPress search via AJAXDOM built client-side; data in localstorage
    • Educational Collaboration Space MIT Dept. of Mathematics, NSF more info at http://ecs.mit.edu
    • Management of “File Groups”Content linked through tags Notification by tags
    • WP beyond blogs?
    • WP beyond blogs?• A solid foundation
    • WP beyond blogs?• A solid foundation • Faster development cycle
    • WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation
    • WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation• A great community
    • WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation• A great community • Plugins and themes you can use
    • CONTENTCC-BY-NC-SA flickr.com/photos/bikeracer/6740232/
    • Details, details, details
    • Details, details, details• Navigation, permalinks, RSS
    • Details, details, details• Navigation, permalinks, RSS• User roles and permissions
    • Details, details, details• Navigation, permalinks, RSS• User roles and permissions• External data? AJAX-heavy UI?
    • Details, details, details• Navigation, permalinks, RSS• User roles and permissions• External data? AJAX-heavy UI? • Ask me about it. :)
    • take WordPressbeyond the blog
    • You customized WordPress for a project.
    • what if...
    • CC-BY-NC-SA flickr.com/photos/slworking/1704538333
    • • they move servers... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
    • • they move servers...• they want to reuse some of it... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
    • • they move servers...• they want to reuse some of it...• they want modifications... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
    • • they move servers...• they want to reuse er ! as t some of it...d i s• they want modifications... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
    • take your codebeyond the hack
    • Abstraction!
    • Abstraction arises from therecognition of similarities betweencertain objects, situations, orprocesses in the real world and thedecision to concentrate on thesesimilarities and to ignore, for thetime being, their differences. — C.A.R. Hoare
    • Abstraction
    • Abstraction = thinking about themore general problem
    • result =
    • result =code that you and others can reuse
    • How?
    • Think abstractly
    • Think abstractly• Produce “functionalities”
    • Think abstractly• Produce “functionalities”• One functionality = one plugin
    • Think abstractly• Produce “functionalities”• One functionality = one plugin• Interrelated code can be modularized
    • Think abstractly• Produce “functionalities”• One functionality = one plugin• Interrelated code can be modularized • introduce new hooks and filters with do_action(), apply_filters()
    • Use WP abstractions
    • Use WP abstractions• DB query? $wpdb, not mysql_*
    • Use WP abstractions• DB query? $wpdb, not mysql_*• Caching? Object Cache and Transients API
    • Use WP abstractions• DB query? $wpdb, not mysql_*• Caching? Object Cache and Transients API• Options? set_option() not db
    • Use WP abstractions
    • Use WP abstractions• Posts? get_posts() not SQL
    • Use WP abstractions• Posts? get_posts() not SQL• Custom data? Custom taxonomy or fields
    • Use WP abstractions• Posts? get_posts() not SQL• Custom data? Custom taxonomy or fields• New entities? Custom post types!
    • Use WP abstractions• Posts? get_posts() not SQL• Custom data? Custom taxonomy or fields• New entities? Custom post types!• External request? wp_remote_post() not curl
    • Don’t reinvent the wheel. © 2008 Drew and Natalie Dee, toothpastefordinner.com
    • Be mobile
    • Be mobile• Don’t expect to be in a particular place
    • Be mobile• Don’t expect to be in a particular place• Use __FILE__, plugins_url(), etc.
    • Be mobile• Don’t expect to be in a particular place• Use __FILE__, plugins_url(), etc.• Get info with get_bloginfo()
    • Be mobile• Don’t expect to be in a particular place• Use __FILE__, plugins_url(), etc.• Get info with get_bloginfo()• Use $wpdb so you can forget about database settings
    • Be classy
    • Be classy• OOP is perfect for abstracting “functionality”
    • Be classy• OOP is perfect for abstracting “functionality”• Write your functionality as a class with some defaults
    • Be classy• OOP is perfect for abstracting “functionality”• Write your functionality as a class with some defaults• Easy for others to extend
    • Be classy• OOP is perfect for abstracting “functionality”• Write your functionality as a class with some defaults• Easy for others to extend• Clean, legible code
    • Give yourself options
    • Give yourself options• Don’t hard code the project name, URLs, emails, etc.
    • Give yourself options• Don’t hard code the project name, URLs, emails, etc.• Bare minimum: declare as overrideable constants
    • Give yourself options• Don’t hard code the project name, URLs, emails, etc.• Bare minimum: declare as overrideable constants• Ideally: create an options screen
    • Learn from the masters
    • Learn from the masters• http://codex.wordpress.org
    • Learn from the masters• http://codex.wordpress.org• Read others’ code.
    • Learn from the masters• http://codex.wordpress.org• Read others’ code. • Borrow and adapt from other plugins, themes, and the Core
    • Learn from the masters• http://codex.wordpress.org• Read others’ code. • Borrow and adapt from other plugins, themes, and the Core • “free as in freedom!”
    • Good practice matters CC-BY-NC xkcd.com/292/
    • Results
    • Results• Won’t [Less likely to] break when you move or upgrade
    • Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain
    • Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain• Easier to build on
    • Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain• Easier to build on• Easier to reuse elsewhere
    • take your codebeyond the hack
    • but wait, there’s more...
    • CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
    • Free software is not a one way street. CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
    • WordPress is not a one way street.CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
    • Think:
    • Think:• You just customized WordPress for a client
    • Think:• You just customized WordPress for a client• Others could benefit from this
    • Think:• You just customized WordPress for a client• Others could benefit from this• You and the client have benefited from free software: WordPress
    • Consider open-sourcing your client-requested functionality.
    • take your codebeyond your site
    • Do people really do this?
    • success stories:
    • success stories: My own work at MIT
    • Open source from MIT
    • Open source from MIT• Shakespeare: Redirect by Custom Field, Require First and Last Name
    • Open source from MIT• Shakespeare: Redirect by Custom Field, Require First and Last Name• Educational Collaboration Space: File Groups, Distinct Preview, Allow LaTeX Uploads, Notifications By Tag, License
    • LicenseEducational Collaboration Space
    • LicenseEducational Collaboration Space
    • ECS and Shibboleth
    • ECS and Shibboleth • Shibboleth authentication
    • ECS and Shibboleth • Shibboleth authentication • now contributing to the pre- existing Shibboleth plugin
    • ECS and Shibboleth • Shibboleth authentication • now contributing to the pre- existing Shibboleth plugin • MIT customizations can be reused in other MIT projects
    • success stories: Brad Williams co-founder, WebDevStudios.com
    • Brad Williams
    • Brad Williams• NextGEN Public Uploader
    • Brad Williams• NextGEN Public Uploader• Post Google Map
    • Brad Williams• NextGEN Public Uploader• Post Google Map • sponsored by injersey.com
    • Brad Williams
    • Brad Williams• no client has said no
    • Brad Williams• no client has said no• many clients want to give back
    • Brad Williams• no client has said no• many clients want to give back• plugins have brought in new clients
    • success stories: John James Jacoby John James Jacoby BuddyPressConsulting and Custom Development
    • BuddyPress Member Filterdevelopment supported by LOGOI Ministries
    • BuddyPress Edit Group Slugdevelopment supported by We Heart This
    • John James Jacoby
    • John James Jacoby• educate client about community role and open-source
    • John James Jacoby• educate client about community role and open-source• sometimes appropriate to just open-source the backend w/o UI
    • John James Jacoby• educate client about community role and open-source• sometimes appropriate to just open-source the backend w/o UI• community contributions got him noticed
    • John James Jacoby• educate client about community role and open-source• sometimes appropriate to just open-source the backend w/o UI• community contributions got him noticed • BuddyPress Core contributor
    • Tips
    • Tips• bring up open-sourcing early
    • Tips• bring up open-sourcing early• if they say no, respect that
    • Tips• bring up open-sourcing early• if they say no, respect that• don’t pass cost back to client
    • Tips• bring up open-sourcing early• if they say no, respect that• don’t pass cost back to client• acknowledge the funding
    • Tips• bring up open-sourcing early• if they say no, respect that• don’t pass cost back to client• acknowledge the funding• don’t forget you can contribute to existing projects as well
    • take your codebeyond your site
    • Today: extend WordPress...
    • Today: extend WordPress... beyond the blog
    • Today: extend WordPress... beyond the blog beyond the hack
    • Today: extend WordPress... beyond the blog beyond the hack beyond your site
    • Thank you!Questions?Slides up on slideshare.net/mitcho.mitcho (Michael 貴 Erlewine)mitcho.com; @themitcho