SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > content-control > classes > > Base >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/content-control/classes//Base/

NameTypeSizeLast ModifiedActions
Container.php File 717 bytes September 21 2023 14:13:04.
Controller.php File 751 bytes June 21 2024 13:00:36.
Stream.php File 3345 bytes October 05 2023 03:16:16.
Upgrade.php File 3044 bytes May 09 2025 02:30:24.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/content-control/classes//Base//Upgrade.php

<?php
/**
 * Plugin controller.
 *
 * @copyright (c) 2021, Code Atlantic LLC.
 *
 * @package ContentControl
 */

namespace ContentControl\Base;

defined( 'ABSPATH' ) || exit;

use Closure;
use stdClass;

/**
 * Base Upgrade class.
 */
abstract class Upgrade implements \ContentControl\Interfaces\Upgrade {

	/**
	 * Type.
	 *
	 * @var string Uses data versioning types.
	 */
	const TYPE = '';

	/**
	 * Version.
	 *
	 * @var int
	 */
	const VERSION = 1;

	/**
	 * Stream.
	 *
	 * @var \ContentControl\Services\UpgradeStream|null
	 */
	public $stream;

	/**
	 * Upgrade constructor.
	 */
	public function __construct() {
	}

	/**
	 * Upgrade label
	 *
	 * @return string
	 */
	abstract public function label();

	/**
	 * Return full description for this upgrade.
	 *
	 * @return string
	 */
	public function description() {
		return '';
	}

	/**
	 * Check if the upgrade is required.
	 *
	 * @return bool
	 */
	public function is_required() {
		$current_version = \ContentControl\get_data_version( static::TYPE );
		return $current_version && $current_version < static::VERSION;
	}

	/**
	 * Get the type of upgrade.
	 *
	 * @return string
	 */
	public function get_type() {
		return static::TYPE;
	}

	/**
	 * Check if the prerequisites are met.
	 *
	 * @return bool
	 */
	public function prerequisites_met() {
		return true;
	}

	/**
	 * Get the dependencies for this upgrade.
	 *
	 * @return string[]
	 */
	public function get_dependencies() {
		return [];
	}

	/**
	 * Run the upgrade.
	 *
	 * @return void|\WP_Error|false
	 */
	abstract public function run();

	/**
	 * Run the upgrade.
	 *
	 * @param \ContentControl\Services\UpgradeStream $stream Stream.
	 *
	 * @return bool|\WP_Error
	 */
	public function stream_run( $stream ) {
		$this->stream = $stream;

		$return = $this->run();

		$this->stream = null;

		if ( is_bool( $return ) || is_wp_error( $return ) ) {
			return $return;
		}

		return true;
	}

	/**
	 * Return the stream.
	 *
	 * If no stream is available it returns a mock object with no-op methods to prevent errors.
	 *
	 * @return \ContentControl\Services\UpgradeStream|(object{
	 *      send_event: Closure,
	 *      send_error: Closure,
	 *      send_data: Closure,
	 *      update_status: Closure,
	 *      update_task_status: Closure,
	 *      start_upgrades: Closure,
	 *      complete_upgrades: Closure,
	 *      start_task: Closure,
	 *      update_task_progress:Closure,
	 *      complete_task: Closure
	 * }&\stdClass) Stream.
	 */
	public function stream() {
		$noop =
		/**
		 * No-op.
		 *
		 * @return void
		 */
		function () {};

		return is_a( $this->stream, '\ContentControl\Services\UpgradeStream' ) ? $this->stream : (object) [
			'send_event'           => $noop,
			'send_error'           => $noop,
			'send_data'            => $noop,
			'update_status'        => $noop,
			'update_task_status'   => $noop,
			'start_upgrades'       => $noop,
			'complete_upgrades'    => $noop,
			'start_task'           => $noop,
			'update_task_progress' => $noop,
			'complete_task'        => $noop,
		];
	}
}

SILENT KILLER Tool