54
Joe Casabona • Web Developer. Writer. Nerd*. – *Computer, Device, Star Wars • Yankee Fan Responsive Design with WordPress – Out Dec 2013 www.rwdwp.com – Discount Code for 35% off: RWDWP site: Casabona.org | twitter: @jcasabona | email: joe @ casabona.org slides/resources: casabona.org/events/blogcon-13

NEPA BlogCon 2013 - WordPress Customization & Security

Embed Size (px)

DESCRIPTION

WordPress Customization & Security Presented By: Joe Casabona and Phil Erb Track: Technology Session Format: Co-Presentation Description: WordPress is one of the most popular blogging platforms used today and if you’re using it already, you already know its benefits – but let’s take things a step further. In this session, Joe and Phil will dive into how to customize your WordPress blog and theme so that it reflects your brand and serves up your content in the best ways possible, ways to make your WordPress blog more secure (and how to monitor it so that it stays that way!), and other techniques and technologies to make the most of this content management system.

Citation preview

Page 1: NEPA BlogCon 2013 - WordPress Customization & Security

Joe Casabona

• Web Developer. Writer. Nerd*. – *Computer, Device, Star Wars

• Yankee Fan

• Responsive Design with WordPress– Out Dec 2013– www.rwdwp.com– Discount Code for 35% off: RWDWP

site: Casabona.org | twitter: @jcasabona | email: [email protected] slides/resources: casabona.org/events/blogcon-13

Page 2: NEPA BlogCon 2013 - WordPress Customization & Security

Phil Erbhttp://philerb.comTwitter: @philerb

Systems Admin & ProgrammerUniversity of Scranton

Co-Founder & Director of TechnologySolve the Net

Lover of WordPress

Page 3: NEPA BlogCon 2013 - WordPress Customization & Security

WordPress Theme Customization

Page 4: NEPA BlogCon 2013 - WordPress Customization & Security

Themes: A Primer

• A WordPress Theme:– Provides control over the look and presentation of

the material on your website.

• The Codex!– Your best friend during development– codex.wordpress.org

Page 5: NEPA BlogCon 2013 - WordPress Customization & Security

Important Files

Tip: Don’t Modify the Core!

Page 6: NEPA BlogCon 2013 - WordPress Customization & Security

style.css

• Includes Theme Definition /*Theme Name: Millennium FlightsTheme URI: http://www.milenniumflights.comDescription: A custom theme for Millennium Flights, Inc.Version: 1.0Author: Joe CasabonaAuthor URI: http://www.casabona.orgTags: blue, white, two-column, flexible-width*/

• Keep Common Classes in mine (rwdwp.com/12)

• RWD Tip: Put all CSS in One File

Page 7: NEPA BlogCon 2013 - WordPress Customization & Security

functions.php

• Place misc PHP functions, code, and variables• Considered a “plugin” file for your theme• Remember “Separation of Concerns”– Themes should only effect display, not content or

functionality • Uses: Actions, Filters, side-wide functions• RWD Tip: Use this file for server-side

detection

Page 8: NEPA BlogCon 2013 - WordPress Customization & Security

index.php

• The backbone of WordPress themes

• Everything that doesn’t have its own template file will use index.php

• Used to display a list of posts or content.

• DO NOT remove The Loop from this page

Page 9: NEPA BlogCon 2013 - WordPress Customization & Security

header.php and footer.php

• Template Files to use throughout the theme

• get_header() and get_footer()

• wp_head() and wp_footer()

Page 10: NEPA BlogCon 2013 - WordPress Customization & Security

The WordPress Hierarchy

Page 11: NEPA BlogCon 2013 - WordPress Customization & Security

wphierarchy.com

Page 12: NEPA BlogCon 2013 - WordPress Customization & Security

Template Files

• Sophisticated Display Controls• Only required files: style.css and index.php• Custom templates down to the single post

level• Example: Custom Post Type named“classes”

single-classes.php single.php index.php

Page 13: NEPA BlogCon 2013 - WordPress Customization & Security

Page Templates

• Naming Convention– page-no-sidebar.php

<?php/*Template Name: No Sidebar*/

?>

Page 14: NEPA BlogCon 2013 - WordPress Customization & Security

The Loop

Page 15: NEPA BlogCon 2013 - WordPress Customization & Security

Defined

• The Loop is used by WordPress to display each of your posts. Using the Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within the Loop tags. Any HTML or PHP code placed in the Loop will be repeated on each post

Page 16: NEPA BlogCon 2013 - WordPress Customization & Security

Essentially…

• The Loop has functions to: – Make sure that you have posts to display– Display those posts.

<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

//print post information using template tags<?php endwhile; ?>

<?php else : ?>print “No posts found.”;

<?php endif; ?>

Page 17: NEPA BlogCon 2013 - WordPress Customization & Security

Template Tags

• Functions in WordPress designed to print information about the Current Post

• Some tags include:– the_title(), the_time(), the_content(),

the_excerpt(), the_category(), the_tags(), the_permalink()

Page 18: NEPA BlogCon 2013 - WordPress Customization & Security

If time permits…

Let’s Look at a Live Theme!

Page 19: NEPA BlogCon 2013 - WordPress Customization & Security

Securing Your WordPress Site

Page 20: NEPA BlogCon 2013 - WordPress Customization & Security

Source: Torque.io - WordPress Core is Secure – Stop Telling People Otherwise

Page 21: NEPA BlogCon 2013 - WordPress Customization & Security

Yes … but …

The code may be secure, but there are always things to improve

Page 22: NEPA BlogCon 2013 - WordPress Customization & Security

Backup ALL the Things

My hosting provider does that,why should I?

Page 23: NEPA BlogCon 2013 - WordPress Customization & Security

