Inpsyde\MultilingualPress\MultilingualPress::check_installation PHP Method

check_installation() private method

Checks (and adapts) the current MultilingualPress installation.
private check_installation ( ) : boolean
return boolean Whether or not MultilingualPress is installed properly.
    private function check_installation()
    {
        $system_checker = static::$container['multilingualpress.system_checker'];
        $installation_check = $system_checker->check_installation();
        if (SystemChecker::PLUGIN_DEACTIVATED === $installation_check) {
            return false;
        }
        if (SystemChecker::INSTALLATION_OK === $installation_check) {
            $type_factory = static::$container['multilingualpress.type_factory'];
            $installed_version = $type_factory->create_version_number([get_network_option(null, $this->version_option)]);
            $current_version = $type_factory->create_version_number([static::$container['multilingualpress.properties']->version()]);
            switch ($system_checker->check_version($installed_version, $current_version)) {
                case SystemChecker::INSTALLATION_OK:
                    return true;
                case SystemChecker::NEEDS_INSTALLATION:
                    static::$container['multilingualpress.installer']->install();
                    break;
                case SystemChecker::NEEDS_UPGRADE:
                    static::$container['multilingualpress.network_plugin_deactivator']->deactivate_plugins(['disable-acf.php', 'mlp-wp-seo-compat.php']);
                    static::$container['multilingualpress.updater']->update($installed_version);
                    break;
            }
            update_network_option(null, $this->version_option, $current_version);
        }
        return true;
    }