PluginProbe
Tracking Code Manager / 1.11.8
Tracking Code Manager v1.11.8
2.8.0 2.7.0 trunk 1.11.8 1.11.9 1.12.0 1.12.1 1.12.2 1.12.3 1.4 1.5 2.0.0 2.0.1 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.2.0 All 29 releases
← All changes | includes/install.php +30 -30 trunk1.11.8 View file →
@@ -1,30 +1,30 @@
1 -<?php
2 -if ( ! defined( 'ABSPATH' ) ) exit;
3 -register_activation_hook( TCMP_PLUGIN_FILE, 'tcmp_install' );
4 -function tcmp_install( $networkwide = null ) {
5 - global $wpdb, $tcmp;
6 -
7 - $time = $tcmp->options->getPluginInstallDate();
8 - if ( 0 === $time ) {
9 - $tcmp->options->setPluginInstallDate( time() );
10 - }
11 - $tcmp->options->setPluginUpdateDate( time() );
12 - $tcmp->options->setShowWhatsNew( true );
13 - $tcmp->options->setPluginFirstInstall( true );
14 -}
15 -
16 -add_action( 'admin_init', 'tcmp_first_redirect' );
17 -function tcmp_first_redirect() {
18 - global $tcmp;
19 - $v = $tcmp->options->getShowWhatsNewSeenVersion();
20 - if ( $v >= 0 && TCMP_WHATSNEW_VERSION != $v ) {
21 - $tcmp->options->setShowWhatsNewSeenVersion( -1 );
22 - tcmp_install();
23 - }
24 -
25 - if ( $tcmp->options->isPluginFirstInstall() ) {
26 - $tcmp->options->setPluginFirstInstall( false );
27 - $tcmp->options->setShowActivationNotice( true );
28 - $tcmp->utils->redirect( TCMP_PAGE_MANAGER );
29 - }
30 -}
1 +<?php
2 +
3 +register_activation_hook(TCMP_PLUGIN_FILE, 'tcmp_install');
4 +function tcmp_install($networkwide=NULL) {
5 + global $wpdb, $tcmp;
6 +
7 + $time=$tcmp->Options->getPluginInstallDate();
8 + if($time==0) {
9 + $tcmp->Options->setPluginInstallDate(time());
10 + }
11 + $tcmp->Options->setPluginUpdateDate(time());
12 + $tcmp->Options->setShowWhatsNew(TRUE);
13 + $tcmp->Options->setPluginFirstInstall(TRUE);
14 +}
15 +
16 +add_action('admin_init', 'tcmp_first_redirect');
17 +function tcmp_first_redirect() {
18 + global $tcmp;
19 + $v=$tcmp->Options->getShowWhatsNewSeenVersion();
20 + if($v>=0 && $v!=TCMP_WHATSNEW_VERSION) {
21 + $tcmp->Options->setShowWhatsNewSeenVersion(-1);
22 + tcmp_install();
23 + }
24 +
25 + if ($tcmp->Options->isPluginFirstInstall()) {
26 + $tcmp->Options->setPluginFirstInstall(FALSE);
27 + $tcmp->Options->setShowActivationNotice(TRUE);
28 + $tcmp->Utils->redirect(TCMP_PAGE_MANAGER);
29 + }
30 +}