updating wordpress themes, plugins, and core safely

38
HOW TO UPDATE WORDPRESS SAFELY BOULDER WP MEETUP @ASKWPGIRL NOVEMBER 2, 2015

Upload: angela-bowman

Post on 16-Feb-2017

2.133 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Updating WordPress Themes, Plugins, and Core Safely

HOW TO UPDATE WORDPRESS SAFELY

BOULDER WP MEETUP

@ASKWPGIRL NOVEMBER 2, 2015

Page 2: Updating WordPress Themes, Plugins, and Core Safely

WHEN TO UPDATE

Page 3: Updating WordPress Themes, Plugins, and Core Safely

ALL THE TIME!

HOW OFTEN DO YOU NEED TO UPDATE

• The longer you wait to update, the harder it will be.

• Updates can be critical for security.

• Updates can be critical for functionality (e.g. to work with latest WordPress version)

• Read changelogs for important notes, like if major functionality changes requiring you to update template files or styles.

Page 4: Updating WordPress Themes, Plugins, and Core Safely

MANAGE SITES

• Use tool to manage multiple sites, otherwise, updates are too time consuming:

• Jetpack

• iControlWP*

• InfiniteWP

• MainWP

• ManageWP

• With site management, you can update ALL plugins across ALL sites quickly! Good for patches, which majority of updates are.

Page 5: Updating WordPress Themes, Plugins, and Core Safely

CREATING STAGING ENVIRONMENT

Page 6: Updating WordPress Themes, Plugins, and Core Safely

USING DESKTOPSERVER - $99.95

CREATE A STAGING SITE LOCALLY

• Backup using BackupBuddy, BackWPUp, or Duplicator plugin

• Choose Zip archive with DesktopServer Pro. Done!

Page 7: Updating WordPress Themes, Plugins, and Core Safely

USING WP STAGING PLUGIN - $0

CREATE A STAGING SITE IN SUBFOLDER

• Works on non-managed, shared hosting accounts.

Page 8: Updating WordPress Themes, Plugins, and Core Safely

USING MANAGED WORDPRESS HOSTING

CREATE A STAGING SITE

• WP Engine, Get Flywheel, and SiteGround provide one-click staging environments.

https://www.siteground.com/tutorials/staging/create-staging.htm

Page 9: Updating WordPress Themes, Plugins, and Core Safely

USING WP STAGECOACH - $4/MONTH/SITE

CREATE A STAGING SITE REMOTELY

• https://wpstagecoach.com/

• Create a staging copy of your live site with one click.

• Copy changes from your staging site back to your live site.

• Choose which changes to import. You can import some or all of your file changes, and/or your database changes.

Page 10: Updating WordPress Themes, Plugins, and Core Safely

BACKING UP SITE

Page 11: Updating WordPress Themes, Plugins, and Core Safely

BACKUP VIA PLUGIN

• BackWPUp - Free plugin, lots of options for scheduling and sending to remote location.

• Duplicator - Pro version can be used for scheduling backups. Free version for duplicating the site quickly. Great for migrations.

• BackupBuddy - Paid plugin. Great for scheduling and migrations.

• UpDraftPlus - Similar to BackWPUp - paid remote backups.

• Not all hosts will work well - might need to enable alternate cron in wp-config.php file: http://ithemes.com/codex/page/BackupBuddy:_Frequent_Support_Issues#HTTP_Loopback_Connections_Disabled

• Keep backups reasonable size! Exclude large files and uploads folders.

Page 12: Updating WordPress Themes, Plugins, and Core Safely

BACKUP VIA SERVICE

• Can be more reliable because not relying on PHP to run.

• WorpDrive - my personal favorite. Great pricing. Has test restores, so you can be sure your backups really are working!

• VaultPress - great option by Automattic.

Page 13: Updating WordPress Themes, Plugins, and Core Safely

UPDATING PLUGINS

Page 14: Updating WordPress Themes, Plugins, and Core Safely

ORDER OF OPERATIONS

UPDATE STRATEGIES

