wpslug/lib/plugin-update-checker/Puc/v5p3/DebugBar/PluginPanel.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

41 lines
980 B
PHP

<?php
namespace YahnisElsts\PluginUpdateChecker\v5p3\DebugBar;
use YahnisElsts\PluginUpdateChecker\v5p3\Plugin\UpdateChecker;
if ( !class_exists(PluginPanel::class, false) ):
class PluginPanel extends Panel {
/**
* @var UpdateChecker
*/
protected $updateChecker;
protected function displayConfigHeader() {
$this->row('Plugin file', htmlentities($this->updateChecker->pluginFile));
parent::displayConfigHeader();
}
protected function getMetadataButton() {
$requestInfoButton = '';
if ( function_exists('get_submit_button') ) {
$requestInfoButton = get_submit_button(
'Request Info',
'secondary',
'puc-request-info-button',
false,
array('id' => $this->updateChecker->getUniqueName('request-info-button'))
);
}
return $requestInfoButton;
}
protected function getUpdateFields() {
return array_merge(
parent::getUpdateFields(),
array('homepage', 'upgrade_notice', 'tested',)
);
}
}
endif;