wpslug/lib/plugin-update-checker/Puc/v5p3/Update.php
feibisi c4e6027779 Integrate plugin update checker library
Added the Plugin Update Checker library under lib/plugin-update-checker and integrated it into WPSlug_Core for automatic update checks. This enables update notifications and management for the plugin via a remote JSON metadata file.
2025-07-15 12:36:48 +08:00

38 lines
749 B
PHP

<?php
namespace YahnisElsts\PluginUpdateChecker\v5p3;
use stdClass;
if ( !class_exists(Update::class, false) ):
/**
* A simple container class for holding information about an available update.
*
* @author Janis Elsts
* @access public
*/
abstract class Update extends 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;