/** * Load the update checker state from the DB. * * @return StdClass|null */ public function getUpdateState() { $state = get_site_option($this->optionName, null); if (empty($state) || !is_object($state)) { $state = null; } if (!empty($state) && isset($state->update) && is_object($state->update)) { $state->update = PluginUpdate_3_0::fromObject($state->update); } return $state; }
/** * @param StdClass|null $updates * @param PluginUpdate_3_0 $updateToAdd * @return StdClass */ private function addUpdateToList($updates, $updateToAdd) { if (!is_object($updates)) { $updates = new stdClass(); $updates->response = array(); } $wpUpdate = $updateToAdd->toWpFormat(); $pluginFile = $this->pluginFile; if ($this->isMuPlugin()) { //WP does not support automatic update installation for mu-plugins, but we can still display a notice. $wpUpdate->package = null; $pluginFile = $this->muPluginFile; } $updates->response[$pluginFile] = $wpUpdate; return $updates; }