PluginProbe ʕ •ᴥ•ʔ
Tracking Code Manager / 2.0.16
Tracking Code Manager v2.0.16
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 2.3.0 2.4.0 2.5.0 2.6.0
tracking-code-manager / includes / install.php
tracking-code-manager / includes Last commit date
admin 3 years ago classes 3 years ago actions.php 3 years ago core.php 3 years ago install.php 3 years ago uninstall.php 3 years ago
install.php
31 lines
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 ( 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 }
31