O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Efficient Code Management

275 visualizações

Publicada em

If your way of reusing custom code across projects is to copy and paste, this one’s for you. Come learn how to streamline your development cycle so you can take on more work from more clients. Instead of adding or making changes to a custom function on a site, by site basis – develop custom code in a single location so it can be reused across projects efficiently.

We’ll explore advantages to separating functionality from design with custom plugins and discuss why a centralized distribution strategy is critical to scaling development services. After this brief discussion, we’ll spend the majority of our time implementing such a strategy for a simple custom plugin.

Walk away with:
– Dedicated location for the development and maintenance of a custom plugin (GitHub)
– Scalable distribution and update strategy for custom plugins and themes
– Basic Git skills

Publicada em: Internet
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Efficient Code Management

  1. 1. EFFICIENT CODE MANAGEMENT WORKSHOP @rachwhitton WordCamp San Antonio 2017
  2. 2. @rachwhitton 2 Value Propositions for Efficient Code Management ‣ Sanity ‣ Scalability ‣ Sustainability
  3. 3. @rachwhitton 3 Design vs Functionality Theme Design & Layout Plugin Functionality & Features ‣ register_sidebar ‣ register_nav_menus ‣ register_post_type ‣ register_taxonomy
  4. 4. @rachwhitton 4 Changing Themes Functionality should persist after swapping themes
  5. 5. @rachwhitton 5 Updating Themes Functionality should persist after updating themes
  6. 6. CUSTOM PLUGINS
  7. 7. @rachwhitton 7 Move Custom Code to Plugins Using site-specific plugins.. ‣ Easily re-use common functions across projects ‣ Site’s functionality remains intact when swapping themes ‣ Dedicated location for development and maintenance
  8. 8. @rachwhitton 8 Example Scenario Feature Request: ‣ Convert page from HTML to downloadable PDF Implementation: ‣ wkhtmltopdf + some custom function
  9. 9. @rachwhitton 9 wp scaffold plugin Docs: https://developer.wordpress.org/cli/commands/scaffold/plugin/ Toolbelt: ‣ Terminal application • Demo uses iTerm2 with oh-my-zsh shell ‣ Local development environment with Git and WP-CLI • Demo uses Lando (developed by Tandem)
  10. 10. @rachwhitton 1 Changing Themes Functionality should persist after swapping themes
  11. 11. @rachwhitton 11 Development & Maintenance Strategy
  12. 12. @rachwhitton 12 Git & GitHub Demo ‣ Copy the new plugin to it’s own project ‣ Initialize the plugin’s root directory with Git to add version control ‣ Create a repo on GitHub ‣ Add the remote ‣ Initial commit ‣ Push
  13. 13. @rachwhitton 13 Distributing Updates Hook core filters ‣ pre_set_site_transient_update_plugins, ‣ plugins_api ‣ upgrader_post_install OR.. ‣ GitHub Updater ‣ WP Pusher
  14. 14. CHILD THEME
  15. 15. @rachwhitton 15 Example Scenario Feature Request: ‣ Add theme support for thumbnails Implementation: ‣ Child theme + some custom function
  16. 16. @rachwhitton 16 wp scaffold child-theme demo Docs: https://developer.wordpress.org/cli/commands/scaffold/child-theme/ Toolbelt: ‣ Terminal application • Demo uses iTerm2 with oh-my-zsh shell ‣ Local development environment with Git and WP-CLI • Demo uses Lando (developed by Tandem)
  17. 17. @rachwhitton 17 Updating Themes Functionality should persist after updating themes
  18. 18. QUESTIONS?
  19. 19. THANK YOU!

×