How do I backup WordPress?

Services– ValutPress

Plugins– BackupBuddy– BackWPUp

The good old fashioned way mysqldump -udbuser mydb > db.sql zip -r backup.zip /webfolder/ db.sql

Page 24: NEPA BlogCon 2013 - WordPress Customization & Security

Backup Best Practices

Create a backup schedule that makes sense for your site.

Get an off-site copy

Test your backups

Page 25: NEPA BlogCon 2013 - WordPress Customization & Security

Secure the Server

To the extent that you can

Page 26: NEPA BlogCon 2013 - WordPress Customization & Security

Use strong passwords

FTP, SSH, and control panels will get hackers access to your sites

Page 27: NEPA BlogCon 2013 - WordPress Customization & Security

Use SFTP instead of FTP,if possible

Page 28: NEPA BlogCon 2013 - WordPress Customization & Security

Understand file permissions

“777” makes everything work …for other people too.

Page 29: NEPA BlogCon 2013 - WordPress Customization & Security

Install an SSL certificate

Page 30: NEPA BlogCon 2013 - WordPress Customization & Security

Securing Core

Page 31: NEPA BlogCon 2013 - WordPress Customization & Security

Secure the login process

Wait, my password is sent over the Internet in plain text???

Page 32: NEPA BlogCon 2013 - WordPress Customization & Security

Don’t use “admin”

Page 33: NEPA BlogCon 2013 - WordPress Customization & Security

Stronger Authentication

Use strong passwordsForce Strong Passwords

Limit the number of bad loginsLogin Lockdown

Use multi-factor authenticationGoogle AuthetnicatorDuo Two-Factor Authentication

Page 34: NEPA BlogCon 2013 - WordPress Customization & Security

Always use SSL encryptionfor login forms and personal info

Page 35: NEPA BlogCon 2013 - WordPress Customization & Security

No SSL? Passwords are Plain Text!

Page 36: NEPA BlogCon 2013 - WordPress Customization & Security

Only give users theaccess they need

This includes YOU

Don’t always run as admin

Page 37: NEPA BlogCon 2013 - WordPress Customization & Security

Don’t let your databasebe predictable

Change the database table prefix

Page 38: NEPA BlogCon 2013 - WordPress Customization & Security

Plugins, Themes, and Updates

Page 39: NEPA BlogCon 2013 - WordPress Customization & Security

Only use trusted sources

Page 40: NEPA BlogCon 2013 - WordPress Customization & Security

DON’T Google “free WordPress themes”

Only one of these is trustworthy

Source: WPMU.org - Why You Should Never Search For Free WordPress Themes

Page 41: NEPA BlogCon 2013 - WordPress Customization & Security

Keep core, plugins, andthemes up to date

Page 42: NEPA BlogCon 2013 - WordPress Customization & Security

Security Services, Plugins & Tools

Page 43: NEPA BlogCon 2013 - WordPress Customization & Security

Security Tools

Sucuri Site scanner, monitoring, and security plugin

Better WP Security

Wordfence

Page 44: NEPA BlogCon 2013 - WordPress Customization & Security

Updates and Management

ManageWP

InfiniteWP

WP Remote

Page 45: NEPA BlogCon 2013 - WordPress Customization & Security

Use a good hosting provider!

Page 46: NEPA BlogCon 2013 - WordPress Customization & Security

Keep Yourself Secure Too!

Page 47: NEPA BlogCon 2013 - WordPress Customization & Security

If your computer is hacked,your site could be next!

Install OS and application updates

Run antivirus software

Use encrypted protocols (HTTPS, SFTP)

Use strong passwords for everything

Page 48: NEPA BlogCon 2013 - WordPress Customization & Security

Keep your ear to theWordPress community

The products and the issues are ever evolving.

Page 49: NEPA BlogCon 2013 - WordPress Customization & Security

Where to get the news

WPSecure.net

Sucuri’s blog

WP Updates Notifier plugin

Check out more on the NEPAWPResources page

Page 50: NEPA BlogCon 2013 - WordPress Customization & Security

Questions? Comments? Statements of Disgust?

Page 51: NEPA BlogCon 2013 - WordPress Customization & Security

References & Links

• VaultPresshttp://vaultpress.com/

• BackupBuddyhttp://ithemes.com/purchase/backupbuddy/

• BackWPUphttp://wordpress.org/plugins/backwpup/

• Codex: Administration over SSLhttp://codex.wordpress.org/Administration_Over_SSL

Page 52: NEPA BlogCon 2013 - WordPress Customization & Security

References & Links

• How to Change the WordPress Databasehttp://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/

• Login Lockdownhttp://wordpress.org/plugins/login-lockdown/

• Force Strong Passwordshttp://wordpress.org/plugins/force-strong-passwords/

• Google Authetnicatorhttp://wordpress.org/plugins/google-authenticator/

• Duo Two-Factor Authenticationhttp://wordpress.org/plugins/duo-wordpress/

Page 53: NEPA BlogCon 2013 - WordPress Customization & Security

References & Links

• WPMU.org: Why You Should Never Search For Free WordPress Themeshttp://wpmu.org/why-you-should-never-search-for-free-wordpress-themes-in-google-or-anywhere-else/

• Sucurihttp://www.sucuri.net/http://wordpress.org/plugins/sucuri-scanner/

• Better WP Securityhttp://wordpress.org/plugins/better-wp-security/

• Wordfencehttp://wordpress.org/plugins/wordfence/

Page 54: NEPA BlogCon 2013 - WordPress Customization & Security

References & Links

• WPSecure.nethttp://wpsecure.net/

• WP Updates Notifierhttp://wordpress.org/plugins/wp-updates-notifier/

• Sucuri bloghttp://blog.sucuri.net/category/wordpress