# tableberg/0.5.6/includes/Version_Control_Upgrader_Skin.php

Tableberg – Simple Gutenberg Table Block, version 0.5.6. 125 lines.

- Page: https://pluginprobe.com/plugins/tableberg/0.5.6/code/includes/Version_Control_Upgrader_Skin.php
- Raw: https://pluginprobe.com/plugins/tableberg/0.5.6/raw/includes/Version_Control_Upgrader_Skin.php
- Modified: 2024-08-19T13:20:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/0.5.6/code/includes/Version_Control_Upgrader_Skin.php#L10-L20`.

```php
<?php
/**
 * Version control upgrader skin
 *
 * @package Tableberg
 */

namespace Tableberg\includes;

use WP_Error;
use WP_Upgrader_Skin;

require_once ABSPATH . '/wp-admin/includes/class-wp-upgrader-skin.php';

// if called directly, abort process.
if ( ! defined( 'WPINC' ) ) {
	die;
}

/**
 * Class Version_Control_Upgrader_Skin
 *
 * Upgrader skin for version rollback and version sync operations.
 */
class Version_Control_Upgrader_Skin extends WP_Upgrader_Skin {
	/**
	 * Errors array.
	 *
	 * @var array
	 */
	protected $errors = array();

	/**
	 * Plugin info.
	 *
	 * @var array
	 */
	public $plugin_info = array();

	/**
	 * Version_Control_Upgrader_Skin constructor.
	 *
	 * @param array $options options.
	 * @param array $plugin_info plugin info.
	 */
	public function __construct( $options, $plugin_info = array() ) {
		$this->plugin_info = $plugin_info;

		parent::__construct( $options );
	}


	/**
	 * Feedback
	 *
	 * @param string $string string value.
	 * @param mixed  ...$args Optional text replacements.
	 */
	public function feedback( $string, ...$args ) {
		// keep it quiet.
	}

	/**
	 * Get error.
	 *
	 * @param string|WP_Error $errors found errors.
	 */
	public function error( $errors ) {
		if ( is_wp_error( $errors ) && $errors->has_errors() ) {
			foreach ( $errors->get_error_messages() as $error_message ) {
				$this->errors[] = $error_message;
			}
		}
	}

	/**
	 * Action to perform following an update.
	 *
	 * @since 2.8.0
	 */
	public function after() {
		if ( count( $this->errors ) > 0 ) {
			header( 'Content-Type: text/plain-text' );

			echo join( ',', $this->errors );
			die();
		}
	}

	/**
	 * Displays a form to the user to request for their FTP/SSH details in order
	 * to connect to the filesystem.
	 *
	 * @param bool|WP_Error $error Optional. Whether the current request has failed to connect,
	 *                                                    or an error object. Default false.
	 * @param string        $context Optional. Full path to the directory that is tested
	 *                                                           for being writable. Default empty.
	 * @param bool          $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
	 *
	 * @return bool True on success, false on failure.
	 * @since 4.6.0 The `$context` parameter default changed from `false` to an empty string.
	 *
	 * @see request_filesystem_credentials()
	 *
	 * @since 2.8.0
	 */
	public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
		return true;
	}

	/**
	 * Header
	 */
	public function header() {
		// keep it quiet.
	}

	/**
	 * Footer
	 */
	public function footer() {
		// keep it quiet.
	}
}

```
