Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Welcome to the WordPress Multisite Environment

Welcome to the WordPress Multisite Environment

Multisite is a powerful tool used to expand the capacity of WordPress while still maintaining all the things you know and love. Multisite allows site mangers to share a core codebase of themes and plugins but deliver different experiences to each website. With multisite domain mapper a company can white label their product for multiple clients while still using one main WordPress engine. Learn how a multisite works, how to set up a multisite, how it can benefit your business and how to development a WordPress multisite platform.

Adam Smith

June 03, 2017
Tweet

More Decks by Adam Smith

Other Decks in Technology

Transcript

  1. SINGLE BLOG ★User roles are set for the entire site.

    ★One theme is activated at a time. ★Plugins are managed on a case by case basis. ★All tables share the same prefix. 
 For example: wp_posts
  2. MULTISITE ★User roles are set on a site by site

    basis. ★Themes are approved by the site admin then activated per site. ★Plugins can either be Network Activated or on a site by site basis. ★Each site has it’s own set of tables prefixed by the site ID.
 For example wp_2_posts ★Site IDs are auto incremented primary keys in the wp_blogs table
  3. USER ROLES ★The super admin can access each different site

    dashboard. ★The super admin can approve which themes can be activated. ★The super admin can Network Activate plugins. ★The super admin can create a new site and add users to that site. ★A user for one site can only access their site dashboard.
  4. THEMES ★The super admin approves which themes can be used

    by other sites. ★Each site selects a theme. ★All themes live in the themes folder. ★Multiple sites can use the same theme. ★Make changes to one theme, updates all site using that theme.
  5. PLUGINS ★The super admin can Network Active a plugin. ★A

    Network Activated plugin is used by all sites and can not be excluded by one site. ★A single site can activate a plugin, just like normal, for that site only. ★Plugins which generate custom tables use the site prefix.
 For example:
 wp_2_woocommerce_sessions
  6. TABLES ★WordPress creates a new table called wp_blogs ★The blog_id

    field in wp_blogs is used as a prefix for each site.
 For example: blog_id 2 is used to create wp_2_posts ★WordPress creates new post, postmeta, taxonomy, terms, options, comments, etc.. ★Each site does NOT get a new users table. All sites share a common wp_users table.
  7. DOUBLE CHECK AND BACK UP EVERYTHING ★ Installation and Server

    Requirements ★ mod_rewrite must be enabled. ★ site can’t be hosted on an IP ★ site can’t be hosted on a special port; mysite.com:8080 ★ site can’t be hosted on a localhost url, must use vhost for local install. ★ Backup all tables! ★ Deactivate all your plugins! ★ Subdomain install can’t be ran out of a subfolder, only the root;
 mysite.com/wordpress-installed-here/ 
 mysite.com/wordpress-installed-here/site2
  8. WOE ★If the main site goes down they all go

    down. ★If one site is hacked all sites can be affected. ★One database password for all the sites. ★A bug in a plugin or a theme can affect multiple sites.
  9. VICTORY ★New features can be rolled out to all the

    sites at once. ★Backup one database! ★Fix a bug in one place, you fix a bug for multiple sites. ★Easier to support a large client base.
  10. FUNCTIONS FOR VALIDATING THE MAIN SITE FUNCTIONS FOR GETTING THE

    CURRENT SITE FUNCTIONS FOR SWITCHING TO ANOTHER SITE
  11. CHECK IF THE USER HAS ACCESS TO A CERTAIN SITE

    Could be used to show beta features to special users for certain blogs.
  12. TABLE PREFIX ★Using the global $wpdb object to obtain the

    prefix.
 For example: $wpdb->prefix ★Use the prefix when building custom tables. ★Use the prefix when writing raw SQL queries.
  13. HOOK FIRES WHEN A NEW SITE IS CREATED HOOK FIRES

    WHEN A SITE IS REMOVED HOOK FIRE WHEN A SITE IS ARCHIVED https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-admin/includes/ms.php
  14. WHY MULTISITE ★Software as a service platform ★Managing multiple clients

    in one controlled space ★Repeatable service model ★Whitelabel products