34
playing nicely with other plugins being a good citizen in the plugin development world Pippin Williamson @pippinsplugins http://pippinsplugins.com

Playing nicely-with-other-plugins

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Playing nicely-with-other-plugins

playing nicely with other plugins

being a good citizen in the plugin development world

Pippin Williamson@pippinsplugins

http://pippinsplugins.com

Page 2: Playing nicely-with-other-plugins

some goals

Page 3: Playing nicely-with-other-plugins

we want to write plugins that work

even in environments “polluted” by other plugins

Page 4: Playing nicely-with-other-plugins

we want to avoid support tickets

“your plugin broke when I installed this other plugin”

Page 5: Playing nicely-with-other-plugins

we want to be nice to other developers

*or we should want to be nice*

Page 6: Playing nicely-with-other-plugins

we want to be liked by other developersno one likes it when other developers break their

plugins

let’s try to avoid being the ones responsible

Page 7: Playing nicely-with-other-plugins

we want to create a cohesive

environmentplugins running nicely with other plugins is

awesome

Page 8: Playing nicely-with-other-plugins

we want to be good citizens

Page 9: Playing nicely-with-other-plugins

don’t be that person“ain’t my problem!”

Page 10: Playing nicely-with-other-plugins

it is always our problem

a problem for the users is a problem for the developer

Page 11: Playing nicely-with-other-plugins

we help others by helping ourselveseliminating a conflict with plugin Y prevents

X support tickets for both parties

Page 12: Playing nicely-with-other-plugins

tips

Page 13: Playing nicely-with-other-plugins

never assume a clean environmenttest on sites with dozens or hundreds of plugins

installed

Page 14: Playing nicely-with-other-plugins

use classes and IDs in your CSSform input { display: none; }

that’s just not nice

Page 15: Playing nicely-with-other-plugins

be careful when filtering content

the the_content filter is awesome

and oh so dangerous

Page 16: Playing nicely-with-other-plugins

check if libraries are loaded

loading Stripe’s API twice isn’t pretty

Page 17: Playing nicely-with-other-plugins

don’t take over all the queries!

pre_get_posts is the key master

it can break everything

Page 18: Playing nicely-with-other-plugins

don’t arbitrarily change actions or

filtersbackwards compatibility matters

don’t break your extensions and/or themes

Page 19: Playing nicely-with-other-plugins

be careful with form submissions

always use input names or nonces to detect your own form submissions

Page 20: Playing nicely-with-other-plugins

notices can break ajax requests

be a good citizen and use isset() and empty()

Page 21: Playing nicely-with-other-plugins

for the love of all that is holynever load your own jQuery

or other scripts included in WP core

pippinsplugins.com/why-loading

Page 22: Playing nicely-with-other-plugins

conditionally load JS

Page 23: Playing nicely-with-other-plugins

conditionally load CSS

Page 24: Playing nicely-with-other-plugins

be careful with post type names

“book” may not be the best option, but “product” might

Page 25: Playing nicely-with-other-plugins

be careful with option names and

meta_keyshaving settings conflict between two plugins is no

fun

Page 26: Playing nicely-with-other-plugins

be careful with list table column namesnaming a column “user” can easily be overwritten

in another plugin with one called “user”

Page 27: Playing nicely-with-other-plugins

- -————

Page 28: Playing nicely-with-other-plugins

encourage others to be good citizensreward developers for finding conflicts

be courteous when developers report conflicts

Page 29: Playing nicely-with-other-plugins

encourage others to be good citizens

do not always assume YOU are right

every developer screws up

Page 30: Playing nicely-with-other-plugins

encourage others to be good citizens

take the high road and be willing to help resolve issues

even if they aren’t in your code

Page 31: Playing nicely-with-other-plugins

be nicefind a conflict, report it appropriately

never black list a plugin immediately

Page 32: Playing nicely-with-other-plugins

be nicefind a security flaw, report it confidentially

don’t yell and scream how plugin X is insecure

Page 33: Playing nicely-with-other-plugins

treat others how you wish to be

treatedit was true before code and it is still true with code

Page 34: Playing nicely-with-other-plugins

ask me anythingseriously, anything