';
}
private function displayConfiguration() {
echo '
Configuration
';
echo '
';
$this->displayConfigHeader();
$this->row('Slug', htmlentities($this->updateChecker->slug));
$this->row('DB option', htmlentities($this->updateChecker->optionName));
$requestInfoButton = $this->getMetadataButton();
$this->row('Metadata URL', htmlentities($this->updateChecker->metadataUrl) . ' ' . $requestInfoButton . $this->responseBox);
$scheduler = $this->updateChecker->scheduler;
if ( $scheduler->checkPeriod > 0 ) {
$this->row('Automatic checks', 'Every ' . $scheduler->checkPeriod . ' hours');
} else {
$this->row('Automatic checks', 'Disabled');
}
if ( isset($scheduler->throttleRedundantChecks) ) {
if ( $scheduler->throttleRedundantChecks && ($scheduler->checkPeriod > 0) ) {
$this->row(
'Throttling',
sprintf(
'Enabled. If an update is already available, check for updates every %1$d hours instead of every %2$d hours.',
$scheduler->throttledCheckPeriod,
$scheduler->checkPeriod
)
);
} else {
$this->row('Throttling', 'Disabled');
}
}
$this->updateChecker->onDisplayConfiguration($this);
echo '
';
}
protected function displayConfigHeader() {
//Do nothing. This should be implemented in subclasses.
}
protected function getMetadataButton() {
return '';
}
private function displayStatus() {
echo '
Status
';
echo '
';
$state = $this->updateChecker->getUpdateState();
$checkButtonId = $this->updateChecker->getUniqueName('check-now-button');
if ( function_exists('get_submit_button') ) {
$checkNowButton = get_submit_button(
'Check Now',
'secondary',
'puc-check-now-button',
false,
array('id' => $checkButtonId)
);
} else {
//get_submit_button() is not available in the frontend. Make a button directly.
//It won't look the same without admin styles, but it should still work.
$checkNowButton = sprintf(
'',
esc_attr($checkButtonId),
esc_attr('Check Now')
);
}
if ( $state->getLastCheck() > 0 ) {
$this->row('Last check', $this->formatTimeWithDelta($state->getLastCheck()) . ' ' . $checkNowButton . $this->responseBox);
} else {
$this->row('Last check', 'Never');
}
$nextCheck = wp_next_scheduled($this->updateChecker->scheduler->getCronHookName());
$this->row('Next automatic check', $this->formatTimeWithDelta($nextCheck));
if ( $state->getCheckedVersion() !== '' ) {
$this->row('Checked version', htmlentities($state->getCheckedVersion()));
$this->row('Cached update', $state->getUpdate());
}
$this->row('Update checker class', htmlentities(get_class($this->updateChecker)));
echo '
';
}
private function displayCurrentUpdate() {
$update = $this->updateChecker->getUpdate();
if ( $update !== null ) {
echo '