PluginProbe
Notibar – Notification Bar for WordPress / 2.0
Notibar – Notification Bar for WordPress v2.0
3.2.2 3.2.1.1 3.2.1 3.1.5 3.1.4 3.1.1 3.1.0 trunk 1.9.2 1.9.3 2.0 2.1.1 2.1.4 2.1.5 2.1.6 2.1.8 2.1.9
notibar / includes / Plugin.php

Plugin.php in Notibar – Notification Bar for WordPress 2.0, at includes/Plugin.php

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace NjtNotificationBar;
3
4 defined('ABSPATH') || exit;
5 /**
6 * Plugin activate/deactivate logic
7 */
8 class Plugin {
9 protected static $instance = null;
10
11 public static function getInstance() {
12 if (null == self::$instance) {
13 self::$instance = new self;
14 }
15
16 return self::$instance;
17 }
18
19 private function __construct() {
20 }
21
22 /** Plugin activated hook */
23 public static function activate() {
24 $first_time_active = get_option('njt_nofi_first_time_active');
25 $njt_nofi_review = get_option('njt_nofi_review');
26
27 if ($first_time_active === false) {
28 update_option('njt_nofi_first_time_active', 1);
29 if ($njt_nofi_review !== false) return;
30 update_option('njt_nofi_review', time() + 3*60*60*24); //After 3 days show
31 }
32
33 $current_version = get_option('njt_nofi_version');
34 if ( version_compare(NJT_NOFI_VERSION, $current_version, '>') ) {
35 $filebirdCross = \FileBirdCross::get_instance('filebird', 'filebird+ninjateam', NJT_NOFI_PLUGIN_URL, array('filebird/filebird.php', 'filebird-pro/filebird.php'));
36 $filebirdCross->need_update_option();
37 update_option('njt_nofi_version', NJT_NOFI_VERSION);
38 if ($njt_nofi_review !== false) return;
39 update_option('njt_nofi_review', time() + 3*60*60*24); //After 3 days show
40 }
41 }
42
43 /** Plugin deactivate hook */
44 public static function deactivate() {
45 }
46 }