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

Surgeon's Guide to Plugin Development

Andy Fragen
September 27, 2015

Surgeon's Guide to Plugin Development

WordCamp Los Angeles 2015

Andy Fragen

September 27, 2015
Tweet

More Decks by Andy Fragen

Other Decks in Technology

Transcript

  1. Triage Requirements in Mass
    Casualty Scenarios

    View full-size slide

  2. A Surgeon's Guide to Plugin
    Development

    View full-size slide

  3. Surgical Aphorisms
    ❖ KISS - Keep It Simple (Stupid)
    ❖ The enemy of good is better
    ❖ Should you really do that?
    ❖ Learn from others
    ❖ You are "captain of the ship"

    View full-size slide

  4. Keep It Simple

    View full-size slide

  5. The Enemy of Good Is Better

    View full-size slide

  6. Just Because You CAN Do
    Something; Doesn't Mean You
    SHOULD You Do Something?

    View full-size slide

  7. Learn the Good and the Bad

    View full-size slide

  8. Captain of the Ship
    Decisions, not options
    Single purpose
    Simple, simple, simple
    Scratch your own itch

    View full-size slide

  9. Tools of the Trade
    DesktopServer
    PHPStorm
    GitHub, Bitbucket, GitLab, etc.
    Tower - towerapp.com
    Google, GitHub, WordPress forums

    View full-size slide

  10. Scratching Your Own Itch
    ❖ What problem do I want to solve?
    ❖ Does a solution already exist?
    ❖ Do current solutions work for you?
    ❖ DIY

    View full-size slide

  11. Plugin Development
    ❖ Identify scope of project
    ❖ Start coding, preference to OOP
    ❖ Ask questions
    ❖ Constantly lookup and learn
    ❖ Core is your best reference

    View full-size slide

  12. Core is your friend
    ❖ Transients API
    ❖ Settings API
    ❖ add_action()/do_action()
    ❖ add_filter()/apply_filters()

    View full-size slide

  13. WordPress.org Plugin Repo
    ❖ The Events Calendar Category Colors
    ❖ The Events Calendar PRO Alarm
    ❖ The Events Calendar User CSS
    ❖ The Events Calendar Outlook Import Fix
    ❖ Add Custom Header Images

    View full-size slide

  14. My Goals for GitHub Updater
    ❖ Simple barrier to entry
    ❖ Work within core as much possible
    ❖ Update both plugins and themes

    View full-size slide

  15. Plugin Requirements for GitHub Updater
    /*

    Plugin Name: GitHub Updater

    Plugin URI: https://github.com/afragen/github-updater

    Description: A plugin to automatically update GitHub, Bitbucket or
    GitLab hosted plugins and themes. It also allows for remote installation
    of plugins or themes into WordPress.
    Version: 1.0.0

    Author: Andy Fragen

    License: GNU General Public License v2

    License URI: http://www.gnu.org/licenses/gpl-2.0.html

    Domain Path: /languages

    Text Domain: github-updater

    GitHub Plugin URI: https://github.com/afragen/github-updater

    GitHub Branch: master

    */


    View full-size slide

  16. Current State of GitHub Updater
    ❖ Seamless updates for plugins and themes
    ❖ Works in single or multisite
    ❖ Works with GitHub, Bitbucket, and GitLab
    ❖ Works with public and private repositories
    ❖ Changelogs, readme.txt, view details, ratings, etc.
    ❖ Rollback for themes
    ❖ Settings page
    ❖ Allows for remote installation of plugins or themes
    ❖ Branch switching/re-installation for plugins/themes
    ❖ Integrates with iThemes Sync and InfiniteWP

    View full-size slide

  17. https://github.com/afragen/github-updater

    View full-size slide

  18. There's no such thing as a minor
    surgery; only minor surgeons.

    View full-size slide

  19. http://wclax.reviews/

    View full-size slide

  20. WhoAmI
    ❖ http://thefragens.com
    ❖ @andyfragen - Twitter
    ❖ https://github.com/afragen
    ❖ Day job, trauma/acute care surgeon
    ❖ Chief of Staff, Desert Regional Medical Center, Palm Springs, CA
    ❖ WordCamp sponsor and now speaker

    View full-size slide