SlideShare a Scribd company logo
1 of 32
Download to read offline
Thomas Griffin https://thomasgriffin.io 1
Using WordPress as a SaaS Platform
By:Thomas Griffin (@jthomasgriffin)
Thomas Griffin https://thomasgriffin.io 2
Who am I?
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 4
To improve is to change; to be
perfect is to change often.
Winston Churchill
Thomas Griffin https://thomasgriffin.io 5
History of OptinMonster
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 7
The Moving Process
Thomas Griffin https://thomasgriffin.io 8
Epic Considerations
•Data Migration	

•Scaling	

•System Architecture	

•Security	

•Payments	

•Onboarding	

•Support	

•Caching	

•High Availability and Redundancy	

•Interfaces	

•User Experience	

•Development Workflow
Thomas Griffin https://thomasgriffin.io 9
Practical Applicationÿ
Thomas Griffin https://thomasgriffin.io 10
Over 7 billion requests served since 2013.
Thomas Griffin https://thomasgriffin.io 11
500 million requests served last 30 days.
Thomas Griffin https://thomasgriffin.io 12
5 million leads generated in last 30 days.	

(That’s a bunch of requests to email service providers)
Thomas Griffin https://thomasgriffin.io 13
And WordPress handles all this??!?!?!	

YES!
Thomas Griffin https://thomasgriffin.io 14
Meat and Potatoes
Thomas Griffin https://thomasgriffin.io 15
Database
•InnoDB preference over MyISAM	

•add index to wp_options autoload	

•use persistent object caching with Redis to prevent extra queries
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 17
Optins
•custom post type for handling each optin	

•custom data storage using JSON (https://thomasgriffin.io/wordpress-
performance-outside-box-handling-retrieving-data/)	

•custom AJAX requests for saving and generating data	

•public output generated at save and update intervals for performance
Thomas Griffin https://thomasgriffin.io 18
API Requests
•scaling API requests (https://thomasgriffin.io/a-creative-approach-to-
efficient-and-scalable-wordpress-api-endpoints/)	

•this solution works for admin-ajax.php requests too! (https://
gist.github.com/thomasgriffin/11b859f0531a812bb273)
Thomas Griffin https://thomasgriffin.io 19
API Requests
<?php
/**
* Plugin Name: Custom admin-ajax.php Helper
* Plugin URI: https://thomasgriffin.io
* Description: Whitelists the plugins to be loaded during admin-ajax.php requests for performance.
* Author: Thomas Griffin
* Author URI: https://thomasgriffin.io
* 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;
!
}
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 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 - (http://nvie.com/posts/a-successful-git-
branching-model/)	

•custom vagrant boxes for easy dev on boarding
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 24
Support
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 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
Thomas Griffin https://thomasgriffin.io 27
But the most important ingredient…
Thomas Griffin https://thomasgriffin.io 28
YOURTEAM!
Thomas Griffin https://thomasgriffin.io 29
Processes and systems help,	

but your team makes the difference.
Thomas Griffin https://thomasgriffin.io 30
So WordPress…Worth It?⋆
Thomas Griffin https://thomasgriffin.io 31
Thomas Griffin https://thomasgriffin.io 32
That’s all, folks!

More Related Content

Recently uploaded

Recently uploaded (20)

Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Using WordPress as a SaaS Platform with OptinMonster

  • 1. Thomas Griffin https://thomasgriffin.io 1 Using WordPress as a SaaS Platform By:Thomas Griffin (@jthomasgriffin)
  • 3. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 4 To improve is to change; to be perfect is to change often. Winston Churchill
  • 5. Thomas Griffin https://thomasgriffin.io 5 History of OptinMonster
  • 6. Thomas Griffin https://thomasgriffin.io 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
  • 8. Thomas Griffin https://thomasgriffin.io 8 Epic Considerations •Data Migration •Scaling •System Architecture •Security •Payments •Onboarding •Support •Caching •High Availability and Redundancy •Interfaces •User Experience •Development Workflow
  • 9. Thomas Griffin https://thomasgriffin.io 9 Practical Applicationÿ
  • 10. Thomas Griffin https://thomasgriffin.io 10 Over 7 billion requests served since 2013.
  • 11. Thomas Griffin https://thomasgriffin.io 11 500 million requests served last 30 days.
  • 12. Thomas Griffin https://thomasgriffin.io 12 5 million leads generated in last 30 days. (That’s a bunch of requests to email service providers)
  • 13. Thomas Griffin https://thomasgriffin.io 13 And WordPress handles all this??!?!?! YES!
  • 15. Thomas Griffin https://thomasgriffin.io 15 Database •InnoDB preference over MyISAM •add index to wp_options autoload •use persistent object caching with Redis to prevent extra queries
  • 16. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 17 Optins •custom post type for handling each optin •custom data storage using JSON (https://thomasgriffin.io/wordpress- 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. Thomas Griffin https://thomasgriffin.io 18 API Requests •scaling API requests (https://thomasgriffin.io/a-creative-approach-to- efficient-and-scalable-wordpress-api-endpoints/) •this solution works for admin-ajax.php requests too! (https:// gist.github.com/thomasgriffin/11b859f0531a812bb273)
  • 19. Thomas Griffin https://thomasgriffin.io 19 API Requests <?php /** * Plugin Name: Custom admin-ajax.php Helper * Plugin URI: https://thomasgriffin.io * Description: Whitelists the plugins to be loaded during admin-ajax.php requests for performance. * Author: Thomas Griffin * Author URI: https://thomasgriffin.io * 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. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 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 - (http://nvie.com/posts/a-successful-git- branching-model/) •custom vagrant boxes for easy dev on boarding
  • 23. Thomas Griffin https://thomasgriffin.io 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
  • 25. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 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. Thomas Griffin https://thomasgriffin.io 27 But the most important ingredient…
  • 29. Thomas Griffin https://thomasgriffin.io 29 Processes and systems help, but your team makes the difference.
  • 30. Thomas Griffin https://thomasgriffin.io 30 So WordPress…Worth It?⋆
  • 32. Thomas Griffin https://thomasgriffin.io 32 That’s all, folks!