Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using WordPress as a SaaS Platform with OptinMonster


Published on

This presentation highlights our journey of using OptinMonster as a SaaS (software-as-a-service) platform built on top of WordPress.

Published in: Technology
  • Be the first to comment

Using WordPress as a SaaS Platform with OptinMonster

  1. 1. Thomas Griffin 1 Using WordPress as a SaaS Platform By:Thomas Griffin (@jthomasgriffin)
  2. 2. Thomas Griffin 2 Who am I?
  3. 3. Thomas Griffin 3 I am a partner and CTO of Awesome Motive, Inc. and the technical Co- Founder of OptinMonster. Prior to OptinMonster, I founded Soliloquy, the fastest WordPress slider plugin, and Envira Gallery, a revolutionary gallery solution for photographers. I also builtTGM Plugin Activation and serve over 30,000 happy customers. Thomas Griffin
  4. 4. Thomas Griffin 4 To improve is to change; to be perfect is to change often. Winston Churchill
  5. 5. Thomas Griffin 5 History of OptinMonster
  6. 6. Thomas Griffin 6 The OptinMonsterTimeline We meet to discuss the awesomeness that would become OptinMonster. OptinMonster is Born We failed to build a SaaS model, so we pivoted to a WordPress plugin.Totally worth it. OptinMonster Launches We moved from an MVP to a rock-solid v2.0 release, building a very feature-rich platform with even better technology. OptinMonster 2.0 Lands Our customers are demanding solutions outside of WordPress, so we hit the ground running building the hosted platform. OptinMonster…SaaS? Jan. 1, 2013 Sept. 24, 2013 Aug. 24, 2014 Oct. 8, 2014 May 5, 2015 The OptinMonster hosted platform launches, allowing OptinMonster to be used on any website. OptinMonster App
  7. 7. Thomas Griffin 7 The Moving Process
  8. 8. Thomas Griffin 8 Epic Considerations •Data Migration •Scaling •System Architecture •Security •Payments •Onboarding •Support •Caching •High Availability and Redundancy •Interfaces •User Experience •Development Workflow
  9. 9. Thomas Griffin 9 Practical Applicationÿ
  10. 10. Thomas Griffin 10 Over 7 billion requests served since 2013.
  11. 11. Thomas Griffin 11 500 million requests served last 30 days.
  12. 12. Thomas Griffin 12 5 million leads generated in last 30 days. (That’s a bunch of requests to email service providers)
  13. 13. Thomas Griffin 13 And WordPress handles all this??!?!?! YES!
  14. 14. Thomas Griffin 14 Meat and Potatoes
  15. 15. Thomas Griffin 15 Database •InnoDB preference over MyISAM •add index to wp_options autoload •use persistent object caching with Redis to prevent extra queries
  16. 16. Thomas Griffin 16 Users <?php wp_*_current_user() *_user_meta() •start with simple subscriber user, strip permissions, add caps from here •custom data keys for account access using user meta
  17. 17. Thomas Griffin 17 Optins •custom post type for handling each optin •custom data storage using JSON ( performance-outside-box-handling-retrieving-data/) •custom AJAX requests for saving and generating data •public output generated at save and update intervals for performance
  18. 18. Thomas Griffin 18 API Requests •scaling API requests ( efficient-and-scalable-wordpress-api-endpoints/) •this solution works for admin-ajax.php requests too! (https://
  19. 19. Thomas Griffin 19 API Requests <?php /** * Plugin Name: Custom admin-ajax.php Helper * Plugin URI: * Description: Whitelists the plugins to be loaded during admin-ajax.php requests for performance. * Author: Thomas Griffin * Author URI: * Version: 1.0.0 */ ! // Check against the request URI. if ( ! isset( $_SERVER['REQUEST_URI'] ) ) { return; } ! // If it does not match the admin-ajax.php route, do nothing. if ( strpos( stripslashes( $_SERVER['REQUEST_URI'] ), 'admin-ajax.php' ) === false ) { return; } ! // Ok, this is an admin-ajax.php request. Filter available plugins. add_filter( 'pre_option_active_plugins', 'tgm_whitelist_admin_ajax_plugins' ); function tgm_whitelist_admin_ajax_plugins( $plugins ) { ! // Only modify the ajax requests performed by our own plugin. $action = isset( $_REQUEST['action'] ) ? stripslashes( $_REQUEST['action'] ) : false; if ( ! $action ) { return $plugins; } ! // For this example, we will target the heartbeat ajax request. if ( 'heartbeat' !== $action ) { return $plugins; } ! // Prevent any plugins from loading during the request. $whitelist = array( // my-custom-plugin/my-custom-plugin.php ); ! // Return the whitelist instead of the default plugins. return $whitelist; ! }
  20. 20. Thomas Griffin 20 Caching •literally cache everything with persistent object cache (preferably Redis) and fastcgi cache with Nginx •this makes 99.9% of requests hit cache •minimize impact of non-cache hits to DB
  21. 21. Thomas Griffin 21 Infrastructure •we love Pagely! •custom setup on AWS using ec2 load balanced instances, RDS (database), Route 53 for DNS, Elasticache w/ Redis •smart cache purge policy on updates and save requests •utilize MaxCDN for images and API script requests
  22. 22. Thomas Griffin 22 Development Flow •absolutely everything starts on local! •marketing and app site split into two separate installs •staging and production environments •git feature branch dev - ( branching-model/) •custom vagrant boxes for easy dev on boarding
  23. 23. Thomas Griffin 23 Support •all requests through HelpScout - easy ticket sharing, notes, workflows •integrated with Gravity Forms to automatically tag and segment requests •TONS OF DOCUMENTATION •fuzzy search and user “creates docs for us” •happiness reports to identify trends, ways to improve
  24. 24. Thomas Griffin 24 Support
  25. 25. Thomas Griffin 25 Notifications •simple notification system for in-app updates •custom post type and user meta to check for view state •pulsing dot to notify users of new notifications
  26. 26. Thomas Griffin 26 Jobs and Queues •daemons and workers to handle intensive, long processes •utilize redis + job queues to prevent server overload •useful for monthly conversion reports, platform data insights
  27. 27. Thomas Griffin 27 But the most important ingredient…
  28. 28. Thomas Griffin 28 YOURTEAM!
  29. 29. Thomas Griffin 29 Processes and systems help, but your team makes the difference.
  30. 30. Thomas Griffin 30 So WordPress…Worth It?⋆
  31. 31. Thomas Griffin 31
  32. 32. Thomas Griffin 32 That’s all, folks!