$30 off During Our Annual Pro Sale. View Details »

Publishing a Plugin on WordPress.org

Publishing a Plugin on WordPress.org

How do you get a plugin onto the WordPress.org repository? What steps do you need to take? Are there any specific requirements? These are just some of the questions this talk, aimed at anyone who wants to push a plugin to the WordPress.org repository will answer. We will go through the steps you need to take in order to prepare your plugin, some best practices in the plugin code and how to submit it to .org.

Mark Wilkinson

April 14, 2016
Tweet

More Decks by Mark Wilkinson

Other Decks in Technology

Transcript

  1. PUBLISHING A
    PLUGIN
    on wordpress.org
    Mark Wilkinson | markwilkinson.me | @wpmark
    highrise.digital

    View Slide

  2. Mark Wilkinson
    Developer & Co-founder at Highrise Digital
    https://highrise.digital
    https://markwilkinson.me
    Twitter: @wpmark

    View Slide

  3. WHY?
    PREPARATION
    SUBMISSION
    AFTERCARE

    View Slide

  4. WHY?
    PREPARATION
    SUBMISSION
    AFTERCARE

    View Slide

  5. WHY?
    PREPARATION
    SUBMISSION
    AFTERCARE

    View Slide

  6. WHY?
    PREPARATION
    SUBMISSION
    AFTERCARE

    View Slide

  7. View Slide

  8. ASSUMPTIONS

    View Slide

  9. WHY?

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. DEVELOPER
    DEVELOPMENT

    View Slide

  15. UPDATES

    View Slide

  16. “You’re brave!”

    View Slide

  17. DEVELOPMENT
    WHERE WILL IT HAPPEN?

    View Slide

  18. Coding Standards
    https://make.wordpress.org/core/handbook/best-practices/coding-standards/
    https://upload.wikimedia.org/wikipedia/commons/1/1a/Code.jpg

    View Slide

  19. EXTENSIBILITY
    do_action() / apply_filters()
    wordpress.tv/2014/08/29/mark-wilkinson-easy-extensible-plugins/

    View Slide

  20. SANITIZE & VALIDATE
    wp_kses( $string, $allowed_html, $allowed_protocols )
    esc_html( $text ) / esc_url( $url ) / esc_attr( $attr )
    $wpdb->insert( $table, (array) $data )

    View Slide

  21. EXAMPLE

    View Slide

  22. EXAMPLE

    $title = sanitize_text_field( $_POST[ ‘title’ ] );
    update_post_meta( $post_id, ‘my_title’, $title );

    View Slide

  23. EXAMPLE

    $title = sanitize_text_field( $_POST[ ‘title’ ] );
    update_post_meta( $post_id, ‘my_title’, $title );
    $title = get_post_meta( $post->ID, ‘my_title’, true );

    View Slide

  24. define( 'WP_DEBUG', true );

    View Slide

  25. https://www.flickr.com/photos/lendingmemo/11702409583

    View Slide

  26. assets/icon-128x128.(png|jpg)

    View Slide

  27. assets/icon-128x128.(png|jpg)
    assets/banner-772x250.(jpg|png)

    View Slide

  28. assets/banner-772x250.(jpg|png)
    assets/icon-128x128.(png|jpg)
    assets/screenshot-1.(jpg|png)

    View Slide

  29. readme.txt
    https://wordpress.org/plugins/about/readme.txt
    https://wordpress.org/plugins/about/validator/
    Contributors: wpmarkuk, highrisedigital
    Donate link: http://markwilkinson.me/saythanks/
    Tags: users, user switching
    Requires at least: 3.1
    Tested up to: 4.4
    Stable tag: 1.0.6
    License: GPLv2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html

    View Slide

  30. View Slide

  31. SUBMIT TO .ORG

    View Slide

  32. https://wordpress.org/plugins/add/

    View Slide

  33. View Slide

  34. SVN

    View Slide

  35. svn co https://
    plugins.svn.wordpress.org/your-
    plugin-name

    View Slide

  36. assets/
    branches/
    tags/
    trunk/

    View Slide

  37. svn add trunk/*

    View Slide

  38. svn ci -m ’Commit message here'

    View Slide

  39. SUPPORT

    View Slide

  40. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  41. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  42. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  43. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  44. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  45. 1.  Must be compatible with the GNU General Public License v2, or later
    2.  Must not do anything illegal, or be morally offensive
    3.  You have to actually use the Subversion repository we give you
    4.  The plugin must not embed external links on the public site (like a
    "powered by" link) without explicitly asking the user's permission.
    5.  If you don’t specify a compatible license, what you check in is
    considered GPLv2 or later.
    6.  We also have a large list of detailed guidelines, but mostly they say how
    not to be a spammer.
    FOLLOW THE RULES

    View Slide

  46. Twitter: @wpmark
    Web: https://highrise.digital
    Email: [email protected]
    Developer & Co-founder at Highrise Digital
    Thank you
    Questions?

    View Slide