# content-control/2.0.1/classes/Upgrades/PluginMeta_2.php

Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks &amp; More, version 2.0.1. 56 lines.

- Page: https://pluginprobe.com/plugins/content-control/2.0.1/code/classes/Upgrades/PluginMeta_2.php
- Raw: https://pluginprobe.com/plugins/content-control/2.0.1/raw/classes/Upgrades/PluginMeta_2.php
- Modified: 2023-09-18T01:47:10+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/content-control/2.0.1/code/classes/Upgrades/PluginMeta_2.php#L10-L20`.

```php
<?php
/**
 * Content Control Migrations
 *
 * @package ContentControl\Plugin
 */

namespace ContentControl\Upgrades;

defined( 'ABSPATH' ) || exit;

/**
 * Version 2 migration.
 */
class PluginMeta_2 extends \ContentControl\Base\Upgrade {

	const TYPE    = 'plugin_meta';
	const VERSION = 2;

	/**
	 * Get the label for the upgrade.
	 *
	 * @return string
	 */
	public function label() {
		return __( 'Update plugin meta', 'content-control' );
	}

	/**
	 * Run the upgrade.
	 *
	 * @return void|WP_Error|false
	 */
	public function run() {
		// Gets a stream or mock stream for sending events.
		$stream = $this->stream();

		$stream->start_task( __( 'Migrating plugin meta', 'content-control' ) );

		$remaps = [
			'jp_cc_reviews_installed_on' => 'content_control_installed_on',
		];

		foreach ( $remaps as $key => $new_key ) {
			$value = \get_option( $key, null );

			if ( null !== $value ) {
				\update_option( $new_key, $value );
				\delete_option( $key );
			}
		}

		$stream->complete_task( __( 'Plugin meta migrated', 'content-control' ) );
	}
}

```
