-- Cache the WordPress core version per site to avoid hammering wp-cli on
-- every panel page load. The WP management page used to call `wp core version`
-- once per site (serial, ~1.5s each), holding the PHP session lock long enough
-- to block every other action in the panel for the same user.
--
-- New flow: a cron writes wp_version + wp_version_checked_at hourly, plus
-- WordPressManager updates these inline after install / import / core update,
-- and the listing AJAX reads from the DB instead of calling wp-cli.

USE whp;

ALTER TABLE wordpress_sites
    ADD COLUMN IF NOT EXISTS wp_version_checked_at DATETIME NULL
        COMMENT 'Last time wp_version was refreshed (cron or inline event).'
        AFTER wp_version;
