Skip to content

Performance: Optimize fs_accounts options loading on plugins page #770

@bjoernzosel

Description

@bjoernzosel

Current Behavior

The fs_accounts option is being queried on every plugins page load through update_option(), loading a large serialized array containing license and configuration data.

Query:

SELECT autoload
FROM wp_options
WHERE option_name = 'fs_accounts'
LIMIT 1

Performance Impact

  • Executes on every plugins page load
  • Loads large serialized array
  • Takes ~0.0005s per execution
  • Unnecessary frequent checks for data that doesn't change often

Suggested Improvements

  1. Implement caching for license and configuration data

    • Cache data for a set period (e.g., 24 hours)
    • Only refresh when truly needed
  2. Move license verification to async background process

    • Use WordPress cron for periodic checks
    • Update data in background
  3. Optimize data structure

    • Only load required fields
    • Consider splitting data into smaller chunks

Benefits

  • Reduced database queries
  • Improved plugins page load time
  • Better resource utilization
  • Enhanced scalability for sites with many Freemius-powered plugins

Would you consider implementing these optimizations to improve performance for sites using the Freemius SDK?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions