AlkantarClanX12

Your IP : 3.16.51.237


Current Path : /home/thanudqk/www/wp-content/plugins/wpcode-premium/includes/pro/
Upload File :
Current File : /home/thanudqk/www/wp-content/plugins/wpcode-premium/includes/pro/install.php

<?php
/**
 * Pro-specific install routines.
 *
 * @package WPCode
 */

add_action( 'wpcode_plugin_activation', 'wpcode_pro_install_routines' );
add_action( 'wpcode_before_version_update', 'wpcode_pro_upgrade_routines' );

/**
 * Called when the plugin is activated to run pro-specific stuff like creating custom DB tables.
 *
 * @return void
 */
function wpcode_pro_install_routines() {
	$db = new WPCode_DB();
	$db->maybe_update_db();
}

/**
 * Run pro-specific upgrade routines.
 *
 * @param array $activated The value of the "ihaf_activated" option.
 *
 * @return void
 */
function wpcode_pro_upgrade_routines( $activated ) {
	if ( empty( $activated['version'] ) ) {
		// If no version is set this is the first install so let's skip.
		return;
	}

	if ( version_compare( $activated['version'], WPCODE_VERSION, '<' ) ) {
		// Let's run upgrade routines but only for the versions needed.
		if ( version_compare( $activated['version'], '2.0.7', '<' ) ) {
			// Upgrade to 2.0.7
			wpcode_pro_update_2_0_7();
		}
	}
}

/**
 * Upgrade routine for 2.0.7.
 *
 * @return void
 */
function wpcode_pro_update_2_0_7() {
	// Let's reset the license cache to grab the addons data.
	// Deleting this option will prompt the plugin to update the key data the next time admin_init runs.
	delete_option( 'wpcode_license_updates' );
}