Skip to content

Conversation

@ilicfilip
Copy link
Collaborator

Spin off from #61, custom DB table to store tracked options.

@github-actions
Copy link

github-actions bot commented Dec 11, 2025

Test on Playground
Test this pull request on the Playground
or download the zip

@ilicfilip ilicfilip marked this pull request as ready for review December 12, 2025 09:03
@ilicfilip
Copy link
Collaborator Author

I have tested migrating data with 52707 tracked options, all were migrated in single page load without any issues.

@ilicfilip
Copy link
Collaborator Author

I have done a few more tests here and made a few adjustments.

Based on the tests I have further improved the migration with:

  • Prevented race conditions: The plugins_loaded upgrade hook now only runs on admin pages (not AJAX/REST) to avoid SQLite locking issues.
  • AJAX migration with progress bar: Migration is now triggered manually via a "Start Migration" button on the plugin admin page. Processes 1000 options per chunk with a visual progress bar, preventing timeouts on slow hosts with large datasets.
Migration screenshot Screenshot 2025-12-22 at 14 53 10

This should be enough to handle migration even on the slowest hosts.

One thing to note is that SQLite works noticeably slower than MySQL, which is understandable but with larger data sets (on my local extremely larger) it might fail to load results for some tables. I think this is an edge case, but if we do get related reports then we would need to refactor endpoints (most likely used-not-autoloaded-options and options-that-do-not-exist).

The refactor should go into direction of replacing loading all tracked and autoloaded options with a custom MySQL query (couple of JOIN statements most likely), so the filtering (heavy lifting part) is done on the DB level instead by PHP.

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

Successfully merging this pull request may close these issues.

3 participants