wordpress plugin development

Post on 17-May-2015

370 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

My presentation for WordCampNL 2012 in English.

TRANSCRIPT

WordPress Plugin DevelopmentWordCamp NL

03/24/2012

Luc De Brouwer

• lucdebrouwer.nl

• hello@lucdebrouwer.nl

• linkedin.com/in/lucdebrouwer

• twitter.com/ldebrouwer

Webdeveloper who loves WordPress, Magento, PHP, MySQL, HTML, CSS, jQuery, good food and Nine Inch Nails.

Developing for WordPress is awesome!

The basics

Always start with the read me /documentation!

Pair with others( Designers, developers, translators, ux specialists, etc. )

Turn debugging onYour users will thank you for it.

Tip: Use Debug Bar and Debug Bar Console. It’s like Firebug for WordPress!

The nitty-grittya.k.a. the fun stuff

Standard plugin information

Time to get hooked!

Set some actions

Possible hooks

Filter functionshas_filter()add_filter()apply_filters()current_filter()merge_filters()remove_filter()remove_all_filters()

Action functionshas_action() add_action() do_action() do_action_ref_array() did_action() remove_action() remove_all_actions()

And some more..Hooks for installation, activation, deactivation etc.

Set up your functions

Magic!

Do not reinvent the wheel!WordPress has an API for almost anything. Built-in will most likely run better than bolted-on.

Storing preferencesYou’ve got plenty of options!

add_option( ‘WordCampNL’, ‘FTW’ );get_option( ‘WordCampNL’);

update_option( ‘WordCampNL’, ’#WCNL12 is awesome’ );

But of course you can usecustom tables tables too!

There’s an API for that!Making HTTP requests, performing filesystem tasks, unzipping files, etc..

Namespace your stuff to avoid f*ck ups

Give your classes and functions a clear prefix

Security!Validate input, check user rights. We don’t any CSRF, XSS attacks etc.

The Codex is your friendhttp://codex.wordpress.org/

Publish your plugin to theWordPress plugin repository

Free feedback and a bigger platform for your work!

Afterwards

Set up a support plan!Will you give support? If so, when? Will you offer paid support?

Keep everything up-to-dateCheck if it works with every WordPress update etc.

Embrace forks and feedbackOpen source matters!

Consult the codeBy reading the core I learned more in 2 hours then I could have learned in a 2 day course.

Thank you for your attention!

Questions?

Want to contact me or ask questions?

• lucdebrouwer.nl

• hello@lucdebrouwer.nl

• linkedin.com/in/lucdebrouwer

• twitter.com/ldebrouwer

top related