@pfefferle Whatever you do: Do not (only) rely on hooks that only trigger when using the standard, internal updating mechanism like https://developer.wordpress.org/reference/hooks/upgrader_process_complete/
There are way too many sites out there that update differently (manual, FTP, composer etc.)
Generally I'd say have an autoloaded option that stores the current version you compare with the current version. On mismatch start migration.
Also be careful to handle downgrades or other broken states and not solely rely on version info in the option
@pfefferle Well it basically is a single "if" comparing a string with an autoloaded option. I'd say the performance impact will be almost impossible to see even in a benchmark. If you've reached that level of performance optimization I really envy your codebase! 😉
Add comment