# powerkit/2.4.4/core/class-powerkit-deprecated.php

Powerkit – Supercharge your WordPress Site, version 2.4.4. 79 lines.

- Page: https://pluginprobe.com/plugins/powerkit/2.4.4/code/core/class-powerkit-deprecated.php
- Raw: https://pluginprobe.com/plugins/powerkit/2.4.4/raw/core/class-powerkit-deprecated.php
- Modified: 2020-12-30T06:28:26+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/powerkit/2.4.4/code/core/class-powerkit-deprecated.php#L10-L20`.

```php
<?php
/**
 * Deprecated features and migration functions
 *
 * @package    Powerkit
 * @subpackage Core
 */

/**
 * Migration to 2.0.7
 *
 * @param string $current Current version.
 * @param string $new     New version.
 */
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
	/* Migration to 2.0.7 */
	if ( version_compare( $current, '2.0.7', '<' ) ) {
		require_once POWERKIT_PATH . 'modules/post-views/helpers/db-powerkit-post-views.php';

		$post_views_db = new Powerkit_Post_Views_DB();

		$post_views_db->activate_single();
	}
}, 10, 2 );

/**
 * Migration to 2.2.2
 *
 * @param string $current Current version.
 * @param string $new     New version.
 */
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
	/* Migration to 2.2.2 */
	if ( version_compare( $current, '2.2.2', '<' ) ) {
		$transients = array(
			'powerkit_connect_instagram_app_access_token',
			'powerkit_connect_instagram_app_type',
			'powerkit_connect_instagram_app_user_id',
			'powerkit_connect_instagram_app_username',
			'powerkit_connect_instagram_app_refresh',
			'powerkit_connect_facebook_app_access_token',
			'powerkit_connect_facebook_app_accounts',
			'powerkit_connect_facebook_app_refresh',
			'powerkit_connect_twitter_app_user_id',
			'powerkit_connect_twitter_app_screen_name',
			'powerkit_connect_twitter_app_oauth_token',
			'powerkit_connect_twitter_app_oauth_token_secret',
		);

		foreach ( $transients as $key => $transient ) {
			if ( get_transient( $transient ) && ! get_option( $transient ) ) {
				update_option( $transient, get_transient( $transient ) );
			}
		}

		if ( ! wp_next_scheduled( 'event_access_token_refresh' ) ) {
			wp_schedule_event( time(), 'daily', 'event_access_token_refresh' );
		}
	}
}, 10, 2 );

/**
 * Migration to 2.3.0
 *
 * @param string $current Current version.
 * @param string $new     New version.
 */
add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
	/* Migration to 2.3.0 */
	if ( version_compare( $current, '2.3.0', '<' ) ) {
		if ( 'before' === get_option( 'powerkit_toc_display', 'none' ) ) {
			update_option( 'powerkit_toc_enable_automatically', true );
		}
		if ( 'after' === get_option( 'powerkit_toc_display', 'none' ) ) {
			update_option( 'powerkit_toc_enable_automatically', true );
		}
	}
}, 10, 2 );

```