1. Update plugins first. Replace old plugins.

2. Update theme.

3. Update WordPress core.

4. If okay on staging, can do the same on live or deploy staging files to live (depending on staging environment).

• Can do patch (bug fix updates) live.

• Good to have backup just in case.

• Have FTP/SFTP/shell and cPanel access handy.

Page 15: Updating WordPress Themes, Plugins, and Core Safely

PATCHES, UPDATES, UPGRADES

UNDERSTANDING SOFTWARE VERSIONING

• Sequence-based identifiers are used to convey the significance of changes between releases

• 4.3 to 4.3.1 - typically bug patch, fix - just do it!

• 4.3.1 to 4.4 - usually update to functionality - read changelog

• 4.4 to 5.0 - is major change to software - test thoroughly

• Read change logs: http://wordpress.org/plugins - find your plugin. Click Changelog tab.

Page 16: Updating WordPress Themes, Plugins, and Core Safely

JUST UPDATE THESE - DON’T WORRY, BE HAPPY!

EXAMPLE PATCHES

Page 17: Updating WordPress Themes, Plugins, and Core Safely

CHECK CHANGELOG

EXAMPLE UPDATES

• Beware the COMPLETE CODE CLEANUP. This will break your site.

Page 18: Updating WordPress Themes, Plugins, and Core Safely

READ CHANGELOG

NEW FEATURES = MANY FIXES

• Example of WooCommerce 2.4 release followed by immediate patch fixes.

• Update to new version IF you need a new feature.

• Okay to wait a short while for immediate bug fixes.

• Always update if security patch!

• Always do the patches!

Page 19: Updating WordPress Themes, Plugins, and Core Safely

USE LICENSE KEYS

UPDATING PREMIUM PLUGINS

• Always enter license key for premium plugins.

• Purchase premium plugins even if bundled with theme. Theme developers may be slow to update their bundled plugins.

Page 20: Updating WordPress Themes, Plugins, and Core Safely

CHOOSING PLUGINS

• Use the least number of plugins you need.

• Use the more popular plugins.

• Pay for plugins! Plugins with Pro option will have better longevity.

• Donate to your free plugin developer.

• Use plugins by developers with good reputation and previous experience.

• Check support tab.

• Don’t use old plugins!!!!

Page 21: Updating WordPress Themes, Plugins, and Core Safely

PLUGIN TEMPLATE/STYLE UPDATES

• If plugin uses customizable templates (e.g. WooCommerce, NextGEN Gallery, The Events Calendar), compare child theme templates to update plugin templates.

• Plugin may have moved, deleted, or renamed the stylesheets and templates you have mirrored in your child theme.

Page 22: Updating WordPress Themes, Plugins, and Core Safely

UPDATING THEMES

Page 23: Updating WordPress Themes, Plugins, and Core Safely

BEST PRACTICES

UPDATING THEMES

• Use Child Theme - https://codex.wordpress.org/Child_Themes

• If no child, use Jetpack’s Custom CSS module to make style changes

• Read changelog to see if major update or just patch

• Compare modified child theme files to parent theme after update

• Export theme options if possible before updating

• Note: If a theme name changes, all options will be reset to default

• Some updates are BIG and require recreating parts of the site - time these for site redesign

Page 24: Updating WordPress Themes, Plugins, and Core Safely

ENTER LICENSE KEY

PREMIUM THEMES

• If Envato theme or plugin doesn’t have license area, install the Envato WordPress Toolkit plugin and enter your user name and API key.

Page 25: Updating WordPress Themes, Plugins, and Core Safely

DOWNLOAD/UPLOAD

MANUALLY UPDATING PARENT THEME

• If no way to auto update theme, then download latest version from developer

• Download a copy of your current theme for backup

• Upload the new version of the theme to the theme’s folder

• Be sure to OVERWRITE the older theme — don’t have two copies

Page 26: Updating WordPress Themes, Plugins, and Core Safely

CHANGES TO NOTE

• Updated theme may use new shortcodes.

• Updated theme may use new HTML, so you’ll need to update your stylesheet selectors.

