playing nicely with
other plugins
being a good citizen in the plugin development world
Pippin Williamson
@pippinsplugins
h...
some goals
we want to write
plugins that work
even in environments “polluted” by other plugins
we want to avoid
support tickets
“your plugin broke when I installed this other plugin”
we want to be nice to
other developers
*or we should want to be nice*
we want to be liked by
other developers
no one likes it when other developers break their plugins
let’s try to avoid being...
we want to create a
cohesive environment
plugins running nicely with other plugins is awesome
we want to be good
citizens
don’t be that person
“ain’t my problem!”
it is always our
problem
a problem for the users is a problem for the developer
we help others by
helping ourselves
eliminating a conflict with plugin Y prevents
X support tickets for both parties
tips
never assume a clean
environment
test on sites with dozens or hundreds of plugins installed
use classes and IDs in
your CSS
form input { display: none; }
that’s just not nice
be careful when
filtering content
the the_content filter is awesome
and oh so dangerous
check if libraries are
loaded
loading Stripe’s API twice isn’t pretty
don’t take over all the
queries!
pre_get_posts is the key master
it can break everything
don’t arbitrarily change
actions or filters
backwards compatibility matters
don’t break your extensions and/or themes
be careful with form
submissions
always use input names or nonces to detect your own
form submissions
notices can break ajax
requests
be a good citizen and use isset() and empty()
for the love of all that is
holy
never load your own jQuery
or other scripts included in WP core
pippinsplugins.com/why-lo...
conditionally load JS
conditionally load CSS
be careful with post
type names
“book” may not be the best option, but “product” might
be careful with option
names and meta_keys
having settings conflict between two plugins is no fun
be careful with list
table column names
naming a column “user” can easily be overwritten in
another plugin with one called...
- -
————
encourage others to be
good citizens
reward developers for finding conflicts
be courteous when developers report conflicts
encourage others to be
good citizens
do not always assume YOU are right
every developer screws up
encourage others to be
good citizens
take the high road and be willing to help resolve issues
even if they aren’t in your ...
be nice
find a conflict, report it appropriately
never black list a plugin immediately
be nice
find a security flaw, report it confidentially
don’t yell and scream how plugin X is insecure
treat others how you
wish to be treated
it was true before code and it is still true with code
ask me anything
seriously, anything
Upcoming SlideShare
Loading in …5
×

Playing nicely-with-other-plugins

1,105 views

Published on

Published in: Technology, Art & Photos
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,105
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Playing nicely-with-other-plugins

  1. 1. playing nicely with other plugins being a good citizen in the plugin development world Pippin Williamson @pippinsplugins http://pippinsplugins.com
  2. 2. some goals
  3. 3. we want to write plugins that work even in environments “polluted” by other plugins
  4. 4. we want to avoid support tickets “your plugin broke when I installed this other plugin”
  5. 5. we want to be nice to other developers *or we should want to be nice*
  6. 6. we want to be liked by other developers no one likes it when other developers break their plugins let’s try to avoid being the ones responsible
  7. 7. we want to create a cohesive environment plugins running nicely with other plugins is awesome
  8. 8. we want to be good citizens
  9. 9. don’t be that person “ain’t my problem!”
  10. 10. it is always our problem a problem for the users is a problem for the developer
  11. 11. we help others by helping ourselves eliminating a conflict with plugin Y prevents X support tickets for both parties
  12. 12. tips
  13. 13. never assume a clean environment test on sites with dozens or hundreds of plugins installed
  14. 14. use classes and IDs in your CSS form input { display: none; } that’s just not nice
  15. 15. be careful when filtering content the the_content filter is awesome and oh so dangerous
  16. 16. check if libraries are loaded loading Stripe’s API twice isn’t pretty
  17. 17. don’t take over all the queries! pre_get_posts is the key master it can break everything
  18. 18. don’t arbitrarily change actions or filters backwards compatibility matters don’t break your extensions and/or themes
  19. 19. be careful with form submissions always use input names or nonces to detect your own form submissions
  20. 20. notices can break ajax requests be a good citizen and use isset() and empty()
  21. 21. for the love of all that is holy never load your own jQuery or other scripts included in WP core pippinsplugins.com/why-loading
  22. 22. conditionally load JS
  23. 23. conditionally load CSS
  24. 24. be careful with post type names “book” may not be the best option, but “product” might
  25. 25. be careful with option names and meta_keys having settings conflict between two plugins is no fun
  26. 26. be careful with list table column names naming a column “user” can easily be overwritten in another plugin with one called “user”
  27. 27. - - ————
  28. 28. encourage others to be good citizens reward developers for finding conflicts be courteous when developers report conflicts
  29. 29. encourage others to be good citizens do not always assume YOU are right every developer screws up
  30. 30. 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
  31. 31. be nice find a conflict, report it appropriately never black list a plugin immediately
  32. 32. be nice find a security flaw, report it confidentially don’t yell and scream how plugin X is insecure
  33. 33. treat others how you wish to be treated it was true before code and it is still true with code
  34. 34. ask me anything seriously, anything

×