Your SlideShare is downloading. ×
Extending WordPress beyond!
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

Extending WordPress beyond!

2,079
views

Published on

Published in: Technology

1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,079
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
14
Comments
1
Likes
2
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

Transcript

  • 1. CC-BY-NC flickr.com/photos/28634332@N05/ExtendingWordPressbeyond! mitcho (Michael 貴 Erlewine) http://mitcho.com, @themitchoD.C. WordPress Meetup, March 18, 2011
  • 2. follow slides onhttp://slideshare.net/mitcho
  • 3. Today: extend WordPress...
  • 4. Today: extend WordPress... beyond the blog
  • 5. Today: extend WordPress... beyond the blog beyond the hack
  • 6. Today: extend WordPress... beyond the blog beyond the hack beyond your site
  • 7. Introduction
  • 8. Introduction• Hi, I’m mitcho.
  • 9. Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.
  • 10. Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho
  • 11. Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho• Linguistics PhD student at MIT
  • 12. Introduction• Hi, I’m mitcho. • Linguist, coder, teacher.• http://mitcho.com; @themitcho• Linguistics PhD student at MIT• Mozilla, Automattic, MIT
  • 13. Yet Another RelatedPosts Plugin (YARPP)
  • 14. Yet Another RelatedPosts Plugin (YARPP)• smart “related posts” listings with lots of customization
  • 15. Yet Another RelatedPosts Plugin (YARPP)• smart “related posts” listings with lots of customization• mitcho.com/code/yarpp or search for “YARPP”; @yarpp
  • 16. 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
  • 17. HookPress
  • 18. HookPress• opens up the WordPress hook system to remote scripts
  • 19. HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages
  • 20. HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages• now on WordPress.com!
  • 21. HookPress• opens up the WordPress hook system to remote scripts• extend WP with other languages• now on WordPress.com!• mitcho.com/code/hookpress; @hookpress
  • 22. ShrimpTest
  • 23. ShrimpTest• A/B testing, built right into WP
  • 24. ShrimpTest• A/B testing, built right into WP• joint project with Automattic
  • 25. ShrimpTest• A/B testing, built right into WP• joint project with Automattic• currently in perpetual beta:
  • 26. ShrimpTest• A/B testing, built right into WP• joint project with Automattic• currently in perpetual beta: • shrimptest.com; @shrimptest
  • 27. 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
  • 28. CC-BY-NC-SA flickr.com/photos/13382424@N00/5216424459/
  • 29. WordPress at MIT
  • 30. WordPress at MIT• Becoming the platform of choice
  • 31. WordPress at MIT• Becoming the platform of choice• Free, flexible, easy, well-known
  • 32. WordPress at MIT• Becoming the platform of choice• Free, flexible, easy, well-known• Academic to administrative; public and private
  • 33. 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?
  • 34. take WordPressbeyond the blog
  • 35. three examples from MIT
  • 36. Edgerton Digital CollectionsMIT Museum and MIT Edgerton Centerhttp://edgerton-digital-collections.org
  • 37. 12000 photos, 8000 notebook pages Dynamic custom UI and search
  • 38. Transcriptions and commentsMetadata direct from museum data store
  • 39. Global Shakespeares MIT Shakespeare Projecthttp://globalshakespeares.org
  • 40. Rich custom metadataAll managed through WordPress
  • 41. Dynamic search Calls WordPress search via AJAXDOM built client-side; data in localstorage
  • 42. Educational Collaboration Space MIT Dept. of Mathematics, NSF more info at http://ecs.mit.edu
  • 43. Management of “File Groups”Content linked through tags Notification by tags
  • 44. WP beyond blogs?
  • 45. WP beyond blogs?• A solid foundation
  • 46. WP beyond blogs?• A solid foundation • Faster development cycle
  • 47. WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation
  • 48. WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation• A great community
  • 49. WP beyond blogs?• A solid foundation • Faster development cycle• Cohesive structure and navigation• A great community • Plugins and themes you can use
  • 50. CONTENTCC-BY-NC-SA flickr.com/photos/bikeracer/6740232/
  • 51. Details, details, details
  • 52. Details, details, details• Navigation, permalinks, RSS
  • 53. Details, details, details• Navigation, permalinks, RSS• User roles and permissions
  • 54. Details, details, details• Navigation, permalinks, RSS• User roles and permissions• External data? AJAX-heavy UI?
  • 55. Details, details, details• Navigation, permalinks, RSS• User roles and permissions• External data? AJAX-heavy UI? • Ask me about it. :)
  • 56. take WordPressbeyond the blog
  • 57. You customized WordPress for a project.
  • 58. what if...
  • 59. CC-BY-NC-SA flickr.com/photos/slworking/1704538333
  • 60. • they move servers... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
  • 61. • they move servers...• they want to reuse some of it... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
  • 62. • they move servers...• they want to reuse some of it...• they want modifications... CC-BY-NC-SA flickr.com/photos/slworking/1704538333
  • 63. • 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
  • 64. take your codebeyond the hack
  • 65. Abstraction!
  • 66. 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
  • 67. Abstraction
  • 68. Abstraction = thinking about themore general problem
  • 69. result =
  • 70. result =code that you and others can reuse
  • 71. How?
  • 72. Think abstractly
  • 73. Think abstractly• Produce “functionalities”
  • 74. Think abstractly• Produce “functionalities”• One functionality = one plugin
  • 75. Think abstractly• Produce “functionalities”• One functionality = one plugin• Interrelated code can be modularized
  • 76. Think abstractly• Produce “functionalities”• One functionality = one plugin• Interrelated code can be modularized • introduce new hooks and filters with do_action(), apply_filters()
  • 77. Use WP abstractions
  • 78. Use WP abstractions• DB query? $wpdb, not mysql_*
  • 79. Use WP abstractions• DB query? $wpdb, not mysql_*• Caching? Object Cache and Transients API
  • 80. Use WP abstractions• DB query? $wpdb, not mysql_*• Caching? Object Cache and Transients API• Options? set_option() not db
  • 81. Use WP abstractions
  • 82. Use WP abstractions• Posts? get_posts() not SQL
  • 83. Use WP abstractions• Posts? get_posts() not SQL• Custom data? Custom taxonomy or fields
  • 84. Use WP abstractions• Posts? get_posts() not SQL• Custom data? Custom taxonomy or fields• New entities? Custom post types!
  • 85. 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
  • 86. Don’t reinvent the wheel. © 2008 Drew and Natalie Dee, toothpastefordinner.com
  • 87. Be mobile
  • 88. Be mobile• Don’t expect to be in a particular place
  • 89. Be mobile• Don’t expect to be in a particular place• Use __FILE__, plugins_url(), etc.
  • 90. Be mobile• Don’t expect to be in a particular place• Use __FILE__, plugins_url(), etc.• Get info with get_bloginfo()
  • 91. 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
  • 92. Be classy
  • 93. Be classy• OOP is perfect for abstracting “functionality”
  • 94. Be classy• OOP is perfect for abstracting “functionality”• Write your functionality as a class with some defaults
  • 95. Be classy• OOP is perfect for abstracting “functionality”• Write your functionality as a class with some defaults• Easy for others to extend
  • 96. 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
  • 97. Give yourself options
  • 98. Give yourself options• Don’t hard code the project name, URLs, emails, etc.
  • 99. Give yourself options• Don’t hard code the project name, URLs, emails, etc.• Bare minimum: declare as overrideable constants
  • 100. Give yourself options• Don’t hard code the project name, URLs, emails, etc.• Bare minimum: declare as overrideable constants• Ideally: create an options screen
  • 101. Learn from the masters
  • 102. Learn from the masters• http://codex.wordpress.org
  • 103. Learn from the masters• http://codex.wordpress.org• Read others’ code.
  • 104. Learn from the masters• http://codex.wordpress.org• Read others’ code. • Borrow and adapt from other plugins, themes, and the Core
  • 105. 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!”
  • 106. Good practice matters CC-BY-NC xkcd.com/292/
  • 107. Results
  • 108. Results• Won’t [Less likely to] break when you move or upgrade
  • 109. Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain
  • 110. Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain• Easier to build on
  • 111. Results• Won’t [Less likely to] break when you move or upgrade• Easier to maintain• Easier to build on• Easier to reuse elsewhere
  • 112. take your codebeyond the hack
  • 113. but wait, there’s more...
  • 114. CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
  • 115. Free software is not a one way street. CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
  • 116. WordPress is not a one way street.CC-BY-NC-SA flickr.com/photos/z6p6tist6/500048151/
  • 117. Think:
  • 118. Think:• You just customized WordPress for a client
  • 119. Think:• You just customized WordPress for a client• Others could benefit from this
  • 120. Think:• You just customized WordPress for a client• Others could benefit from this• You and the client have benefited from free software: WordPress
  • 121. Consider open-sourcing your client-requested functionality.
  • 122. take your codebeyond your site
  • 123. Do people really do this?
  • 124. success stories:
  • 125. success stories: My own work at MIT
  • 126. Open source from MIT
  • 127. Open source from MIT• Shakespeare: Redirect by Custom Field, Require First and Last Name
  • 128. 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
  • 129. LicenseEducational Collaboration Space
  • 130. LicenseEducational Collaboration Space
  • 131. ECS and Shibboleth
  • 132. ECS and Shibboleth • Shibboleth authentication
  • 133. ECS and Shibboleth • Shibboleth authentication • now contributing to the pre- existing Shibboleth plugin
  • 134. ECS and Shibboleth • Shibboleth authentication • now contributing to the pre- existing Shibboleth plugin • MIT customizations can be reused in other MIT projects
  • 135. success stories: Brad Williams co-founder, WebDevStudios.com
  • 136. Brad Williams
  • 137. Brad Williams• NextGEN Public Uploader
  • 138. Brad Williams• NextGEN Public Uploader• Post Google Map
  • 139. Brad Williams• NextGEN Public Uploader• Post Google Map • sponsored by injersey.com
  • 140. Brad Williams
  • 141. Brad Williams• no client has said no
  • 142. Brad Williams• no client has said no• many clients want to give back
  • 143. Brad Williams• no client has said no• many clients want to give back• plugins have brought in new clients
  • 144. success stories: John James Jacoby John James Jacoby BuddyPressConsulting and Custom Development
  • 145. BuddyPress Member Filterdevelopment supported by LOGOI Ministries
  • 146. BuddyPress Edit Group Slugdevelopment supported by We Heart This
  • 147. John James Jacoby
  • 148. John James Jacoby• educate client about community role and open-source
  • 149. John James Jacoby• educate client about community role and open-source• sometimes appropriate to just open-source the backend w/o UI
  • 150. 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
  • 151. 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
  • 152. Tips
  • 153. Tips• bring up open-sourcing early
  • 154. Tips• bring up open-sourcing early• if they say no, respect that
  • 155. Tips• bring up open-sourcing early• if they say no, respect that• don’t pass cost back to client
  • 156. Tips• bring up open-sourcing early• if they say no, respect that• don’t pass cost back to client• acknowledge the funding
  • 157. 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
  • 158. take your codebeyond your site
  • 159. Today: extend WordPress...
  • 160. Today: extend WordPress... beyond the blog
  • 161. Today: extend WordPress... beyond the blog beyond the hack
  • 162. Today: extend WordPress... beyond the blog beyond the hack beyond your site
  • 163. Thank you!Questions?Slides up on slideshare.net/mitcho.mitcho (Michael 貴 Erlewine)mitcho.com; @themitcho

×