• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Extending & Scaling | Dallas PHP
 

Extending & Scaling | Dallas PHP

on

  • 3,652 views

WordPress is an effective platform for powering large web sites with various types of content and structured data. In this case study, Randy Hoyt will share from his experience developing a network of ...

WordPress is an effective platform for powering large web sites with various types of content and structured data. In this case study, Randy Hoyt will share from his experience developing a network of shopping center web sites on WordPress for a large property management company. He will explore the newer WordPress 3.x features, its child theme architecture, custom plugins, caching techniques, and cloud hosting infrastructure used to extend and scale WordPress for this project.

Statistics

Views

Total Views
3,652
Views on SlideShare
3,123
Embed Views
529

Actions

Likes
10
Downloads
0
Comments
0

5 Embeds 529

http://randyhoyt.com 269
http://phpdallas.org 251
http://phpdallas.com 6
http://phpdallas.org. 2
http://phpdallas.net 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Extending & Scaling | Dallas PHP Extending & Scaling | Dallas PHP Presentation Transcript

    • About Me
      Web Developer – imaginuity.com
      Extending &Scaling
      WordPress
      By Randy Hoyt
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      About Me
      Randy Hoyt randyhoyt.com
      @randyhoyt
      Presentation randyhoyt.com/lonestarwp
      #dallasphp
    • About Me
      Web Developer – imaginuity.com
      Case Study
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      Project Background
      Client: Jones Lang LaSalle (JLL)
      • Retail property management company
      Requirements:
      • Cost effective platform for 40-50 sites
      • Consistent templates, allow customization
      • Content updates by marketing managers
      • Easily add or remove shopping centers
    • @randyhoyt#dallasphp
      Home Page
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Wireframe 2?
      A
      • a
      Store Directory
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Wireframe 2?
      A
      • a
      Store Detail Page
    • @randyhoyt#dallasphp
      Content Requirements
      What types of content? Taxonomies?
      • Pages
      • Stores Bath & Beauty, Jewelry,
      Music, Fitness, etc.
      • Events
      • Job Listings Full-time, Part-time,
      Seasonal
      • Center Hours
    • About Me
      Web Developer – imaginuity.com
      Extending WordPress
      Functionality
      @randyhoyt#dallasphp
    • About Me
      @randyhoyt#dallasphp
      Plugin Architecture
      Hooks:
      • Pre-defined places in WordPress where plugins and themes can inject their own code
      Two Types of Hooks:
      • Filters – For modifying various pieces of text
      • Actions – For executing code triggered by an event
    • About Me
      @randyhoyt#dallasphp
      Filters
      • Modify pieces of text that WordPress generates
      • Example:
      • the_content()
      • applied to the post content retrieved from the database, prior to printing on the screen
      • Function:
      • add_filter( $tag, $function, $priority, $args );
      • Applies a function to a filter hook
      • http://codex.wordpress.org/Function_Reference/add_filter
    • Screenshot TwentyTen
      @randyhoyt#dallasphp
      WP Tweet Button
      http://wordpress.org/extend/plugins/wp-tweet-button/
    • Screenshot TwentyTen
      @randyhoyt#dallasphp
      198 add_filter('the_content', 'tw_update');
      578 function tw_update($content) {
      612 $button = tw_generate_button();
      621 return $button . $content;
      634 }
    • About Me
      @randyhoyt#dallasphp
      Actions
      • Execute code when an event in WordPressoccurs
      • Examples:
      • init
      • runs after the WordPress environment has been loaded
      • admin_head
      • runs after outputting the common HTML header for admin area
      • Function:
      • add_action( $tag, $function, $priority, $args );
      • Applies a function to a filter hook
      • http://codex.wordpress.org/Plugin_API/Action_Reference
    • @randyhoyt#dallasphp
      Custom Post Types
      WordPress can hold and display many different types of content. Internally, these are all stored in the same place, in the posts table. These are differentiated by a column called post_type.
      WordPress 3.0 gives you the capability to add your own custom post types.
      WordPress Codex: Post Types
      http://codex.wordpress.org/Post_Types
    • @randyhoyt#dallasphp
      add_action( 'init', 'create_post_type' );
      function create_post_type() {
      register_post_type( 'imag_store',
      array(
      'labels' => array(
      'name' => __('Stores'),
      'singular_name' => __('Store')
      ),
      'public' => true
      )
      );
      }
      WordPress Codex: Post Types > Custom Types
      http://codex.wordpress.org/Post_Types#Custom_Types
    • @randyhoyt#dallasphp
      Custom Taxonomies
      A taxonomy is a way to group things together. In WordPress, a taxonomy is a grouping mechanism for posts or links or custom post types.
      WordPress Codex: Taxonomies
      http://codex.wordpress.org/Taxonomies
    • @randyhoyt#dallasphp
      add_action( 'init', 'create_taxonomy' );
      function create_taxonomy() {
      register_taxonomy(
      'imag_store_category',
      'imag_store',
      array(
      'label' => __('Categories')
      )
      );
      }
      WordPress Codex: Taxonomies > Registering a Taxonomy
      http://codex.wordpress.org/Taxonomies#Registering_a_taxonomy
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Plugin: Custom Post Type UI
      http://wordpress.org/extend/plugins/custom-post-type-ui/
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Wireframe 2?
      A
      • a
      Store Detail Page
    • @randyhoyt#dallasphp
      Custom Fields
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Store Page
      A
      • A
      • A
      Enable?
      • Custom Post Type UI
      • Custom Field Templates
      • Custom Meta Boxes
      • Write Your Own
    • @randyhoyt#dallasphp
      Custom Fields
      Example: “Adding custom field to the post screen”
      Stack Overflow: http://r2h.me/9de6m
      Plugin: Custom Field Template
      http://wordpress.org/extend/plugins/custom-field-template/
      Library: Custom Meta Boxes
      http://www.billerickson.net/wordpress-metaboxes/
    • @randyhoyt#dallasphp
      Custom Themes
      WordPress Themes are files that work together to create the design and functionality of a WordPress site.
      A theme consists of the following files:
      • stylesheet(s), JavaScript files, and images
      • function file (functions.php)
      • template files
      WordPress Codex: Theme Development
      http://codex.wordpress.org/Theme_Development
    • @randyhoyt#dallasphp
      Child Themes
      A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify or add functionality.
      Making a child theme is very simple. Create a directory, put a properly formatted style.css file in it, and you have a child theme!
      WordPress Codex: Child Themes
      http://codex.wordpress.org/Child_Themes
    • @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      WordPress Codex: Template Hierarchy
      http://codex.wordpress.org/Template_Hierarchy
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Displaying Data
      Page templates
      • A
      • A
      single-imag_store.php
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Displaying Data
      Page templates
      • A
      • A
      archive-imag_store.php, taxonomy-imag_store_category.php
    • @randyhoyt#dallasphp
      Page-Specific Custom Fields
    • @randyhoyt#dallasphp
      Custom Settings
      A taxonomy is a way to group things together. In WordPress, a taxonomy is a grouping mechanism for posts or links or custom post types.”
      WordPress Settings API Tutorial
      http://ottopress.com/2009/wordpress-settings-api-tutorial/
    • @randyhoyt#dallasphp
      Smashing Magazine: Mastering WordPress Shortcodes
      http://coding.smashingmagazine.com/2009/02/02/mastering-wordpress-shortcodes/
    • @randyhoyt#dallasphp
      Menu
      Rearranging the WordPress Admin Menu
      • http://randyhoyt.com/wordpress/admin/
      WordPress Custom Post Type Icons
      • http://r2h.me/wpicons
    • About Me
      Web Developer – imaginuity.com
      Extending to a
      Network
      @randyhoyt#dallasphp
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      WordPress Network
      As of WordPress 3.0, you have the ability to create a network of WordPress sites in a single installation.
      WordPress Codex: Create A Network
      http://codex.wordpress.org/Create_A_Network
    • @randyhoyt#dallasphp
      Network Suggestions
      • Read the Codex Article Thoroughlyhttp://codex.wordpress.org/Create_A_Network
      • Subfolder Configuration
      • Plugin: WordPress MU Domain Mappinghttp://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/
    • @randyhoyt#dallasphp
      Network Suggestions
      • Put Custom Code In A Custom Plugin
      • Network-Activate Plugins With Caution
      • Create Additional Site for Shared Content
      Retailer Information, Social Updatesswitch_to_blog(7);restore_current_blog();
    • About Me
      Web Developer – imaginuity.com
      Scaling:
      Architecture
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      Server Architecture
    • @randyhoyt#dallasphp
      Uploaded Images
      Amazon Simple Storage Service (S3)
      Amazon S3 is storage for the Internet. It’s a simple storage service that offers software developers highly-scalable, reliable, and low-latency data storage.
      Plugin: W3 Total Cache
      Improve site performance and user experience via caching: browser, page, object, database, minify and content delivery network support.
      Plugin: W3 Total Cache
      http://wordpress.org/extend/plugins/w3-total-cache/
    • @randyhoyt#dallasphp
      Query Caching
      The query cache can have an astonishingly positive impact on the response time. MySQL stores the query’s result set. The results are extremely fast response times where clients are repetitively executing the same queries.
      A Practical Look at the MySQL Query Cache
      http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html
    • @randyhoyt#dallasphp
      Page Caching
      WP Super Cache generates static HTML files from your dynamic WordPress blog. After an HTML file is generated your webserver will serve that file instead of processing the WordPress PHP scripts.
      Plugin: WP Super Cache
      http://wordpress.org/extend/plugins/wp-super-cache/
    • About Me
      Web Developer – imaginuity.com
      Extending to
      Mobile
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      Mobile Theme
      The mobile switcher identifies whether the visitor to the site is mobile or not, and switches between the primary WordPress theme and a mobile theme.
      • Browser Detection
      • Domain Mapping
      Plugin: WordPress Mobile Pack
      http://wordpress.org/extend/plugins/wordpress-mobile-pack/
    • @randyhoyt#dallasphp
      Mobile Theme
      Theme: Carrington Mobile
      http://wordpress.org/extend/themes/carrington-mobile
    • @randyhoyt#dallasphp
      Think Vitamin: Getting Started With WordPress Custom Menus
      http://thinkvitamin.com/code/getting-started-with-wordpress-custom-menus/
    • @randyhoyt#dallasphp
    • About Me
      Web Developer – imaginuity.com
      Some Final
      Remarks
      @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      Challenges
      Plugins in WordPress Network
      • Some plugins simply do not work (wp-content, uploads)
      • Network activation does not activate site settings
      • W3 Total Cache’s page caching did not work with subfolders
      • Sometimes hard-coding configuration into a plugin is the best bet (SMTP)
      Custom Post Type Data Structure
      • Avoid too many JOINs; running two queries is often the best
      • Queries can be difficult to write and perform slow
    • About Me
      Web Developer – imaginuity.com
      @randyhoyt#dallasphp
      Displaying Data
      Page templates
      • A
      • A
    • @randyhoyt#dallasphp
    • @randyhoyt#dallasphp
      Plugins
      • Gravity Forms + MailChimp
      • Analytics 360°
      • Yoast SEO
      • Yoast Google Analytics
      • Relevanssi
      • CSV Importer
    • About Me
      Web Developer – imaginuity.com
      Extending &Scaling
      WordPress
      By Randy Hoyt
      @randyhoyt#dallasphp