id(), [ 'moved_to_cloud' => false, 'result' => MigrationManager::RESULT_LEGACY_MODULE, ]); // A site that came in through the cloud never had this flag set, and // the old system reads it on every load. if ($source->legacyFlagOption()) { update_option($source->legacyFlagOption(), $source->legacyFlagValue()); } return admin_url('admin.php?page=' . $source->modulePageSlug()); } /** * Can this site go back to that plugin's old system? */ private static function isAvailableFor(SourcePlugin $source): bool { // Buttonizer carries the code and this site actually came from there. // A plain Buttonizer install ships the module like every other copy, // which is why the module alone proves nothing. if (!$source->hasModule() || !MigrationState::isMigrated($source->id())) { return false; } // The plugin itself is back and serving its own screens. // // Deliberately about the plugin's own active flag, not isModuleLoaded(): // Buttonizer's own ModuleLoader requires the module on every request // while it is embedded, including this one, so that check is true here // regardless of whether the source plugin is active. Going by it would // hide the way back on the one screen it has to stay reachable from. if ($source->isActive()) { return false; } return true; } }