=' ) ) { return; } // A site with no recorded version runs every step: each one is safe on // data that is already in its final shape. if ( ! is_string( $current ) || version_compare( $current, '2.1.0', '<' ) ) { $this->upgrade_210(); } update_option( self::DB_VERSION_OPTION, self::CURRENT_VERSION, true ); } /** * 2.1.0: the settings row is autoloaded, because the front-end tags read * it on every request. A row saved by 2.0.0 was not, and update_option() * leaves the autoload flag alone when a save changes nothing, so the flag * is set here. A site with no row gets one holding the defaults, so * reading the settings never queries for an option that does not exist. */ private function upgrade_210(): void { if ( null === get_option( Settings::OPTION, null ) ) { add_option( Settings::OPTION, Settings::defaults(), '', true ); return; } wp_set_option_autoload( Settings::OPTION, true ); } }