Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress Tapas

hotzeplotz
November 09, 2013

WordPress Tapas

Tasty small recipes for delightful development
WordCamp Porto 2013, 9 November 2013

hotzeplotz

November 09, 2013
Tweet

More Decks by hotzeplotz

Other Decks in Programming

Transcript

  1. #7 - We optimize for joy. We believe writing code

    is a lot of hard work, and the only way it can be worth is by enjoying it. When there is no longer joy in writing code, the best thing to do is stop. To prevent this, we'll avoid taking paths that will make Redis less of a joy to develop. The Redis Manifesto
  2. JOY

  3. #4 - Code is like a poem; it's not just

    something we write to reach some practical result. Sometimes people that are far from the Redis philosophy suggest using other code written by other authors (frequently in other languages) in order to implement something Redis currently lacks. But to us this is like if Shakespeare decided to end Enrico IV using the Paradiso from the Divina Commedia. The Redis Manifesto
  4. Is using any external code a bad idea? Not at

    all. Like in "One Thousand and One Nights" smaller self contained stories are embedded in a bigger story, we'll be happy to use beautiful self contained libraries when needed. At the same time, when writing the Redis story we're trying to write smaller stories that will fit in to other code. The Redis Manifesto
  5. ISSUE #1 < m e t a n a m

    e = " G E N E R A T O R " c o n t e n t = " M i c r o s o f t F r o n t P a g e 6 . 0 " > < m e t a n a m e = " P r o g I d " c o n t e n t = " F r o n t P a g e . E d i t o r . D o c u m e n t " > it was actually a FrontPage template updated in DreamWeaver text as image for brand font table-based layout
  6. ISSUE #5 my first issue enter : XML source, XSLT

    templates, YAML metadata, CLI-based micro-pipeline, completely based on Git, written in Perl + Bash today it would be a Static Site Generator, it would be written in Node.js and it would have Awesome in the tagline 248 XSLT SLOC (v2), 299 SLOC (v3), 439 SLOC (v4), 531 SLOC (v5) 80 XSLT SLOC (v5-simple), 220 SLOC (v5-simple+tables) - only Table of Contents for email campaigns, full newsletter via HTTP only CSS was in external stylesheet, moved inline through an external service just before creating the campaign in the mailing service provider's web interface Sfursat
  7. IN THE MEANWHILE dozens of single-item micro-campaigns sent produced in

    WordPress as plain pages with custom page template HTML template based on Mailchimp's ~672 SLOC, inline CSS email blueprints
  8. ISSUE #14 upcoming issue email version: only table of contents,

    table-based web version: full newsletter contents, responsive layout requirement: easy to produce for editors requirement: structured data (future layout changes, etc.) requirement: reuse WP Posts for the 'recent news' section
  9. MTHAML Multi target HAML best of both worlds Twig's power

    and efficiency... ...with HAML syntax! github.com/arnaud-lb/MtHaml
  10. SASS + COMPASS SASS: CSS pre-processor powerful and expressive syntax

    compiled to standard CSS Compass: CSS authoring framework makes authoring complex, cross-browser CSS3 designs easy sass-lang.com compass-style.org
  11. JSON n a m e s p a c e

    M y T h e m e \ e v e n t _ p r o g r a m m e ; $ d o c u m e n t = p r e p a r e _ e v e n t _ p r o g r a m m e ( $ s l u g ) ; full separation of content and presentation easier to debug makes it easy to output content in different formats e.g. HTML for browsers and JSON for an API for a Javascript frontend, HTML5 web app...
  12. GIT-BASED DEPLOYMENT $ r a k e d e p

    l o y : l i v e S w i t c h e d t o b r a n c h ' d e p l o y / l i v e ' M e r g e m a d e b y t h e ' r e c u r s i v e ' s t r a t e g y . S w i t c h e d t o b r a n c h ' m a s t e r ' C o u n t i n g o b j e c t s : 4 , d o n e . D e l t a c o m p r e s s i o n u s i n g u p t o 2 t h r e a d s . C o m p r e s s i n g o b j e c t s : 1 0 0 % ( 4 / 4 ) , d o n e . W r i t i n g o b j e c t s : 1 0 0 % ( 4 / 4 ) , 7 9 4 b y t e s , d o n e . T o t a l 4 ( d e l t a 0 ) , r e u s e d 0 ( d e l t a 0 ) U n p a c k i n g o b j e c t s : 1 0 0 % ( 4 / 4 ) , d o n e .
  13. GIT-BASED DEPLOYMENT r e m o t e : r

    e f s / h e a d s / d e p l o y / l i v e r e m o t e : F r o m / s r v / w e b / w o r d p r e s s / w w w / t m p / l s e c i t i e s - 2 0 1 2 r e m o t e : * b r a n c h d e p l o y / l i v e - > F E T C H _ H E A D r e m o t e : U p d a t i n g 6 e 3 0 2 1 3 . . 9 a d 0 1 1 9 r e m o t e : F a s t - f o r w a r d r e m o t e : S u b m o d u l e ' j a v a s c r i p t s / v e n d o r / g a l l e r i a . i o ' ( ) r e g i s t e r e d f o r p a t h ' j a v a s c r i p t s / v e n d o r / g a l l e r i a . i o '
  14. COMPOSER r e m o t e : L o

    a d i n g c o m p o s e r r e p o s i t o r i e s w i t h p a c k a g e i n f o r m a t i o n r e m o t e : I n s t a l l i n g d e p e n d e n c i e s ( i n c l u d i n g r e q u i r e - d e v ) f r o m l o c k f i l e r e m o t e : N o t h i n g t o i n s t a l l o r u p d a t e r e m o t e : G e n e r a t i n g a u t o l o a d f i l e s r e m o t e : C o m p i l i n g c o m p o n e n t f i l e s T o / s r v / w e b / w o r d p r e s s / w w w / t m p / l s e c i t i e s - 2 0 1 2 . g i t / 6 e 3 0 2 1 3 . . 9 a d 0 1 1 9 d e p l o y / l i v e - > d e p l o y / l i v e getcomposer.org capifony.org
  15. WP-CLI a set of command-line tools to manage WordPress installations

    flexible, powerful automation of configuration, content, permissions, etc. makes managing large WordPress installations easy and robust wp-cli.org
  16. JOY

  17. STATE OF THE WORD default is - plugins, themes, admin

    interface great for end users and in many scenarios not much of my favourite tapas poetry: WordPress as an opinionated framework joy: anything not managed through DevOps is a nightmare to scale large hosting companies can build expertise and tools for large-scale operations purpose: what about small businesses and organizations?
  18. ANOTHER WORD IS POSSIBLE is another WordPress possible? another WordPress

    is already happening WordPress as an app framework ( ) WordPress as a free software ecosystem free software as collective wisdom management of software and wisdom requires expertise and resources large-scale WordPress operations with Purpose, Joy and Poetry: ? SOTW 2013 WordOps
  19. END TITLES ME Andrea Rota - - [email protected] @hotzeplotz THIS

    PRESENTATION , 9 November 2013. All content Creative Commons Attribution ShareAlike (cc by-sa) WordCamp Porto 2013 PHOTO CREDITS Ça vaut la peine d'attendre... quand on est gourmand by Chris de Rham (ah zut) on flickr.com - cc by-nc-nd 2.0