What Would Core Do?

41
What Would Core Do? WWCD? (What would core do?) Extending with Classiness and Consistency

description

A fun look at how to extend WordPress with class and consistency. Challenges plug-in and theme authors to apply a new, rigorous philosophy to their work: what would core do?

Transcript of What Would Core Do?

  • 1. WWCD?(What would core do?)Extending with Classiness and Consistency What Would Core Do?

2. About Me: Jake Goldman President (& chief engineer!) @ 10up LLC, aWordPress development & strategy agency Author of over a dozen WordPress plug-ins Dozens of clients, from university like BatesCollege to WP.com VIP clients like TechCrunch Writer/expert reviewer @ Smashing Magazine @jakemgoldWhat Would Core Do? 3. This is WordPress Core Simple, clean,economical. And moddable! What Would Core Do? 4. This is (often) WordPress Core with Plug-insWell I guess it does go faster.And it has moreHTML5! What Would Core Do? 5. WordPress with a lot of complex plug-insIs this even a car? What Would Core Do? 6. (BTW What Drupal Developers Think WordPress is)What Would Core Do? 7. (And what we think Drupal is)What Would Core Do? 8. What Extended WordPress Should Look Like What Would Core Do? 9. Seriously, heres the point.Its not the our extensions dont work, or arent wellcoded (there are plenty of those, too). Its that they stick out like sore thumbs.What Would Core Do? 10. WordPressWordPressWordPressPagepageMash Category Post Editor Editor Editor What Would Core Do? 11. Why do consumers love WordPress? Its simple for writers to understand. The userinterface is intuitive and (mostly) consistent. Its pretty. There are no more bullets. Alright maybe its affordable, too.Many of our extensions are ruining this. What Would Core Do? 12. 10ups Philosophy WHAT WOULD CORE DO? Can you tell where out of the boxWordPress stops and our customfunctionality begins? If so, we did it wrong. If the core team was tasked with buildingthis functionality in, how would they havedone it? What Would Core Do? 13. The right way: AkismetDo you even remember its not built into core? BTW, is anyone elsesurprised that erectiledysfunction is still themost common spam? What Would Core Do? 14. The wrong way: cformsIIWhere did these colorscome from?? What Would Core Do? 15. The wrong way: cformsIIWhere else dowe selectcontent to edit like this?What Would Core Do? 16. The wrong way: cformsIIWhere did theseicon conventions come from? What Would Core Do? 17. The wrong way: cformsIIWhat is a Save form settingsoption doing inthe admin bar?What Would Core Do? 18. The wrong way: cformsII Why are forms at thebottom instead of with content? And shouldwe just call it Forms? What Would Core Do? 19. The wrong way: cformsII Why is there a Help menuitem? What Would Core Do? 20. Case Study: Simple Local Avatars Why did I build it?I just wanted to upload avatars.Werent there other plug-ins that do that?Sure, if you want a page full of settings (including a defaultoption to include a plug-in author credit), a completely new user admin page to manage the avatars, want to retrieveavatars from Twitter and Facebook, want SnapShot integration, andWhat Would Core Do? 21. The Alternative: Add Local Avatars Do I really needa whole new user list screen?What Would Core Do? 22. Oh come on.Really?What Would Core Do? 23. Who careswhere its saved?? What Would Core Do? 24. Isnt size aparameter inget_avataralready?What Would Core Do? 25. Save it for another plug-in.What Would Core Do? 26. No.What Would Core Do? 27. Case Study: Simple Local Avatars Number of new admin screens: None.What Would Core Do? 28. Simple Local AvatarsNumber of new setting fields: One. What Would Core Do? 29. Simple Local AvatarsNumber of new user profile fields: One.What Would Core Do? 30. Simple Local AvatarsValue of it justworks:Priceless.What Would Core Do? 31. Its not just plug-insWhere elsedo we have tabs likeWe get it.these?Heading 5? Whats with thefont?Hex only?What Would Core Do? 32. Its not just plug-ins Oh god.What Would Core Do? 33. Best Practices: Think About DesignWhat would core do? Heck, what does WordPress do? What Would Core Do? 34. Best Practices: Think About Settings Should it be a top level menu or submenu? Does it need its own page? Or is it part of, say, writing settings? Should it be a drop down or a radio button? Do really you even need any settings?What Would Core Do? 35. Best Practices: Leave DashboardAlone! (a.k.a. stop advertising to us) I love you, Frederick, but frankly, my dear, I dont give adamn. What Would Core Do? 36. Yep. This isntBest Practices:even theadvanced tab.Less is MoreFor users: the paradox ofchoice. Save it for anotherplug-in.Decisions > Options.What Would Core Do? 37. Coding Techniques: Settings APIadd_settings_field & add_settings_sectionhttp://codex.wordpress.org/Settings_APIYou can add setting fields and sections to existingsetting screens. Dont make a page for two mediasettings.What Would Core Do? 38. Coding Techniques: Screen API Add help and documentation using thenative Help pull down.wpdevel.wordpress.com/2011/12/06/help-and-screen-api-changes-in-3-3/ What Would Core Do? 39. Coding Techniques: Add HooksInstead of two dozen options, add your own hooksso that other developers can override behavior forthe 5% in the long tail. (Like core does!)do_action( my_plugin_save );$output = apply_filter( my_plugin_output, $output ) ;What Would Core Do? 40. Coding Techniques: Uninstall Hookcodex.wordpress.org/Function_Reference/register_uninstall_hookThank goodness thatplug-in is gone!What Would Core Do? 41. WWCD? What would core do?by Jake Goldman@jakemgoldslides & code will be available atget10up.comWhat Would Core Do?