<?php
register_activation_hook(IRPP_PLUGIN_FILE, 'irpp_install');
function irpp_install($networkwide=NULL) {
	global $wpdb, $irpp;

    $time=$irpp->Options->getPluginInstallDate();
    if($time==0) {
        $irpp->Options->setPluginInstallDate(time());
    }
    $irpp->Options->setPluginUpdateDate(time());
    $irpp->Options->setPluginFirstInstall(TRUE);
    $irpp->Options->setTrackingLastSend(0);
}

add_action('admin_init', 'irpp_first_redirect');
function irpp_first_redirect() {
    global $irpp;
    if ($irpp->Options->isPluginFirstInstall()) {
        $irpp->Options->setPluginFirstInstall(FALSE);
        if (!$irpp->Options->isPluginFirstInstall()) {
            $irpp->Options->setShowActivationNotice(TRUE);
            $irpp->Options->setShowWhatsNew(TRUE);
            $irpp->Utils->redirect(IRPP_PAGE_SETTINGS);
        }
    }
}