• Updated theme may have changed location of template files, so you’ll need to make sure to match your child theme files to the parent.

• Update theme may have new theme options.

Page 27: Updating WordPress Themes, Plugins, and Core Safely

UPDATING WP CORE

Page 28: Updating WordPress Themes, Plugins, and Core Safely

JUST DO IT!

UPDATING WORDPRESS

• Do all patch/security updates immediately - no need for staging, e.g. 4.3 to 4.3.1.

• Major version numbers - okay to wait a little bit, e.g. 4.3 to 4.4, to be sure your plugins have been updated for it.

• Test major version updates in staging to be sure plugins and themes play well.

Page 29: Updating WordPress Themes, Plugins, and Core Safely

IF UPDATE FAILS OR CAN’T UPDATE

• Download core files from WordPress.org.

• Unzip archive.

• Copy all files over EXCEPT wp-content folder. Replace whatever is existing.

Page 30: Updating WordPress Themes, Plugins, and Core Safely

UPGRADING DATABASE TABLES

• After major WP update, you will likely need to visit your site’s Dashboard and will be prompted to update the database tables.

Page 31: Updating WordPress Themes, Plugins, and Core Safely

TROUBLE-SHOOTING

Page 32: Updating WordPress Themes, Plugins, and Core Safely

101

WHAT IS TROUBLESHOOTING?

• Identify variables

• Eliminate variables

• Variables include:

• Hosting - MySQL and PHP versions (and Apache)

• Themes and plugins

• WordPress core

• Modifications made to your child theme

• Cache

Page 33: Updating WordPress Themes, Plugins, and Core Safely

YIKES!

TROUBLESHOOTING PLUGIN UPDATES

• If white screen of death, rename plugins folder to plugins-old

• Login to Dashboard and go to plugins page - all plugins will show as de-activated

• Rename plugins folder back to plugins

• Activate plugins one at a time

• See if issue is repeatable using TwentyFifteen theme

Page 34: Updating WordPress Themes, Plugins, and Core Safely

REINSTALLING SUBVERSION

• Find plugin on wordpress.org > click Developers tab

• Download previous version

• De-activate and delete the broken version on your site

• Upload and activate the old, working version

• NOT a long-term solution!

Page 35: Updating WordPress Themes, Plugins, and Core Safely

GENERAL TROUBLESHOOTING

• Edit your wp-config.php file in the public_html (or WordPress install directory) and change the line define(‘WP_DEBUG’, false); to define(‘WP_DEBUG’, true);

• Install Query Monitor plugin to check for PHP errors as well as check environment:

Page 36: Updating WordPress Themes, Plugins, and Core Safely

HTTPS://WORDPRESS.ORG/ABOUT/REQUIREMENTS/

WORDPRESS REQUIREMENTS

• WordPress recommend your host supports:

• PHP version 5.6 or greater - may need to update PHP

• MySQL version 5.5 or greater - may need to update DB

• Apache or Nginx are most robust and feature-rich server environment

• WordPress works with PHP 5.2.4+ and MySQL 5.0+, but some plugins might not.

• Time for a new host?

Page 37: Updating WordPress Themes, Plugins, and Core Safely

CLEAR YOUR CACHE

• Clear your WordPress cache via your plugin settings

• Clear your server cache at web host (WP Engine, SiteGround, etc.)

• Clear your Cloudflare cache

• Clear your browser cache

Page 38: Updating WordPress Themes, Plugins, and Core Safely

RESOURCES

• http://askwpgirl.com/updating-wordpress-plugins-themes-core/

• https://codex.wordpress.org/Updating_WordPress

• Sign up at wordpress.org to always get the latest news from WP

• Sign up for sucuri.net emails to get latest security news

• Submit your site to Google Search Console: http://askwpgirl.com/submitting-wordpress-site-google-webmaster-tools/

• Optimize your database: http://askwpgirl.com/optimize-wordpress-mysql-database/

@askwpgirl - http://askwpgirl.com Angela Bowman, Boulder, CO