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.

A3c3d8a2b363c794bf2f0da138fb9684?s=128

Adam Smith

June 03, 2017
Tweet

Transcript

  1. WORDPRESS MULTISITE ENVIRONMENT

  2. GREETINGS EARTHLINGS @acodesmith | acodesmith.com | Adam Smith

  3. WORDPRESS AS A SINGLE BLOG

  4. 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
  5. HOW WORDPRESS WORKS AS A MULTISITE

  6. A queen bees pheromones affects social behavior, maintenance of the

    hive, swarming, and mating behavior.
  7. 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
  8. 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.
  9. 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.
  10. 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
  11. 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.
  12. TURN ANY WORDPRESS SITE INTO A MULTISITE

  13. /* Multisite */ define( 'WP_ALLOW_MULTISITE', true );

  14. 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
  15. TALES OF WOE AND VICTORY

  16. 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.
  17. 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.
  18. BUILDING A MULTISITE PLUGIN

  19. FUNCTIONS FOR VALIDATING THE MAIN SITE FUNCTIONS FOR GETTING THE

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

    Could be used to show beta features to special users for certain blogs.
  21. GET DETAILS ABOUT A BLOG BASED ON THE BLOG_ID

  22. 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.
  23. 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
  24. WHY MULTISITE

  25. WHY MULTISITE ★Software as a service platform ★Managing multiple clients

    in one controlled space ★Repeatable service model ★Whitelabel products
  26. QUICK DEMO AND QUESTIONS