Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

So You Want to Build and Release a Plugin? WordCamp Lancaster 2014

945 views

Published on

My talk from WordCamp Lancaster 2014. Things to implement when preparing a plugin for public release.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

So You Want to Build and Release a Plugin? WordCamp Lancaster 2014

  1. 1. SO YOU WANT TO BUILD AND RELEASE A PLUGIN… Ryan Duff WordCamp Lancaster 2014
  2. 2. ABOUT ME • Long time WordPress user • Plugin Developer • Meetup Organizer
  3. 3. A BIT OF PLUGIN HISTORY
  4. 4. my-hacks.php
  5. 5. VERSION 1.2 (May 22, 2004)
  6. 6. Plugin API
  7. 7. THINGS TO CONSIDER
  8. 8. YOUR CODE
  9. 9. FILTERS
  10. 10. apply_filters( $tag, $value, $var ... ) http://codex.wordpress.org/Function_Reference/apply_filters
  11. 11. EXAMPLE $query_args = array( 'post_type' => 'books', 'posts_per_page' => 5, 'author' => 3 ); $books = new WP_Query( apply_filters( 'wclanc_books_query', $query_args ) );
  12. 12. ACTIONS
  13. 13. do_action( $tag, $arg_a, $arg_b, $etc ); http://codex.wordpress.org/Function_Reference/do_action
  14. 14. EXAMPLE do_action( 'wclanc_books_before' ); echo '<div class="wclanc_books">'; while( $books->have_posts() ) : $books->the_post() echo '<div class="wclanc_book">'; do_action( 'wclanc_before_book_title', get_the_ID() ); echo '<h3 class="wclanc_book_title">' . get_the_title() . '</h3>'; do_action( 'wclanc_after_book_title', get_the_ID() ); echo '</div>'; endwhile; echo '</div>'; do_action( 'wclanc_books_after' );
  15. 15. INTERNATIONALIZATION
  16. 16. EXAMPLE /* * Plugin Name: i18n Test * Author: Ryan Duff * Text Domain: wclanc-i18n */ $text = __( ‘This is a test', ‘wclanc-i18n' ); _e( ‘This test will echo', ‘wclanc-i18n' ); https://codex.wordpress.org/I18n_for_WordPress_Developers
  17. 17. PLUGIN SETTINGS http://themeoptions.wordpress.com/
  18. 18. OTHER CONSIDERATIONS • Code style • Documentation • Errors
  19. 19. PLUGIN LICENSE
  20. 20. COMMON LICENSES • GPL v2/v3 • MIT (X11) • Apache License v2 • WTFPL v2 1) http://wordpress.org/plugins/about/ 2) http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
  21. 21. PLUGIN HOSTING
  22. 22. • WordPress.org • GitHub • Both?
  23. 23. QUESTIONS?
  24. 24. RYAN DUFF RYAN@FUSIONIZED.COM @RYANCDUFF

×