Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: Optimize fs_accounts options loading on plugins page #770

Open
bjoernzosel opened this issue Dec 10, 2024 · 0 comments
Open

Comments

@bjoernzosel
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant