As most WordPress users know, plugins can be used to enhance WordPress sites in many ways. Unfortunately, they can also easily break your work. From javascript errors to buggy updates, from slow-performing code to stylesheet conflicts, this talk aims to help users identify and troubleshoot problems with plugins as they work on their creations.
2. @ylefebvre
ylefebvre.ca
Plugins: A Double-Edged Sword
● About me
● The power of plugins
● The wild nature of plugins
● Site-building strategies
● Troubleshooting plugin issues
● Handling problematic updates
● Avoiding bad plugin breakups
● Conclusions
4. @ylefebvre
ylefebvre.ca
The Power of Plugins
● Custom code modules that can be
downloaded and added to WordPress
● Can change almost any aspect of
WordPress
– Add extra content / new functionality
– Modify / enhance default behavior
– Simplify complex tasks
5. @ylefebvre
ylefebvre.ca
The Power of Plugins
● Allow integrators to create custom content
without modifying core
● Large developer community
● More than 25 000 plugins available, plus
premium plugins!
6. @ylefebvre
ylefebvre.ca
The Wild Nature of Plugins
● Only available on self-hosted installs
● No enforced coding standard
● Difficult to assess performance and quality
● No code reviews
● No easy way to identify bad updates
● Difficult to predict interaction with site and
other plugins
11. @ylefebvre
ylefebvre.ca
Troubleshooting plugin issues
● Deactivate the last plugin installed
● Deactivate all other plugins and bring back
one at a time to identify source of conflict
● Visit the official plugin page
– Installation procedure
– FAQ
– Support Forum
● Contact the plugin author
14. @ylefebvre
ylefebvre.ca
TROUBLESHOOTING Styling issues
● Theme can be modified
– Users don't always know full impact of changes
● Plugin stylesheet can be modified
– Avoid changing plugin files (Plugin updates
override file changes)
– Backup files if no other option
– Some plugins have stylesheet editors
– The !important CSS keyword is very useful
15. @ylefebvre
ylefebvre.ca
Troubleshooting jQuery issues
● Most animated / dynamic site elements
today are powered by jQuery
● jQuery conflicts can easily occur when a
theme and one or more plugins are mixed
● A conflict usually breaks all jQuery elements
on a site
17. @ylefebvre
ylefebvre.ca
TYPICAL JQUERY ISSUES
● More than one copy of jQuery.js is loaded
– Verify in page source code
– Each additional copy wipes out previous work
● An incompatible version of jQuery is loaded
– E.g. Google API version loaded for speed boost
18. @ylefebvre
ylefebvre.ca
TYPICAL JQUERY ISSUES
● Multiple versions of javascript/jQuery
library are loaded by different plugins
● Theme or plugin jQuery code uses
unavailable jQuery shorthand
– All jQuery calls should use jQuery long-form
instead of $ or re-create the shorthand
themselves
20. @ylefebvre
ylefebvre.ca
Troubleshooting upload issues
● Lack of permissions
– Increase write permissions on upload folder
● Exceeding server maximum upload file size
– Not controlled by WordPress
– Set in server php.ini file (default often 8 MB)
– Plugins can display current settings (e.g.
WordPress phpinfo)
– See with hosting company to change settings
35. @ylefebvre
ylefebvre.ca
FIND previous PLUGIN versions
● Once you have the previous version
– Upload to your server via FTP
– Stop updating until you see a message
indicating that the issue has been resolved
36. @ylefebvre
ylefebvre.ca
Avoiding bad plugin breakups
● User-triggered breakup
– Better solution available
– Extra functionality no longer required
● Plugin-triggered breakup
– Plugin converted to paid model
– End of development life
– Lack of support for new versions
37. @ylefebvre
ylefebvre.ca
Avoiding bad plugin breakups
● Many plugins store user information to the
database to provide additional capabilities
– Custom fields
– Custom post types
– Custom tables
● Not all developers consider what will happen
if users decide to stop using their plugin
38. @ylefebvre
ylefebvre.ca
Avoiding bad plugin breakups
● Before deploying plugins, analyze the
effects of deactivation to prepare for
eventual breakup
– Clean removal
– Ease or difficulty of accessing custom data
– Core data modifications
– Broken site
39. @ylefebvre
ylefebvre.ca
Conclusions
● Plugins are amazing tools that can greatly
enhance your site
● Plugins are potential liabilities that can break
your site
● When used with caution, plugins bring
limitless possibilities to web site creation
41. @ylefebvre
ylefebvre.ca
Recommended Readings
● Learn about plugin development
– WordPress Plugin Development
Cookbook by Yannick Lefebvre,
published by Packt Publishing
(packtpub.com)
– Use code WCMONTREAL13 to get 75%
off ebook on packtpub.com (until Aug 1)
● Find help when you run into issues
– WordPress Support Forum
(wordpress.org/support)
● Today's presentation available at:
– http://yannickcorner.nayanna.biz/wcmtl2013
42. @ylefebvre
ylefebvre.ca
Thank you for attending this talk
on Plugins
Questions?
Presentation: http://yannickcorner.nayanna.biz/wcmtl2013
ylefebvre@gmail.com
profiles.wordpress.org/users/jackdewey
Use code
WCMONTREAL13
to get 75 off%
WordPress Plugin
Development
Cookbook ebook
on packtpub.com
(until Aug 1)