Advanced Wordpress

From DevSummit
Revision as of 17:47, 5 May 2015 by Vivian (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Facilitator: Zack

Notetaker: Kathryn Benedicto

Zack: His shop does mostly Rails, Wordpress, a little Drupal. Wordpress has been closing the

gap between itself and Rails, in their practice.

Overview

  • Examples of newer powerful features: multisite, networked, custom post types
  • New plug-ins that make custom post types sing
  • Wordpress can now function as an application engine

Zack & Automattic host the SF Wordpress meetup. There's

  • Wordpress hosting, can help launch/scale sites: WP-Engine, Pagely, zippy the kid, & others
  • Zack really likes WP-Engine - built-in caching, built-in CDN, helped them deal with a site

launch that had a big traffic spike

  • Wordpress hosting price points: $29/month -> $100/mo -> $250/mo. Cost competitive with

EC2. * Can be very cost-effective if you factor in the dev hours you would need to optimize

your Wordpress site

  • Best practice for plug-ins: Plug-ins are a mixed blessing. New users tend to

install/disable plug-ins willy-nilly to try them out Even good plug-ins can conflict with each other And there are bad plug-ins too - poorly-written, obsolete, or unsupported How to evaluate plug-in quality: how recently updated? how frequently updated? how well

supported? how many developers working on it? Plug-ins are amazing, but you have to be thoughtful about which one you pick?

  • Is there an equivalent of Drupal Views for Wordpress (yet)? Wordpress can do that, but

currently you'll need to write some custom code. Check out these themes: Headway and

Carrington Build(sp?), they have admin tools for "views"-like features

  • Wordpress 3.5 news: Brand-new media manager, totally rewritten from scratch, really

amazing

Case Study: Skoll World Forum website

Skoll World Forum - social innovation/entrepreneurship, pivoting their site to be more

about content (a la Huffington Post for social enterprise) instead of their annual

forum/conference

Front-end tour:

  • Data model: Forums have speakers, sessions, videos attached to sessions
  • If you view a forum, it displays all associated sessions, can select day
  • If you view a session, it displays all associated speakers, session notes, video clips
  • If you view a speaker, it displays their list of sessions, videos
  • All of these are objects created on the back end and linked to one another

Back-end tour

  • Posts, pages - you're probably familiar with these from Wordpress
  • Custom post types - e.g. contributors (speakers)
  • Custom meta fields
  • Contributor: Subtitle

drop-down checkbox, image, text fields, repeater fields, links to objects, relationships

(similar to Posts-to-Posts), and more

  • Plug-ins needed: ACF (Advanced Custom Fields), Posts-to-Posts
  • Can you do computed fields with this? Zack: I don't know
  • Advanced Custom Fields - reasonably priced, can reuse on all of your sites
  • You set up option groups (a collection of fields that you can then associate with a custom

post type or other Wordpress object)

  • You can associate custom fields with custom post types, but also with pages, posts, users

and media

  • You can configure the fields to appear in the main body or in the sidebar
  • ACF Relationships vs. Posts-to-Posts: Right now, Post-to-Posts has an advantage because it

is reciprocal whereas ACF relationships are not (this may change soon)

  • Repeater fields: multi-valued fields or field groups - groups of fields that you can enter

multiple times. You can actually nest these, but don't get carried away

  • You can make the display of your custom fields conditional on other fields
  • Q: What about the database schema? A: Everything is a post, currently it all goes in the

same two database tables. This is not a database design, it is a kludge. You basically need

to cache the crap out of everything. This is why hosts like WP-Engine provide so much value

  • Once you've added the custom meta fields to the custom post types, this doesn't

automatically display the new fields on the custom post type. This is where you have to edit

code. You need to go into the Wordpress theme template

  • Posts-to-Posts also lets you put metadata on the linkage between two posts: e.g. a

contributor's relationship to a session may be as a speaker, facilitator, or moderator

  • Plug-in: Custom Post Type UI - An admin UI for creating custom post types (otherwise you'd

need to do this in code)

  • Q: REST API access to Wordpress? A: Wordpress has an API built into it, not sure it's

suitable as a high-volume

  • Q: How many plug-ins does a site like Skoll World Forum have? A:
  • Wordpress plug-ins may have somewhat less vetting than Drupal modules (although Drupal

modules can still have their issues). Wordpress plug-ins have ratings and download counts

but these metrics don't necessarily reflect on the quality or suitability of the plug-in.

  • Q: Do plug-ins have issue queues? Yes - look at the support tab; are the support requests

being answered

  • Q: Which cache engine are you using? A: We don't because WPEngine does it for us, but some

recommended ones are WP supercache, Totalcache

  • WP Engine provides a nice admin UI for configuring and managing the cache
  • Backbone.js: Javascript framework, available in Wordpress backend really soon, maybe will

be available in front end in 2013-2014

Case Study: FIN

Scientists doing research on sustainable fishing practices can share their research results

Front-end tour

  • Tricked out with lots of in-place editing/configuring - you never have to see the

Wordpress backend

  • Can access editing features depending on your user role
  • Theme editor is the most painful way to edit code, but at least you can...it's a last

resort if you don't have your FTP access set up etc.

  • Quick example of theme code to display Posts-to-Posts linked objects, ACF custom meta

fields