mirror of
https://gh.wpcy.net/https://github.com/YahnisElsts/plugin-update-checker.git
synced 2026-04-27 01:52:19 +08:00
- Refactor the scheduler so that it can be used in themes. - Add state storage to the base update checker. - Move the "allow metadata host" workaround to the base class. - Rename cron hook from "check_plugin_updates-$slug" to "puc_cron_check_updates-$slug" and "tuc_cron_check_updates-$slug".
34 lines
No EOL
700 B
PHP
34 lines
No EOL
700 B
PHP
<?php
|
|
if ( !class_exists('Puc_v4_Update', false) ):
|
|
|
|
/**
|
|
* A simple container class for holding information about an available update.
|
|
*
|
|
* @author Janis Elsts
|
|
* @access public
|
|
*/
|
|
abstract class Puc_v4_Update extends Puc_v4_Metadata {
|
|
public $slug;
|
|
public $version;
|
|
public $download_url;
|
|
public $translations = array();
|
|
|
|
/**
|
|
* @return string[]
|
|
*/
|
|
protected function getFieldNames() {
|
|
return array('slug', 'version', 'download_url', 'translations');
|
|
}
|
|
|
|
public function toWpFormat() {
|
|
$update = new stdClass();
|
|
|
|
$update->slug = $this->slug;
|
|
$update->new_version = $this->version;
|
|
$update->package = $this->download_url;
|
|
|
|
return $update;
|
|
}
|
|
}
|
|
|
|
endif; |